mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Add --enable-rust configure switch
Introduce a way to optionally enable Rust integration for our builds. No actual Rust code is added yet and specifying the flag has no effect other than failing the build if rustc and cargo are unavailable.
This commit is contained in:
parent
b8f7488e94
commit
915fa39d0f
@ -25,6 +25,12 @@ else
|
||||
TESTING_TOR_BINARY=$(top_builddir)/src/or/tor$(EXEEXT)
|
||||
endif
|
||||
|
||||
if USE_RUST
|
||||
rust_ldadd=
|
||||
else
|
||||
rust_ldadd=
|
||||
endif
|
||||
|
||||
include src/include.am
|
||||
include doc/include.am
|
||||
include contrib/include.am
|
||||
|
20
configure.ac
20
configure.ac
@ -55,6 +55,8 @@ AC_ARG_ENABLE(oss-fuzz,
|
||||
AS_HELP_STRING(--enable-oss-fuzz, [build extra fuzzers based on 'oss-fuzz' environment]))
|
||||
AC_ARG_ENABLE(memory-sentinels,
|
||||
AS_HELP_STRING(--disable-memory-sentinels, [disable code that tries to prevent some kinds of memory access bugs. For fuzzing only.]))
|
||||
AC_ARG_ENABLE(rust,
|
||||
AS_HELP_STRING(--enable-rust, [enable rust integration]))
|
||||
|
||||
if test "x$enable_coverage" != "xyes" -a "x$enable_asserts_in_tests" = "xno" ; then
|
||||
AC_MSG_ERROR([Can't disable assertions outside of coverage build])
|
||||
@ -65,6 +67,7 @@ AM_CONDITIONAL(COVERAGE_ENABLED, test "x$enable_coverage" = "xyes")
|
||||
AM_CONDITIONAL(DISABLE_ASSERTS_IN_UNIT_TESTS, test "x$enable_asserts_in_tests" = "xno")
|
||||
AM_CONDITIONAL(LIBFUZZER_ENABLED, test "x$enable_libfuzzer" = "xyes")
|
||||
AM_CONDITIONAL(OSS_FUZZ_ENABLED, test "x$enable_oss_fuzz" = "xyes")
|
||||
AM_CONDITIONAL(USE_RUST, test "x$enable_rust" = "xyes")
|
||||
|
||||
if test "$enable_static_tor" = "yes"; then
|
||||
enable_static_libevent="yes";
|
||||
@ -249,6 +252,23 @@ if test "x$PYTHON" = "x"; then
|
||||
fi
|
||||
AM_CONDITIONAL(USEPYTHON, [test "x$PYTHON" != "x"])
|
||||
|
||||
|
||||
if test "x$enable_rust" = "xyes"; then
|
||||
AC_ARG_VAR([RUSTC], [path to the rustc binary])
|
||||
AC_CHECK_PROG([RUSTC], [rustc], [rustc],[no])
|
||||
if test "x$RUSTC" = "xno"; then
|
||||
AC_MSG_ERROR([rustc unavailable but rust integration requested.])
|
||||
fi
|
||||
|
||||
AC_ARG_VAR([CARGO], [path to the cargo binary])
|
||||
AC_CHECK_PROG([CARGO], [cargo], [cargo],[no])
|
||||
if test "x$CARGO" = "xno"; then
|
||||
AC_MSG_ERROR([cargo unavailable but rust integration requested.])
|
||||
fi
|
||||
|
||||
AC_DEFINE([HAVE_RUST], 1, [have Rust])
|
||||
fi
|
||||
|
||||
ifdef([AC_C_FLEXIBLE_ARRAY_MEMBER], [
|
||||
AC_C_FLEXIBLE_ARRAY_MEMBER
|
||||
], [
|
||||
|
@ -2,6 +2,7 @@ include src/ext/include.am
|
||||
include src/trunnel/include.am
|
||||
include src/common/include.am
|
||||
include src/or/include.am
|
||||
include src/rust/include.am
|
||||
include src/test/include.am
|
||||
include src/tools/include.am
|
||||
include src/win32/include.am
|
||||
|
@ -123,7 +123,8 @@ src_or_tor_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-ctime.a \
|
||||
src/trace/libor-trace.a \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
|
||||
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ \
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
if COVERAGE_ENABLED
|
||||
src_or_tor_cov_SOURCES = src/or/tor_main.c
|
||||
|
@ -20,7 +20,8 @@ FUZZING_LIBS = \
|
||||
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
@TOR_SYSTEMD_LIBS@ \
|
||||
@TOR_LZMA_LIBS@ \
|
||||
@TOR_ZSTD_LIBS@
|
||||
@TOR_ZSTD_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
oss-fuzz-prereqs: \
|
||||
src/or/libtor-testing.a \
|
||||
|
@ -181,7 +181,8 @@ src_test_test_switch_id_LDADD = \
|
||||
src/common/libor-testing.a \
|
||||
src/common/libor-ctime-testing.a \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
src_test_test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
|
||||
@TOR_LDFLAGS_libevent@
|
||||
@ -196,7 +197,8 @@ src_test_test_LDADD = src/or/libtor-testing.a \
|
||||
src/trace/libor-trace.a \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
|
||||
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
@TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
@TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
src_test_test_slow_CPPFLAGS = $(src_test_test_CPPFLAGS)
|
||||
src_test_test_slow_CFLAGS = $(src_test_test_CFLAGS)
|
||||
@ -220,7 +222,8 @@ src_test_bench_LDADD = src/or/libtor.a src/common/libor.a \
|
||||
src/trace/libor-trace.a \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
|
||||
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
@TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
@TOR_SYSTEMD_LIBS@ @TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
src_test_test_workqueue_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
|
||||
@TOR_LDFLAGS_libevent@
|
||||
@ -232,7 +235,8 @@ src_test_test_workqueue_LDADD = src/or/libtor-testing.a \
|
||||
src/trace/libor-trace.a \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
|
||||
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@
|
||||
@TOR_LZMA_LIBS@ @TOR_ZSTD_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
src_test_test_timers_CPPFLAGS = $(src_test_test_CPPFLAGS)
|
||||
src_test_test_timers_CFLAGS = $(src_test_test_CFLAGS)
|
||||
@ -243,7 +247,8 @@ src_test_test_timers_LDADD = \
|
||||
src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
|
||||
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
@TOR_LZMA_LIBS@
|
||||
@TOR_LZMA_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
src_test_test_timers_LDFLAGS = $(src_test_test_LDFLAGS)
|
||||
|
||||
noinst_HEADERS+= \
|
||||
@ -270,7 +275,8 @@ src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
|
||||
src/trace/libor-trace.a \
|
||||
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
|
||||
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
@TOR_LZMA_LIBS@
|
||||
@TOR_LZMA_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
src_test_test_ntor_cl_AM_CPPFLAGS = \
|
||||
-I"$(top_srcdir)/src/or"
|
||||
|
||||
@ -291,7 +297,8 @@ src_test_test_bt_cl_LDADD = src/common/libor-testing.a \
|
||||
src/common/libor-ctime-testing.a \
|
||||
src/trace/libor-trace.a \
|
||||
@TOR_LIB_MATH@ \
|
||||
@TOR_LIB_WS32@ @TOR_LIB_GDI@
|
||||
@TOR_LIB_WS32@ @TOR_LIB_GDI@ \
|
||||
$(rust_ldadd)
|
||||
src_test_test_bt_cl_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
|
||||
src_test_test_bt_cl_CPPFLAGS= $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS)
|
||||
|
||||
|
@ -8,7 +8,8 @@ src_tools_tor_resolve_SOURCES = src/tools/tor-resolve.c
|
||||
src_tools_tor_resolve_LDFLAGS =
|
||||
src_tools_tor_resolve_LDADD = src/common/libor.a \
|
||||
src/common/libor-ctime.a \
|
||||
@TOR_LIB_MATH@ @TOR_LIB_WS32@
|
||||
@TOR_LIB_MATH@ @TOR_LIB_WS32@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
if COVERAGE_ENABLED
|
||||
src_tools_tor_cov_resolve_SOURCES = src/tools/tor-resolve.c
|
||||
@ -26,7 +27,8 @@ src_tools_tor_gencert_LDADD = src/common/libor.a src/common/libor-crypto.a \
|
||||
$(LIBKECCAK_TINY) \
|
||||
$(LIBDONNA) \
|
||||
@TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \
|
||||
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
|
||||
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
|
||||
$(rust_ldadd)
|
||||
|
||||
if COVERAGE_ENABLED
|
||||
src_tools_tor_cov_gencert_SOURCES = src/tools/tor-gencert.c
|
||||
|
Loading…
Reference in New Issue
Block a user