[glib] build: also unset LIBS when LDFLAGS is unset



commit 6c7972a05c2901d67d793be2db64817fec94e8e7
Author: Antoine Jacoutot <ajacoutot gnome org>
Date:   Thu Apr 10 11:16:44 2014 +0200

    build: also unset LIBS when LDFLAGS is unset
    
    On OpenBSD, libintl is installed under /usr/local/lib. When configure
    checks unset LDFLAGS, LIBS should also be unset otherwise we end up with
    -lintl which cannot be found resulting to the compile check to fail.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727939

 configure.ac |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f5ce6af..108a411 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3449,15 +3449,16 @@ dnl
 AC_ARG_ENABLE(Bsymbolic,
               [AS_HELP_STRING([--disable-Bsymbolic],
                               [avoid linking with -Bsymbolic])],,
-              [SAVED_LDFLAGS="${LDFLAGS}"
+              [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
                LDFLAGS=-Wl,-Bsymbolic-functions
+               LIBS=
                AC_TRY_LINK([], [int main (void) { return 0; }],
                            AC_MSG_RESULT(yes)
                            enable_Bsymbolic=yes,
                            AC_MSG_RESULT(no)
                            enable_Bsymbolic=no)
-               LDFLAGS="${SAVED_LDFLAGS}"])
+               LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
 
 if test "x${enable_Bsymbolic}" = "xyes"; then
   GLIB_LINK_FLAGS=-Wl,-Bsymbolic-functions
@@ -3476,9 +3477,10 @@ dnl
 AC_ARG_ENABLE([znodelete],
               [AS_HELP_STRING([--disable-znodelete],
                               [avoid linking with -z,nodelete])],,
-              [SAVED_LDFLAGS="${LDFLAGS}"
+              [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
                AC_MSG_CHECKING([for --fatal-warnings linker flag])
                LDFLAGS=-Wl,--fatal-warnings
+               LIBS=
                AC_TRY_LINK([], [int main (void) { return 0; }],
                            AC_MSG_RESULT(yes)
                            [ldflags_fatal=-Wl,--fatal-warnings],
@@ -3491,7 +3493,7 @@ AC_ARG_ENABLE([znodelete],
                            enable_znodelete=yes,
                            AC_MSG_RESULT(no)
                            enable_znodelete=no)
-               LDFLAGS="${SAVED_LDFLAGS}"])
+               LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
 
 if test "x${enable_znodelete}" = "xyes"; then
   GOBJECT_LINK_FLAGS=-Wl,-z,nodelete


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]