summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-07-17 12:33:27 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-07-17 12:33:27 +0000
commit8727c0c8309bd5913473614aba9c701f40435f0b (patch)
treebb6441aafb07577af55b9d130b2bc10f71dffc00 /configure.ac
parentba5bd35fda8157d7ac97b8c812eff035c3f1c5f2 (diff)
downloadmpfr-8727c0c8309bd5913473614aba9c701f40435f0b.tar.gz
[configure.ac] Under Linux, make sure that the old dtags are used
if LD_LIBRARY_PATH is defined, avoiding the following issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732 https://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html (merged changeset r11587 from the 3.1 branch) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11588 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 30 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 765eda58c..294e79e4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -546,6 +546,36 @@ error
;;
esac
+dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
+dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
+dnl the precedence over the run path, so that if a compatible MPFR library
+dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
+dnl MPFR library will be this library instead of the MPFR library from the
+dnl build tree. Other OS with the same issue might be added later.
+dnl
+dnl References:
+dnl https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732
+dnl http://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html
+dnl
+dnl We need to check whether --disable-new-dtags is supported as alternate
+dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
+dnl
+case $host in
+ *-*-linux*)
+ if test -n "$LD_LIBRARY_PATH"; then
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--disable-new-dtags"
+ AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
+int main (void) { return 0; }
+ ]])],
+ [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],
+ [AC_MSG_RESULT(no)
+ LDFLAGS="$saved_LDFLAGS"
+ ])
+ fi
+ ;;
+esac
dnl
dnl For mpfr-longlong.h - TODO: should be replaced (see acinclude.m4).