]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
configure: fix static builds with clang-12 and LTO
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 29 Jan 2021 12:04:58 +0000 (13:04 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 29 Jan 2021 12:04:58 +0000 (13:04 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
configure.ac

index bc1aec88ecd54a6859fc0cb65347a3f8eb3252c9..4f31d94ac8cfe9a2ae82ddad086864a10c12c5f1 100644 (file)
@@ -61,6 +61,18 @@ if test "x$valid_compiler" = "xno"; then
        AC_MSG_ERROR([Sorry, your compiler is too old - please upgrade it])
 fi
 
+AC_PROG_GCC_TRADITIONAL
+AC_ENABLE_SHARED
+AC_ENABLE_STATIC
+# Check binaries
+AC_PROG_SED
+case $CC in clang*)
+       AC_CHECK_TOOL([AR], llvm-ar)
+       AC_CHECK_TOOL([NM], llvm-nm)
+       AC_CHECK_TOOL([OBJCOPY], llvm-objcopy)
+       AC_CHECK_TOOL([RANLIB], llvm-ranlib)
+esac
+
 # libtool
 LT_INIT
 AC_SUBST([LIBTOOL_DEPS])
@@ -731,10 +743,6 @@ AC_CHECK_TYPES([struct rtnl_link_stats64], [], [], [[#include <linux/if_link.h>]
 AX_PTHREAD
 AC_SEARCH_LIBS(clock_gettime, [rt])
 
-# Check for some standard binaries
-AC_PROG_GCC_TRADITIONAL
-AC_PROG_SED
-
 # See if we support thread-local storage.
 LXC_CHECK_TLS