~ubuntu-branches/ubuntu/raring/findutils/raring

« back to all changes in this revision

Viewing changes to gnulib/m4/fnmatch.m4

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mto: (11.1.1 lenny) (1.1.10 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050704113737-oxfumqxsqgfz5gay
Tags: upstream-4.2.22
Import upstream version 4.2.22

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
5
5
 
6
 
# Copyright (C) 2000-2003 Free Software Foundation, Inc.
7
 
 
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)
11
 
# any later version.
12
 
 
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.
17
 
 
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
21
 
# 02111-1307, USA.
 
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.
22
10
 
23
11
# _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE)
24
12
# -------------------------------------------------------------------------
28
16
[AC_CACHE_CHECK(
29
17
   [for working $1 fnmatch],
30
18
   [$2],
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.
35
23
   AC_RUN_IFELSE(
36
24
      [AC_LANG_PROGRAM(
37
25
         [
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
80
66
 
81
67
 
82
 
# Additional prerequisites of lib/fnmatch.c, not part of _AC_LIBOBJ_FNMATCH.
83
 
AC_DEFUN([gl_PREREQ_FNMATCH_EXTRA],
84
 
[
85
 
  AC_REQUIRE([AC_HEADER_STDC])
86
 
  AC_CHECK_HEADERS_ONCE(string.h strings.h)
87
 
])
88
 
 
89
 
 
90
68
AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
91
69
[
92
70
  FNMATCH_H=
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.