Commit 620f6923 authored by hrchilds's avatar hrchilds
Browse files

Add initial support for linking the server statically.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8950 18c085ea-50e0-402c-830e-de6fd14e8384
parent 9993605f
......@@ -177,6 +177,11 @@
# been defined by build_visit and it will contain the user's env. just
# after starting build_visit but before build_visit starts adding things
# to the user's environment.
#
# Hank Childs, Thu Nov 12 12:23:56 PST 2009
# Add variable for static link. This places the plugins before the
# components.
#
##############################################################################
@SET_MAKE@
......@@ -191,6 +196,9 @@ SUBDIRS_ENGINE_ONLY=include lib bin third_party_builtin common visit_vtk avt eng
SUBDIRS_SERVER_COMPONENTS_ONLY=include lib bin third_party_builtin common visit_vtk \
avt engine launcher mdserver sim plots operators databases
SUBDIRS_STATIC_LINK=include lib bin third_party_builtin common visit_vtk \
avt plots operators databases engine launcher mdserver
SUBDIRS_STD=include lib bin third_party_builtin common @VTKQT@ visit_vtk \
avt engine launcher @METADATA_SERVER@ winutil @VIEWER@ \
@GUI@ @VISITPY@ @JAVA_TARGET@ sim plots operators databases @HELP@ \
......
......@@ -95,6 +95,9 @@
# Brad Whitlock, Wed Jun 3 15:42:02 PST 2009
# I added an engine-only build option.
#
# Hank Childs, Thu Nov 12 13:42:52 PST 2009
# Added an option for static linking.
#
##############################################################################
@SET_MAKE@
......@@ -109,6 +112,8 @@ SUBDIRS_ENGINE_ONLY=DBAtts Math IVP Pipeline DDF MIR Shapelets\
SUBDIRS_SERVER_COMPONENTS_ONLY=$(SUBDIRS_ENGINE_ONLY)
SUBDIRS_STATIC_LINK=$(SUBDIRS_ENGINE_ONLY)
SUBDIRS_STD=$(SUBDIRS_ENGINE_ONLY) QtVisWindow
SUBDIRS=@SUBDIRS@
......
......@@ -80,6 +80,12 @@ using std::sort;
#define MAX_PLUGINERROR 500
#ifdef STATIC
extern void *fake_dlsym(const string &);
extern void StaticGetSupportedLibs(std::vector<std::pair<std::string, std::string> > &,
const string &);
#endif
// ****************************************************************************
// Method: PluginManager constructor
//
......@@ -496,11 +502,19 @@ PluginManager::EnablePlugin(const string &id)
// Hank Childs, Fri Nov 16 15:24:16 PST 2007
// Fix bug pointed out by Paul Selby of AWE.
//
// Hank Childs, Thu Nov 12 17:49:58 PST 2009
// Only read the supported libraries if we are doing a static link.
//
// ****************************************************************************
void
PluginManager::GetPluginList(vector<pair<string,string> > &libs)
{
#ifdef STATIC
StaticGetSupportedLibs(libs, managerName);
return;
#endif
// Read the files in the plugin directory.
vector< vector<pair<string,string> > > files;
ReadPluginDir(files);
......@@ -1471,6 +1485,10 @@ PluginManager::ReadPluginDir(vector< vector<pair<string,string> > > &files)
//
// Mark C. Miller, Thu Aug 14 01:22:59 PDT 2008
// Made messages reported to screen include plugin name and error msg.
//
// Hank Childs, Thu Nov 12 11:28:10 PST 2009
// Add support for static "plugins".
//
// ****************************************************************************
void
......@@ -1488,6 +1506,8 @@ PluginManager::PluginOpen(const string &pluginFile)
}
handle = (void *)lib;
#elif defined(STATIC)
debug1 << "Not opening " << pluginFile << " because this is a static build." << endl;
#else
// dlopen the plugin
handle = dlopen(pluginFile.c_str(), RTLD_LAZY);
......@@ -1543,15 +1563,16 @@ PluginManager::PluginOpen(const string &pluginFile)
// Cyrus Harrison, Wed Jun 20 14:05:58 PDT 2007
// Changed __DARWIN__ back to __APPLE__
//
// Hank Childs, Thu Nov 12 11:28:10 PST 2009
// Add support for static "plugins".
//
// ****************************************************************************
void *
PluginManager::PluginSymbol(const string &symbol, bool noError)
{
void *retval;
#if defined(_WIN32)
retval = (void *)GetProcAddress((HMODULE)handle, symbol.c_str());
#elif defined(__APPLE__)
string symbolName(symbol);
//
......@@ -1572,17 +1593,24 @@ PluginManager::PluginSymbol(const string &symbol, bool noError)
int len = openPlugin.size() - slashPos - suffixLen - 5 -
managerName.size() - ext.size();
string pluginPrefix(openPlugin.substr(slashPos + 5, len));
// debug4 << "PluginSymbol: prefix: " << pluginPrefix << endl;
// debug4 << "PluginSymbol: prefix: " << pluginPrefix << endl;
if(pluginVersion)
symbolName = string(pluginPrefix + symbol);
else
symbolName = string(pluginPrefix + "_" + symbol);
// debug4 << "PluginSymbol: sym: " << symbolName << endl;
// debug4 << "PluginSymbol: sym: " << symbolName << endl;
}
retval = dlsym(handle, symbolName.c_str());
#if defined(_WIN32)
retval = (void *)GetProcAddress((HMODULE)handle, symbol.c_str());
#else
retval = dlsym(handle, symbol.c_str());
#if defined(STATIC)
retval = fake_dlsym(symbolName);
if (retval == NULL)
debug1 << "fake_dlsym was not able to return " << symbolName << endl;
#else
retval = dlsym(handle, symbolName.c_str());
#endif
#endif
// If the symbol was not found, print the error message if appropriate.
......
......@@ -310,7 +310,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TOPDIR PLATFORM_CPPFLAGS SUBDIRS ALLSUBDIRS SRC BUILD_DBIO_ONLY CHECK_MAKE_AND_ENV_VARS NON_DBIO_SERLIBS NON_DBIO_PARLIBS CMAKE CXXFLAGS EGREP CXX LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP PARALLEL PARALLEL_CPPFLAGS MPI_LIBS MPI_CC MPI_CXX LIBSTATICPAR LIBSHAREDPAR LIBSHAREDPAR_UPDATEONLY PARDEP BUILD_COGNOMEN LIBCOGNOMEN MESA_DIR MESA_INCLUDE MESA_LIBS MESA_LIBGL VIEWER_MESA_STUB_CPPFLAGS VIEWER_MESA_LIBS BUILD_MESA_STUB GL_LIBS OVERLAY_INC OVERLAY_LIB VTK_DIR VTK_INCLUDES VTK_LIBS VTK_LIGHTWEIGHT_LIBS MESA_OBJ SERMESA_OBJ PARMESA_OBJ AVTPREP_SER AVTPREP_PAR CONVERT_SER CONVERT_PAR CONVERT_SER_LITE CONVERT_PAR_LITE MAKEMILI_SER MAKEMILI_PAR ENGINE_SER ENGINE_PAR ENGINELIBSER ENGINELIBPAR METADATA_SERVER MDSERVERLIB MDSERVEROBJ VISITPY SCRIPTINGLIB SCRIPTINGOBJ PY_BUILD_VISITMODULE VIEWER VIEWERLIB VIEWEROBJ VIEWERLIB_SRC VIEWEREXE_SRC GUI GUILIB GUIOBJ GUIFRAMEWORKS ANNOTATION_FLAGS JAVAC JAVA_TARGET JAR JAVAFLAGS JAVAPLUGINFLAGS BUILD_SLIVR SLIVR_INCLUDE SLIVR_LIBS TEEM_CMAKE_C_FLAGS SLIVR_CMAKE_SHARED_LINKER_FLAGS SLIVR_GUI_IMPL SLIVR_GUI_HDR HELP PLOT_BUILD_DIRS OPERATOR_BUILD_DIRS DB_BUILD_DIRS BUILD_GLEW GLEW_INCLUDE GLEW_LIBS BUILD_BILIB VISITWRAPPER_RPATH CXXCPP F77 FFLAGS ac_ct_F77 SET_MAKE RANLIB ac_ct_RANLIB MAKEDEPEND BUILD_FORTRAN XML2MAKEFILE_CXX OS_RULE BUILD_TUVOK TUVOK_LIB TUVOK_INCLUDE BUILD_ZLIB ZLIB_LIB HDF5_INCLUDE HDF5_LIB HDF5_TARGET SILO_INCLUDE SILO_LIB SILO_TARGET EXODUS EXODUS_LIB EXODUS_LIBS EXODUS_FLAGS PDB_INCLUDE PDB_LIB PDB_TARGET MILI MILI_FLAGS MILI_LIBS MILI_DIR TCMALLOC_LIB TCMALLOC_DIR CREATE_TCMALLOC_LINK HDF4 HDF4_FLAGS HDF4_LIBS HDF4_LIBDIR BOXLIB2D BOXLIB2D_INCLUDE BOXLIB2D_LIBS BOXLIB2D_LIBDIR BOXLIB3D BOXLIB3D_INCLUDE BOXLIB3D_LIBS BOXLIB3D_LIBDIR H5PART H5PART_INCLUDE H5PART_LIB H5PART_LIBDIR FASTBIT FASTBIT_INCLUDE FASTBIT_LIB FASTBIT_LIBDIR ADIOS ADIOS_INCLUDE ADIOS_LIB VISUS VISUS_INCLUDE VISUS_LIB NETCDF NETCDF_INCLUDE NETCDF_LIB NETCDF_CXX_LIB CGNS CGNS_INCLUDE CGNS_LIB GDAL GDAL_INCLUDE GDAL_LIB GDAL_LIBS CFITSIO CFITSIO_INCLUDE CFITSIO_LIB CFITSIO_LIBDIR ITAPS_C_INCLUDE ITAPS_C_LIB ITAPS_C0_INCLUDE ITAPS_C0_LIB ITAPS_C1_INCLUDE ITAPS_C1_LIB ITAPS_C2_INCLUDE ITAPS_C2_LIB ITAPS_C3_INCLUDE ITAPS_C3_LIB ITAPS_C4_INCLUDE ITAPS_C4_LIB ITAPS_C CCMIO CCMIO_INCLUDE CCMIO_LIBS CCMIO_LIBDIR ADVIO ADVIO_INCLUDE ADVIO_LIB SIMULATION EXPORT_DYNAMIC ENGINE_CPPFLAGS PREPROCESSOR_CPPFLAGS PREPROCESSOR_PARALLEL_SRC COMPONENT_CPPFLAGS VISIT_VTK_CPPFLAGS VISIT_VTK_LDFLAGS VIEWER_CPPFLAGS QT_BIN QT_INCLUDE QT_LIB QT_LDFLAGS QT_LIBS QT_CORE QT_CORE_LIB QT_DESIGNER QT_DESIGNER_LIB QT_GUI QT_GUI_LIB QT_HELP QT_HELP_LIB QT_CLUCENE QT_CLUCENE_LIB QT_NETWORK QT_NETWORK_LIB QT_OPENGL QT_OPENGL_LIB QT_SCRIPT QT_SCRIPT_LIB QT_SQL QT_SQL_LIB QT_SVG QT_SVG_LIB QT_TEST QT_TEST_LIB QT_XML QT_XML_LIB QT_QUI QT_QUI_LIB QT_CXXFLAGS QT_MOC VTKQT_CPPFLAGS VTKQT VTKQT_LIBS X_LIBS X_CPPFLAGS PTHREAD_LIB PTHREAD_CXXFLAGS ICET_CXXFLAGS ICET_LDFLAGS ICET_LIBS ICET_ENG_MAIN_OBJ PYDIR PYVERSION PY_INCLUDEDIR PY_CXXFLAGS PY_LDFLAGS PY_LIB PY_CLI_LIB EXE_LDFLAGS PLUGIN_LDFLAGS DATA_EXE_LDFLAGS SHLIB_CREATEPROG SHLIB_LIBS SHLIB_SERLIBS SHLIB_PARLIBS SHLIB_MPI_LIBS SHLIB_ILIBS SHLIB_GLIBS SHLIB_VLIBS SHLIB_MLIBS SHLIB_ESERLIBS SHLIB_EPARLIBS SHLIB_SLIBS SHLIB_POSTPROCESS_ILIBS SHLIB_POSTPROCESS_GLIBS SHLIB_POSTPROCESS_VLIBS SHLIB_POSTPROCESS_MLIBS SHLIB_POSTPROCESS_ESERLIBS SHLIB_POSTPROCESS_EPARLIBS SHLIB_POSTPROCESS_SLIBS SHLIB_SOEXT SHLIB_LIBEXT SHLIB_POSTPROCESS SHLIB_POSTPROCESS_SER SHLIB_POSTPROCESS_PAR SHLIB_TMPDIR PREBIND_LIBS LIBSIM_RUNTIME_SER LIBSIM_RUNTIME_PAR CREATE_MILI_LINK CREATE_HDF4_LINK CREATE_NETCDF_LINK CREATE_CGNS_LINK CREATE_GDAL_LINK CREATE_EXODUS_LINK CREATE_BOXLIB2D_LINK CREATE_BOXLIB3D_LINK CREATE_CFITSIO_LINK CREATE_H5PART_LINK CREATE_FASTBIT_LINK CREATE_CCMIO_LINK VAC_CV_LIBDIR_CREATE_LINKS VAC_CV_LIBDIR_DESTROY_LINKS MG tmpbin tmpinc tmplib plotplugindir operatorplugindir databaseplugindir DATA_REL_VISIT_PATH LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TOPDIR PLATFORM_CPPFLAGS SUBDIRS ALLSUBDIRS SRC BUILD_DBIO_ONLY CHECK_MAKE_AND_ENV_VARS NON_DBIO_SERLIBS NON_DBIO_PARLIBS STATIC_LINK STATIC_LINK_PAR STATIC_LINK_DBS CMAKE CXXFLAGS EGREP CXX LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP PARALLEL PARALLEL_CPPFLAGS MPI_LIBS MPI_CC MPI_CXX LIBSTATICPAR LIBSHAREDPAR LIBSHAREDPAR_UPDATEONLY PARDEP BUILD_COGNOMEN LIBCOGNOMEN MESA_DIR MESA_INCLUDE MESA_LIBS MESA_LIBGL VIEWER_MESA_STUB_CPPFLAGS VIEWER_MESA_LIBS BUILD_MESA_STUB GL_LIBS OVERLAY_INC OVERLAY_LIB VTK_DIR VTK_INCLUDES VTK_LIBS VTK_LIGHTWEIGHT_LIBS MESA_OBJ SERMESA_OBJ PARMESA_OBJ AVTPREP_SER AVTPREP_PAR CONVERT_SER CONVERT_PAR CONVERT_SER_LITE CONVERT_PAR_LITE MAKEMILI_SER MAKEMILI_PAR ENGINE_SER ENGINE_PAR ENGINELIBSER ENGINELIBPAR METADATA_SERVER MDSERVERLIB MDSERVEROBJ VISITPY SCRIPTINGLIB SCRIPTINGOBJ PY_BUILD_VISITMODULE VIEWER VIEWERLIB VIEWEROBJ VIEWERLIB_SRC VIEWEREXE_SRC GUI GUILIB GUIOBJ GUIFRAMEWORKS ANNOTATION_FLAGS JAVAC JAVA_TARGET JAR JAVAFLAGS JAVAPLUGINFLAGS BUILD_SLIVR SLIVR_INCLUDE SLIVR_LIBS TEEM_CMAKE_C_FLAGS SLIVR_CMAKE_SHARED_LINKER_FLAGS SLIVR_GUI_IMPL SLIVR_GUI_HDR HELP PLOT_BUILD_DIRS OPERATOR_BUILD_DIRS DB_BUILD_DIRS BUILD_GLEW GLEW_INCLUDE GLEW_LIBS BUILD_BILIB VISITWRAPPER_RPATH CXXCPP F77 FFLAGS ac_ct_F77 SET_MAKE RANLIB ac_ct_RANLIB MAKEDEPEND BUILD_FORTRAN XML2MAKEFILE_CXX OS_RULE BUILD_TUVOK TUVOK_LIB TUVOK_INCLUDE BUILD_ZLIB ZLIB_LIB HDF5_INCLUDE HDF5_LIB HDF5_TARGET SILO_INCLUDE SILO_LIB SILO_TARGET EXODUS EXODUS_LIB EXODUS_LIBS EXODUS_FLAGS PDB_INCLUDE PDB_LIB PDB_TARGET MILI MILI_FLAGS MILI_LIBS MILI_DIR TCMALLOC_LIB TCMALLOC_DIR CREATE_TCMALLOC_LINK HDF4 HDF4_FLAGS HDF4_LIBS HDF4_LIBDIR BOXLIB2D BOXLIB2D_INCLUDE BOXLIB2D_LIBS BOXLIB2D_LIBDIR BOXLIB3D BOXLIB3D_INCLUDE BOXLIB3D_LIBS BOXLIB3D_LIBDIR H5PART H5PART_INCLUDE H5PART_LIB H5PART_LIBDIR FASTBIT FASTBIT_INCLUDE FASTBIT_LIB FASTBIT_LIBDIR ADIOS ADIOS_INCLUDE ADIOS_LIB VISUS VISUS_INCLUDE VISUS_LIB NETCDF NETCDF_INCLUDE NETCDF_LIB NETCDF_CXX_LIB CGNS CGNS_INCLUDE CGNS_LIB GDAL GDAL_INCLUDE GDAL_LIB GDAL_LIBS CFITSIO CFITSIO_INCLUDE CFITSIO_LIB CFITSIO_LIBDIR ITAPS_C_INCLUDE ITAPS_C_LIB ITAPS_C0_INCLUDE ITAPS_C0_LIB ITAPS_C1_INCLUDE ITAPS_C1_LIB ITAPS_C2_INCLUDE ITAPS_C2_LIB ITAPS_C3_INCLUDE ITAPS_C3_LIB ITAPS_C4_INCLUDE ITAPS_C4_LIB ITAPS_C CCMIO CCMIO_INCLUDE CCMIO_LIBS CCMIO_LIBDIR ADVIO ADVIO_INCLUDE ADVIO_LIB SIMULATION EXPORT_DYNAMIC ENGINE_CPPFLAGS PREPROCESSOR_CPPFLAGS PREPROCESSOR_PARALLEL_SRC COMPONENT_CPPFLAGS VISIT_VTK_CPPFLAGS VISIT_VTK_LDFLAGS VIEWER_CPPFLAGS QT_BIN QT_INCLUDE QT_LIB QT_LDFLAGS QT_LIBS QT_CORE QT_CORE_LIB QT_DESIGNER QT_DESIGNER_LIB QT_GUI QT_GUI_LIB QT_HELP QT_HELP_LIB QT_CLUCENE QT_CLUCENE_LIB QT_NETWORK QT_NETWORK_LIB QT_OPENGL QT_OPENGL_LIB QT_SCRIPT QT_SCRIPT_LIB QT_SQL QT_SQL_LIB QT_SVG QT_SVG_LIB QT_TEST QT_TEST_LIB QT_XML QT_XML_LIB QT_QUI QT_QUI_LIB QT_CXXFLAGS QT_MOC VTKQT_CPPFLAGS VTKQT VTKQT_LIBS X_LIBS X_CPPFLAGS PTHREAD_LIB PTHREAD_CXXFLAGS ICET_CXXFLAGS ICET_LDFLAGS ICET_LIBS ICET_ENG_MAIN_OBJ PYDIR PYVERSION PY_INCLUDEDIR PY_CXXFLAGS PY_LDFLAGS PY_LIB PY_CLI_LIB EXE_LDFLAGS PLUGIN_LDFLAGS DATA_EXE_LDFLAGS SHLIB_CREATEPROG SHLIB_LIBS SHLIB_SERLIBS SHLIB_PARLIBS SHLIB_MPI_LIBS SHLIB_ILIBS SHLIB_GLIBS SHLIB_VLIBS SHLIB_MLIBS SHLIB_ESERLIBS SHLIB_EPARLIBS SHLIB_SLIBS SHLIB_POSTPROCESS_ILIBS SHLIB_POSTPROCESS_GLIBS SHLIB_POSTPROCESS_VLIBS SHLIB_POSTPROCESS_MLIBS SHLIB_POSTPROCESS_ESERLIBS SHLIB_POSTPROCESS_EPARLIBS SHLIB_POSTPROCESS_SLIBS SHLIB_SOEXT SHLIB_LIBEXT SHLIB_POSTPROCESS SHLIB_POSTPROCESS_SER SHLIB_POSTPROCESS_PAR SHLIB_TMPDIR PREBIND_LIBS LIBSIM_RUNTIME_SER LIBSIM_RUNTIME_PAR CREATE_MILI_LINK CREATE_HDF4_LINK CREATE_NETCDF_LINK CREATE_CGNS_LINK CREATE_GDAL_LINK CREATE_EXODUS_LINK CREATE_BOXLIB2D_LINK CREATE_BOXLIB3D_LINK CREATE_CFITSIO_LINK CREATE_H5PART_LINK CREATE_FASTBIT_LINK CREATE_CCMIO_LINK VAC_CV_LIBDIR_CREATE_LINKS VAC_CV_LIBDIR_DESTROY_LINKS MG tmpbin tmpinc tmplib plotplugindir operatorplugindir databaseplugindir DATA_REL_VISIT_PATH LIBOBJS LTLIBOBJS'
ac_subst_files='VARIABLES TARGETS DIRTARGETS LIBTARGETS PARLIBTARGETS SOURCE_DEPENDENCIES'
# Initialize some variables set by options.
......@@ -871,6 +871,8 @@ Optional Features:
--enable-server-components-only
build only the server components
(engine,mdserver,vcl)
--enable-static build the server components statically (you must
also issue --enable-server-components-only)
--enable-fake-exceptions do not make use of C++'s exception library
--enable-ignore-hangups ignore hangup signals (this avoids RHEL3 bug)
--enable-parallel make the parallel version
......@@ -1650,6 +1652,39 @@ echo "$as_me: WARNING: --enable-server-components-only overrides --enable-engine
enable_engine_only=no
fi
#
# Check for static builds.
#
# Check whether --enable-static or --disable-static was given.
if test "${enable_static+set}" = set; then
enableval="$enable_static"
fi;
if test "$enable_static" = yes && test "$enable_server_components_only" != yes; then
{ { echo "$as_me:$LINENO: error: --static requires --enable-server-components-only" >&5
echo "$as_me: error: --static requires --enable-server-components-only" >&2;}
{ (exit 1); exit 1; }; }
fi
STATIC_LINK=""
STATIC_LINK_PAR=""
STATIC_LINK_DBS=""
if test "$enable_static" = yes; then
STATIC_LINK="$""(STATIC_LINK)"
STATIC_LINK_PAR="$""(STATIC_LINK_PAR)"
STATIC_LINK_DBS="$""(STATIC_LINK_DBS)"
cat >>confdefs.h <<\_ACEOF
#define STATIC 1
_ACEOF
SHLIB_CREATEPROG="ar rcs"
SHLIB_SOEXT="a"
SHLIB_LIBEXT="a"
fi
#
# Check for CMake
#
......@@ -4073,11 +4108,11 @@ echo "${ECHO_T}found" >&6
VTK_DIR=$VTK
VTK_INCROOT="$""(TOPDIR)/include/vtk"
VTK_INCLUDES="-I$VTK_INCROOT -I$VTK_INCROOT/vtk-5.0"
VTK_LIBS="-lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkRendering -lvtkzlib -lvtkexpat -lvtkjpeg -lvtkpng -lvtktiff -lvtkftgl -lvtkfreetype -lvtksys -lvtkMPEG2Encode "
VTK_LIBS="-lvtkDICOMParser -lvtkHybrid -lvtkIO -lvtkImaging -lvtkRendering -lvtkGraphics -lvtkFiltering -lvtkCommon -lvtkexpat -lvtkjpeg -lvtkpng -lvtktiff -lvtkftgl -lvtkfreetype -lvtkzlib -lvtksys -lvtkMPEG2Encode"
if test "$UNAME" = "Darwin"; then
VTK_LIGHTWEIGHT_LIBS=$VTK_LIBS
else
VTK_LIGHTWEIGHT_LIBS="-lvtkCommon -lvtkFiltering -lvtkzlib -lvtkexpat -lvtksys"
VTK_LIGHTWEIGHT_LIBS="-lvtkFiltering -lvtkCommon -lvtkzlib -lvtkexpat -lvtksys"
fi
# Determine whether VTK was built with mangled Mesa support. If it wasn't
......@@ -6355,7 +6390,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:6358:" \
echo "$as_me:6393:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
......@@ -12579,10 +12614,14 @@ case $UNAME in
SHLIB_CREATEPROG="$""(CXX) -shared -o"
fi
# Set RPATH relative to executable
if test "$enable_static" = yes; then
EXE_LDFLAGS="-L$""(TOPDIR)/lib/"
else
EXE_LDFLAGS="$EXE_LDFLAGS -Wl,--rpath,\\\$\$ORIGIN/../lib"
PLUGIN_LDFLAGS="$PLUGIN_LDFLAGS -Wl,--rpath,\\\$\$ORIGIN/../../lib"
DATA_EXE_LDFLAGS="$DATA_EXE_LDFLAGS -Wl,--rpath,\\\$\$ORIGIN/../src/lib"
fi
fi
;;
Darwin)
......@@ -20533,7 +20572,9 @@ operatorplugindir="$""(TOPDIR)/plugins/operators"
databaseplugindir="$""(TOPDIR)/plugins/databases"
LDFLAGS="-L$libdir $LDFLAGS"
if test ! "$enable_static" = yes; then
LDFLAGS="-L$libdir $LDFLAGS"
fi
# Expand variables.
......@@ -20553,6 +20594,7 @@ if test -n "$METADATA_SERVER"; then
MDSERVER_FILES="mdserver/Makefile
mdserver/rpc/Makefile
mdserver/proxy/Makefile
mdserver/ssl/Makefile
mdserver/main/Makefile"
else
MDSERVER_FILES=""
......@@ -20585,6 +20627,7 @@ if test -n "$ENGINE"; then
ENGINE_FILES="engine/Makefile
engine/rpc/Makefile
engine/proxy/Makefile
engine/ssl/Makefile
engine/main/Makefile"
else
ENGINE_FILES=""
......@@ -20772,7 +20815,7 @@ if test "$enable_engine_only" = yes; then
VISITPY_FILES=""
CQSCORE_FILES=""
JAVA_FILES=""
TOOLS_FILES=""
TOOLS_FILES="tools/xml/Makefile"
COMPONENT_FILES="avt/Makefile
avt/DBAtts/Makefile
avt/DDF/Makefile
......@@ -20804,7 +20847,7 @@ if test "$enable_server_components_only" = yes; then
VISITPY_FILES=""
CQSCORE_FILES=""
JAVA_FILES=""
TOOLS_FILES=""
TOOLS_FILES="tools/xml/Makefile"
COMPONENT_FILES="avt/Makefile
avt/DBAtts/Makefile
avt/DDF/Makefile
......@@ -20823,6 +20866,9 @@ if test "$enable_server_components_only" = yes; then
avt/View/Makefile
avt/VisWindow/Makefile"
fi
if test "$enable_static" = yes; then
SUBDIRS="$""(SUBDIRS_STATIC_LINK)"
fi
ac_config_files="$ac_config_files $STANDARD_FILES $GUI_FILES $HELP_FILES $WINUTIL_FILES $VIEWER_FILES $ENGINE_FILES $MDSERVER_FILES $LAUNCHER_FILES $COMMON_FILES $TOOLS_FILES $VISIT_VTK_FILES $VTKQT_FILES $COMPONENT_FILES $PLOT_FILES $OPERATOR_FILES $DATABASE_FILES $DATA_FILES $VISITPY_FILES $SIMULATION_PROTOTYPE_FILES $CQSCORE_FILES $THIRD_PARTY_BUILTIN_FILES $JAVA_FILES"
ac_config_commands="$ac_config_commands default"
......@@ -21471,6 +21517,9 @@ s,@BUILD_DBIO_ONLY@,$BUILD_DBIO_ONLY,;t t
s,@CHECK_MAKE_AND_ENV_VARS@,$CHECK_MAKE_AND_ENV_VARS,;t t
s,@NON_DBIO_SERLIBS@,$NON_DBIO_SERLIBS,;t t
s,@NON_DBIO_PARLIBS@,$NON_DBIO_PARLIBS,;t t
s,@STATIC_LINK@,$STATIC_LINK,;t t
s,@STATIC_LINK_PAR@,$STATIC_LINK_PAR,;t t
s,@STATIC_LINK_DBS@,$STATIC_LINK_DBS,;t t
s,@CMAKE@,$CMAKE,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
s,@EGREP@,$EGREP,;t t
......
......@@ -988,6 +988,14 @@ dnl
dnl Cyrus Harrison, Tue Oct 6 08:56:58 PDT 2009
dnl Changed vtk include paths to reflect a 'make install'ed vtk
dnl installation.
dnl
dnl Hank Childs, Thu Nov 12 11:48:11 PST 2009
dnl Add support for static linking of the server side components.
dnl Client side components have not been tested. Further, it is assumed
dnl that third party libraries have been linked statically. Dynamic
dnl libraries are nominally fine, but the symlinks in /lib will not work and
dnl you won't get a true "static" binary.
dnl
dnl --------------------------------------------------------------------------
dnl
......@@ -1176,6 +1184,30 @@ if test "$enable_server_components_only" = yes && test "$enable_engine_only" = y
enable_engine_only=no
fi
#
# Check for static builds.
#
AC_ARG_ENABLE(static,
AC_HELP_STRING([--enable-static], [build the server components statically (you must also issue --enable-server-components-only)]))
if test "$enable_static" = yes && test "$enable_server_components_only" != yes; then
AC_MSG_ERROR([--static requires --enable-server-components-only])
fi
STATIC_LINK=""
STATIC_LINK_PAR=""
STATIC_LINK_DBS=""
if test "$enable_static" = yes; then
STATIC_LINK="$""(STATIC_LINK)"
STATIC_LINK_PAR="$""(STATIC_LINK_PAR)"
STATIC_LINK_DBS="$""(STATIC_LINK_DBS)"
AC_DEFINE(STATIC, [1], [Preprocessor directive for a static link.])
SHLIB_CREATEPROG="ar rcs"
SHLIB_SOEXT="a"
SHLIB_LIBEXT="a"
fi
AC_SUBST(STATIC_LINK)
AC_SUBST(STATIC_LINK_PAR)
AC_SUBST(STATIC_LINK_DBS)
#
# Check for CMake
#
......@@ -1452,11 +1484,11 @@ if test -n "$VTK"; then
VTK_DIR=$VTK
VTK_INCROOT="$""(TOPDIR)/include/vtk"
VTK_INCLUDES="-I$VTK_INCROOT -I$VTK_INCROOT/vtk-5.0"
VTK_LIBS="-lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkRendering -lvtkzlib -lvtkexpat -lvtkjpeg -lvtkpng -lvtktiff -lvtkftgl -lvtkfreetype -lvtksys -lvtkMPEG2Encode "
VTK_LIBS="-lvtkDICOMParser -lvtkHybrid -lvtkIO -lvtkImaging -lvtkRendering -lvtkGraphics -lvtkFiltering -lvtkCommon -lvtkexpat -lvtkjpeg -lvtkpng -lvtktiff -lvtkftgl -lvtkfreetype -lvtkzlib -lvtksys -lvtkMPEG2Encode"
if test "$UNAME" = "Darwin"; then
VTK_LIGHTWEIGHT_LIBS=$VTK_LIBS
else
VTK_LIGHTWEIGHT_LIBS="-lvtkCommon -lvtkFiltering -lvtkzlib -lvtkexpat -lvtksys"
VTK_LIGHTWEIGHT_LIBS="-lvtkFiltering -lvtkCommon -lvtkzlib -lvtkexpat -lvtksys"
fi
# Determine whether VTK was built with mangled Mesa support. If it wasn't
......@@ -3928,10 +3960,14 @@ case $UNAME in
SHLIB_CREATEPROG="$""(CXX) -shared -o"
fi
# Set RPATH relative to executable
if test "$enable_static" = yes; then
EXE_LDFLAGS="-L$""(TOPDIR)/lib/"
else
EXE_LDFLAGS="$EXE_LDFLAGS -Wl,--rpath,\\\$\$ORIGIN/../lib"
PLUGIN_LDFLAGS="$PLUGIN_LDFLAGS -Wl,--rpath,\\\$\$ORIGIN/../../lib"
DATA_EXE_LDFLAGS="$DATA_EXE_LDFLAGS -Wl,--rpath,\\\$\$ORIGIN/../src/lib"
fi
fi
;;
Darwin)
......@@ -4221,7 +4257,9 @@ operatorplugindir="$""(TOPDIR)/plugins/operators"
AC_SUBST(databaseplugindir)
databaseplugindir="$""(TOPDIR)/plugins/databases"
LDFLAGS="-L$libdir $LDFLAGS"
if test ! "$enable_static" = yes; then
LDFLAGS="-L$libdir $LDFLAGS"
fi
dnl
......@@ -4247,6 +4285,7 @@ if test -n "$METADATA_SERVER"; then
MDSERVER_FILES="mdserver/Makefile
mdserver/rpc/Makefile
mdserver/proxy/Makefile
mdserver/ssl/Makefile
mdserver/main/Makefile"
else
MDSERVER_FILES=""
......@@ -4279,6 +4318,7 @@ if test -n "$ENGINE"; then
ENGINE_FILES="engine/Makefile
engine/rpc/Makefile
engine/proxy/Makefile
engine/ssl/Makefile
engine/main/Makefile"
else
ENGINE_FILES=""
......@@ -4469,7 +4509,7 @@ if test "$enable_engine_only" = yes; then
VISITPY_FILES=""
CQSCORE_FILES=""
JAVA_FILES=""
TOOLS_FILES=""
TOOLS_FILES="tools/xml/Makefile"
COMPONENT_FILES="avt/Makefile
avt/DBAtts/Makefile
avt/DDF/Makefile
......@@ -4501,7 +4541,7 @@ if test "$enable_server_components_only" = yes; then
VISITPY_FILES=""
CQSCORE_FILES=""
JAVA_FILES=""
TOOLS_FILES=""
TOOLS_FILES="tools/xml/Makefile"
COMPONENT_FILES="avt/Makefile
avt/DBAtts/Makefile
avt/DDF/Makefile
......@@ -4520,6 +4560,9 @@ if test "$enable_server_components_only" = yes; then
avt/View/Makefile
avt/VisWindow/Makefile"
fi
if test "$enable_static" = yes; then
SUBDIRS="$""(SUBDIRS_STATIC_LINK)"
fi
AC_OUTPUT($STANDARD_FILES
$GUI_FILES
......
......@@ -38,10 +38,6 @@
#include <ANALYZEPluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo ANALYZE_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
......@@ -52,7 +48,7 @@
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT EngineDatabasePluginInfo* GetEngineInfo()
extern "C" DBP_EXPORT EngineDatabasePluginInfo* ANALYZE_GetEngineInfo()
{
return new ANALYZEEnginePluginInfo;
}
......
......@@ -38,10 +38,6 @@
#include <ANALYZEPluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo ANALYZE_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
......@@ -52,7 +48,7 @@
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* GetMDServerInfo()
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* ANALYZE_GetMDServerInfo()
{
return new ANALYZEMDServerPluginInfo;
}
......
......@@ -43,15 +43,7 @@
#include <ANALYZEPluginInfo.h>
#include <visit-config.h>
#if defined(__APPLE__)
extern "C" DBP_EXPORT const char *ANALYZEVisItPluginVersion = VISIT_VERSION;
#else
extern "C" DBP_EXPORT const char *VisItPluginVersion = VISIT_VERSION;
#endif
#if defined(__APPLE__)
#define GetGeneralInfo ANALYZE_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
......@@ -63,7 +55,7 @@ extern "C" DBP_EXPORT const char *VisItPluginVersion = VISIT_VERSION;
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* GetGeneralInfo()
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* ANALYZE_GetGeneralInfo()
{
return new ANALYZEGeneralPluginInfo;
}
......
......@@ -38,10 +38,6 @@
#include <ANSYSPluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo ANSYS_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
......@@ -52,7 +48,7 @@
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT EngineDatabasePluginInfo* GetEngineInfo()
extern "C" DBP_EXPORT EngineDatabasePluginInfo* ANSYS_GetEngineInfo()
{
return new ANSYSEnginePluginInfo;
}
......
......@@ -38,10 +38,6 @@
#include <ANSYSPluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo ANSYS_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
......@@ -52,7 +48,7 @@
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* GetMDServerInfo()
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* ANSYS_GetMDServerInfo()
{
return new ANSYSMDServerPluginInfo;
}
......
......@@ -43,15 +43,7 @@
#include <ANSYSPluginInfo.h>
#include <visit-config.h>
#if defined(__APPLE__)
extern "C" DBP_EXPORT const char *ANSYSVisItPluginVersion = VISIT_VERSION;
#else
extern "C" DBP_EXPORT const char *VisItPluginVersion = VISIT_VERSION;
#endif
#if defined(__APPLE__)
#define GetGeneralInfo ANSYS_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
......@@ -63,7 +55,7 @@ extern "C" DBP_EXPORT const char *VisItPluginVersion = VISIT_VERSION;
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* GetGeneralInfo()
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* ANSYS_GetGeneralInfo()
{
return new ANSYSGeneralPluginInfo;
}
......
......@@ -38,10 +38,6 @@
#include <AUXFilePluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo AUXFile_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
......@@ -52,7 +48,7 @@
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT EngineDatabasePluginInfo* GetEngineInfo()
extern "C" DBP_EXPORT EngineDatabasePluginInfo* AUXFile_GetEngineInfo()
{
return new AUXFileEnginePluginInfo;
}
......
......@@ -38,10 +38,6 @@
#include <AUXFilePluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo AUXFile_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
......@@ -52,7 +48,7 @@
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* GetMDServerInfo()
extern "C" DBP_EXPORT MDServerDatabasePluginInfo* AUXFile_GetMDServerInfo()
{
return new AUXFileMDServerPluginInfo;
}
......
......@@ -43,15 +43,7 @@
#include <AUXFilePluginInfo.h>
#include <visit-config.h>
#if defined(__APPLE__)
extern "C" DBP_EXPORT const char *AUXFileVisItPluginVersion = VISIT_VERSION;
#else
extern "C" DBP_EXPORT const char *VisItPluginVersion = VISIT_VERSION;
#endif
#if defined(__APPLE__)
#define GetGeneralInfo AUXFile_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
......@@ -63,7 +55,7 @@ extern "C" DBP_EXPORT const char *VisItPluginVersion = VISIT_VERSION;
// Creation: omitted
//
// ****************************************************************************
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* GetGeneralInfo()
extern "C" DBP_EXPORT GeneralDatabasePluginInfo* AUXFile_GetGeneralInfo()
{