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
This commit is contained in:
Alan Coopersmith 2016-11-05 10:39:53 -07:00 committed by Philip Withnall
parent 6bcc8b4034
commit ca32be3bf2

View File

@ -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"