configure should be more careful with linker script
authorIgor Pashev <pashev.igor@gmail.com>
Wed, 21 Nov 2012 06:04:29 +0000 (14:04 +0800)
committerDaniel Veillard <veillard@redhat.com>
Wed, 21 Nov 2012 06:04:29 +0000 (14:04 +0800)
For https://bugzilla.gnome.org/show_bug.cgi?id=685626

it would assume the system linker for extracting the linker
script options, even if GNU ld is in use. Which breaks on Solaris.

configure.in

index 0d7ba86..db48224 100644 (file)
@@ -130,13 +130,16 @@ dnl
 dnl if the system support linker version scripts for symbol versioning
 dnl then add it
 dnl
-VERSION_SCRIPT_FLAGS=
-$(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
+AC_MSG_CHECKING([how to pass version script to the linker ($LD)])
+VERSION_SCRIPT_FLAGS=none
+if $LD --help 2>&1 | grep "version-script" >/dev/null 2>/dev/null; then
     VERSION_SCRIPT_FLAGS=-Wl,--version-script=
-test "`uname`" = "SunOS" && \
+elif $LD --help 2>&1 | grep "M mapfile" >/dev/null 2>/dev/null; then
     VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
+fi
+AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS])
 AC_SUBST(VERSION_SCRIPT_FLAGS)
-AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
+AM_CONDITIONAL([USE_VERSION_SCRIPT], [test "$VERSION_SCRIPT_FLAGS" != none])
 
 dnl Look for pthread.h, needed for testThreads
 case $host in