[PPL-devel] [GIT] ppl/ppl(devel): Avoid overriding LD_LIBRARY_PATH; use libtool instead .

Roberto Bagnara roberto.bagnara at bugseng.com
Wed Feb 10 21:10:44 CET 2016


Module: ppl/ppl
Branch: devel
Commit: 11f5d7fc82d6f92d135506f02e0ddc5536cbabb0
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=11f5d7fc82d6f92d135506f02e0ddc5536cbabb0

Author: Roberto Bagnara <roberto.bagnara at bugseng.com>
Date:   Fri Feb  5 17:11:25 2016 +0100

Avoid overriding LD_LIBRARY_PATH; use libtool instead.

---

 configure.ac         |   17 +++++++++++------
 m4/Makefile.am       |    1 +
 m4/ac_check_gmp.m4   |    4 ----
 m4/ac_use_libtool.m4 |   27 +++++++++++++++++++++++++++
 4 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 23f227b..576f378 100644
--- a/configure.ac
+++ b/configure.ac
@@ -851,6 +851,17 @@ AC_CHECK_TYPES([int_fast16_t,int_fast32_t,int_fast64_t,uint_fast16_t,uint_fast32
 AC_TYPE_UINTPTR_T
 
 
+# Libtool.
+LT_PREREQ([1.5.24])
+LT_INIT([dlopen,win32-dll])
+AM_CONDITIONAL(ENABLE_SHARED, test x"$enable_shared" = xyes)
+AM_CONDITIONAL(ENABLE_STATIC, test x"$enable_static" = xyes)
+
+
+# Make sure libtool is used for linking.
+AC_USE_LIBTOOL
+
+
 # Checks on the GMP library.
 
 AC_CHECK_GMP
@@ -1490,12 +1501,6 @@ quick)
 esac
 AM_CONDITIONAL(THOROUGH_MAKE_CHECK, test x"$enableval" = xthorough)
 
-# Libtool.
-LT_PREREQ([1.5.24])
-LT_INIT([dlopen,win32-dll])
-AM_CONDITIONAL(ENABLE_SHARED, test x"$enable_shared" = xyes)
-AM_CONDITIONAL(ENABLE_STATIC, test x"$enable_static" = xyes)
-
 # Checks for md5sum.
 AC_CHECK_PROG(MD5SUM, md5sum, md5sum)
 AM_CONDITIONAL(HAVE_MD5SUM, test x$MD5SUM = xmd5sum)
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 2c955b0..ac17ea7 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -50,6 +50,7 @@ ac_prog_java.m4 \
 ac_prog_javac.m4 \
 ac_prog_javah.m4 \
 ac_text_md5sum.m4 \
+ac_use_libtool.m4 \
 libtool.m4 \
 ltoptions.m4 \
 ltsugar.m4 \
diff --git a/m4/ac_check_gmp.m4 b/m4/ac_check_gmp.m4
index 7e5e005..a424532 100644
--- a/m4/ac_check_gmp.m4
+++ b/m4/ac_check_gmp.m4
@@ -81,9 +81,6 @@ ac_save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $gmp_include_options"
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $gmp_library_options"
-eval ac_save_shared_library_path="\$$shared_library_path_env_var"
-eval $shared_library_path_env_var=\"$gmp_library_paths:$ac_save_shared_library_path\"
-export $shared_library_path_env_var
 
 AC_LANG_PUSH(C++)
 
@@ -224,7 +221,6 @@ AC_DEFINE_UNQUOTED(PPL_GMP_SUPPORTS_EXCEPTIONS, $value,
 fi
 
 AC_LANG_POP(C++)
-eval $shared_library_path_env_var=\"$ac_save_shared_library_path\"
 LIBS="$ac_save_LIBS"
 CPPFLAGS="$ac_save_CPPFLAGS"
 
diff --git a/m4/ac_use_libtool.m4 b/m4/ac_use_libtool.m4
new file mode 100644
index 0000000..bc13e24
--- /dev/null
+++ b/m4/ac_use_libtool.m4
@@ -0,0 +1,27 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 1995-2009 Karl Berry <tex-live at tug.org>
+# Copyright (C) 2009-2012 Peter Breitenlohner <tex-live at tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# Use libtool for linking.  This allows testing properties of libraries
+# that can be either (1) uninstalled libtool libraries already built
+# when this configure runs, or (2) installed libraries -- libtool or not.
+
+AC_DEFUN([AC_USE_LIBTOOL],
+[## $0: Generate a libtool script for use in configure tests
+AC_PROVIDE_IFELSE([LT_INIT], ,
+                  [m4_fatal([$0: requires libtool])])[]dnl
+LT_OUTPUT
+m4_append([AC_LANG(C)],
+[ac_link="./libtool --mode=link --tag=CC $ac_link"
+])[]dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+[m4_append([AC_LANG(C++)],
+[ac_link="./libtool --mode=link --tag=CXX $ac_link"
+])])[]dnl
+AC_LANG(_AC_LANG)[]dnl
+]) # AC_USE_LIBTOOL




More information about the PPL-devel mailing list