build: Allow disabling linking with -Bsymbolic
authorEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 3 Sep 2010 12:55:07 +0000 (13:55 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 3 Sep 2010 12:55:07 +0000 (13:55 +0100)
Some debugging tools might require full visibility for the Clutter
symbols; for this reason, and to match what the Clutter dependencies
already allow, we should provide a configure switch to disable linking
with the -Bsymbolic flag.

README
configure.ac

diff --git a/README b/README
index 447fe24..8f298c0 100644 (file)
--- a/README
+++ b/README
@@ -153,6 +153,9 @@ Clutter has additional command line options for the configure script:
  --enable-conform=[yes/no]
         Build the Clutter conformance test suite.
 
+ --disable-Bsymbolic
+        Disable linking with -Bsymbolic.
+
  --with-flavour=[glx/eglx/eglnative/osx/win32/fruity]
         Select the Clutter backend: (default=glx)
 
index d7b2a12..31e3308 100644 (file)
@@ -100,19 +100,28 @@ AM_PATH_GLIB_2_0([2.18.0], [have_glib=yes], [have_glib=no],
 AS_IF([test "x$have_glib" = "xno"], AC_MSG_ERROR([glib-2.0 is required]))
 
 # Check for -Bsymbolic-functions to avoid intra-library PLT jumps
-clutter_LDFLAGS="${LDFLAGS}"
-AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
-LDFLAGS=-Wl,-Bsymbolic-functions
-AC_TRY_LINK([], [int main (void) { return 0; }],
-            [
-              CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions
-              AC_MSG_RESULT([yes])
-            ],
-            [
-              CLUTTER_LINK_FLAGS=
-              AC_MSG_RESULT([no])
-            ])
-LDFLAGS="${clutter_LDFLAGS}"
+AC_ARG_ENABLE([Bsymbolic],
+              [AC_HELP_STRING([--disable-Bsymbolic],
+                              [Avoid linking with -Bsymbolic])],
+              [],
+              [
+                saved_LDFLAGS="${LDFLAGS}"
+                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
+                LDFLAGS=-Wl,-Bsymbolic-functions
+                AC_TRY_LINK([], [int main (void) { return 0; }],
+                            [
+                              AC_MSG_RESULT([yes])
+                              enable_Bsymbolic=yes
+                            ],
+                            [
+                              AC_MSG_RESULT([no])
+                              enable_Bsymbolic=no
+                            ])
+                LDFLAGS="${saved_LDFLAGS}"
+              ])
+
+AS_IF([test "x$enable_Bsymbolic" = "xyes"],
+      [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
 AC_SUBST(CLUTTER_LINK_FLAGS)
 
 dnl ========================================================================