From 0e3ff74b849431fd0921138205f4205faecc682e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 16 Feb 2012 23:30:07 -0600 Subject: Add configure-time check for -Wl, --version-script option This is supported by the GNU linker, but not the Solaris linker, which is used as the default on that platform even when compiling with GCC. Omit passing the option to the linker on platforms that do not support it. Signed-off-by: Dan McGee --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1c15e745..b8acfa94 100644 --- a/configure.ac +++ b/configure.ac @@ -518,6 +518,16 @@ fi AC_MSG_RESULT($have_gcc4) AC_SUBST(VISIBILITY_HIDDEN_CFLAGS) +dnl ensure linker supports ---version-script option before using it +AC_CACHE_CHECK([if -Wl,--version-script works], [spice_cv_ld_version_script], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/server/spice-server.syms" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [spice_cv_ld_version_script=yes], [spice_cv_ld_version_script=no]) + LDFLAGS="$save_LDFLAGS"]) +AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], + [test x"$spice_cv_ld_version_script" = xyes]) + AC_SUBST(SPICE_REQUIRES) AC_SUBST(SPICE_NONPKGCONFIG_CFLAGS) AC_SUBST(SPICE_NONPKGCONFIG_LIBS) -- cgit