[nasm:nasm-2.16.xx] autoconf: more aggressively avoid cross-compilation problems

nasm-bot for H. Peter Anvin hpa at zytor.com
Thu Jan 4 23:27:13 PST 2024


Commit-ID:  a31565995723ef1657e8cab7ffc1ce74e3b24ba6
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=a31565995723ef1657e8cab7ffc1ce74e3b24ba6
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Thu, 4 Jan 2024 23:21:44 -0800
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Thu, 4 Jan 2024 23:21:44 -0800

autoconf: more aggressively avoid cross-compilation problems

We could end up invoking WINE even when we didn't want to.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 autoconf/m4/pa_cross_compile.m4 | 41 +++++++++++++++++++++++++++++++++++++++++
 configure.ac                    |  3 +--
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/autoconf/m4/pa_cross_compile.m4 b/autoconf/m4/pa_cross_compile.m4
new file mode 100644
index 00000000..f0829732
--- /dev/null
+++ b/autoconf/m4/pa_cross_compile.m4
@@ -0,0 +1,41 @@
+dnl --------------------------------------------------------------------------
+dnl  PA_CROSS_COMPILE
+dnl
+dnl Get the canonical name for the build and host (runtime) systems;
+dnl then figure out if this is cross-compilation. Specifically, this
+dnl disables invoking WINE on non-Windows systems which are configured
+dnl to run WINE automatically.
+dnl
+dnl Use PA_CROSS_COMPILE_TOOL if the target system (output of a code-
+dnl generation tool) is applicable.
+dnl
+dnl This doesn't explicitly print any messages as that is automatically
+dnl done elsewhere.
+dnl --------------------------------------------------------------------------
+AC_DEFUN_ONCE([PA_CROSS_COMPILE],
+[
+ AC_BEFORE([$0], [AC_LANG_COMPILER])
+ AC_BEFORE([$0], [AC_LANG])
+ AC_BEFORE([$0], [AC_PROG_CC])
+ AC_BEFORE([$0], [AC_PROG_CPP])
+ AC_BEFORE([$0], [AC_PROG_CXX])
+ AC_BEFORE([$0], [AC_PROG_CXXCPP])
+ AC_BEFORE([$0], [AC_PROG_OBJC])
+ AC_BEFORE([$0], [AC_PROG_OBJCPP])
+ AC_BEFORE([$0], [AC_PROG_OBJCXX])
+ AC_BEFORE([$0], [AC_PROG_OBJCXXCPP])
+ AC_BEFORE([$0], [AC_PROG_F77])
+ AC_BEFORE([$0], [AC_PROG_FC])
+ AC_BEFORE([$0], [AC_PROG_GO])
+
+ # Disable WINE
+ WINELOADER=/dev/null
+ export WINELOADER
+ WINESERVER=/dev/null
+ export WINESERVER
+ WINEPREFIX=/dev/null
+ export WINEPREFIX
+
+ AC_CANONICAL_BUILD
+ AC_CANONICAL_HOST
+])
diff --git a/configure.ac b/configure.ac
index 0099485c..c55dfb3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,8 +15,7 @@ AH_BOTTOM([
 dnl This prevents us from running Wine and thinking we are not
 dnl cross-compiling when in fact we are; running Wine here is at
 dnl the best very slow and doesn't buy us a single thing at all.
-WINELOADER=/dev/null
-export WINELOADER
+PA_CROSS_COMPILE
 
 dnl Get the canonical target system name
 AC_CANONICAL_HOST


More information about the Nasm-commits mailing list