[glib] Fix -z nodelete configure check to work on Solaris



commit ca32be3bf231c6591cbe34f4e58e98312c4b73c5
Author: Alan Coopersmith <alan coopersmith oracle com>
Date:   Sat Nov 5 10:39:53 2016 -0700

    Fix -z nodelete configure check to work on Solaris
    
    Passing -z nodelete without the shared library flags on Solaris results in
    ld: fatal: option '-z nodelete' is incompatible with building a dynamic executable
    which causes the configure test to falsely report its not supported.
    
    Signed-off-by: Alan Coopersmith <alan coopersmith oracle com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776195

 configure.ac |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 16f416f..0b7ee95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3322,8 +3322,9 @@ dnl
 AC_ARG_ENABLE([znodelete],
               [AS_HELP_STRING([--disable-znodelete],
                               [avoid linking with -z,nodelete])],,
-              [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
+              [SAVED_CFLAGS="${CFLAGS}" SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
                AC_MSG_CHECKING([for --fatal-warnings linker flag])
+               CFLAGS="${SAVED_CFLAGS} ${shared_flag:- -shared}"
                LDFLAGS=-Wl,--fatal-warnings
                LIBS=
                AC_TRY_LINK([], [return 0],
@@ -3338,7 +3339,7 @@ AC_ARG_ENABLE([znodelete],
                            enable_znodelete=yes,
                            AC_MSG_RESULT(no)
                            enable_znodelete=no)
-               LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
+               CFLAGS="${SAVED_CFLAGS}" LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
 
 if test "x${enable_znodelete}" = "xyes"; then
   GLIB_LINK_FLAGS="$GLIB_LINK_FLAGS -Wl,-z,nodelete"


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