configure.ac: Move llvm-config searching outside the function
authorTobias Droste <tdroste@gmx.de>
Sat, 19 Nov 2016 01:38:59 +0000 (02:38 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 5 Dec 2016 14:43:46 +0000 (14:43 +0000)
There's no harm in always searching llvm-config.
This way it's available as soon as possible for all functions.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
configure.ac

index 4add91e7da5814904ebe263e79f08f6543609d09..78eb8cb9ff1d9d7b1a36b7502a21763f8c1ebaae 100644 (file)
@@ -887,6 +887,14 @@ if test "x$have_libelf" = xno; then
    AC_SUBST([LIBELF_CFLAGS])
 fi
 
+if test -z "$LLVM_CONFIG"; then
+    if test -n "$llvm_prefix"; then
+        AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
+    else
+        AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
+    fi
+fi
+
 llvm_add_component() {
     new_llvm_component=$1
     driver_name=$2
@@ -948,14 +956,6 @@ strip_unwanted_llvm_flags() {
 }
 
 llvm_set_environment_variables() {
-    if test -z "$LLVM_CONFIG"; then
-        if test -n "$llvm_prefix"; then
-            AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
-        else
-            AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
-        fi
-    fi
-
     if test "x$LLVM_CONFIG" != xno; then
         LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'`
         LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`