Commit 77eceb6a84e2ee04ee3a87f7909a28a2e8d121a8

Authored by Kirill Smelkov
Committed by Stéphane Raimbault
1 parent b8c0558c

configure: Correctly detect if we are cross-compiling for win32

First, it's $host_os which should be checked, not $target (remember,
'build' is where we build, host is where the program will be run, and
target is only for compiler - for which system the compiler will
generate code.

Second, correct OS pattern - e.g. on debian with i586-mingw32msvc-gcc,
host_os is mingw32msvc, so we better for *mingw32*.

Also, it's better to call AC_CANONICAL_* for normalizing variables.

Build tested with `configure --host=i586-mingw32msvc` on Debian
GNU/Linux 5.0 (Lenny).

Cc: Александр Сёмуха <sav@mns.spb.ru>
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
Showing 1 changed file with 4 additions and 2 deletions
configure.ac
@@ -46,10 +46,12 @@ LIBMODBUS_LD_AGE=0 @@ -46,10 +46,12 @@ LIBMODBUS_LD_AGE=0
46 LIBMODBUS_LT_VERSION_INFO=$LIBMODBUS_LD_CURRENT:$LIBMODBUS_LD_REVISION:$LIBMODBUS_LD_AGE 46 LIBMODBUS_LT_VERSION_INFO=$LIBMODBUS_LD_CURRENT:$LIBMODBUS_LD_REVISION:$LIBMODBUS_LD_AGE
47 AC_SUBST(LIBMODBUS_LT_VERSION_INFO) 47 AC_SUBST(LIBMODBUS_LT_VERSION_INFO)
48 48
  49 +AC_CANONICAL_HOST
  50 +
49 # Check whether we are building for Win32 51 # Check whether we are building for Win32
50 os_win32="false" 52 os_win32="false"
51 -case "${target}" in  
52 - *mingw32) 53 +case "${host_os}" in
  54 + *mingw32*)
53 os_win32="true" 55 os_win32="true"
54 ;; 56 ;;
55 esac 57 esac