diff options
author | NIIBE Yutaka <[email protected]> | 2019-01-16 01:59:25 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2019-01-16 01:59:25 +0000 |
commit | 66bcb8acb2452cf19318023ed0ff1ea7d7bb8439 (patch) | |
tree | 450034696813822c94b4b321e5f6a77f5591c6ad /configure.ac | |
parent | tests: Add diagnostic example to run-import.c (diff) | |
download | gpgme-66bcb8acb2452cf19318023ed0ff1ea7d7bb8439.tar.gz gpgme-66bcb8acb2452cf19318023ed0ff1ea7d7bb8439.zip |
build: With LD_LIBRARY_PATH defined, use --disable-new-dtags.
* configure.ac (LDADD_FOR_TESTS_KLUDGE): New for --disable-new-dtags.
* tests/Makefile.am (LDADD): Use LDADD_FOR_TESTS_KLUDGE.
* lang/cpp/tests/Makefile.am, lang/qt/tests/Makefile.am: Likewise.
* tests/gpg/Makefile.am, tests/gpgsm/Makefile.am: Likewise.
* tests/json/Makefile.am, tests/opassuan/Makefile.am: Likewise.
--
GnuPG-bug-id: 4298
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index ff37794f..e59a2f84 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,41 @@ AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory]) # Enable GNU extensions on systems that have them. AC_GNU_SOURCE +# Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE +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" + LDADD_FOR_TESTS_KLUDGE="-Wl,--disable-new-dtags" + LDFLAGS="$LDFLAGS $LDADD_FOR_TESTS_KLUDGE" + 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) + LDADD_FOR_TESTS_KLUDGE="" + ]) + LDFLAGS="$saved_LDFLAGS" + fi + ;; +esac +AC_SUBST([LDADD_FOR_TESTS_KLUDGE]) + AH_VERBATIM([_REENTRANT], [/* To allow the use of GPGME in multithreaded programs we have to use special features from the library. |