112 lines
5 KiB
Diff
112 lines
5 KiB
Diff
From 204dd050b9d50013eeb4137dc84e7cb678a7315a Mon Sep 17 00:00:00 2001
|
|
From: Samuel Hym <samuel@tarides.com>
|
|
Date: Thu, 22 Feb 2024 13:37:28 +0100
|
|
Subject: [PATCH 03/14] Use `target` instead of `host` to detect the C
|
|
toolchain
|
|
|
|
When building a cross-compiler, the runtime will run on the target, not
|
|
the host so:
|
|
- set `cross_compiling` by comparing `build` to `target` (rather than to
|
|
`host`), as this variable will be used later
|
|
- use `target` to set up the tool prefix,
|
|
- as the libtool configuration will configure a `build` to `host`
|
|
toolchain, temporarily assign `host*` values to `target*` values
|
|
---
|
|
configure | Bin 682393 -> 682949 bytes
|
|
configure.ac | 18 ++++++++++++++++++
|
|
2 files changed, 18 insertions(+)
|
|
|
|
diff --git a/configure b/configure
|
|
index 9f16ca87352a88b5e995631c15fd8914f6b2ebfc..f81f4ca213b710395b61b64d1380318d4d80867d 100755
|
|
GIT binary patch
|
|
delta 1998
|
|
zcmZ`(drVbz9N+yt?u9D~^12Qaj&QXR!UV#QN5pXGe6e(h`QUQ6_W&nu=Unc&0<{Wr
|
|
zD<>GO8vK+s2i9!ONBq(FHF{hNafq|VoH5JU!?YZcjAl&@>UX)nUodan?QEa>`F_s#
|
|
z{XIu7rw)#$?*GVC)z(thsCd1qOOc#j-7p+Z{W*{7R<&A5)?AY8bog}L?eKV&8nsz!
|
|
zl)b84?N$uQP&KC_`RWv@L<%UJb+W2Ss$or$_8E$caZ;_KDPGyfRI;~L@kvgd1!<~N
|
|
zG^u)@>UPb9kerEusLU3Ks(7txjpS1dpVXXepHY#uX0tt(X$v*os<;hBvde};(>>O=
|
|
zdymC~8kGz+TUI=jXQ4e9(jmK5*+{q6sB}-8>Ch7ioYsxGab`&J;7ijZcm~ph0aI~I
|
|
z5R;zYOxrmuo&>9j|1VP}X|$OmN!hr`N;5`Hp1Ap?(RA&&X)65x1(f-^xhyQ0)1w(=
|
|
zxdl8<ug3vU8r0J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^cg$6+s>X0ck$(Ip
|
|
zu1*Wu8&SO_YCRZ@lZ#<J7xq`X){GkViptY>@Vc&Achtpe)Lez!{FqCDmY6Nw>3mT0
|
|
zQM8z8Y*?3T#)7(7*~w>$M;f_LxH9?Y#Ohoo|5*_@mc`wZS8zU?o9U!p9_A0LZEw%z
|
|
z5p^x{r}^CDCH0>re4Hl3CnrjIK2v0hp5UugdGRNCvD%d@PxA_LS-6}ZR>~VI_-)li
|
|
zOA1JQjvtuZk`oc$rxsOqmh+Xf$?@_le2C`FFORhIoM|f8_?x^nPZhpZ1FzgRz{}A7
|
|
u&lW!p@=K}(wVRsnJ~JiB)J%E(6z`yWe|`NKZk-hCq*})%*Pn5(>G=<2b2Q8V
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 2e3a11f60c..0862b381ff 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -288,6 +288,14 @@ AC_CANONICAL_BUILD
|
|
AC_CANONICAL_HOST
|
|
AC_CANONICAL_TARGET
|
|
|
|
+# Override cross_compiling and ac_tool_prefix variables since the C toolchain is
|
|
+# used to generate target code when building a cross compiler
|
|
+AS_IF([test x"$build" = x"$target"],
|
|
+ [cross_compiling=no],
|
|
+ [cross_compiling=yes])
|
|
+AS_IF([test -n "$target_alias"],
|
|
+ [ac_tool_prefix=$target_alias-])
|
|
+
|
|
# Ensure that AC_CONFIG_LINKS will either create symlinks which are compatible
|
|
# with native Windows (i.e. NTFS symlinks, not WSL or Cygwin-emulated ones) or
|
|
# use its fallback mechanisms. Native Windows versions of ocamlc/ocamlopt cannot
|
|
@@ -594,12 +602,22 @@ AC_CHECK_TOOLS([LD],[ld link])
|
|
# Also, it has been observed that, on some platforms (e.g. msvc) LT_INIT
|
|
# alters the CFLAGS variable, so we save its value before calling the macro
|
|
# and restore it after the call
|
|
+pushdef([host], target)dnl
|
|
+pushdef([host_alias], target_alias)dnl
|
|
+pushdef([host_cpu], target_cpu)dnl
|
|
+pushdef([host_vendor], target_vendor)dnl
|
|
+pushdef([host_os], target_os)dnl
|
|
old_host_os=$host_os
|
|
AS_IF([test x"$host_os" = "xwindows"],[host_os=mingw])
|
|
saved_CFLAGS="$CFLAGS"
|
|
LT_INIT
|
|
CFLAGS="$saved_CFLAGS"
|
|
host_os=$old_host_os
|
|
+popdef([host_os])dnl
|
|
+popdef([host_vendor])dnl
|
|
+popdef([host_cpu])dnl
|
|
+popdef([host_alias])dnl
|
|
+popdef([host])dnl
|
|
|
|
AS_CASE([$host],
|
|
[sparc-sun-solaris*],
|
|
--
|
|
2.45.2
|
|
|