summarylogtreecommitdiffstats
path: root/configure-fix.patch
blob: c87bcacd67dcf196223948fe31ad34a270ad0330 (plain)
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
35
diff -ruN librsvg-2.42.5/configure.ac librsvg-2.42.5-patched/configure.ac
--- librsvg-2.42.5/configure.ac	2018-05-08 02:33:46.000000000 +0800
+++ librsvg-2.42.5-patched/configure.ac	2018-05-16 15:05:00.000000000 +0800
@@ -119,6 +119,22 @@
 AC_MSG_RESULT([$native_win32])
 AM_CONDITIONAL(OS_WIN32, test "$native_win32" = "yes")
 
+AC_MSG_CHECKING([for rust target])
+case "$host" in
+  i686*-*-mingw*|i686*-*-cygwin*)
+    rust_target=i686-pc-windows-gnu
+    ;;
+  x86_64*-*-mingw*|x86_64*-*-cygwin*)
+    rust_target=x86_64-pc-windows-gnu
+    ;;
+  *)
+    rust_target=$host
+    ;;
+esac
+AC_MSG_RESULT([$rust_target])
+AM_CONDITIONAL(RUST_TARGET, test -n rust_target)
+AC_ARG_VAR(rust_target, [used in cargo --target=])
+
 dnl ===========================================================================
 
 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
@@ -283,7 +299,7 @@
 
 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
 if test "x$cross_compiling" = "xyes" ; then
-	RUST_TARGET_SUBDIR="$host/$RUST_TARGET_SUBDIR"
+	RUST_TARGET_SUBDIR="$rust_target/$RUST_TARGET_SUBDIR"
 fi
 AC_SUBST([RUST_TARGET_SUBDIR])