summaryrefslogtreecommitdiff
path: root/gnulib
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-06-09 13:48:30 +0100
committerColin Watson <cjwatson@debian.org>2008-06-09 13:48:30 +0100
commit36b4756a21da97fb2c4caf877afeae4414be8ce4 (patch)
tree8a9c19d3acf30e44b85ee1790d54be1f48aed865 /gnulib
parentece750144d34af78bb6f0357552057dcb25820ec (diff)
* gnulib: Upgrade to 20080601.
Diffstat (limited to 'gnulib')
-rw-r--r--gnulib/lib/argp-help.c22
-rw-r--r--gnulib/lib/argp-parse.c2
-rw-r--r--gnulib/lib/regcomp.c52
-rw-r--r--gnulib/lib/regex_internal.c6
-rw-r--r--gnulib/lib/regexec.c7
-rw-r--r--gnulib/lib/stdbool.in.h6
-rw-r--r--gnulib/lib/vasnprintf.c21
-rw-r--r--gnulib/lib/xalloc.h24
-rw-r--r--gnulib/lib/xmalloc.c2
-rw-r--r--gnulib/lib/xmalloc.c.orig2
-rw-r--r--gnulib/m4/gnulib-common.m49
-rw-r--r--gnulib/m4/gnulib-comp.m458
-rw-r--r--gnulib/m4/memcmp.m416
-rw-r--r--gnulib/m4/wctype.m413
14 files changed, 147 insertions, 93 deletions
diff --git a/gnulib/lib/argp-help.c b/gnulib/lib/argp-help.c
index 4c0ca60c..a9843c0a 100644
--- a/gnulib/lib/argp-help.c
+++ b/gnulib/lib/argp-help.c
@@ -88,11 +88,11 @@ struct uparams
int dup_args_note;
/* Various output columns. */
- int short_opt_col; /* column in which short options start */
- int long_opt_col; /* column in which long options start */
+ int short_opt_col; /* column in which short options start */
+ int long_opt_col; /* column in which long options start */
int doc_opt_col; /* column in which doc options start */
int opt_doc_col; /* column in which option text starts */
- int header_col; /* column in which group headers are printed */
+ int header_col; /* column in which group headers are printed */
int usage_indent; /* indentation of wrapped usage lines */
int rmargin; /* right margin used for wrapping */
@@ -160,7 +160,7 @@ fill_in_uparams (const struct argp_state *state)
{
const char *var = getenv ("ARGP_HELP_FMT");
struct uparams new_params = uparams;
-
+
#define SKIPWS(p) do { while (isspace ((unsigned char) *p)) p++; } while (0);
if (var)
@@ -169,7 +169,7 @@ fill_in_uparams (const struct argp_state *state)
while (*var)
{
SKIPWS (var);
-
+
if (isalpha ((unsigned char) *var))
{
size_t var_len;
@@ -180,9 +180,9 @@ fill_in_uparams (const struct argp_state *state)
while (isalnum ((unsigned char) *arg) || *arg == '-' || *arg == '_')
arg++;
var_len = arg - var;
-
+
SKIPWS (arg);
-
+
if (*arg == '\0' || *arg == ',')
unspec = 1;
else if (*arg == '=')
@@ -190,7 +190,7 @@ fill_in_uparams (const struct argp_state *state)
arg++;
SKIPWS (arg);
}
-
+
if (unspec)
{
if (var[0] == 'n' && var[1] == 'o' && var[2] == '-')
@@ -209,7 +209,7 @@ fill_in_uparams (const struct argp_state *state)
arg++;
SKIPWS (arg);
}
-
+
for (un = uparam_names; un->name; un++)
if (strlen (un->name) == var_len
&& strncmp (var, un->name, var_len) == 0)
@@ -676,7 +676,7 @@ hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2)
{
/* If one cluster is deeper than the other, use its ancestor at the same
level, so that finding the common ancestor is straightforward.
-
+
clN->depth > 0 means that clN->parent != NULL (see hol_add_cluster) */
while (cl1->depth > cl2->depth)
cl1 = cl1->parent;
@@ -806,7 +806,7 @@ hol_entry_cmp (const struct hol_entry *entry1,
#endif
/* Compare ignoring case, except when the options are both the
same letter, in which case lower-case always comes first. */
- return lower_cmp ? lower_cmp :
+ return lower_cmp ? lower_cmp :
(rc = first2 - first1) ?
rc : HOL_ENTRY_PTRCMP(entry1, entry2);
}
diff --git a/gnulib/lib/argp-parse.c b/gnulib/lib/argp-parse.c
index d86256a8..317ce21b 100644
--- a/gnulib/lib/argp-parse.c
+++ b/gnulib/lib/argp-parse.c
@@ -889,7 +889,7 @@ __argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
#endif
}
#endif
-
+
if (! (flags & ARGP_NO_HELP))
/* Add our own options. */
{
diff --git a/gnulib/lib/regcomp.c b/gnulib/lib/regcomp.c
index 8827e03c..2566a330 100644
--- a/gnulib/lib/regcomp.c
+++ b/gnulib/lib/regcomp.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+ Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -776,7 +776,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
__libc_lock_init (dfa->lock);
err = re_string_construct (&regexp, pattern, length, preg->translate,
- syntax & RE_ICASE, dfa);
+ (syntax & RE_ICASE) != 0, dfa);
if (BE (err != REG_NOERROR, 0))
{
re_compile_internal_free_return:
@@ -1057,7 +1057,9 @@ optimize_utf8 (re_dfa_t *dfa)
case BUF_LAST:
break;
default:
- /* Word anchors etc. cannot be handled. */
+ /* Word anchors etc. cannot be handled. It's okay to test
+ opr.ctx_type since constraints (for all DFA nodes) are
+ created by ORing one or more opr.ctx_type values. */
return;
}
break;
@@ -1344,6 +1346,8 @@ calc_first (void *extra, bin_tree_t *node)
node->node_idx = re_dfa_add_node (dfa, node->token);
if (BE (node->node_idx == REG_MISSING, 0))
return REG_ESPACE;
+ if (node->token.type == ANCHOR)
+ dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
}
return REG_NOERROR;
}
@@ -1473,21 +1477,18 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
destination. */
org_dest = dfa->edests[org_node].elems[0];
re_node_set_empty (dfa->edests + clone_node);
- if (dfa->nodes[org_node].type == ANCHOR)
+ clone_dest = search_duplicated_node (dfa, org_dest, constraint);
+ /* If the node is root_node itself, it means the epsilon closure
+ has a loop. Then tie it to the destination of the root_node. */
+ if (org_node == root_node && clone_node != org_node)
{
- /* In case of the node has another constraint, append it. */
- if (org_node == root_node && clone_node != org_node)
- {
- /* ...but if the node is root_node itself, it means the
- epsilon closure have a loop, then tie it to the
- destination of the root_node. */
- ok = re_node_set_insert (dfa->edests + clone_node, org_dest);
- if (BE (! ok, 0))
- return REG_ESPACE;
- break;
- }
- constraint |= dfa->nodes[org_node].opr.ctx_type;
+ ok = re_node_set_insert (dfa->edests + clone_node, org_dest);
+ if (BE (! ok, 0))
+ return REG_ESPACE;
+ break;
}
+ /* In case the node has another constraint, append it. */
+ constraint |= dfa->nodes[org_node].constraint;
clone_dest = duplicate_node (dfa, org_dest, constraint);
if (BE (clone_dest == REG_MISSING, 0))
return REG_ESPACE;
@@ -1505,7 +1506,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
clone_dest = search_duplicated_node (dfa, org_dest, constraint);
if (clone_dest == REG_MISSING)
{
- /* There are no such a duplicated node, create a new one. */
+ /* There is no such duplicated node, create a new one. */
reg_errcode_t err;
clone_dest = duplicate_node (dfa, org_dest, constraint);
if (BE (clone_dest == REG_MISSING, 0))
@@ -1520,7 +1521,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
}
else
{
- /* There are a duplicated node which satisfy the constraint,
+ /* There is a duplicated node which satisfy the constraint,
use it to avoid infinite loop. */
ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
if (BE (! ok, 0))
@@ -1569,8 +1570,7 @@ duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint)
if (BE (dup_idx != REG_MISSING, 1))
{
dfa->nodes[dup_idx].constraint = constraint;
- if (dfa->nodes[org_idx].type == ANCHOR)
- dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].opr.ctx_type;
+ dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint;
dfa->nodes[dup_idx].duplicated = 1;
/* Store the index of the original node. */
@@ -1652,7 +1652,6 @@ static reg_errcode_t
calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
{
reg_errcode_t err;
- unsigned int constraint;
Idx i;
bool incomplete;
bool ok;
@@ -1666,15 +1665,14 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
We reference this value to avoid infinite loop. */
dfa->eclosures[node].nelem = REG_MISSING;
- constraint = ((dfa->nodes[node].type == ANCHOR)
- ? dfa->nodes[node].opr.ctx_type : 0);
- /* If the current node has constraints, duplicate all nodes.
- Since they must inherit the constraints. */
- if (constraint
+ /* If the current node has constraints, duplicate all nodes
+ since they must inherit the constraints. */
+ if (dfa->nodes[node].constraint
&& dfa->edests[node].nelem
&& !dfa->nodes[dfa->edests[node].elems[0]].duplicated)
{
- err = duplicate_node_closure (dfa, node, node, node, constraint);
+ err = duplicate_node_closure (dfa, node, node, node,
+ dfa->nodes[node].constraint);
if (BE (err != REG_NOERROR, 0))
return err;
}
diff --git a/gnulib/lib/regex_internal.c b/gnulib/lib/regex_internal.c
index cf3bf1bb..08ad4990 100644
--- a/gnulib/lib/regex_internal.c
+++ b/gnulib/lib/regex_internal.c
@@ -1689,11 +1689,9 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
for (i = 0 ; i < nodes->nelem ; i++)
{
- unsigned int constraint = 0;
re_token_t *node = dfa->nodes + nodes->elems[i];
re_token_type_t type = node->type;
- if (node->constraint)
- constraint = node->constraint;
+ unsigned int constraint = node->constraint;
if (type == CHARACTER && !constraint)
continue;
@@ -1706,8 +1704,6 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
newstate->halt = 1;
else if (type == OP_BACK_REF)
newstate->has_backref = 1;
- else if (type == ANCHOR)
- constraint = node->opr.ctx_type;
if (constraint)
{
diff --git a/gnulib/lib/regexec.c b/gnulib/lib/regexec.c
index ac6c258e..51f9458b 100644
--- a/gnulib/lib/regexec.c
+++ b/gnulib/lib/regexec.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -701,7 +701,8 @@ re_search_internal (const regex_t *preg,
fl_longest_match = (nmatch != 0 || dfa->nbackref);
err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1,
- preg->translate, preg->syntax & RE_ICASE, dfa);
+ preg->translate, (preg->syntax & RE_ICASE) != 0,
+ dfa);
if (BE (err != REG_NOERROR, 0))
goto free_return;
mctx.input.stop = stop;
@@ -3467,7 +3468,7 @@ out_free:
CONTEXT_NEWLINE);
if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0))
goto out_free;
- }
+ }
else
{
dest_states_word[i] = dest_states[i];
diff --git a/gnulib/lib/stdbool.in.h b/gnulib/lib/stdbool.in.h
index 171d70ab..cffa0ab2 100644
--- a/gnulib/lib/stdbool.in.h
+++ b/gnulib/lib/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
@@ -58,7 +58,7 @@
/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
definitions below, but temporarily we have to #undef them. */
-#ifdef __BEOS__
+#if defined __BEOS__ && !defined __HAIKU__
# include <OS.h> /* defines bool but not _Bool */
# undef false
# undef true
@@ -73,7 +73,7 @@
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
(see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
enum; this ensures that '_Bool' promotes to 'int'. */
-#if defined __cplusplus || defined __BEOS__
+#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
/* A compiler known to have 'bool'. */
/* If the compiler already has both 'bool' and '_Bool', we can assume they
are the same types. */
diff --git a/gnulib/lib/vasnprintf.c b/gnulib/lib/vasnprintf.c
index a105c746..fdfeb858 100644
--- a/gnulib/lib/vasnprintf.c
+++ b/gnulib/lib/vasnprintf.c
@@ -200,6 +200,21 @@ local_wcslen (const wchar_t *s)
/* Here we need to call the native sprintf, not rpl_sprintf. */
#undef sprintf
+/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
+ warnings in this file. Use -Dlint to suppress them. */
+#ifdef lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+/* Avoid some warnings from "gcc -Wshadow".
+ This file doesn't use the exp() and remainder() functions. */
+#undef exp
+#define exp expo
+#undef remainder
+#define remainder rem
+
#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
/* Determine the decimal-point character according to the current locale. */
# ifndef decimal_point_char_defined
@@ -1198,7 +1213,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
static char *
scale10_round_decimal_long_double (long double x, int n)
{
- int e;
+ int e IF_LINT(= 0);
mpn_t m;
void *memory = decode_long_double (x, &e, &m);
return scale10_round_decimal_decoded (e, m, memory, n);
@@ -1216,7 +1231,7 @@ scale10_round_decimal_long_double (long double x, int n)
static char *
scale10_round_decimal_double (double x, int n)
{
- int e;
+ int e IF_LINT(= 0);
mpn_t m;
void *memory = decode_double (x, &e, &m);
return scale10_round_decimal_decoded (e, m, memory, n);
@@ -3693,7 +3708,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
TCHAR_T *fbp;
unsigned int prefix_count;
- int prefixes[2];
+ int prefixes[2] IF_LINT (= { 0 });
#if !USE_SNPRINTF
size_t tmp_length;
TCHAR_T tmpbuf[700];
diff --git a/gnulib/lib/xalloc.h b/gnulib/lib/xalloc.h
index 40dcf4bd..57a13e0a 100644
--- a/gnulib/lib/xalloc.h
+++ b/gnulib/lib/xalloc.h
@@ -37,6 +37,14 @@ extern "C" {
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
# endif
+# ifndef ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3
+# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define ATTRIBUTE_MALLOC
+# endif
+# endif
+
/* This function is always triggered when memory is exhausted.
It must be defined by the application, either explicitly
or by using gnulib's xalloc-die module. This is the
@@ -44,13 +52,13 @@ extern "C" {
memory allocation failure. */
extern void xalloc_die (void) ATTRIBUTE_NORETURN;
-void *xmalloc (size_t s);
-void *xzalloc (size_t s);
-void *xcalloc (size_t n, size_t s);
+void *xmalloc (size_t s) ATTRIBUTE_MALLOC;
+void *xzalloc (size_t s) ATTRIBUTE_MALLOC;
+void *xcalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
void *xrealloc (void *p, size_t s);
void *x2realloc (void *p, size_t *pn);
-void *xmemdup (void const *p, size_t s);
-char *xstrdup (char const *str);
+void *xmemdup (void const *p, size_t s) ATTRIBUTE_MALLOC;
+char *xstrdup (char const *str) ATTRIBUTE_MALLOC;
/* Return 1 if an array of N objects, each of size S, cannot exist due
to size arithmetic overflow. S must be positive and N must be
@@ -97,10 +105,10 @@ char *xstrdup (char const *str);
# if HAVE_INLINE
# define static_inline static inline
# else
- void *xnmalloc (size_t n, size_t s);
+ void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
void *xnrealloc (void *p, size_t n, size_t s);
void *x2nrealloc (void *p, size_t *pn, size_t s);
- char *xcharalloc (size_t n);
+ char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
# endif
# ifdef static_inline
@@ -108,6 +116,7 @@ char *xstrdup (char const *str);
/* Allocate an array of N objects, each with S bytes of memory,
dynamically, with error checking. S must be nonzero. */
+static_inline void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
static_inline void *
xnmalloc (size_t n, size_t s)
{
@@ -219,6 +228,7 @@ x2nrealloc (void *p, size_t *pn, size_t s)
/* Return a pointer to a new buffer of N bytes. This is like xmalloc,
except it returns char *. */
+static_inline char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
static_inline char *
xcharalloc (size_t n)
{
diff --git a/gnulib/lib/xmalloc.c b/gnulib/lib/xmalloc.c
index e049ff8f..0186dc8a 100644
--- a/gnulib/lib/xmalloc.c
+++ b/gnulib/lib/xmalloc.c
@@ -1,7 +1,7 @@
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+ 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gnulib/lib/xmalloc.c.orig b/gnulib/lib/xmalloc.c.orig
index 3a123457..89ecf17a 100644
--- a/gnulib/lib/xmalloc.c.orig
+++ b/gnulib/lib/xmalloc.c.orig
@@ -1,7 +1,7 @@
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+ 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/gnulib/m4/gnulib-common.m4 b/gnulib/m4/gnulib-common.m4
index 3edfc120..34d91c72 100644
--- a/gnulib/m4/gnulib-common.m4
+++ b/gnulib/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 4
+# gnulib-common.m4 serial 5
dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -31,6 +31,13 @@ AC_DEFUN([gl_MODULE_INDICATOR],
[Define to 1 when using the gnulib module ]$1[.])
])
+# m4_foreach_w
+# is a backport of autoconf-2.59c's m4_foreach_w.
+# Remove this macro when we can assume autoconf >= 2.60.
+m4_ifndef([m4_foreach_w],
+ [m4_define([m4_foreach_w],
+ [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
+
# AC_PROG_MKDIR_P
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
# Remove this macro when we can assume autoconf >= 2.60.
diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
index afb23647..ab0203a9 100644
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -46,6 +46,8 @@ AC_DEFUN([gl_INIT],
m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
+ m4_pushdef([gl_LIBSOURCES_LIST], [])
+ m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='gnulib/lib'
gl_EOVERFLOW
@@ -195,6 +197,19 @@ AC_DEFUN([gl_INIT],
gl_XVASPRINTF
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_XGETTEXT_OPTION([--flag=xasprintf:1:c-format])])
+ m4_ifval(gl_LIBSOURCES_LIST, [
+ m4_syscmd([test ! -d ]gl_LIBSOURCES_DIR[ ||
+ for gl_file in ]gl_LIBSOURCES_LIST[ ; do
+ if test ! -r ]gl_LIBSOURCES_DIR[/$gl_file ; then
+ echo "missing file ]gl_LIBSOURCES_DIR[/$gl_file" >&2
+ exit 1
+ fi
+ done])dnl
+ m4_if(m4_sysval, [0], [],
+ [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
+ ])
+ m4_popdef([gl_LIBSOURCES_DIR])
+ m4_popdef([gl_LIBSOURCES_LIST])
m4_popdef([AC_LIBSOURCES])
m4_popdef([AC_REPLACE_FUNCS])
m4_popdef([AC_LIBOBJ])
@@ -217,8 +232,23 @@ AC_DEFUN([gl_INIT],
m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
+ m4_pushdef([gltests_LIBSOURCES_LIST], [])
+ m4_pushdef([gltests_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='tests'
+ m4_ifval(gltests_LIBSOURCES_LIST, [
+ m4_syscmd([test ! -d ]gltests_LIBSOURCES_DIR[ ||
+ for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
+ if test ! -r ]gltests_LIBSOURCES_DIR[/$gl_file ; then
+ echo "missing file ]gltests_LIBSOURCES_DIR[/$gl_file" >&2
+ exit 1
+ fi
+ done])dnl
+ m4_if(m4_sysval, [0], [],
+ [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
+ ])
+ m4_popdef([gltests_LIBSOURCES_DIR])
+ m4_popdef([gltests_LIBSOURCES_LIST])
m4_popdef([AC_LIBSOURCES])
m4_popdef([AC_REPLACE_FUNCS])
m4_popdef([AC_LIBOBJ])
@@ -249,13 +279,6 @@ AC_DEFUN([gl_LIBOBJ], [
gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
])
-# m4_foreach_w is provided by autoconf-2.59c and later.
-# This definition is to accommodate developers using versions
-# of autoconf older than that.
-m4_ifndef([m4_foreach_w],
- [m4_define([m4_foreach_w],
- [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
-
# Like AC_REPLACE_FUNCS, except that the module name goes
# into gl_LIBOBJS instead of into LIBOBJS.
AC_DEFUN([gl_REPLACE_FUNCS], [
@@ -264,15 +287,14 @@ AC_DEFUN([gl_REPLACE_FUNCS], [
])
# Like AC_LIBSOURCES, except the directory where the source file is
-# expected is derived from the gnulib-tool parametrization,
+# expected is derived from the gnulib-tool parameterization,
# and alloca is special cased (for the alloca-opt module).
# We could also entirely rely on EXTRA_lib..._SOURCES.
AC_DEFUN([gl_LIBSOURCES], [
m4_foreach([_gl_NAME], [$1], [
m4_if(_gl_NAME, [alloca.c], [], [
- m4_syscmd([test -r gnulib/lib/]_gl_NAME[ || test ! -d gnulib/lib])dnl
- m4_if(m4_sysval, [0], [],
- [AC_FATAL([missing gnulib/lib/]_gl_NAME)])
+ m4_define([gl_LIBSOURCES_DIR], [gnulib/lib])
+ m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
])
])
])
@@ -284,13 +306,6 @@ AC_DEFUN([gltests_LIBOBJ], [
gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
])
-# m4_foreach_w is provided by autoconf-2.59c and later.
-# This definition is to accommodate developers using versions
-# of autoconf older than that.
-m4_ifndef([m4_foreach_w],
- [m4_define([m4_foreach_w],
- [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
-
# Like AC_REPLACE_FUNCS, except that the module name goes
# into gltests_LIBOBJS instead of into LIBOBJS.
AC_DEFUN([gltests_REPLACE_FUNCS], [
@@ -299,15 +314,14 @@ AC_DEFUN([gltests_REPLACE_FUNCS], [
])
# Like AC_LIBSOURCES, except the directory where the source file is
-# expected is derived from the gnulib-tool parametrization,
+# expected is derived from the gnulib-tool parameterization,
# and alloca is special cased (for the alloca-opt module).
# We could also entirely rely on EXTRA_lib..._SOURCES.
AC_DEFUN([gltests_LIBSOURCES], [
m4_foreach([_gl_NAME], [$1], [
m4_if(_gl_NAME, [alloca.c], [], [
- m4_syscmd([test -r tests/]_gl_NAME[ || test ! -d tests])dnl
- m4_if(m4_sysval, [0], [],
- [AC_FATAL([missing tests/]_gl_NAME)])
+ m4_define([gltests_LIBSOURCES_DIR], [tests])
+ m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
])
])
])
diff --git a/gnulib/m4/memcmp.m4 b/gnulib/m4/memcmp.m4
index 099b141b..a8d87b93 100644
--- a/gnulib/m4/memcmp.m4
+++ b/gnulib/m4/memcmp.m4
@@ -1,11 +1,23 @@
-# memcmp.m4 serial 12
-dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+# memcmp.m4 serial 13
+dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 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_MEMCMP],
[
+ if test $cross_compiling != no; then
+ # AC_FUNC_MEMCMP as of 2.62 defaults to 'no' when cross compiling.
+ # We default to yes if memcmp appears to exist, which works
+ # better for MinGW.
+ AC_CACHE_CHECK([whether cross-compiling target has memcmp],
+ [ac_cv_func_memcmp_working],
+ [AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[#include <string.h>
+ ]], [[int ret = memcmp ("foo", "bar", 0);]])],
+ [ac_cv_func_memcmp_working=yes],
+ [ac_cv_func_memcmp_working=no])])
+ fi
AC_FUNC_MEMCMP
dnl Note: AC_FUNC_MEMCMP does AC_LIBOBJ(memcmp).
if test $ac_cv_func_memcmp_working = no; then
diff --git a/gnulib/m4/wctype.m4 b/gnulib/m4/wctype.m4
index 7c6718c3..6a1b6f07 100644
--- a/gnulib/m4/wctype.m4
+++ b/gnulib/m4/wctype.m4
@@ -1,3 +1,5 @@
+# wctype.m4 serial 2
+
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
@@ -41,14 +43,13 @@ AC_DEFUN([gl_WCTYPE_H],
#include <wchar.h>
#include <wctype.h>
int main () { return iswprint ('x') == 0; }],
- [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
- ],
- [
- AC_TRY_COMPILE([#include <stdlib.h>
+ [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
+ [AC_TRY_COMPILE([#include <stdlib.h>
#if __GNU_LIBRARY__ == 1
Linux libc5 i18n is broken.
- #endif],
- [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
+ #endif], [],
+ [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
+ ])
])
if test $gl_cv_func_iswcntrl_works = yes; then
WCTYPE_H=