- AC_INIT(suricata, 4.0dev)
+ AC_INIT(suricata, 4.0.0-dev)
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/suricata.c])
;;
*-*-linux*)
#for now do nothing
+ RUST_LDADD="-ldl -lrt -lm"
;;
*-*-mingw32*)
CFLAGS="${CFLAGS} -DOS_WIN32"
fi
AM_CONDITIONAL([HAVE_PDFLATEX], [test "x$enable_pdflatex" != "xno"])
+# Cargo/Rust.
+ dnl enable_rust="no"
+ dnl AC_ARG_ENABLE(rust, AS_HELP_STRING([--enable-rust], [Enable Rust]),
+ dnl [enable_rust="$enableval"], [enable_rust=no])
+ AC_ARG_ENABLE([rust], AS_HELP_STRING([--enable-rust], [Enable Rust]))
+
+ rust_vendor_comment="# "
+ have_rust_vendor="no"
+
+ if test "x$enable_rust" != "xyes"; then
+ enable_rust="no"
+ else
+ AC_PATH_PROG(HAVE_CARGO, cargo, "no")
+ AC_PATH_PROG(HAVE_RUSTC, rustc, "no")
+
+ # Deal with the case where Rust was requested but rustc or cargo
+ # cannot be found.
+ if test "x$HAVE_CARGO" = "xno"; then
+ echo ""
+ echo " ERROR! Rust support requested but cargo not found."
+ echo ""
+ exit 1
+ fi
+ if test "x$HAVE_RUST" = "xno"; then
+ echo ""
+ echo " ERROR! Rust support requested but rustc not found."
+ echo ""
+ exit 1
+ fi
+
+ if test "x$HAVE_CARGO" != "xno"; then
+ if test "x$HAVE_RUSTC" != "xno"; then
+ enable_rust="yes"
+ AC_DEFINE([HAVE_RUST],[1],[Enable Rust language])
+ if test "x$enable_debug" = "xyes"; then
+ RUST_SURICATA_LIB="../rust/target/debug/libsuricata.a"
+ else
+ RUST_SURICATA_LIB="../rust/target/release/libsuricata.a"
+ fi
+ RUST_LDADD="${RUST_SURICATA_LIB} ${RUST_LDADD}"
+ CFLAGS="${CFLAGS} -I../rust/gen/c-headers"
+ AC_SUBST(RUST_SURICATA_LIB)
+ AC_SUBST(RUST_LDADD)
+ AC_CHECK_FILES([$srcdir/rust/vendor], [have_rust_vendor="yes"])
+ if test "x$have_rust_vendor" = "xyes"; then
+ rust_vendor_comment=""
+ fi
+ fi
+ fi
+ fi
+
+ AM_CONDITIONAL([HAVE_RUST], [test "x$enable_rust" = "xyes"])
+ AC_SUBST(rust_vendor_comment)
+ AM_CONDITIONAL([HAVE_RUST_VENDOR], [test "x$have_rust_vendor" = "xyes"])
+
+ if test "x$enable_rust" = "xyes"; then
+ AC_PATH_PROG(HAVE_CARGO_VENDOR, cargo-vendor, "no")
+ if test "x$HAVE_CARGO_VENDOR" = "xno"; then
+ echo " Warning: cargo-vendor not found, but it is only required"
+ echo " for building the distribution"
+ echo " To install: cargo install cargo-vendor"
+ fi
+ fi
+ AM_CONDITIONAL([HAVE_CARGO_VENDOR], [test "x$HAVE_CARGO_VENDOR" != "xno"])
+
# get revision
if test -f ./revision; then
REVISION=`cat ./revision`
AC_SUBST(CONFIGURE_PREFIX)
AC_SUBST(CONFIGURE_SYSCONDIR)
AC_SUBST(CONFIGURE_LOCALSTATEDIR)
+AC_SUBST(PACKAGE_VERSION)
-AC_OUTPUT(Makefile src/Makefile qa/Makefile qa/coccinelle/Makefile rules/Makefile doc/Makefile doc/userguide/Makefile contrib/Makefile contrib/file_processor/Makefile contrib/file_processor/Action/Makefile contrib/file_processor/Processor/Makefile contrib/tile_pcie_logd/Makefile suricata.yaml scripts/Makefile scripts/suricatasc/Makefile scripts/suricatasc/suricatasc)
+AC_OUTPUT(Makefile src/Makefile rust/Makefile rust/Cargo.toml rust/.cargo/config qa/Makefile qa/coccinelle/Makefile rules/Makefile doc/Makefile doc/userguide/Makefile contrib/Makefile contrib/file_processor/Makefile contrib/file_processor/Action/Makefile contrib/file_processor/Processor/Makefile contrib/tile_pcie_logd/Makefile suricata.yaml scripts/Makefile scripts/suricatasc/Makefile scripts/suricatasc/suricatasc)
SURICATA_BUILD_CONF="Suricata Configuration:
AF_PACKET support: ${enable_af_packet}
Hyperscan support: ${enable_hyperscan}
Libnet support: ${enable_libnet}
+ Rust support: ${enable_rust}
+
Suricatasc install: ${enable_python}
Profiling enabled: ${enable_profiling}