3
3
# This is a modified version of autoconf's AC_FUNC_FNMATCH.
4
4
# This file should be simplified after Autoconf 2.57 is required.
6
# Copyright (C) 2000-2003 Free Software Foundation, Inc.
8
# This program is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 2, or (at your option)
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
6
# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
7
# This file is free software; the Free Software Foundation
8
# gives unlimited permission to copy and/or distribute it,
9
# with or without modifications, as long as this notice is preserved.
23
11
# _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE)
24
12
# -------------------------------------------------------------------------
29
17
[for working $1 fnmatch],
31
[# Some versions of Solaris, SCO, and the GNU C Library
32
# have a broken or incompatible fnmatch.
33
# So we run a test program. If we are cross-compiling, take no chance.
34
# Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
19
[dnl Some versions of Solaris, SCO, and the GNU C Library
20
dnl have a broken or incompatible fnmatch.
21
dnl So we run a test program. If we are cross-compiling, take no chance.
22
dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this test.
70
58
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
71
59
AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
72
60
AC_CHECK_DECLS([getenv])
73
AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy])
61
AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
74
62
AC_CHECK_HEADERS([wchar.h wctype.h])
75
63
AC_LIBOBJ([fnmatch])
76
64
FNMATCH_H=fnmatch.h
77
AC_DEFINE(fnmatch, rpl_fnmatch,
78
[Define to rpl_fnmatch if the replacement function should be used.])
79
65
])# _AC_LIBOBJ_FNMATCH
82
# Additional prerequisites of lib/fnmatch.c, not part of _AC_LIBOBJ_FNMATCH.
83
AC_DEFUN([gl_PREREQ_FNMATCH_EXTRA],
85
AC_REQUIRE([AC_HEADER_STDC])
86
AC_CHECK_HEADERS_ONCE(string.h strings.h)
90
68
AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
94
72
[rm -f lib/fnmatch.h],
95
73
[_AC_LIBOBJ_FNMATCH])
96
74
if test $ac_cv_func_fnmatch_posix != yes; then
97
gl_PREREQ_FNMATCH_EXTRA
98
75
dnl We must choose a different name for our function, since on ELF systems
99
76
dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
100
77
dnl compiled into a shared library.
115
92
[rm -f lib/fnmatch.h],
116
93
[_AC_LIBOBJ_FNMATCH])
117
94
if test $ac_cv_func_fnmatch_gnu != yes; then
118
gl_PREREQ_FNMATCH_EXTRA
119
95
dnl We must choose a different name for our function, since on ELF systems
120
96
dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
121
97
dnl compiled into a shared library.