From: <ai...@us...> - 2012-01-27 22:29:22
|
Revision: 12160 http://plplot.svn.sourceforge.net/plplot/?rev=12160&view=rev Author: airwin Date: 2012-01-27 22:29:16 +0000 (Fri, 27 Jan 2012) Log Message: ----------- Replace the iargc and getarg GNU extensions in bindings/f95/configurable.f90 with the Fortran 2003 standard library routines, command_argument_count and get_command_argument. Arjen's tests show this change means it is no longer necessary to build configurable.f90 in a separate static library on windows platforms. Therefore, remove all STATIC_OPTS logic from the build system that made that separate static build possible. This means, configurable.f90 is now completely equivalent to other source for the plplotf95 library on all platforms now. (Since it is not configured, it is also time to change its name, but I will leave that to Arjen.) This change has been tested with the test_diff_psc target on Linux with good results (except for examples 20 and 28 because of on-going blank issues and the missing example 00). That target should also be tested on Windows to make sure all is well with that platform for Fortran 95. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/bindings/f95/CMakeLists.txt trunk/bindings/f95/configurable.f90 trunk/cmake/modules/TestF77CmdLine.cmake trunk/examples/f77/CMakeLists.txt trunk/examples/f95/CMakeLists.txt trunk/examples/plplot_configure.cmake_installed_examples.in Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/bindings/f77/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -179,24 +179,12 @@ ) ## Build fortran part of F77 bindings - if(STATIC_OPTS) - # Put the file configurable.f in a separate static library - set(plplotf77opts${LIB_TAG}_LIB_SRCS - configurable.f - ) - set(plplotf77${LIB_TAG}_LIB_SRCS - strutil.f - sfstubs.f - ) - else(STATIC_OPTS) - set(plplotf77${LIB_TAG}_LIB_SRCS - strutil.f - sfstubs.f - configurable.f - ) - endif(STATIC_OPTS) + set(plplotf77${LIB_TAG}_LIB_SRCS + strutil.f + sfstubs.f + configurable.f + ) - if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77${DEFFILE}.def) endif(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) @@ -215,13 +203,7 @@ set(PC_REQUIRES_TAG "Requires") endif(NON_TRANSITIVE) - if(STATIC_OPTS) - add_library(plplotf77opts${LIB_TAG} STATIC ${plplotf77opts${LIB_TAG}_LIB_SRCS}) - target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - target_link_libraries(plplotf77opts${LIB_TAG} plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) if(USE_RPATH) set_target_properties(plplotf77${LIB_TAG} @@ -247,15 +229,6 @@ RUNTIME DESTINATION ${BIN_DIR} ) - if(STATIC_OPTS) - install(TARGETS plplotf77opts${LIB_TAG} - EXPORT export_plplot - ARCHIVE DESTINATION ${LIB_DIR} - LIBRARY DESTINATION ${LIB_DIR} - RUNTIME DESTINATION ${BIN_DIR} - ) - endif(STATIC_OPTS) - # Configure pkg-config *.pc file corresponding to libplplotf77${LIB_TAG} if(PKG_CONFIG_EXECUTABLE) if(LIB_TAG) Modified: trunk/bindings/f95/CMakeLists.txt =================================================================== --- trunk/bindings/f95/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/bindings/f95/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -125,21 +125,11 @@ ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare ) - if(STATIC_OPTS) - set(plplotf95opts${LIB_TAG}_LIB_SRCS - configurable.f90 - ) - set(plplotf95${LIB_TAG}_LIB_SRCS - strutil.f90 - sfstubsf95.f90 - ) - else(STATIC_OPTS) - set(plplotf95${LIB_TAG}_LIB_SRCS - strutil.f90 - configurable.f90 - sfstubsf95.f90 - ) - endif(STATIC_OPTS) + set(plplotf95${LIB_TAG}_LIB_SRCS + strutil.f90 + configurable.f90 + sfstubsf95.f90 + ) if(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT CYGWIN) SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95${DEFFILE}.def) @@ -159,13 +149,7 @@ set(PC_REQUIRES_TAG "Requires") endif(NON_TRANSITIVE) - if(STATIC_OPTS) - add_library(plplotf95opts${LIB_TAG} STATIC ${plplotf95opts${LIB_TAG}_LIB_SRCS}) - target_link_libraries(plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - target_link_libraries(plplotf95opts${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) if(USE_RPATH) set_target_properties(plplotf95${LIB_TAG} @@ -201,15 +185,6 @@ RUNTIME DESTINATION ${BIN_DIR} ) - if(STATIC_OPTS) - install(TARGETS plplotf95opts${LIB_TAG} - EXPORT export_plplot - ARCHIVE DESTINATION ${LIB_DIR} - LIBRARY DESTINATION ${LIB_DIR} - RUNTIME DESTINATION ${BIN_DIR} - ) - endif(STATIC_OPTS) - # For CMake-2.6.0 and above, the module files are created by # default during the library build in the bindings/f95 directory. install( Modified: trunk/bindings/f95/configurable.f90 =================================================================== --- trunk/bindings/f95/configurable.f90 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/bindings/f95/configurable.f90 2012-01-27 22:29:16 UTC (rev 12160) @@ -22,16 +22,14 @@ use plplot implicit none integer :: mode - integer :: maxargs, iargs, numargs, index, maxindex, iargc + integer :: maxargs, iargs, numargs, index, maxindex parameter(maxindex = maxlen/4) parameter (maxargs=20) character (len=maxlen) :: arg integer, dimension(maxindex, maxargs) :: iargsarr -! write(0,'(a)') 'plparseopts not implemented on this fortran'// -! & ' platform because iargc or getarg are not available' - numargs = iargc() + numargs = command_argument_count() if(numargs.lt.0) then -! This actually happened on badly linked Cygwin platform. +! This actually happened historically on a badly linked Cygwin platform. write(0,'(a)') 'plparseopts: negative number of arguments' return endif @@ -40,7 +38,7 @@ return endif do 10 iargs = 0, numargs - call getarg(iargs, arg) + call get_command_argument(iargs, arg) call plstrf2c(trim(arg), string1) s1 = transfer( string1, s1 ) do 5 index = 1, maxindex Modified: trunk/cmake/modules/TestF77CmdLine.cmake =================================================================== --- trunk/cmake/modules/TestF77CmdLine.cmake 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/cmake/modules/TestF77CmdLine.cmake 2012-01-27 22:29:16 UTC (rev 12160) @@ -51,20 +51,3 @@ "the following output:\n${OUTPUT}\n\n") ENDIF (CMAKE_F77_CMD_LINE) ENDIF(NOT DEFINED CMAKE_F77_CMD_LINE) - -# On some Windows platforms the plparseopts routine should be in a -# static library - -SET(STATIC OFF) -IF(WIN32) - IF(MINGW OR CYGWIN) - IF(BUILD_SHARED_LIBS) - SET(STATIC ON) - ENDIF(BUILD_SHARED_LIBS) - ENDIF(MINGW OR CYGWIN) -ENDIF(WIN32) -IF(STATIC) - SET(STATIC_OPTS ON CACHE BOOL "Command-line parsing in static library") -ELSE(STATIC) - SET(STATIC_OPTS OFF CACHE BOOL "Command-line parsing in static library") -ENDIF(STATIC) Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/examples/f77/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -145,11 +145,7 @@ set_property(GLOBAL PROPERTY TARGETS_examples_f77) foreach(STRING_INDEX ${f77_STRING_INDICES}) add_executable(x${STRING_INDEX}f ${f77_directory}/x${STRING_INDEX}f.f) - if(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f plplotf77opts${LIB_TAG} plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) add_dependencies(x${STRING_INDEX}f build_plplot_parameters_h) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_f77 x${STRING_INDEX}f) endforeach(STRING_INDEX ${f77_STRING_INDICES}) Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/examples/f95/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -140,11 +140,7 @@ x${STRING_INDEX}f95 PROPERTIES OUTPUT_NAME x${STRING_INDEX}f ) - if(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f95 plf95demolib${LIB_TAG} plplotf95opts${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f95 plf95demolib${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f95 plf95demolib${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_f95 x${STRING_INDEX}f95) endforeach(STRING_INDEX ${f95_STRING_INDICES}) endif(BUILD_TEST) Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2012-01-27 22:29:16 UTC (rev 12160) @@ -111,12 +111,10 @@ endif(ENABLE_ada) if(ENABLE_f77) - set(STATIC_OPTS @STATIC_OPTS@) set(F77_INCLUDE_DIR @F77_INCLUDE_DIR@) endif(ENABLE_f77) if(ENABLE_f95) - set(STATIC_OPTS @STATIC_OPTS@) set(F95_MOD_DIR "@F95_MOD_DIR@") endif(ENABLE_f95) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |