From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: Fix cross-compilation test results
Date: Sat, 17 Jul 2021 17:32:38 +0200 [thread overview]
Message-ID: <1784408.1fznxiESHG@omega> (raw)
Before testing __GNU_LIBRARY__, one has to include either <features.h>
(which only exists on glibc, musl, Android, and Cygwin systems) or some
header file such as <stdlib.h> or <string.h>.
2021-07-17 Bruno Haible <bruno@clisp.org>
Fix cross-compilation test results.
* m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): When cross-compiling, include
<string.h> before testing __GNU_LIBRARY__.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Likewise.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Likewise.
diff --git a/m4/memmem.m4 b/m4/memmem.m4
index f4a167b..6dac766 100644
--- a/m4/memmem.m4
+++ b/m4/memmem.m4
@@ -1,4 +1,4 @@
-# memmem.m4 serial 28
+# memmem.m4 serial 29
dnl Copyright (C) 2002-2004, 2007-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -50,6 +50,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
dnl Assume that it works on all other platforms (even if not linear).
AC_EGREP_CPP([Lucky user],
[
+#include <string.h> /* for __GNU_LIBRARY__ */
#ifdef __GNU_LIBRARY__
#include <features.h>
#if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
diff --git a/m4/strcasestr.m4 b/m4/strcasestr.m4
index e9dc3e2..6939144 100644
--- a/m4/strcasestr.m4
+++ b/m4/strcasestr.m4
@@ -1,4 +1,4 @@
-# strcasestr.m4 serial 27
+# strcasestr.m4 serial 28
dnl Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
[gl_cv_func_strcasestr_works_always],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
-#include <string.h> /* for strcasestr */
+#include <string.h> /* for __GNU_LIBRARY__, strcasestr */
#ifdef __GNU_LIBRARY__
#include <features.h>
#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
@@ -48,6 +48,7 @@ AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
dnl linear.
AC_EGREP_CPP([Lucky user],
[
+#include <string.h> /* for __GNU_LIBRARY__ */
#ifdef __GNU_LIBRARY__
#include <features.h>
#if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
diff --git a/m4/strstr.m4 b/m4/strstr.m4
index 9604fe2..a32e9c1 100644
--- a/m4/strstr.m4
+++ b/m4/strstr.m4
@@ -1,4 +1,4 @@
-# strstr.m4 serial 23
+# strstr.m4 serial 24
dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
[gl_cv_func_strstr_works_always],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
-#include <string.h> /* for strstr */
+#include <string.h> /* for __GNU_LIBRARY__, strstr */
#ifdef __GNU_LIBRARY__
#include <features.h>
#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
@@ -40,6 +40,7 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
dnl linear.
AC_EGREP_CPP([Lucky user],
[
+#include <string.h> /* for __GNU_LIBRARY__ */
#ifdef __GNU_LIBRARY__
#include <features.h>
#if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
reply other threads:[~2021-07-17 15:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1784408.1fznxiESHG@omega \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).