]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
configure.ac: better llc binary detection
authorEric Leblond <eric@regit.org>
Tue, 23 Oct 2018 04:39:18 +0000 (06:39 +0200)
committerEric Leblond <eric@regit.org>
Mon, 3 Dec 2018 16:46:33 +0000 (17:46 +0100)
llc is needed to build the ebpf files and current autoconf code
was not working properly on Debian.

configure.ac

index 57d0c5146def718bffc99373939ad9db386ab7ed..b1e66f8831c2245b5171f4230d9cf48533a7799b 100644 (file)
     if test "x$enable_ebpf_build" = "xyes"; then
         if echo $CC | grep clang; then
             if test "x$CC" = "xclang"; then
-                AC_MSG_CHECKING([llc binary])
-                AC_PATH_PROG(HAVE_LLC, llc, "yes", "no")
-                if test "$HAVE_LLC" = "yes"; then
+                AC_PATH_PROG(HAVE_LLC, llc, "no")
+                if test "$HAVE_LLC" != "no"; then
                     LLC="llc"
                     AC_SUBST(LLC)
                 else
-                    AC_MSG_CHECKING([llc binary for clang version])
                     llc_version_line=$($CC --version|$GREP version)
                     llc_version=$(echo $llc_version_line| cut -d '(' -f 1 | $GREP -E -o '@<:@0-9@:>@\.@<:@0-9@:>@')
-                    AC_MSG_RESULT($llc_version)
+                    AC_PATH_PROG(HAVE_LLC, "llc-$llc_version", "no")
+                    if test "$HAVE_LLC" != "no"; then
+                        LLC="llc-$llc_version"
+                        AC_SUBST(LLC)
+                   else
+                        echo "unable to find llc needed to build ebpf files"
+                        exit 1
+                    fi
+                fi
+            else
+                llc_version=$(echo $CC | cut -d '-' -f 2)
+                AC_PATH_PROG(HAVE_LLC, "llc-$llc_version", "no")
+                if test "$HAVE_LLC" != "no"; then
                     LLC="llc-$llc_version"
                     AC_SUBST(LLC)
+                else
+                    llc_version_line=$($CC --version|$GREP version)
+                    llc_version=$(echo $llc_version_line| cut -d '(' -f 1 | $GREP -E -o '@<:@0-9@:>@\.@<:@0-9@:>@')
+                    AC_PATH_PROG(HAVE_LLC, "llc-$llc_version", "no")
+                    if test "$HAVE_LLC" != "no"; then
+                        LLC="llc-$llc_version"
+                        AC_SUBST(LLC)
+                    else
+                        echo "unable to find llc needed to build ebpf files"
+                        exit 1
+                    fi
                 fi
-            else
-                AC_MSG_CHECKING([llc binary for clang version])
-                llc_version_line=$($CC --version|$GREP version)
-                llc_version=$(echo $llc_version_line| cut -d '(' -f 1 | $GREP -E -o '@<:@0-9@:>@\.@<:@0-9@:>@')
-                AC_MSG_RESULT($llc_version)
-                LLC="llc-$llc_version"
-                AC_SUBST(LLC)
             fi
         else
             echo "clang needed to build ebpf files"