diff options
| author | Dani Moncayo | 2014-11-26 20:59:07 +0100 |
|---|---|---|
| committer | Dani Moncayo | 2014-11-26 20:59:07 +0100 |
| commit | c9cb3d535b2daf19b53dcaeedc2f2ae923bca2a1 (patch) | |
| tree | 2cb59b3d741ea0b3554f16c1bdaca285e1999370 | |
| parent | b67e8b793f27a4f7e0d2786aed2308d4ba37ff76 (diff) | |
| download | emacs-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-- | ChangeLog | 5 | ||||
| -rw-r--r-- | configure.ac | 42 |
2 files changed, 27 insertions, 20 deletions
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-11-26 Dani Moncayo <dmoncayo@gmail.com> | ||
| 2 | |||
| 3 | * configure.ac [MINGW]: Fix the way of getting the right host | ||
| 4 | platform. | ||
| 5 | |||
| 1 | 2014-11-25 Glenn Morris <rgm@gnu.org> | 6 | 2014-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 | ||
| 138 | dnl Canonicalize the configuration name. | 138 | dnl Canonicalize the configuration name. |
| 139 | AC_CANONICAL_HOST | 139 | AC_CANONICAL_HOST |
| 140 | canonical=$host | ||
| 141 | configuration=${host_alias-${build_alias-$host}} | ||
| 142 | 140 | ||
| 143 | dnl We get MINGW64 with MSYS2, MINGW32 with MSYS. | 141 | case $host in |
| 144 | case $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. |
| 165 | Please explicitly provide --target]) | 164 | Please explicitly provide --host.]) |
| 166 | ;; | 165 | ;; |
| 167 | *) AC_MSG_WARN([Compiler reported non-standard target. | 166 | *) AC_MSG_WARN([Compiler reported non-standard target. |
| 168 | Defaulting to $canonical.]) | 167 | Defaulting 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;; |
| 186 | esac | 185 | esac |
| 187 | 186 | ||
| 187 | canonical=$host | ||
| 188 | configuration=${host_alias-${build_alias-$host}} | ||
| 189 | |||
| 188 | dnl Support for --program-prefix, --program-suffix and | 190 | dnl Support for --program-prefix, --program-suffix and |
| 189 | dnl --program-transform-name options | 191 | dnl --program-transform-name options |
| 190 | AC_ARG_PROGRAM | 192 | AC_ARG_PROGRAM |