From: Arjen M. <arj...@us...> - 2007-01-30 21:07:12
|
Update of /cvsroot/plplot/plplot/bindings/f77 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14949/bindings/f77 Modified Files: CMakeLists.txt plstubs.h Log Message: Added patches by Jim Dishaw for FORTRAN 77 under Windows Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/plplot/plplot/bindings/f77/CMakeLists.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- CMakeLists.txt 7 Jan 2007 15:07:59 -0000 1.15 +++ CMakeLists.txt 30 Jan 2007 21:06:56 -0000 1.16 @@ -21,7 +21,7 @@ if(ENABLE_f77) ## Generate source files depending on type of PLFLT -## Note: Sed will possibly fail on windows. Would this be better +## Note: Sed will possibly fail on windows. Would this be better ## done using the cmake configure_file option eventually? if(PL_DOUBLE) add_custom_command( @@ -39,6 +39,16 @@ ) endif(PL_DOUBLE) +if(WIN32) + # Set the flags for the C compiler. The C stubs need to have the + # correction case and calling convention for the Fortran compiler + IF(TARGET_FORTRAN MATCHES "IVF") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIVF") + ELSEIF(TARGET_FORTRAN MATCHES "CVF") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF") + ENDIF(TARGET_FORTRAN MATCHES "IVF") +endif(WIN32) + if(F77_CMD_LINE) set(HAVE_F77PARSE_CL_FALSE C) else(F77_CMD_LINE) @@ -49,7 +59,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/configurable.f.cmake ${CMAKE_CURRENT_BINARY_DIR}/configurable.f ) -set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/configurable.f +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/configurable.f PROPERTIES GENERATED ON) # Set the include path @@ -62,8 +72,8 @@ ## Build C part of F77 bindings set(plplotf77c${LIB_TAG}_LIB_SRCS -sc3d.c -sccont.c +sc3d.c +sccont.c scstubs.c ) @@ -77,7 +87,7 @@ target_link_libraries(plplotf77c${LIB_TAG} plplot${LIB_TAG}) get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) -set_target_properties(plplotf77c${LIB_TAG} +set_target_properties(plplotf77c${LIB_TAG} PROPERTIES SOVERSION ${plplotf77_SOVERSION} VERSION ${plplotf77_VERSION} @@ -89,8 +99,8 @@ ## Build fortran part of F77 bindings set(plplotf77${LIB_TAG}_LIB_SRCS -strutil.f -sfstubs.f +strutil.f +sfstubs.f configurable.f ) @@ -98,7 +108,7 @@ target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) -set_target_properties(plplotf77${LIB_TAG} +set_target_properties(plplotf77${LIB_TAG} PROPERTIES SOVERSION ${plplotf77_SOVERSION} VERSION ${plplotf77_VERSION} @@ -121,7 +131,7 @@ # BINDING - ENABLE_${BINDING} keeps track of whether a # binding has been enabled (ON) or not (OFF). # Also, ${BINDING} used to determine PC_FILE_SUFFIX - # which helps to determine name of configured + # which helps to determine name of configured # *.pc file. # PC_SHORT_NAME - Used in *.pc NAME: field # PC_LONG_NAME - Used in *.pc Description: field Index: plstubs.h =================================================================== RCS file: /cvsroot/plplot/plplot/bindings/f77/plstubs.h,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- plstubs.h 7 Jan 2007 21:43:02 -0000 1.42 +++ plstubs.h 30 Jan 2007 21:06:56 -0000 1.43 @@ -90,13 +90,19 @@ #endif #endif -#ifdef MSDOS /* MS-DOS based */ +#ifdef WIN32 /* Windows 32-bit */ +#ifdef IVF /* Intel Visual Fortran */ +#define STUB_LINKAGE STUB_U +#elif defined(CVF) /* MSVC/CVF */ +#define STUB_LINKAGE STUB_U +#elif defined(MSDOS) /* MS-DOS based */ #define STUB_LINKAGE STUB_FORTRAN -#endif - -#ifdef _MSC_VER /* MSVC/CVF based */ +#elif defined(_MSC_VER) #define STUB_LINKAGE STUB_STDCALL #endif +#elif defined(MSDOS) /* MS-DOS based */ +#define STUB_LINKAGE STUB_FORTRAN +#endif /* Windows 32-bit */ #ifndef STUB_LINKAGE /* The default */ #define STUB_LINKAGE STUB_LAU |