From: <and...@us...> - 2008-09-09 09:16:47
|
Revision: 8758 http://plplot.svn.sourceforge.net/plplot/?rev=8758&view=rev Author: andrewross Date: 2008-09-09 09:16:57 +0000 (Tue, 09 Sep 2008) Log Message: ----------- Some further fixes required to get gcc visibility support to work using -fvisibility=hidden. These are mostly to do with dynamic drivers. Since these don't work on Windows (?) the import / export macros are not in place. There is also a fix for plcore where the -DMAKINGPLDLL options were being overwritten within src/CMakeLists.txt. This only fixes the ps driver as a proof of concept. For now you will need to disable all other drivers and all bindings. To test you need to do export CC="-fvisibility=hidden" before running cmake. With this, ctest passes all C example tests fine. At the least all drivers will have to ensure they export plD_DEVICE_INFO_xxx plD_dispatch_init_xxx Modified Paths: -------------- trunk/drivers/CMakeLists.txt trunk/drivers/ps.c trunk/include/plplotP.h trunk/include/plstrm.h trunk/src/CMakeLists.txt Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2008-09-09 06:38:21 UTC (rev 8757) +++ trunk/drivers/CMakeLists.txt 2008-09-09 09:16:57 UTC (rev 8758) @@ -27,7 +27,7 @@ if(ENABLE_DYNDRIVERS) set_source_files_properties( get-drv-info.c - PROPERTIES COMPILE_FLAGS "-I${LTDL_INCLUDE_DIR}" + PROPERTIES COMPILE_FLAGS "-I${LTDL_INCLUDE_DIR} -DUSINGPLDLL" ) include_directories( @@ -63,9 +63,14 @@ if(${SOURCE_ROOT_NAME}_COMPILE_FLAGS) set_source_files_properties( ${${SOURCE_ROOT_NAME}_SOURCE} - PROPERTIES COMPILE_FLAGS ${${SOURCE_ROOT_NAME}_COMPILE_FLAGS} + PROPERTIES COMPILE_FLAGS "${${SOURCE_ROOT_NAME}_COMPILE_FLAGS} -DUSINGPLDLL" ) #message("${SOURCE_ROOT_NAME}_COMPILE_FLAGS = ${${SOURCE_ROOT_NAME}_COMPILE_FLAGS}") + else(${SOURCE_ROOT_NAME}_COMPILE_FLAGS) + set_source_files_properties( + ${${SOURCE_ROOT_NAME}_SOURCE} + PROPERTIES COMPILE_FLAGS "-DUSINGPLDLL" + ) endif(${SOURCE_ROOT_NAME}_COMPILE_FLAGS) add_library(${SOURCE_ROOT_NAME} MODULE ${${SOURCE_ROOT_NAME}_SOURCE}) # ${SOURCE_ROOT_NAME}_LINK_FLAGS is ideally a list of the full path names Modified: trunk/drivers/ps.c =================================================================== --- trunk/drivers/ps.c 2008-09-09 06:38:21 UTC (rev 8757) +++ trunk/drivers/ps.c 2008-09-09 09:16:57 UTC (rev 8758) @@ -49,15 +49,15 @@ /* Device info */ -const char* plD_DEVICE_INFO_ps = +PLDLLEXPORT const char * plD_DEVICE_INFO_ps = "ps:PostScript File (monochrome):0:ps:29:psm\n" "psc:PostScript File (color):0:ps:30:psc"; /* Prototypes for functions in this file. */ -void plD_dispatch_init_psm ( PLDispatchTable *pdt ); -void plD_dispatch_init_psc ( PLDispatchTable *pdt ); +PLDLLEXPORT void plD_dispatch_init_psm ( PLDispatchTable *pdt ); +PLDLLEXPORT void plD_dispatch_init_psc ( PLDispatchTable *pdt ); static char *ps_getdate (void); static void ps_init (PLStream *); Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2008-09-09 06:38:21 UTC (rev 8757) +++ trunk/include/plplotP.h 2008-09-09 09:16:57 UTC (rev 8758) @@ -174,6 +174,8 @@ #define pl_fgetpos(a,b) (-1L == (*b = ftell(a))) #endif +#include "pldll.h" + /* Include all externally-visible definitions and prototypes */ /* plplot.h also includes some handy system header files */ @@ -533,7 +535,7 @@ /* Driver interface filter -- passes all coordinates through a variety of filters. */ -void +PLDLLIMPEXP void difilt(PLINT *, PLINT *, PLINT, PLINT *, PLINT *, PLINT *, PLINT *); @@ -580,7 +582,7 @@ /* parse driver specific options, as in -drvopt <option[=value]>* */ -int +PLDLLIMPEXP int plParseDrvOpts(DrvOpt *); /* give help on driver specific options */ @@ -671,7 +673,7 @@ /* All the drivers call this to set physical pixels/mm. */ -void +PLDLLIMPEXP void plP_setpxl(PLFLT xpmm0, PLFLT ypmm0); /* Get background parameters (including line width) for 3d plot. */ @@ -711,7 +713,7 @@ /* Sets up physical limits of plotting device. */ -void +PLDLLIMPEXP void plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax); /* Set up the subpage boundaries according to the current subpage selected */ @@ -1016,7 +1018,7 @@ } FCI_to_FontName_Table; /* Internal function to obtain a pointer to a valid font name. */ -char * +PLDLLIMPEXP char * plP_FCI2FontName ( PLUNICODE fci, const FCI_to_FontName_Table lookup[], const int nlookup); @@ -1051,7 +1053,7 @@ /* get drivers directory */ #ifdef ENABLE_DYNDRIVERS -char* +PLDLLIMPEXP char* plGetDrvDir (void); #endif Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2008-09-09 06:38:21 UTC (rev 8757) +++ trunk/include/plstrm.h 2008-09-09 09:16:57 UTC (rev 8758) @@ -734,7 +734,7 @@ /* Opens file for output, prompting if not set. */ -void +PLDLLIMPEXP void plOpenFile(PLStream *pls); /* Sets up next file member name (in pls->FileName), but does not open it. */ @@ -749,17 +749,17 @@ /* Initializes family file parameters. */ -void +PLDLLIMPEXP void plFamInit(PLStream *pls); /* Starts new member file of family file set if necessary. */ -void +PLDLLIMPEXP void plGetFam(PLStream *pls); /* Rotates physical coordinates if necessary for given orientation. */ -void +PLDLLIMPEXP void plRotPhy(PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax, PLINT *px, PLINT *py); Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2008-09-09 06:38:21 UTC (rev 8757) +++ trunk/src/CMakeLists.txt 2008-09-09 09:16:57 UTC (rev 8758) @@ -57,9 +57,10 @@ endif(BUILD_SHARED_LIBS) if(ENABLE_DYNDRIVERS) + get_source_file_property(PLCORE_COMPILE_PROPS plcore.c COMPILE_FLAGS) set_source_files_properties( plcore.c - PROPERTIES COMPILE_FLAGS "-I${LTDL_INCLUDE_DIR}" + PROPERTIES COMPILE_FLAGS "${PLCORE_COMPILE_PROPS} -I${LTDL_INCLUDE_DIR}" ) else(ENABLE_DYNDRIVERS) if(ENABLE_tcl) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |