aboutsummaryrefslogtreecommitdiff
path: root/config.rust.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-18 17:08:23 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-19 12:01:13 -0400
commitbd9ebb3763b90a8ef429376ee578e0571371145f (patch)
tree06a8e6fd20118ec47e87dc36a4b9780f809360d6 /config.rust.in
parentd27745d81de8829d1a6da851fe9be057458e86df (diff)
downloadtor-bd9ebb3763b90a8ef429376ee578e0571371145f.tar.gz
tor-bd9ebb3763b90a8ef429376ee578e0571371145f.zip
Use a rust build script to set linker options correctly for tests.
We need this trick because some of our Rust tests depend on our C code, which in turn depend on other native libraries, which thereby pulls a whole mess of our build system into "cargo test". To solve this, we add a build script (build.rs) to set most of the options that we want based on the contents of config.rust. Some options can't be set, and need to go to the linker directly: we use a linker replacement (link_rust.sh) for these. Both config.rust and link_rust.sh are generated by autoconf for us. This patch on its own should enough to make the crypto test build, but not necessarily enough to make it pass.
Diffstat (limited to 'config.rust.in')
-rw-r--r--config.rust.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/config.rust.in b/config.rust.in
new file mode 100644
index 0000000000..4ca5351aec
--- /dev/null
+++ b/config.rust.in
@@ -0,0 +1,22 @@
+# Used by our cargo build.rs script to get variables from autoconf.
+#
+# The "configure" script will generate "config.rust" from "config.rust.in",
+# and then build.rs will read "config.rust".
+
+BUILDDIR=@BUILDDIR@
+TOR_LDFLAGS_zlib=@TOR_LDFLAGS_zlib@
+TOR_LDFLAGS_openssl=@TOR_LDFLAGS_openssl@
+TOR_LDFLAGS_libevent=@TOR_LDFLAGS_libevent@
+TOR_ZLIB_LIBS=@TOR_ZLIB_LIBS@
+TOR_LIB_MATH=@TOR_LIB_MATH@
+TOR_LIBEVENT_LIBS=@TOR_LIBEVENT_LIBS@
+TOR_OPENSSL_LIBS=@TOR_OPENSSL_LIBS@
+TOR_LIB_WS32=@TOR_LIB_WS32@
+TOR_LIB_GDI=@TOR_LIB_GDI@
+TOR_LIB_USERENV=@TOR_LIB_USERENV@
+CURVE25519_LIBS=@CURVE25519_LIBS@
+TOR_SYSTEMD_LIBS=@TOR_SYSTEMD_LIBS@
+TOR_LZMA_LIBS=@TOR_LZMA_LIBS@
+TOR_ZSTD_LIBS=@TOR_ZSTD_LIBS@
+LIBS=@LIBS@
+LDFLAGS=@LDFLAGS@