From ee35681421a303546f158507d8b18a5cc8e28896 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 14 Aug 2018 02:00:05 +0200 Subject: fnmatch, fnmatch-gnu: Fix compilation error on Mac OS X. Reported by Jeroen Meijer in and by Paul J. Lucas in . * m4/fnmatch_h.m4 (gl_FNMATCH_H): Define through AC_DEFUN_ONCE. (gl_FNMATCH_H_GNU): New macro. * m4/fnmatch.m4 (gl_FUNC_FNMATCH_GNU): Require gl_FNMATCH_H_GNU. --- m4/fnmatch_h.m4 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'm4/fnmatch_h.m4') diff --git a/m4/fnmatch_h.m4 b/m4/fnmatch_h.m4 index c40d0a713b..f36557822a 100644 --- a/m4/fnmatch_h.m4 +++ b/m4/fnmatch_h.m4 @@ -1,4 +1,4 @@ -# fnmatch_h.m4 serial 2 +# fnmatch_h.m4 serial 3 dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,7 +6,8 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -AC_DEFUN([gl_FNMATCH_H], +# Request a POSIX compliant include file. +AC_DEFUN_ONCE([gl_FNMATCH_H], [ AC_REQUIRE([gl_FNMATCH_H_DEFAULTS]) m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) @@ -49,6 +50,27 @@ AC_DEFUN([gl_FNMATCH_H], [fnmatch]) ]) +# Request a POSIX compliant include file with GNU extensions. +AC_DEFUN([gl_FNMATCH_H_GNU], +[ + AC_REQUIRE([gl_FNMATCH_H]) + if test -z "$FNMATCH_H"; then + AC_CACHE_CHECK([whether has the GNU extensions], + [gl_cv_header_fnmatch_h_gnu], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[int gnu_flags = FNM_FILE_NAME | FNM_LEADING_DIR | FNM_CASEFOLD | FNM_EXTMATCH;]])], + [gl_cv_header_fnmatch_h_gnu=yes], + [gl_cv_header_fnmatch_h_gnu=no]) + ]) + if test $gl_cv_header_fnmatch_h_gnu != yes; then + FNMATCH_H=fnmatch.h + AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) + fi + fi +]) + AC_DEFUN([gl_FNMATCH_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. -- cgit v1.2.1