From: Jannick Date: Wed, 28 Oct 2020 14:59:27 +0000 (-0400) Subject: Treat msys(2) the same as cygwin when looking at host_os. X-Git-Tag: v2.69d~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b7a4f9ccd9c0583fcfc928b62ba5ab28cfbd68c;p=thirdparty%2Fautoconf.git Treat msys(2) the same as cygwin when looking at host_os. In most cases, checks depending on the value of $host_os should treat *-*-cygwin*, *-*-msys*, and *-*-mingw* all the same. * lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Discard -lkernel32 on msys* as well. When not discarding -lkernel32, deduplicate it, like other -l options. * lib/autoconf/functions.m4 (AC_FUNC_MALLOC, AC_FUNC_REALLOC): msys* also guarantee to return nonnull for malloc(0)/realloc(0). * tests/local.at (at_check_env): Also ignore MSYS as an environment variable. --- diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 59a8859b..16bd9cb0 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -665,9 +665,12 @@ while test $[@%:@] != 1; do |-LANG:=* | -LIST:* | -LNO:* | -link) ;; -lkernel32) + # Ignore this library only on Windows-like systems. case $host_os in - *cygwin*) ;; - *) ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg" + cygwin* | msys* ) ;; + *) + _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, , + ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg") ;; esac ;; diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index 4598b408..e474984f 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -961,7 +961,7 @@ AC_CACHE_CHECK([for GNU libc compatible malloc], ac_cv_func_malloc_0_nonnull, [case "$host_os" in # (( # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw*) + | hpux* | solaris* | cygwin* | mingw* | msys* ) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. *) ac_cv_func_malloc_0_nonnull=no ;; @@ -1467,7 +1467,7 @@ AC_CACHE_CHECK([for GNU libc compatible realloc], ac_cv_func_realloc_0_nonnull, [case "$host_os" in # (( # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ - | hpux* | solaris* | cygwin* | mingw*) + | hpux* | solaris* | cygwin* | mingw* | msys* ) ac_cv_func_realloc_0_nonnull=yes ;; # If we don't know, assume the worst. *) ac_cv_func_realloc_0_nonnull=no ;; diff --git a/tests/local.at b/tests/local.at index b9f866f7..374e530c 100644 --- a/tests/local.at +++ b/tests/local.at @@ -366,7 +366,8 @@ if test -f state-env.before && test -f state-env.after; then [OPENMP_CFLAGS], [LIBS|LIB@&t@OBJS|LTLIBOBJS|LDFLAGS], [INSTALL(_(DATA|PROGRAM|SCRIPT))?], - [CYGWIN|ISC|MINGW32|MINIX|EMXOS2|XENIX|EXEEXT|OBJEXT], + [EXEEXT|OBJEXT], + [CYGWIN|EMXOS2|ISC|MINGW32|MINIX|MSYS|XENIX], [X_(CFLAGS|(EXTRA_|PRE_)?LIBS)|x_(includes|libraries)|(have|no)_x], [(host|build|target)(_(alias|cpu|vendor|os))?], [cross_compiling|U],