bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19111: 25.0.50; 32 bits temacs.exe is linked with wrong image-base w


From: Dani Moncayo
Subject: bug#19111: 25.0.50; 32 bits temacs.exe is linked with wrong image-base when built on 64 bit Windows host
Date: Wed, 26 Nov 2014 00:42:46 +0100

Another detail that I think is wrong in the MinGW-specific block of
code is this: if a --host parameter was given to 'configure', there is
no need to update anything there.

So, here is the last version of my proposed patch:

-------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 8830ec7..3814104 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,42 +137,44 @@ AM_INIT_AUTOMAKE(1.11)

 dnl Canonicalize the configuration name.
 AC_CANONICAL_HOST
-canonical=$host
-configuration=${host_alias-${build_alias-$host}}

-dnl We get MINGW64 with MSYS2, MINGW32 with MSYS.
-case $canonical in
+case $host in
  *-mingw*)
-  . $srcdir/nt/mingw-cfg.site

-  # When we build with MinGW under MSYS, we are cross-compiling. Hence
-  # we can't rely on the output of MSYS `uname' for the architecture
-  # (32 bit MinGW compiler with 64 bit MSYS2, for instance) and must
-  # use the compiler's target, unless when the user explicitly
-  # provides one:
-  if test -z $target_alias; then
+  # We are building with a MSYS[2]/MinGW[-w64] toolchain.
+
+  if test -z "$host_alias"; then
+
+      # No --host argument was given, but we cannot rely on the
+      # current value of '$host', because it is based on the MSYS[2]
+      # environment ('i686-pc-mingw32' on MSYS and MSYS2-i686, and
+      # 'x86_64-pc-mingw64' on MSYS2-x86_64), which may not match
+      # the actual compiler's target.  E.g. building with MSYS2-x86_64
+      # and MinGW-i686.  Therefore, we have to check the compiler's
+      # target.
+
       AC_MSG_CHECKING([the compiler's target])
-      if test -z $CC; then
+      if test -z "$CC"; then
   cc=gcc
       else
   cc=$CC
       fi
       t=`$cc -v 2>&1 | sed -n 's/Target: //p'`
       case "$t" in
-          *-*) canonical=$t
+          *-*) host=$t
       ;;
           "") AC_MSG_ERROR([Impossible to obtain $cc compiler target.
-Please explicitly provide --target])
+Please explicitly provide --host.])
               ;;
   *) AC_MSG_WARN([Compiler reported non-standard target.
-Defaulting to $canonical.])
+Defaulting to $host.])
               ;;
       esac
-      AC_MSG_RESULT([$canonical])
-  else
-      canonical=$target_alias
+      AC_MSG_RESULT([$host])
   fi

+  . $srcdir/nt/mingw-cfg.site
+
   case $srcdir in
     /* | ?:*)
       # srcdir is an absolute path.  In this case, force the format
@@ -185,6 +187,9 @@ Defaulting to $canonical.])
   esac;;
 esac

+canonical=$host
+configuration=${host_alias-${build_alias-$host}}
+
 dnl Support for --program-prefix, --program-suffix and
 dnl --program-transform-name options
 AC_ARG_PROGRAM
-------------------------------------------------------

-- 
Dani Moncayo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]