summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-12-18 13:42:35 +0000
committerBruno Haible <bruno@clisp.org>2009-06-21 23:50:24 +0200
commit2470ca28e843e6bca8ba474fc01976adee802aa2 (patch)
tree0eb1fc0efc0680c6724ae015ba922e8a2a92f56f /m4
parentb4eabed43045d533620e99911de1ec4b11c2a74f (diff)
downloadexternal_gettext-2470ca28e843e6bca8ba474fc01976adee802aa2.zip
external_gettext-2470ca28e843e6bca8ba474fc01976adee802aa2.tar.gz
external_gettext-2470ca28e843e6bca8ba474fc01976adee802aa2.tar.bz2
msggrep --location now accepts wildcards.
Diffstat (limited to 'm4')
-rw-r--r--m4/ChangeLog5
-rw-r--r--m4/Makefile.am12
-rw-r--r--m4/fnmatch.m443
3 files changed, 54 insertions, 6 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 90853af..320cc00 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,5 +1,10 @@
2001-12-17 Bruno Haible <bruno@clisp.org>
+ * fnmatch.m4: New file, inspired by autoconf-2.13 and autoconf-2.52.
+ * Makefile.am (EXTRA_DIST): Add it.
+
+2001-12-17 Bruno Haible <bruno@clisp.org>
+
* getline.m4 (AM_FUNC_GETLINE): Include <stdlib.h>, not <sys/types.h>,
for declaring size_t and exit(). #define getline to a different
symbol at linkage level.
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 23054aa..38303e9 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -7,9 +7,9 @@ aclocal_DATA = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lib-ld.m4
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
EXTRA_DIST = README \
-backupfile.m4 c-bs-a.m4 codeset.m4 flex.m4 getline.m4 gettext.m4 \
-glibc21.m4 hostname.m4 iconv.m4 inttypes_h.m4 isc-posix.m4 javacomp.m4 \
-javaexec.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 libtool.m4 \
-mbrtowc.m4 mbstate_t.m4 mbswidth.m4 mkdtemp.m4 progtest.m4 setenv.m4 \
-setlocale.m4 siginfo.m4 signalblocking.m4 signed.m4 ssize_t.m4 stdbool.m4 \
-stdint_h.m4 tmpdir.m4 uintmax_t.m4 ulonglong.m4 unionwait.m4
+backupfile.m4 c-bs-a.m4 codeset.m4 flex.m4 fnmatch.m4 getline.m4 \
+gettext.m4 glibc21.m4 hostname.m4 iconv.m4 inttypes_h.m4 isc-posix.m4 \
+javacomp.m4 javaexec.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 \
+libtool.m4 mbrtowc.m4 mbstate_t.m4 mbswidth.m4 mkdtemp.m4 progtest.m4 \
+setenv.m4 setlocale.m4 siginfo.m4 signalblocking.m4 signed.m4 ssize_t.m4 \
+stdbool.m4 stdint_h.m4 tmpdir.m4 uintmax_t.m4 ulonglong.m4 unionwait.m4
diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4
new file mode 100644
index 0000000..b20bcec
--- /dev/null
+++ b/m4/fnmatch.m4
@@ -0,0 +1,43 @@
+#serial 1
+
+dnl Determine whether the system has a working fnmatch() function.
+AC_DEFUN([gt_FUNC_FNMATCH],
+[
+ dnl Don't use AC_FUNC_FNMATCH. In autoconf-2.52 the test is buggy and
+ dnl excludes all non-GNU implementations.
+ dnl Some versions of Solaris or SCO have a broken fnmatch function.
+ dnl So we run a test program. If we are cross-compiling, take no chance.
+ dnl Thanks to John Oleynick and Franc,ois Pinard for this test.
+ AC_CACHE_CHECK([for working fnmatch function], gt_cv_func_fnmatch_works, [
+ AC_TRY_RUN([
+# include <stdlib.h>
+# include <fnmatch.h>
+ int main ()
+ {
+ exit (fnmatch ("a*", "abc", 0) != 0
+ || fnmatch ("d*/*1", "d/s/1", FNM_PATHNAME) != FNM_NOMATCH);
+ }
+ ],
+ gt_cv_func_fnmatch_works=yes, gt_cv_func_fnmatch_works=no,
+ gt_cv_func_fnmatch_works=no dnl cross-compiling
+ )
+ ])
+ if test $gt_cv_func_fnmatch_works = yes; then
+ AC_DEFINE([HAVE_FNMATCH], 1,
+ [Define if you have <fnmatch.h> and a working fnmatch() function.])
+ fi
+
+ dnl Now some other actions, not part of AC_FUNC_FNMATCH.
+ if test $gt_cv_func_fnmatch_works = yes; then
+ rm -f lib/fnmatch.h
+ else
+ echo '#include "pfnmatch.h"' > lib/fnmatch.h
+ 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() in
+ dnl libgettextlib.so.
+ AC_DEFINE([fnmatch], [posix_fnmatch],
+ [Define to a replacement function name for fnmatch().])
+ LIBOBJS="$LIBOBJS pfnmatch.${ac_objext}"
+ AC_SUBST(LIBOBJS)
+ fi
+])