]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
configure: fix test for rust headers for cross compile
authorJason Ish <jason.ish@oisf.net>
Tue, 1 Sep 2020 15:49:46 +0000 (09:49 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 3 Sep 2020 10:56:25 +0000 (12:56 +0200)
Use "if test ..." instead of AC_CHECK_FILES which does not work
when cross compiling.

configure.ac

index f51d7b2b52b5b5d2ac830082cb9fb00297e108b3..a0fb7e2247e441f6040462a00458586419c55885 100644 (file)
@@ -2596,7 +2596,22 @@ fi
         have_cargo_vendor=$have_cargo_vendor_bin
     fi
 
-    AC_CHECK_FILES([$srcdir/rust/dist $srcdir/rust/gen], [have_rust_headers="yes"])
+    have_rust_headers="no"
+    AC_MSG_CHECKING(for $srcdir/rust/dist/rust-bindings.h)
+    if test -f "$srcdir/rust/dist/rust-bindings.h"; then
+       AC_MSG_RESULT(yes)
+       have_rust_headers="yes"
+    else
+       AC_MSG_RESULT(no)
+       AC_MSG_CHECKING(for $srcdir/rust/gen/rust-bindings.h)
+       if test -f "$srcdir/rust/gen/rust-bindings.h"; then
+           AC_MSG_RESULT(yes)
+           have_rust_headers="yes"
+       else
+           AC_MSG_RESULT(no)
+       fi
+    fi
+
     AC_PATH_PROG(CBINDGEN, cbindgen, "no")
     if test "x$CBINDGEN" != "xno"; then
       cbindgen_version=$(cbindgen --version | cut -d' ' -f2-)