[PPL-devel] [GIT] ppl/ppl(master): Allow `--with-gmp-build' to be used with `--enable-shared'.

Roberto Bagnara bagnara at cs.unipr.it
Sun Nov 6 14:43:23 CET 2011


Module: ppl/ppl
Branch: master
Commit: 2f98bbb6a85b18aecbe9da3bc0d48bb36ac6b089
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=2f98bbb6a85b18aecbe9da3bc0d48bb36ac6b089

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Sun Nov  6 14:39:47 2011 +0100

Allow `--with-gmp-build' to be used with `--enable-shared'.
(Thanks to Serge Belyshev.)

---

 m4/ac_check_gmp.m4 |   11 +++++++----
 src/Makefile.am    |    1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/m4/ac_check_gmp.m4 b/m4/ac_check_gmp.m4
index dbb747c..469f536 100644
--- a/m4/ac_check_gmp.m4
+++ b/m4/ac_check_gmp.m4
@@ -53,6 +53,8 @@ then
   gmp_library_options="-L$gmp_library_paths"
 fi
 
+gmp_libs="-lgmpxx -lgmp"
+
 AC_ARG_WITH(gmp-build,
   AS_HELP_STRING([--with-gmp-build=DIR],
                  [use a non-installed build of GMP in DIR]),
@@ -62,15 +64,15 @@ AC_ARG_WITH(gmp-build,
   then
     AC_MSG_ERROR([cannot use --with-gmp-build and other --with-gmp* options together])
   else
-    gmp_library_paths="$gmp_build_dir$PATH_SEPARATOR$gmp_build_dir/.libs:$gmp_build_dir/tune"
-    gmp_library_options="-L$gmp_build_dir -L$gmp_build_dir/.libs"
-    gmp_library_options="$gmp_library_options -L$gmp_build_dir/tune"
     gmp_srcdir=`echo @abs_srcdir@ | $gmp_build_dir/config.status --file=-`
     gmp_include_options="-I$gmp_build_dir -I$gmp_build_dir/tune -I$gmp_srcdir"
+    gmp_libs="$gmp_build_dir/libgmp.la $gmp_build_dir/libgmpxx.la"
   fi)
 
-gmp_library_options="$gmp_library_options -lgmpxx -lgmp"
+gmp_library_options="$gmp_library_options $gmp_libs"
 
+ac_save_CXX="$CXX"
+CXX="libtool --mode=link $CXX"
 ac_save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $gmp_include_options"
 ac_save_LIBS="$LIBS"
@@ -221,4 +223,5 @@ AC_LANG_POP(C++)
 eval $shared_library_path_env_var=\"$ac_save_shared_library_path\"
 LIBS="$ac_save_LIBS"
 CPPFLAGS="$ac_save_CPPFLAGS"
+CXX="$ac_save_CXX"
 ])
diff --git a/src/Makefile.am b/src/Makefile.am
index d674d6a..bea3a7b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -81,6 +81,7 @@ ppl-config.cc \
 ppl.hh
 
 ppl_config_LDADD = \
+ at extra_libraries@ \
 libppl.la
 
 if USE_NATIVE_INTEGERS




More information about the PPL-devel mailing list