rust: enable by default

Remove 'experimental' label for Rust, and enable it by default if
rustc and cargo (and libjansson) are available.

Add rustc and cargo versions to the build-info.
pull/3500/head
Victor Julien 6 years ago
parent 4ece6ba758
commit ed712768d5

@ -2170,14 +2170,20 @@ fi
AM_CONDITIONAL([HAVE_PDFLATEX], [test "x$enable_pdflatex" != "xno"])
# Cargo/Rust.
AC_ARG_ENABLE([rust], AS_HELP_STRING([--enable-rust], [Enable Experimental Rust support]))
AC_ARG_ENABLE([rust], AS_HELP_STRING([--enable-rust], [Enable Rust support]),
[enable_rust="$enableval"], [enable_rust="yes (default)"])
rust_config_enabled="no" # used in suricata.yaml.in to enable/disable app-layers
rust_config_comment="#" # used in suricata.yaml.in to enable/disable eve loggers
rust_vendor_comment="# "
have_rust_vendor="no"
rust_compiler_version="not set"
rust_cargo_version="not set"
if test "x$enable_rust" != "xyes"; then
if test "x$enable_rust" != "xyes" && test "x$enable_rust" != "xyes (default)"; then
enable_rust="no"
elif test "x$enable_python" != "xyes" && test ! -f rust/gen/c-headers/rust-core-gen.h; then
enable_rust="no"
else
# Rust require jansson (json support).
@ -2189,8 +2195,12 @@ fi
echo " Fedora: dnf install jansson-devel"
echo " CentOS/RHEL: yum install jansson-devel"
echo ""
if test "x$enable_rust" = "xyes"; then
exit 1
fi
echo " Rust support will be disabled."
enable_rust="no"
fi
AC_PATH_PROG(HAVE_CARGO, cargo, "no")
AC_PATH_PROG(HAVE_RUSTC, rustc, "no")
@ -2205,22 +2215,32 @@ fi
echo " Fedora: dnf install cargo"
echo " CentOS/RHEL: yum install cargo"
echo ""
if test "x$enable_rust" = "xyes"; then
exit 1
fi
echo " Rust support will be disabled."
enable_rust="no"
fi
if test "x$HAVE_RUST" = "xno"; then
echo ""
echo " ERROR! Rust support requested but rustc not found."
echo
echo " Ubuntu: apt-get install rustc"
echo " Debian <= 9: use rustup to install"
echo " Debian 10: apt-get install rustc"
echo " Fedora: dnf install rust"
echo " CentOS/RHEL: yum install rust"
echo ""
if test "x$enable_rust" = "xyes"; then
exit 1
fi
echo " Rust support will be disabled."
enable_rust="no"
fi
if test "x$enable_rust" != "xno"; then
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/${RUST_SURICATA_LIBNAME}"
@ -2244,17 +2264,20 @@ fi
rust_config_enabled="yes"
rust_config_comment=""
rust_compiler_version=$(rustc --version)
rust_cargo_version=$(cargo --version)
fi
fi
fi
fi
AM_CONDITIONAL([HAVE_RUST], [test "x$enable_rust" = "xyes"])
AM_CONDITIONAL([HAVE_RUST], [test "x$enable_rust" = "xyes" || test "x$enable_rust" = "xyes (default)"])
AC_SUBST(rust_vendor_comment)
AC_SUBST(rust_config_enabled)
AC_SUBST(rust_config_comment)
AM_CONDITIONAL([HAVE_RUST_VENDOR], [test "x$have_rust_vendor" = "xyes"])
if test "x$enable_rust" = "xyes"; then
if test "x$enable_rust" = "xyes" || test "x$enable_rust" = "xyes (default)"; 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"
@ -2405,9 +2428,11 @@ SURICATA_BUILD_CONF="Suricata Configuration:
Libnet support: ${enable_libnet}
liblz4 support: ${enable_liblz4}
Rust support (experimental): ${enable_rust}
Rust support: ${enable_rust}
Rust strict mode: ${enable_rust_strict}
Rust debug mode: ${enable_rust_debug}
Rust compiler: ${rust_compiler_version}
Rust cargo: ${rust_cargo_version}
Suricatasc install: ${enable_python}

@ -1000,7 +1000,7 @@ app-layer:
dp: 44818
sp: 44818
# Note: parser depends on experimental Rust support
# Note: parser depends on Rust support
ntp:
enabled: @rust_config_enabled@

Loading…
Cancel
Save