Add check for -Bsymbolic-functions linker flag
authorRyan Lortie <desrt@desrt.ca>
Mon, 21 Jun 2010 17:25:44 +0000 (13:25 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 21 Jun 2010 17:25:44 +0000 (13:25 -0400)
configure.in

index 29754c5..739c01f 100644 (file)
@@ -3634,6 +3634,21 @@ AC_SUBST(DBUS1_CFLAGS)
 AC_SUBST(DBUS1_LIBS)
 AM_CONDITIONAL(HAVE_DBUS1, [test "x$have_dbus1" = "xyes"])
 
+dnl
+dnl Check for -Bsymbolic-functions linker flag used to avoid
+dnl intra-library PLT jumps, if available.
+dnl
+SAVED_LDFLAGS="${LDFLAGS}"
+AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
+LDFLAGS=-Wl,-Bsymbolic-functions
+AC_TRY_LINK([], [int main (void) { return 0; }],
+            GLIB_LINK_FLAGS=-Bsymbolic-functions
+            AC_MSG_RESULT(yes),
+            GLIB_LINK_FLAGS=
+            AC_MSG_RESULT(no))
+AC_SUBST(GLIB_LINK_FLAGS)
+LDFLAGS="${SAVED_LDFLAGS}"
+
 AC_CONFIG_FILES([
 glib-2.0.pc
 glib-2.0-uninstalled.pc