From e60171986b2b72a2ec67d26ade4ebb394adf9b9c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 6 Jul 2010 10:50:28 +0200 Subject: [PATCH] Let configure perform linker test with --version-script if enabled --- acinclude.m4 | 15 +++++++++++++++ configure.ac | 10 ++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 61ed963..4c9f780 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -131,6 +131,21 @@ iconv_close(cd); ]) +dnl LIBISOFS_ASSERT_VERS_LIBS is by Thomas Schmitt, libburnia project +dnl It tests whether -Wl,--version-script=... works with the compiler +AC_DEFUN([LIBISOFS_ASSERT_VERS_LIBS], +[ + libburnia_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=libisofs/libisofs.ver" + AC_TRY_LINK([#include ], [printf("Hello\n");], + [vers_libs_test="yes"], [vers_libs_test="no"]) + if test x$vers_libs_test = xno + then + LDFLAGS="$libburnia_save_LDFLAGS" + fi +]) + + dnl LIBBURNIA_SET_PKGCONFIG determines the install directory for the *.pc file. dnl Important: Must be performed _after_ TARGET_SHIZZLE dnl diff --git a/configure.ac b/configure.ac index ae457ee..d4e8976 100644 --- a/configure.ac +++ b/configure.ac @@ -218,8 +218,14 @@ AC_ARG_ENABLE(versioned-libs, [ --enable-versioned-libs Enable strict symbol encapsulation , default=yes], , enable_versioned_libs=yes) if test x$enable_versioned_libs = xyes; then - LDFLAGS="$LDFLAGS -Wl,--version-script=libisofs/libisofs.ver" - echo "enabled strict symbol encapsulation" + vers_libs_test=no + LIBISOFS_ASSERT_VERS_LIBS + if test x$vers_libs_test = xno + then + echo "disabled strict symbol encapsulation (test failed)" + else + echo "enabled strict symbol encapsulation" + fi else echo "disabled strict symbol encapsulation" fi