[PPL-devel] [PATCH] fix --with-gmp-build= when gmp builddir != srcdir

Serge Belyshev belyshev at depni.sinp.msu.ru
Sat Nov 5 21:52:29 CET 2011


This patch does two things:

* fixes logic error introduced in 1f0282c0
* allows --with-gmp-build= to work when gmp was built not in the source
  directory.

Note that --with-gmp-build= still doesn't work when --enable-shared is
specified (--disable-shared is ok).

This patch is required to restore possibility to build gmp and ppl in a
combined tree with gcc.

---
 m4/ac_check_gmp.m4 |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: ppl/m4/ac_check_gmp.m4
===================================================================
--- ppl.orig/m4/ac_check_gmp.m4
+++ ppl/m4/ac_check_gmp.m4
@@ -57,13 +57,14 @@ AC_ARG_WITH(gmp-build,
   AS_HELP_STRING([--with-gmp-build=DIR],
                  [use a non-installed build of GMP in DIR]),
   gmp_build_dir=$with_gmp_build
-  if test -n "$with_gmp" \
-  || test -n "$with_gmp_include" || test -n "$with_gmp_lib"
+  if test -z "$with_gmp" && test -z "$with_gmp_include" && test -z "$with_gmp_lib"
   then
     gmp_include_options="-I$gmp_build_dir -I$gmp_build_dir/tune"
     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="$gmp_include_options -I$gmp_srcdir"
   else
     AC_MSG_ERROR([cannot use --with-gmp-build and other --with-gmp* options together])
   fi)



More information about the PPL-devel mailing list