[gjs/wip/ptomato/autotools: 12/18] build: Check for -Bsymbolic-functions with macro



commit 33159c8ac131c50179844edb0658db531ee3b8de
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Sep 26 22:06:46 2016 -0700

    build: Check for -Bsymbolic-functions with macro
    
    There is an Autoconf Archive macro for checking for linker flags now,
    AX_APPEND_LINK_FLAGS, so we can simplify our check.

 Makefile.am  |    1 -
 configure.ac |   22 ++++------------------
 2 files changed, 4 insertions(+), 19 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index aa275aa..e8e9752 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,7 +94,6 @@ libgjs_la_CPPFLAGS =          \
        -I$(top_srcdir)/gi      \
        -DGJS_COMPILATION
 libgjs_la_LDFLAGS =            \
-       $(EXTRA_LINK_FLAGS)     \
        -export-symbols-regex "^[^_]" -version-info 0:0:0       \
        -no-undefined \
        -rdynamic
diff --git a/configure.ac b/configure.ac
index 386b15b..a261f50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -194,24 +194,10 @@ dnl
 dnl Check for -Bsymbolic-functions linker flag used to avoid
 dnl intra-library PLT jumps, if available.
 dnl
-AC_ARG_ENABLE(Bsymbolic,
-              [AS_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}"])
-
-if test "x${enable_Bsymbolic}" = "xyes"; then
-  EXTRA_LINK_FLAGS=-Wl,-Bsymbolic-functions
-fi
-
-AC_SUBST(EXTRA_LINK_FLAGS)
+AC_ARG_ENABLE([Bsymbolic],
+  [AS_HELP_STRING([--disable-Bsymbolic], [avoid linking with -Bsymbolic])])
+AS_IF([test "x$enable_Bsymbolic" != "xno"],
+  [AX_APPEND_LINK_FLAGS([-Bsymbolic-functions])])
 
 AC_ARG_WITH([xvfb-tests],
   [AS_HELP_STRING([--with-xvfb-tests],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]