[PPL-devel] [PATCH] fix --with-gmp-build= when gmp builddir != srcdir
Serge Belyshev
belyshev at depni.sinp.msu.ru
Sun Nov 6 13:30:08 CET 2011
Here is an incremental version of an updated patch with fix for
--enable-shared on top of current HEAD:
---
m4/ac_check_gmp.m4 | 11 +++++++----
src/Makefile.am | 2 +-
2 files changed, 8 insertions(+), 5 deletions(-)
Index: ppl/m4/ac_check_gmp.m4
===================================================================
--- ppl.orig/m4/ac_check_gmp.m4
+++ ppl/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"
])
Index: ppl/src/Makefile.am
===================================================================
--- ppl.orig/src/Makefile.am
+++ ppl/src/Makefile.am
@@ -81,7 +81,7 @@ ppl-config.cc \
ppl.hh
ppl_config_LDADD = \
-libppl.la
+libppl.la @extra_libraries@
if USE_NATIVE_INTEGERS
More information about the PPL-devel
mailing list