[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:54:20 UTC 2009
The following commit has been merged in the upstream branch:
commit a0c84d5fc267d6818b054103969839c75c447a80
Author: Stephane Popinet <popinet at users.sf.net>
Date: Tue Apr 24 10:56:18 2007 +1000
Configure checks for linker flags required for module compilation
This should fix issues on the various versions of Mac OSX.
darcs-hash:20070424005618-d4795-d25d8cc764da238f632aac3c52e6add44fab81b2.gz
diff --git a/configure.in b/configure.in
index b05959a..9f5c69a 100644
--- a/configure.in
+++ b/configure.in
@@ -226,6 +226,27 @@ AC_MSG_RESULT($have_gmodule)
CFLAGS=$OLD_CFLAGS
LIBS=$OLD_LIBS
+# checking how to build modules
+if test "$have_gmodule" = "yes"; then
+ module_flags=""
+ for flags in \
+ "-fPIC -shared -x c" \
+ "-fPIC -dynamiclib -x c -undefined dynamic_lookup" \
+ "-fPIC -bundle -x c"
+ do
+ if test x"$module_flags" = x; then
+ if echo "test(){}" | gcc $flags - 2> /dev/null; then
+ module_flags=\"$flags\"
+ fi
+ fi
+ done
+ if test x"$module_flags" = x; then
+ have_gmodule=no
+ AC_MSG_WARN([Could not build module, functions in parameter files will not be supported.])
+ fi
+ AC_DEFINE_UNQUOTED(MODULES_FLAGS, $module_flags, [Linking flags to build modules.])
+fi
+
# checks for pkg-config
if test "$have_gmodule" = "yes"; then
AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
diff --git a/src/utils.c b/src/utils.c
index 47b810a..362032f 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -449,11 +449,8 @@ static gint compile (GtsFile * fp, GfsFunction * f, const gchar * finname)
#else /* 3D */
"gerris3D"
#endif
-#if defined(__APPLE__) && defined(__MACH__)
- " --cflags --libs` -O -fPIC -bundle -x c";
-#else /* not MACOSX */
- " --cflags --libs` -O -fPIC -shared -x c";
-#endif /* not MACOSX*/
+ " --cflags --libs` -O "
+ MODULES_FLAGS;
foutd = mkstemp (foutname);
ferrd = mkstemp (ferrname);
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list