]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/aclocal.m4
acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES): Do not clear SECTION_LDFLAGS and OPT_LD...
[thirdparty/gcc.git] / libstdc++-v3 / aclocal.m4
index b945d5a293738fd9d9a38ae706b152dba294c7d7..8b4500bbc45ab2626eea8091ac56dcf63964184b 100644 (file)
@@ -298,8 +298,8 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
   # If we're not using GNU ld, then there's no point in even trying these
   # tests.  Check for that first.  We should have already tested for gld
   # by now (in libtool), but require it now just to be safe...
-  SECTION_LDFLAGS=''
-  OPT_LDFLAGS=''
+  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
   AC_REQUIRE([AC_PROG_LD])
 
   # Set --gc-sections.
@@ -335,7 +335,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
       CFLAGS=''
     fi
     if test "$ac_sectionLDflags" = "yes"; then
-      SECTION_LDFLAGS='-Wl,--gc-sections'
+      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
     fi
     AC_MSG_RESULT($ac_sectionLDflags)
   fi
@@ -343,7 +343,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
   # Set linker optimization flags.
   if test x"$ac_cv_prog_gnu_ld" = x"yes" &&
      test x"$enable_debug" = x"no"; then
-    OPT_LDFLAGS='-Wl,-O1'
+    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
   fi
 
   AC_SUBST(SECTION_LDFLAGS)