configure.ac |   29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

New commits:
commit 94ace0e51744f82b58156392e53b4c4ad819e4bf
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed Mar 30 13:16:06 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Wed Mar 30 17:14:29 2022 +0200

    try to use llvm-readelf etc. first when building with Clang
    
    With Clang14 the binutils readelf prints out a lot of warnings
    that are presumably related to Clang's switch to DWARF5, but
    llvm-readelf is silent about it. And in general it seems to make
    sense to first try to use the related tool.
    
    Change-Id: If0dd4f267bae080b7053a6944cd24df7f9b9cf69
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132309
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/configure.ac b/configure.ac
index 224faea12abf..ccaf7172e74c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4699,6 +4699,7 @@ if test "$enable_ld" != "no"; then
     fi
 fi
 AC_SUBST(USE_LD)
+AC_SUBST(LD)
 
 HAVE_LD_BSYMBOLIC_FUNCTIONS=
 if test "$GCC" = "yes" -a "$_os" != Emscripten ; then
@@ -6471,6 +6472,9 @@ dnl 
===================================================================
 if test "$_os" != "WINNT"; then
     PKG_PROG_PKG_CONFIG
 fi
+AC_SUBST(PKG_CONFIG)
+AC_SUBST(PKG_CONFIG_PATH)
+AC_SUBST(PKG_CONFIG_LIBDIR)
 
 if test "$_os" != "WINNT"; then
 
@@ -6478,27 +6482,20 @@ if test "$_os" != "WINNT"; then
     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
     # explicitly. Or put /path/to/compiler in PATH yourself.
 
-    # Use wrappers for LTO
-    if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
-        AC_CHECK_TOOL(AR,gcc-ar)
-        AC_CHECK_TOOL(NM,gcc-nm)
-        AC_CHECK_TOOL(RANLIB,gcc-ranlib)
-    else
-        AC_CHECK_TOOL(AR,ar)
-        AC_CHECK_TOOL(NM,nm)
-        AC_CHECK_TOOL(RANLIB,ranlib)
+    toolprefix=gcc
+    if test "$COM_IS_CLANG" = "TRUE"; then
+        toolprefix=llvm
     fi
-    AC_CHECK_TOOL(OBJDUMP,objdump)
-    AC_CHECK_TOOL(READELF,readelf)
-    AC_CHECK_TOOL(STRIP,strip)
+    AC_CHECK_TOOLS(AR,$toolprefix-ar ar)
+    AC_CHECK_TOOLS(NM,$toolprefix-nm nm)
+    AC_CHECK_TOOLS(RANLIB,$toolprefix-ranlib ranlib)
+    AC_CHECK_TOOLS(OBJDUMP,$toolprefix-objdump objdump)
+    AC_CHECK_TOOLS(READELF,$toolprefix-readelf readelf)
+    AC_CHECK_TOOLS(STRIP,$toolprefix-strip strip)
 fi
 AC_SUBST(AR)
-AC_SUBST(LD)
 AC_SUBST(NM)
 AC_SUBST(OBJDUMP)
-AC_SUBST(PKG_CONFIG)
-AC_SUBST(PKG_CONFIG_PATH)
-AC_SUBST(PKG_CONFIG_LIBDIR)
 AC_SUBST(RANLIB)
 AC_SUBST(READELF)
 AC_SUBST(STRIP)

Reply via email to