X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Ffnmatch.m4;h=e46b6e521cfa103ee1e135e8a023434c0620cb4b;hb=d6d7a9dc245badda81a34e336dda7baaeee78322;hp=c8ed9e74e776b2ba96ca2716456f331c3dbaee43;hpb=76d82d2d7f5ba1a69da6aaa71ff170f5a90a6c94;p=gnulib.git diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4 index c8ed9e74e..e46b6e521 100644 --- a/m4/fnmatch.m4 +++ b/m4/fnmatch.m4 @@ -1,6 +1,6 @@ -# Check for fnmatch - serial 6. +# Check for fnmatch - serial 9. -# Copyright (C) 2000-2007, 2009-2011 Free Software Foundation, Inc. +# Copyright (C) 2000-2007, 2009-2012 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], FNMATCH_H= gl_fnmatch_required_lowercase=` - echo $gl_fnmatch_required | tr '[[A-Z]]' '[[a-z]]' + echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]' ` gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch], @@ -65,6 +65,8 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], return 1; if (!y ("a*", "abc", 0)) return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) return 2; if (!y ("a\\\\bc", "abc", 0)) @@ -126,17 +128,6 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], rm -f "$gl_source_base/fnmatch.h" else FNMATCH_H=fnmatch.h - AC_LIBOBJ([fnmatch]) - dnl We must choose a different name for our function, since on ELF systems - dnl a broken fnmatch() in libc.so would override our fnmatch() if it is - dnl compiled into a shared library. - AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch], - [Define to a replacement function name for fnmatch().]) - dnl Prerequisites of lib/fnmatch.c. - AC_REQUIRE([AC_TYPE_MBSTATE_T]) - AC_CHECK_DECLS([isblank], [], [], [#include ]) - AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy]) - AC_CHECK_HEADERS_ONCE([wctype.h]) fi AC_SUBST([FNMATCH_H]) AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) @@ -149,3 +140,17 @@ AC_DEFUN([gl_FUNC_FNMATCH_GNU], AC_REQUIRE([gl_FUNC_FNMATCH_POSIX]) ]) + +AC_DEFUN([gl_PREREQ_FNMATCH], +[ + dnl We must choose a different name for our function, since on ELF systems + dnl a broken fnmatch() in libc.so would override our fnmatch() if it is + dnl compiled into a shared library. + AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch], + [Define to a replacement function name for fnmatch().]) + dnl Prerequisites of lib/fnmatch.c. + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_DECLS([isblank], [], [], [[#include ]]) + AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy]) + AC_CHECK_HEADERS_ONCE([wctype.h]) +])