aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Moncayo2014-11-26 20:59:07 +0100
committerDani Moncayo2014-11-26 20:59:07 +0100
commitc9cb3d535b2daf19b53dcaeedc2f2ae923bca2a1 (patch)
tree2cb59b3d741ea0b3554f16c1bdaca285e1999370
parentb67e8b793f27a4f7e0d2786aed2308d4ba37ff76 (diff)
downloademacs-c9cb3d535b2daf19b53dcaeedc2f2ae923bca2a1.tar.gz
emacs-c9cb3d535b2daf19b53dcaeedc2f2ae923bca2a1.zip
configure.ac [MINGW]: Fix the way of getting the right host platform.
* configure.ac [MINGW]: Fix the way of getting the right host platform.
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac42
2 files changed, 27 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e34db90dd5..55c6778a960 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12014-11-26 Dani Moncayo <dmoncayo@gmail.com>
2
3 * configure.ac [MINGW]: Fix the way of getting the right host
4 platform.
5
12014-11-25 Glenn Morris <rgm@gnu.org> 62014-11-25 Glenn Morris <rgm@gnu.org>
2 7
3 * configure.ac: Fix yesterday's use of uninitialised $version. 8 * configure.ac: Fix yesterday's use of uninitialised $version.
diff --git a/configure.ac b/configure.ac
index 8830ec7e090..70592d97e0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,42 +137,41 @@ AM_INIT_AUTOMAKE(1.11)
137 137
138dnl Canonicalize the configuration name. 138dnl Canonicalize the configuration name.
139AC_CANONICAL_HOST 139AC_CANONICAL_HOST
140canonical=$host
141configuration=${host_alias-${build_alias-$host}}
142 140
143dnl We get MINGW64 with MSYS2, MINGW32 with MSYS. 141case $host in
144case $canonical in
145 *-mingw*) 142 *-mingw*)
146 . $srcdir/nt/mingw-cfg.site
147 143
148 # When we build with MinGW under MSYS, we are cross-compiling. Hence 144 if test -z "$host_alias"; then
149 # we can't rely on the output of MSYS `uname' for the architecture 145
150 # (32 bit MinGW compiler with 64 bit MSYS2, for instance) and must 146 # No --host argument was given to 'configure'; therefore $host
151 # use the compiler's target, unless when the user explicitly 147 # was set to a default value based on the build platform. But
152 # provides one: 148 # this default value may be wrong if we are building from a
153 if test -z $target_alias; then 149 # 64-bit MSYS[2] pre-configured to build 32-bit MinGW programs.
150 # Therefore, we'll try to get the right host platform from the
151 # compiler's target.
152
154 AC_MSG_CHECKING([the compiler's target]) 153 AC_MSG_CHECKING([the compiler's target])
155 if test -z $CC; then 154 if test -z "$CC"; then
156 cc=gcc 155 cc=gcc
157 else 156 else
158 cc=$CC 157 cc=$CC
159 fi 158 fi
160 t=`$cc -v 2>&1 | sed -n 's/Target: //p'` 159 cc_target=`$cc -v 2>&1 | sed -n 's/Target: //p'`
161 case "$t" in 160 case "$cc_target" in
162 *-*) canonical=$t 161 *-*) host=$cc_target
163 ;; 162 ;;
164 "") AC_MSG_ERROR([Impossible to obtain $cc compiler target. 163 "") AC_MSG_ERROR([Impossible to obtain $cc compiler target.
165Please explicitly provide --target]) 164Please explicitly provide --host.])
166 ;; 165 ;;
167 *) AC_MSG_WARN([Compiler reported non-standard target. 166 *) AC_MSG_WARN([Compiler reported non-standard target.
168Defaulting to $canonical.]) 167Defaulting to $host.])
169 ;; 168 ;;
170 esac 169 esac
171 AC_MSG_RESULT([$canonical]) 170 AC_MSG_RESULT([$host])
172 else
173 canonical=$target_alias
174 fi 171 fi
175 172
173 . $srcdir/nt/mingw-cfg.site
174
176 case $srcdir in 175 case $srcdir in
177 /* | ?:*) 176 /* | ?:*)
178 # srcdir is an absolute path. In this case, force the format 177 # srcdir is an absolute path. In this case, force the format
@@ -185,6 +184,9 @@ Defaulting to $canonical.])
185 esac;; 184 esac;;
186esac 185esac
187 186
187canonical=$host
188configuration=${host_alias-${build_alias-$host}}
189
188dnl Support for --program-prefix, --program-suffix and 190dnl Support for --program-prefix, --program-suffix and
189dnl --program-transform-name options 191dnl --program-transform-name options
190AC_ARG_PROGRAM 192AC_ARG_PROGRAM