summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-08-16 14:50:01 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-08-16 14:50:01 +0000
commitde67b70034470e528365853873851bad6a985197 (patch)
tree1231964339d08266f448c05740b4c212ec7805be /m4
parent2ee90b9b7bfa8631f752a1b8cf56f7b189087df7 (diff)
downloadmailutils-de67b70034470e528365853873851bad6a985197.tar.gz
mailutils-de67b70034470e528365853873851bad6a985197.tar.bz2
Updated by gnulib-sync
Diffstat (limited to 'm4')
-rw-r--r--m4/argp.m410
-rw-r--r--m4/exitfail.m47
-rw-r--r--m4/extensions.m44
-rw-r--r--m4/getline.m428
-rw-r--r--m4/getopt.m460
-rw-r--r--m4/getpass.m48
-rw-r--r--m4/gnulib.m432
-rw-r--r--m4/longdouble.m48
-rw-r--r--m4/mbrtowc.m420
-rw-r--r--m4/md5.m47
-rw-r--r--m4/onceonly.m44
-rw-r--r--m4/regex.m4162
-rw-r--r--m4/signed.m48
-rw-r--r--m4/size_max.m418
-rw-r--r--m4/strcase.m415
-rw-r--r--m4/strndup.m410
-rw-r--r--m4/strnlen.m410
-rw-r--r--m4/unlocked-io.m46
-rw-r--r--m4/wchar_t.m48
-rw-r--r--m4/wint_t.m48
-rw-r--r--m4/xalloc.m47
-rw-r--r--m4/xsize.m413
-rw-r--r--m4/xstrtol.m48
23 files changed, 273 insertions, 188 deletions
diff --git a/m4/argp.m4 b/m4/argp.m4
index 98fb40f62..8ecc4ee15 100644
--- a/m4/argp.m4
+++ b/m4/argp.m4
@@ -1,5 +1,5 @@
-# argp.m4 serial 4
-dnl Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+# argp.m4 serial 5
+dnl Copyright (C) 2003-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,11 +7,15 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ARGP],
[
AC_REQUIRE([AC_C_INLINE])
- AC_REQUIRE([gl_FUNC_GLIBC_UNLOCKED_IO])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_GETOPT_SUBSTITUTE])
AC_CHECK_DECLS([program_invocation_name, program_invocation_short_name],,,
[#include <errno.h>])
+ AC_CHECK_DECLS_ONCE(
+ [clearerr_unlocked feof_unlocked ferror_unlocked
+ fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
+ fread_unlocked fwrite_unlocked getc_unlocked
+ getchar_unlocked putc_unlocked putchar_unlocked])
AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
])
diff --git a/m4/exitfail.m4 b/m4/exitfail.m4
index f25c64df8..5523676f1 100644
--- a/m4/exitfail.m4
+++ b/m4/exitfail.m4
@@ -1,11 +1,14 @@
-# exitfail.m4 serial 4
-dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# exitfail.m4 serial 5
+dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_EXITFAIL],
[
+ AC_LIBSOURCES([exitfail.c, exitfail.h])
+ AC_LIBOBJ([exitfail])
+
dnl No prerequisites of lib/exitfail.c.
:
])
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index 6f34a8d35..e71845f1d 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -21,6 +21,10 @@ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
[/* Enable extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
#endif])
AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
])
diff --git a/m4/getline.m4 b/m4/getline.m4
index 28dd0d247..812eda79b 100644
--- a/m4/getline.m4
+++ b/m4/getline.m4
@@ -1,6 +1,6 @@
-# getline.m4 serial 11
+# getline.m4 serial 13
-dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software
dnl Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
@@ -13,17 +13,21 @@ dnl See if there's a working, system-supplied version of the getline function.
dnl We can't just do MU_REPLACE_FUNCS(getline) because some systems
dnl have a function by that name in -linet that doesn't have anything
dnl to do with the function we need.
-AC_DEFUN([AM_FUNC_GETLINE],
+AC_DEFUN([gl_FUNC_GETLINE],
[
- dnl Persuade glibc <stdio.h> to declare getline() and getdelim().
+ MU_LIBSOURCES([getline.c, getline.h])
+
+ dnl Persuade glibc <stdio.h> to declare getline().
AC_REQUIRE([AC_GNU_SOURCE])
- am_getline_needs_run_time_check=no
+ AC_CHECK_DECLS([getline])
+
+ gl_getline_needs_run_time_check=no
AC_CHECK_FUNC(getline,
dnl Found it in some library. Verify that it works.
- am_getline_needs_run_time_check=yes,
+ gl_getline_needs_run_time_check=yes,
am_cv_func_working_getline=no)
- if test $am_getline_needs_run_time_check = yes; then
+ if test $gl_getline_needs_run_time_check = yes; then
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data
AC_TRY_RUN([
@@ -55,20 +59,12 @@ AC_DEFUN([AM_FUNC_GETLINE],
[Define to a replacement function name for getline().])
MU_LIBOBJ(getline)
- # Avoid multiple inclusions of getndelim2.o into LIBOBJS.
- # This hack won't be needed after gnulib requires Autoconf 2.58 or later.
- case " $LIB@&t@OBJS " in
- *" getndelim2.$ac_objext "* ) ;;
- *) MU_LIBOBJ(getndelim2);;
- esac
-
gl_PREREQ_GETLINE
- gl_PREREQ_GETNDELIM2
fi
])
# Prerequisites of lib/getline.c.
AC_DEFUN([gl_PREREQ_GETLINE],
[
- AC_CHECK_FUNCS(getdelim)
+ gl_FUNC_GETDELIM
])
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 85df7a7a4..39a3dfa41 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,5 +1,5 @@
-# getopt.m4 serial 7
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# getopt.m4 serial 10
+dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,33 +10,69 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_GETOPT_SUBSTITUTE],
[
- GETOPT_H=getopt.h
MU_LIBOBJ([getopt])
MU_LIBOBJ([getopt1])
+ gl_GETOPT_SUBSTITUTE_HEADER
+ gl_PREREQ_GETOPT
+])
+
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
+[
+ GETOPT_H=getopt.h
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
AC_SUBST([GETOPT_H])
])
-AC_DEFUN([gl_GETOPT],
+AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
[
- gl_PREREQ_GETOPT
-
+ GETOPT_H=
+ AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
if test -z "$GETOPT_H"; then
- GETOPT_H=
- AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
+ fi
- dnl BSD getopt_long uses an incompatible method to reset option processing,
- dnl and (as of 2004-10-15) mishandles optional option-arguments.
+ dnl BSD getopt_long uses an incompatible method to reset option processing,
+ dnl and (as of 2004-10-15) mishandles optional option-arguments.
+ if test -z "$GETOPT_H"; then
AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
+ fi
- if test -n "$GETOPT_H"; then
- gl_GETOPT_SUBSTITUTE
+ dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
+ dnl option string (as of 2005-05-05).
+ if test -z "$GETOPT_H"; then
+ AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([#include <getopt.h>],
+ [[
+ char *myargv[3];
+ myargv[0] = "conftest";
+ myargv[1] = "-+";
+ myargv[2] = 0;
+ return getopt (2, myargv, "+a") != '?';
+ ]])],
+ [gl_cv_func_gnu_getopt=yes],
+ [gl_cv_func_gnu_getopt=no],
+ [dnl cross compiling - pessimistically guess based on decls
+ dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
+ dnl option string (as of 2005-05-05).
+ AC_CHECK_DECL([getopt_clip],
+ [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
+ [#include <getopt.h>])])])
+ if test "$gl_cv_func_gnu_getopt" = "no"; then
+ GETOPT_H=getopt.h
fi
fi
])
+AC_DEFUN([gl_GETOPT_IFELSE],
+[
+ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+ AS_IF([test -n "$GETOPT_H"], [$1], [$2])
+])
+
+AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
+
# Prerequisites of lib/getopt*.
AC_DEFUN([gl_PREREQ_GETOPT], [:])
diff --git a/m4/getpass.m4 b/m4/getpass.m4
index d48534c57..3816253fd 100644
--- a/m4/getpass.m4
+++ b/m4/getpass.m4
@@ -1,5 +1,5 @@
-# getpass.m4 serial 5
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# getpass.m4 serial 6
+dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
# Provide a getpass() function if the system doesn't have it.
AC_DEFUN([gl_FUNC_GETPASS],
[
+ AC_LIBSOURCES([getpass.c, getpass.h])
+
AC_REPLACE_FUNCS(getpass)
AC_CHECK_DECLS_ONCE(getpass)
if test $ac_cv_func_getpass = no; then
@@ -18,6 +20,8 @@ AC_DEFUN([gl_FUNC_GETPASS],
# arbitrary length (not just 8 bytes as on HP-UX).
AC_DEFUN([gl_FUNC_GETPASS_GNU],
[
+ AC_LIBSOURCES([getpass.c, getpass.h])
+
AC_CHECK_DECLS_ONCE(getpass)
dnl TODO: Detect when GNU getpass() is already found in glibc.
AC_LIBOBJ(getpass)
diff --git a/m4/gnulib.m4 b/m4/gnulib.m4
index 602e4498e..a145b8cdb 100644
--- a/m4/gnulib.m4
+++ b/m4/gnulib.m4
@@ -1,6 +1,6 @@
# This file is generated automatically. Please, do not edit.
#
-AC_DEFUN([libmailutils_GNULIB],[
+AC_DEFUN([libmuaux_GNULIB],[
# allocsa
gl_ALLOCSA
@@ -12,8 +12,8 @@ gl_ERROR
# exitfail
gl_EXITFAIL
-# stdbool
-AM_STDBOOL_H
+# xalloc
+gl_XALLOC
# xalloc
gl_XALLOC
@@ -48,11 +48,13 @@ gl_XSTRTOL
# vasprintf
gl_FUNC_VASPRINTF
+# xalloc-die
+
# xsize
gl_XSIZE
])
-AC_DEFUN([libmailbox_GNULIB],[
+AC_DEFUN([libmailutils_GNULIB],[
# alloca
# alloca-opt
@@ -62,7 +64,7 @@ gl_FUNC_ALLOCA
gl_ARGP
# getline
-AM_FUNC_GETLINE
+gl_FUNC_GETLINE
# regex
gl_REGEX
@@ -76,19 +78,35 @@ gl_MD5
# extensions
dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac.
+# getdelim
+gl_FUNC_GETDELIM
+
# getopt
gl_GETOPT
-# gettext
+# gettext-h
+
+# mbchar
+gl_MBCHAR
+
+# memchr
+gl_FUNC_MEMCHR
# mempcpy
gl_FUNC_MEMPCPY
# minmax
+gl_MINMAX
# restrict
gl_C_RESTRICT
+# size_max
+gl_SIZE_MAX
+
+# stdbool
+AM_STDBOOL_H
+
# strcase
gl_STRCASE
@@ -101,6 +119,8 @@ gl_FUNC_STRNDUP
# strnlen
gl_FUNC_STRNLEN
+# strnlen1
+
# sysexits
gl_SYSEXITS
diff --git a/m4/longdouble.m4 b/m4/longdouble.m4
index 1333d2f57..40cd7ce02 100644
--- a/m4/longdouble.m4
+++ b/m4/longdouble.m4
@@ -1,10 +1,8 @@
# longdouble.m4 serial 1 (gettext-0.12)
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether the compiler supports the 'long double' type.
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index 2eee1a64f..a3bd9114c 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 7
-dnl Copyright (C) 2001-2002, 2004 Free Software Foundation, Inc.
+# mbrtowc.m4 serial 8
+dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,19 +7,25 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert
dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with
-dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
+dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere.
AC_DEFUN([gl_FUNC_MBRTOWC],
[
+ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
gl_cv_func_mbrtowc,
- [AC_TRY_LINK(
- [#include <wchar.h>],
- [mbstate_t state; return ! (sizeof state && mbrtowc);],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>]],
+ [[wchar_t wc;
+ char const s[] = "";
+ size_t n = 1;
+ mbstate_t state;
+ return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
gl_cv_func_mbrtowc=yes,
gl_cv_func_mbrtowc=no)])
if test $gl_cv_func_mbrtowc = yes; then
- AC_DEFINE(HAVE_MBRTOWC, 1,
+ AC_DEFINE([HAVE_MBRTOWC], 1,
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
fi
])
diff --git a/m4/md5.m4 b/m4/md5.m4
index 861e3ff0e..1a5e9fadf 100644
--- a/m4/md5.m4
+++ b/m4/md5.m4
@@ -1,11 +1,14 @@
-# md5.m4 serial 6
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# md5.m4 serial 7
+dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_MD5],
[
+ MU_LIBSOURCES([md5.c, md5.h])
+ MU_LIBOBJ([md5])
+
dnl Prerequisites of lib/md5.h.
AC_REQUIRE([gl_AC_TYPE_UINT32_T])
diff --git a/m4/onceonly.m4 b/m4/onceonly.m4
index 9fc510e06..14d3c0b2a 100644
--- a/m4/onceonly.m4
+++ b/m4/onceonly.m4
@@ -1,5 +1,5 @@
# onceonly_2_57.m4 serial 3
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
@@ -27,7 +27,7 @@ dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
dnl size reduction is ca. 9%.
dnl Autoconf version 2.57 or newer is recommended.
-AC_PREREQ(2.54)
+AC_PREREQ(2.57)
# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
diff --git a/m4/regex.m4 b/m4/regex.m4
index 2d11f2a84..a120ea83b 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,6 +1,6 @@
-#serial 22
+#serial 24
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 Free
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
# Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
@@ -19,6 +19,10 @@ dnl Usage: gl_INCLUDED_REGEX([lib/regex.c])
dnl
AC_DEFUN([gl_INCLUDED_REGEX],
[
+ MU_LIBSOURCES(
+ [regcomp.c, regex.c, regex.h,
+ regex_internal.c, regex_internal.h, regexec.c])
+
dnl Even packages that don't use regex.c can use this macro.
dnl Of course, for them it doesn't do anything.
@@ -31,75 +35,86 @@ AC_DEFUN([gl_INCLUDED_REGEX],
# regex.c. The first failing regular expression is from `Spencer ere
# test #75' in grep-2.3.
AC_CACHE_CHECK([for working re_compile_pattern],
- jm_cv_func_working_re_compile_pattern,
- AC_TRY_RUN(
-[#include <stdio.h>
-#include <string.h>
-#include <regex.h>
- int
- main ()
- {
- static struct re_pattern_buffer regex;
- const char *s;
- struct re_registers regs;
- re_set_syntax (RE_SYNTAX_POSIX_EGREP);
- memset (&regex, 0, sizeof (regex));
- [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, &regex);]
- /* This should fail with _Invalid character class name_ error. */
- if (!s)
- exit (1);
-
- /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
- memset (&regex, 0, sizeof (regex));
- s = re_compile_pattern ("{1", 2, &regex);
-
- if (s)
- exit (1);
-
- /* The following example is derived from a problem report
- against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
- memset (&regex, 0, sizeof (regex));
- s = re_compile_pattern ("[[an\371]]*n", 7, &regex);
- if (s)
- exit (1);
-
- /* This should match, but doesn't for e.g. glibc-2.2.1. */
- if (re_match (&regex, "an", 2, 0, &regs) != 2)
- exit (1);
-
- memset (&regex, 0, sizeof (regex));
- s = re_compile_pattern ("x", 1, &regex);
- if (s)
- exit (1);
-
- /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
- work with a negative RANGE argument. */
- if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
- exit (1);
-
- exit (0);
- }
- ],
- jm_cv_func_working_re_compile_pattern=yes,
- jm_cv_func_working_re_compile_pattern=no,
- dnl When crosscompiling, assume it's broken.
- jm_cv_func_working_re_compile_pattern=no))
- if test $jm_cv_func_working_re_compile_pattern = yes; then
+ [gl_cv_func_working_re_compile_pattern],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT
+ #include <regex.h>],
+ [[static struct re_pattern_buffer regex;
+ const char *s;
+ struct re_registers regs;
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof (regex));
+ s = re_compile_pattern ("a[:@:>@:]b\n", 9, &regex);
+ /* This should fail with _Invalid character class name_ error. */
+ if (!s)
+ exit (1);
+
+ /* This should succeed, but does not for e.g. glibc-2.1.3. */
+ memset (&regex, 0, sizeof (regex));
+ s = re_compile_pattern ("{1", 2, &regex);
+
+ if (s)
+ exit (1);
+
+ /* The following example is derived from a problem report
+ against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
+ memset (&regex, 0, sizeof (regex));
+ s = re_compile_pattern ("[an\371]*n", 7, &regex);
+ if (s)
+ exit (1);
+
+ /* This should match, but does not for e.g. glibc-2.2.1. */
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ exit (1);
+
+ memset (&regex, 0, sizeof (regex));
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ exit (1);
+
+ /* The version of regex.c in e.g. GNU libc-2.2.93 did not
+ work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ exit (1);
+
+ /* The version of regex.c in older versions of gnulib
+ * ignored RE_ICASE. Detect that problem too. */
+ memset (&regex, 0, sizeof (regex));
+ re_set_syntax(RE_SYNTAX_EMACS|RE_ICASE);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ exit (1);
+
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ exit (1);
+
+ /* REG_STARTEND was added to glibc on 2004-01-15.
+ Reject older versions. */
+ if (! REG_STARTEND)
+ exit (1);
+
+ exit (0);]])],
+ [gl_cv_func_working_re_compile_pattern=yes],
+ [gl_cv_func_working_re_compile_pattern=no],
+ dnl When crosscompiling, assume it is broken.
+ [gl_cv_func_working_re_compile_pattern=no])])
+ if test $gl_cv_func_working_re_compile_pattern = yes; then
ac_use_included_regex=no
fi
test -n "$1" || AC_MSG_ERROR([missing argument])
- m4_syscmd([test -f $1])
+ m4_syscmd([test -f '$1'])
ifelse(m4_sysval, 0,
[
- AC_ARG_WITH(included-regex,
- [ --without-included-regex don't compile regex; this is the default on
- systems with version 2 of the GNU C library
- (use with caution on other system)],
- jm_with_regex=$withval,
- jm_with_regex=$ac_use_included_regex)
- if test "$jm_with_regex" = yes; then
- MU_LIBOBJ(regex)
+ AC_ARG_WITH([included-regex],
+ [ --without-included-regex don't compile regex; this is the default on
+ systems with recent-enough versions of the GNU C
+ Library (use with caution on other systems)],
+ [gl_with_regex=$withval],
+ [gl_with_regex=$ac_use_included_regex])
+ if test "X$gl_with_regex" = Xyes; then
+ MU_LIBOBJ([regex])
gl_PREREQ_REGEX
fi
],
@@ -107,20 +122,11 @@ AC_DEFUN([gl_INCLUDED_REGEX],
]
)
-# Prerequisites of lib/regex.c.
+# Prerequisites of lib/regex.c and lib/regex_internal.c.
AC_DEFUN([gl_PREREQ_REGEX],
[
- dnl FIXME: Maybe provide a btowc replacement someday: Solaris 2.5.1 lacks it.
- dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
- dnl to get them.
-
- dnl Persuade glibc <string.h> to declare mempcpy().
- AC_REQUIRE([AC_GNU_SOURCE])
-
AC_REQUIRE([gl_C_RESTRICT])
- AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([AC_HEADER_STDC])
- AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
- AC_CHECK_FUNCS_ONCE(isascii mempcpy)
- AC_CHECK_FUNCS(btowc)
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CHECK_HEADERS_ONCE([locale.h wchar.h wctype.h])
+ AC_CHECK_FUNCS_ONCE([isblank mbrtowc mempcpy wcrtomb wcscoll])
])
diff --git a/m4/signed.m4 b/m4/signed.m4
index dc1f54f10..048f59369 100644
--- a/m4/signed.m4
+++ b/m4/signed.m4
@@ -1,10 +1,8 @@
# signed.m4 serial 1 (gettext-0.10.40)
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index 5762fc333..0336f3af5 100644
--- a/m4/size_max.m4
+++ b/m4/size_max.m4
@@ -1,10 +1,8 @@
-# size_max.m4 serial 2
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# size_max.m4 serial 3
+dnl Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
@@ -28,9 +26,9 @@ Found it
dnl than the type 'unsigned long'.
dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
- _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
+ _AC_COMPUTE_INT([(size_t)~(size_t)0 / 10], res_hi,
[#include <stddef.h>], result=?)
- _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
+ _AC_COMPUTE_INT([(size_t)~(size_t)0 % 10], res_lo,
[#include <stddef.h>], result=?)
_AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
[#include <stddef.h>], result=?)
@@ -50,7 +48,7 @@ Found it
fi
else
dnl Shouldn't happen, but who knows...
- result='~(size_t)0'
+ result='((size_t)~(size_t)0)'
fi
fi
AC_MSG_RESULT([$result])
diff --git a/m4/strcase.m4 b/m4/strcase.m4
index 33efdec5e..0e2f2f08b 100644
--- a/m4/strcase.m4
+++ b/m4/strcase.m4
@@ -1,5 +1,5 @@
-# strcase.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# strcase.m4 serial 2
+dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,10 +12,11 @@ AC_DEFUN([gl_STRCASE],
AC_DEFUN([gl_FUNC_STRCASECMP],
[
- MU_REPLACE_FUNCS(strcasecmp)
- if test $ac_cv_func_strcasecmp = no; then
- gl_PREREQ_STRCASECMP
- fi
+ dnl No known system has a strcasecmp() function that works correctly in
+ dnl multibyte locales. Therefore we use our version always.
+ MU_LIBOBJ(strcasecmp)
+ AC_DEFINE(strcasecmp, rpl_strcasecmp, [Define to rpl_strcasecmp always.])
+ gl_PREREQ_STRCASECMP
])
AC_DEFUN([gl_FUNC_STRNCASECMP],
@@ -28,7 +29,7 @@ AC_DEFUN([gl_FUNC_STRNCASECMP],
# Prerequisites of lib/strcasecmp.c.
AC_DEFUN([gl_PREREQ_STRCASECMP], [
- :
+ gl_FUNC_MBRTOWC
])
# Prerequisites of lib/strncasecmp.c.
diff --git a/m4/strndup.m4 b/m4/strndup.m4
index a94e69730..00af8352d 100644
--- a/m4/strndup.m4
+++ b/m4/strndup.m4
@@ -1,11 +1,13 @@
-# strndup.m4 serial 3
-dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# strndup.m4 serial 5
+dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRNDUP],
[
+ MU_LIBSOURCES([strndup.c, strndup.h])
+
dnl Persuade glibc <string.h> to declare strndup().
AC_REQUIRE([AC_GNU_SOURCE])
@@ -16,6 +18,4 @@ AC_DEFUN([gl_FUNC_STRNDUP],
])
# Prerequisites of lib/strndup.c.
-AC_DEFUN([gl_PREREQ_STRNDUP], [
- AC_CHECK_DECLS(strnlen)
-])
+AC_DEFUN([gl_PREREQ_STRNDUP], [:])
diff --git a/m4/strnlen.m4 b/m4/strnlen.m4
index ff69fa1a3..2d0550aaf 100644
--- a/m4/strnlen.m4
+++ b/m4/strnlen.m4
@@ -1,11 +1,13 @@
-# strnlen.m4 serial 4
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# strnlen.m4 serial 5
+dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRNLEN],
[
+ MU_LIBSOURCES([strnlen.c, strnlen.h])
+
dnl Persuade glibc <string.h> to declare strnlen().
AC_REQUIRE([AC_GNU_SOURCE])
@@ -22,4 +24,6 @@ AC_DEFUN([gl_FUNC_STRNLEN],
])
# Prerequisites of lib/strnlen.c.
-AC_DEFUN([gl_PREREQ_STRNLEN], [:])
+AC_DEFUN([gl_PREREQ_STRNLEN], [
+ AC_CHECK_DECLS_ONCE(strnlen)
+])
diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4
index c536d2dd9..e66b19ffe 100644
--- a/m4/unlocked-io.m4
+++ b/m4/unlocked-io.m4
@@ -1,6 +1,6 @@
-# unlocked-io.m4 serial 11
+# unlocked-io.m4 serial 12
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
# Foundation, Inc.
#
# This file is free software; the Free Software Foundation
@@ -17,6 +17,8 @@ dnl on Solaris 2.6).
AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO],
[
+ MU_LIBSOURCES([unlocked-io.h])
+
AC_DEFINE([USE_UNLOCKED_IO], 1,
[Define to 1 if you want getc etc. to use unlocked I/O if available.
Unlocked I/O can improve performance in unithreaded apps,
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
index d8fd1ec5c..cde2129a9 100644
--- a/m4/wchar_t.m4
+++ b/m4/wchar_t.m4
@@ -1,10 +1,8 @@
# wchar_t.m4 serial 1 (gettext-0.12)
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index 3d8d21594..b8fff9c86 100644
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,10 +1,8 @@
# wint_t.m4 serial 1 (gettext-0.12)
dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Test whether <wchar.h> has the 'wint_t' type.