diff options
author | Thomas Haller <thaller@redhat.com> | 2017-06-01 10:26:59 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-06-01 12:51:31 +0200 |
commit | 484d666485f481ea3fce447bfeec0b32a3b4f793 (patch) | |
tree | 463dbd9f4f5a8660dddd35f67fc49d83f1a0f723 /configure.ac | |
parent | afebdc795d90e9555b5004905955b267b81b9785 (diff) | |
download | NetworkManager-484d666485f481ea3fce447bfeec0b32a3b4f793.tar.gz |
build: fix nm binutils tool when building with LTO
When building with -flto, we need to use linker plugins.
In case of binutils' nm, it means to prefer gcc-nm if
available.
Like for ranlib and ar, prefer gcc-nm.
- replace AC_PATH_TOOL() by AC_CHECK_TOOLS(). That is consistent
with what we do for ar,ranlib and suggested on bgo#783311.
- instead of using the variable $BINUTILS_NM, replace it by
$NM, which is more common according to bgo#783311.
- Keep recognizing $BINUTILS_NM environment, which was introduced
by commit 8bc88bcc7c. This is purely to keep previous build
scripts working. Originally I named it "$BINUTILS_NM" because
using $NM in NetworkManager seemed confusing. But well...
https://bugs.gentoo.org/show_bug.cgi?id=620052
https://bugzilla.gnome.org/show_bug.cgi?id=782525
https://bugzilla.gnome.org/show_bug.cgi?id=783311
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 1b6f3b6060..4080fd4837 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,7 @@ AC_PROG_MKDIR_P # Prefer gcc-* variants; the ones libtool would choose don't work with LTO AC_CHECK_TOOLS(AR, [gcc-ar ar], false) AC_CHECK_TOOLS(RANLIB, [gcc-ranlib ranlib], :) +AC_CHECK_TOOLS(NM, [$BINUTILS_NM gcc-nm nm]) dnl Initialize libtool LT_PREREQ([2.2]) @@ -1199,8 +1200,6 @@ else fi AC_SUBST(NM_LOG_COMPILER, 'LOG_COMPILER = "$(top_srcdir)/tools/run-nm-test.sh" --called-from-make "$(LIBTOOL)" "$(with_valgrind)" "'"$with_valgrind_suppressions"'" --launch-dbus=auto') -AC_PATH_TOOL(BINUTILS_NM, nm, nm) - AM_PATH_PYTHON([], [], [PYTHON=python]) AC_SUBST(PYTHON, [$PYTHON]) AC_DEFINE_UNQUOTED(TEST_NM_PYTHON, "$PYTHON", [Define python path for test binary]) |