summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-01-08 10:21:44 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2019-01-08 10:29:34 +0900
commit5f9569ee181f807cdfa74e2b12c8fab9f80784fe (patch)
treecf650ddac5facb797d74a6e44ff0d7a0d47d1798
parent7933692f2e6060f09dc13e2ce07f677feacd364f (diff)
downloadlibgpg-error-gniibe/disable-new-dtags.tar.gz
build: Build with LD_LIBRARY_PATH, use of DT_RPATH (2/2).gniibe/disable-new-dtags
* configure.ac (LDADD_TESTS): New for --disable-new-dtags. * tests/Makefile.am (LDADD): Use LDADD_TESTS. (t_lock_LDADD, t_poll_LDADD): Use LDADD. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--configure.ac9
-rw-r--r--tests/Makefile.am6
2 files changed, 9 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 8f1598e..dc9b543 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,7 @@ AC_PROG_AWK
AC_CHECK_TOOL(AR, ar, :)
AC_GNU_SOURCE
-# Taken from mpfr-4.0.1
+# Taken from mpfr-4.0.1, then modified for LDADD_TESTS
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
@@ -101,18 +101,21 @@ case $host in
*-*-linux*)
if test -n "$LD_LIBRARY_PATH"; then
saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--disable-new-dtags"
+ LDADD_TESTS="-Wl,--disable-new-dtags"
+ LDFLAGS="$LDFLAGS $LDADD_TESTS"
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"
+ LDADD_TESTS=""
])
+ LDFLAGS="$saved_LDFLAGS"
fi
;;
esac
+AC_SUBST([LDADD_TESTS])
# Set some variables depending on the platform for later use.
have_w32_system=no
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 71ca3a4..97f06eb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -33,10 +33,10 @@ TESTS = t-version t-strerror t-syserror t-lock t-printf t-poll t-b64 \
AM_CPPFLAGS = -I$(top_builddir)/src $(extra_includes)
AM_LDFLAGS = -no-install
-LDADD = $(gpg_error_lib)
+LDADD = $(gpg_error_lib) @LDADD_TESTS@
noinst_PROGRAMS = $(TESTS)
noinst_HEADERS = t-common.h
-t_lock_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
-t_poll_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
+t_lock_LDADD = $(LDADD) $(LIBMULTITHREAD)
+t_poll_LDADD = $(LDADD) $(LIBMULTITHREAD)