aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-30 09:15:39 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-30 09:15:39 -0400
commit028523c801606301fe744eee462a55efeda385ec (patch)
tree643303501d889e1a3285efedd75098d91f533e63 /configure.ac
parent57155d38a3c71e352c083b0e0c3a2326c3181c8d (diff)
parente042727cf02fbeb0dd193f5faa60f7caf1f19aea (diff)
downloadtor-028523c801606301fe744eee462a55efeda385ec.tar.gz
tor-028523c801606301fe744eee462a55efeda385ec.zip
Merge branch 'maint-0.3.4'
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 22 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 38d4303699..97e8dadeba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -443,6 +443,8 @@ fi
AC_C_BIGENDIAN
+AC_ARG_VAR([TOR_RUST_TARGET], [Rust target, must be specified when cross-compiling (HOST != BUILD). example: i686-pc-windows-gnu])
+
if test "x$enable_rust" = "xyes"; then
AC_ARG_VAR([RUSTC], [path to the rustc binary])
AC_CHECK_PROG([RUSTC], [rustc], [rustc],[no])
@@ -508,12 +510,29 @@ if test "x$enable_rust" = "xyes"; then
dnl For now both MSVC and MinGW rust libraries will output static libs with
dnl the MSVC naming convention.
if test "$bwin32" = "true"; then
- TOR_RUST_STATIC_NAME=tor_rust.lib
+ tor_rust_static_name=tor_rust.lib
else
- TOR_RUST_STATIC_NAME=libtor_rust.a
+ tor_rust_static_name=libtor_rust.a
+ fi
+
+ AC_CANONICAL_BUILD
+
+ if test -n "$TOR_RUST_TARGET"; then
+ if test "$host" = "$build"; then
+ AC_MSG_ERROR([HOST = BUILD is invalid if TOR_RUST_TARGET is specified, see configure --help for more information.])
+ fi
+ RUST_TARGET_PROP="target = '$TOR_RUST_TARGET'"
+ TOR_RUST_LIB_PATH="src/rust/target/$TOR_RUST_TARGET/release/$tor_rust_static_name"
+ else
+ if test "$host" != "$build"; then
+ AC_MSG_ERROR([TOR_RUST_TARGET must be specified when cross-compiling with Rust enabled.])
+ fi
+ RUST_TARGET_PROP=
+ TOR_RUST_LIB_PATH="src/rust/target/release/$tor_rust_static_name"
fi
- AC_SUBST(TOR_RUST_STATIC_NAME)
+ AC_SUBST(RUST_TARGET_PROP)
+ AC_SUBST(TOR_RUST_LIB_PATH)
AC_SUBST(CARGO_ONLINE)
AC_SUBST(RUST_WARN)
AC_SUBST(RUST_DL)