aboutsummaryrefslogtreecommitdiff
path: root/libiberty/configure.ac
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-11-13 06:11:41 -0800
committerH.J. Lu <hjl.tools@gmail.com>2021-12-15 14:18:10 -0800
commitbf8cdd35117dea2049abbeebcdf14de11b323ef7 (patch)
tree2a9b15300ca8bc1b3497086f2e0010a2fd9306c7 /libiberty/configure.ac
parent807ad4bc854caea407aaa09993e4a3220290b0f0 (diff)
downloadgcc-bf8cdd35117dea2049abbeebcdf14de11b323ef7.zip
gcc-bf8cdd35117dea2049abbeebcdf14de11b323ef7.tar.gz
gcc-bf8cdd35117dea2049abbeebcdf14de11b323ef7.tar.bz2
Sync with binutils: GCC: Pass --plugin to AR and RANLIB
Sync with binutils for building binutils with LTO: 50ad1254d50 GCC: Pass --plugin to AR and RANLIB Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. ChangeLog: * Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. * configure.ac: Include config/gcc-plugin.m4. AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and RANLIB if possible. * Makefile.in: Regenerated. * configure: Likewise. config/ * gcc-plugin.m4 (GCC_PLUGIN_OPTION): New. libiberty/ * Makefile.in (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. (configure_deps): Depend on ../config/gcc-plugin.m4. * configure.ac: AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * aclocal.m4: Regenerated. * configure: Likewise. zlib/ * configure: Regenerated.
Diffstat (limited to 'libiberty/configure.ac')
-rw-r--r--libiberty/configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 84a7b37..f59f35e 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -113,6 +113,18 @@ dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
+GCC_PLUGIN_OPTION(PLUGIN_OPTION)
+if test -n "$PLUGIN_OPTION"; then
+ if $AR --help 2>&1 | grep -q "\--plugin"; then
+ AR_PLUGIN_OPTION="$PLUGIN_OPTION"
+ AC_SUBST(AR_PLUGIN_OPTION)
+ fi
+ if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+ RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
+ AC_SUBST(RANLIB_PLUGIN_OPTION)
+ fi
+fi
+
dnl When switching to automake, replace the following with AM_ENABLE_MULTILIB.
# Add --enable-multilib to configure.
# Default to --enable-multilib