summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-01-08 10:05:25 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2019-01-10 10:03:40 +0900
commit1044ee639dab7260da481250cd2a46a69ab2b5d3 (patch)
tree7a1053ce2d8882e7d3f49c75faa32aa0cf0154bc /configure.ac
parent07e8c2e9ed04bb48fa380d8d23d3a7a7353e5878 (diff)
downloadlibgpg-error-1044ee639dab7260da481250cd2a46a69ab2b5d3.tar.gz
build: Build with LD_LIBRARY_PATH, use of DT_RPATH (1/2).
* configure.ac: Check against --disable-new-dtags. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 32 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4a99523..8f1598e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,6 +82,38 @@ AC_PROG_AWK
AC_CHECK_TOOL(AR, ar, :)
AC_GNU_SOURCE
+# Taken from mpfr-4.0.1
+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
+
# Set some variables depending on the platform for later use.
have_w32_system=no
have_w64_system=no