From f8f97218cbf97f6c6d1c762f62f7969a4ad41f05 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 7 Feb 2009 18:07:29 +0000 Subject: [PATCH] create config option string at configure time --- Common/CommandLine.cpp | 45 +----------------------------------------- Common/GmshConfig.h.in | 2 ++ configure | 6 +++++- configure.in | 3 ++- 4 files changed, 10 insertions(+), 46 deletions(-) diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index de4f0f8d66..5cc8be0a08 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -112,50 +112,7 @@ const char *Get_GmshBuildHost(){ return GMSH_HOST; } const char *Get_GmshPackager(){ return GMSH_PACKAGER; } const char *Get_GmshBuildOS(){ return GMSH_OS; } const char *Get_GmshShortLicense(){ return GMSH_SHORT_LICENSE; } -std::string Get_GmshBuildOptions() -{ - std::string opt; -#if defined(HAVE_NETGEN) - opt += "NETGEN "; -#endif -#if defined(HAVE_TETGEN) - opt += "TETGEN "; -#endif -#if defined(HAVE_LIBJPEG) - opt += "JPEG "; -#endif -#if defined(HAVE_LIBPNG) - opt += "PNG "; -#endif -#if defined(HAVE_LIBZ) - opt += "ZLIB "; -#endif -#if defined(HAVE_MATH_EVAL) - opt += "MATHEVAL "; -#endif -#if defined(HAVE_METIS) - opt += "METIS "; -#endif -#if defined(HAVE_CHACO) - opt += "CHACO "; -#endif -#if defined(HAVE_ANN) - opt += "ANN "; -#endif -#if defined(HAVE_CGNS) - opt += "CGNS "; -#endif -#if defined(HAVE_OCC) - opt += "OCC "; -#endif -#if defined(HAVE_MED) - opt += "MED "; -#endif -#if defined(HAVE_GMM) - opt += "GMM++ "; -#endif - return opt; -} +std::string Get_GmshBuildOptions(){ return GMSH_CONFIG_OPTIONS; } void Get_Options(int argc, char *argv[]) { diff --git a/Common/GmshConfig.h.in b/Common/GmshConfig.h.in index 1a1e3ca2d3..3b5ad15d47 100644 --- a/Common/GmshConfig.h.in +++ b/Common/GmshConfig.h.in @@ -35,4 +35,6 @@ #undef HAVE_TETGEN #undef HAVE_TREE_BROWSER +#define GMSH_CONFIG_OPTIONS "" + #endif diff --git a/configure b/configure index 413c6ed27e..debf99efb4 100755 --- a/configure +++ b/configure @@ -3928,7 +3928,7 @@ fi #define HAVE_TREE_BROWSER 1 _ACEOF - BO="${BO} TreeBrowser" + BO="${BO} TreeBrowser" fi fi @@ -7098,6 +7098,10 @@ _ACEOF fi fi +cat >>confdefs.h <<_ACEOF +#define GMSH_CONFIG_OPTIONS "${BO}" +_ACEOF + ac_config_headers="$ac_config_headers Common/GmshConfig.h:Common/GmshConfig.h.in" diff --git a/configure.in b/configure.in index d92e38c2c0..b045346381 100644 --- a/configure.in +++ b/configure.in @@ -274,7 +274,7 @@ if test "x$enable_gui" != "xno"; then GMSH_DIRS="${GMSH_DIRS} contrib/TreeBrowser" GMSH_LIBS="${GMSH_LIBS} -lGmshTreeBrowser" AC_DEFINE(HAVE_TREE_BROWSER) - BO="${BO} TreeBrowser" + BO="${BO} TreeBrowser" fi fi @@ -856,6 +856,7 @@ if test $ac_cv_sizeof_size_t != 4; then fi fi +AC_DEFINE_UNQUOTED(GMSH_CONFIG_OPTIONS, "${BO}") AC_CONFIG_HEADER(Common/GmshConfig.h:Common/GmshConfig.h.in) dnl Write output -- GitLab