hc
2024-08-13 72be3801e63d82671c9d90577a9efb3126a6aa37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 7ab4d5eb55e1d3900390b76e5f46e80e22d4e80e Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 10 Oct 2020 21:34:21 +0200
Subject: [PATCH] configure.ac: allow the user to override RUST_TARGET
 
When cross-compiling, RUST_TARGET is not always equal to host_triplet
(e.g. buildroot) so allow the user to override this default value
through RUST_TARGET environment variable
 
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 configure.ac | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
 
diff --git a/configure.ac b/configure.ac
index 32c230209..7d7c9373f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2489,7 +2489,12 @@ fi
     have_rust_vendor="no"
 
     if test "x$cross_compiling" = "xyes"; then
-      RUST_SURICATA_LIB_XC_DIR="${host_alias}/"
+      if test "x$RUST_TARGET" != "x"; then
+        RUST_SURICATA_LIB_XC_DIR="$RUST_TARGET/"
+        AC_SUBST([RUST_TARGET],["--target $RUST_TARGET"])
+      else
+        RUST_SURICATA_LIB_XC_DIR="${host_alias}/"
+      fi
     else
       if test "x$CARGO_BUILD_TARGET" = "x"; then
         RUST_SURICATA_LIB_XC_DIR=
-- 
2.28.0