+2017-07-13 Bruno Haible <bruno@clisp.org>
+
+ Improve cross-compilation guesses for native Windows.
+ * m4/memchr.m4 (gl_FUNC_MEMCHR): Add cross-compilation guess for native
+ Windows.
+ * m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Don't use internals of
+ memchr.m4.
+ * m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Likewise.
+
2017-07-13 Bruno Haible <bruno@clisp.org>
Improve cross-compilation guesses for native Windows.
-# memchr.m4 serial 12
+# memchr.m4 serial 13
dnl Copyright (C) 2002-2004, 2009-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
dnl Check for prerequisites for memory fence checks.
gl_FUNC_MMAP_ANON
AC_CHECK_HEADERS_ONCE([sys/mman.h])
result |= 4;
}
return result;
-]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
- [dnl Be pessimistic for now.
- gl_cv_func_memchr_works="guessing no"])])
- if test "$gl_cv_func_memchr_works" != yes; then
- REPLACE_MEMCHR=1
- fi
+]])],
+ [gl_cv_func_memchr_works=yes],
+ [gl_cv_func_memchr_works=no],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_memchr_works="guessing yes" ;;
+ # Be pessimistic for now.
+ *) gl_cv_func_memchr_works="guessing no" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_memchr_works" in
+ *yes) ;;
+ *) REPLACE_MEMCHR=1 ;;
+ esac
fi
])
-# strcasestr.m4 serial 22
+# strcasestr.m4 serial 23
dnl Copyright (C) 2005, 2007-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test $ac_cv_func_strcasestr = no; then
HAVE_STRCASESTR=0
else
- if test "$gl_cv_func_memchr_works" != yes; then
+ if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
REPLACE_STRCASESTR=1
else
dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
-# strstr.m4 serial 18
+# strstr.m4 serial 19
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_MEMCHR])
- if test "$gl_cv_func_memchr_works" != yes; then
+ if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
REPLACE_STRSTR=1
else
dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.