Mercurial > gnulib
annotate m4/regex.m4 @ 17355:9855b352e525
regex: port to mingw's recent addition of undeclared alarm
On mingw (at least, when cross-compiling with Fedora 18's
mingw32-headers-2.0.999-0.15.trunk.20121110.fc18.noarch build),
compilation of test-regex fails:
test-regex.c: In function 'main':
test-regex.c:42:11: error: 'SIGALRM' undeclared (first use in this function)
test-regex.c:42:11: note: each undeclared identifier is reported only
once for each function it appears in
test-regex.c:43:3: warning: implicit declaration of function 'alarm'
It turns out that recent mingw64 added an export of alarm() and
SIGALRM, but guarded their declarations behind __USE_MINGW_ALARM
(default off, and with alarm() only in the non-standard <io.h>);
so the m4 tests were setting HAVE_ALARM to 1 based on link success
but then failing to compile.
* doc/posix-functions/alarm.texi (alarm): Document that alarm
exists but still doesn't work in newer mingw.
* m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Check for alarm declaration,
not existence. Ensure SIGALRM is not trapped.
* m4/mktime.m4 (gl_FUNC_MKTIME): Likewise.
* m4/regex.m4 (gl_REGEX): Likewise.
* m4/remainderf.m4 (gl_FUNC_REMAINDERF_WORKS): Likewise.
* tests/test-regex.c (main): Use correct probe for alarm.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Mon, 11 Mar 2013 14:51:33 -0600 |
parents | a9f418d6d676 |
children | e192356f48c2 |
rev | line source |
---|---|
17355
9855b352e525
regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents:
17310
diff
changeset
|
1 # serial 64 |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
2 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
17235
diff
changeset
|
3 # Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc. |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
4 # |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
5 # This file is free software; the Free Software Foundation |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
6 # gives unlimited permission to copy and/or distribute it, |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
7 # with or without modifications, as long as this notice is preserved. |
1403 | 8 |
1698
4059f896cb68
Add a run-time Test for proper operation of re_compile_pattern.
Jim Meyering <jim@meyering.net>
parents:
1623
diff
changeset
|
9 dnl Initially derived from code in GNU grep. |
4059f896cb68
Add a run-time Test for proper operation of re_compile_pattern.
Jim Meyering <jim@meyering.net>
parents:
1623
diff
changeset
|
10 dnl Mostly written by Jim Meyering. |
1403 | 11 |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
12 AC_PREREQ([2.50]) |
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
13 |
4108
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3339
diff
changeset
|
14 AC_DEFUN([gl_REGEX], |
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3339
diff
changeset
|
15 [ |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
16 AC_ARG_WITH([included-regex], |
9878 | 17 [AS_HELP_STRING([--without-included-regex], |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
18 [don't compile regex; this is the default on systems |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
19 with recent-enough versions of the GNU C Library |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
20 (use with caution on other systems).])]) |
1698
4059f896cb68
Add a run-time Test for proper operation of re_compile_pattern.
Jim Meyering <jim@meyering.net>
parents:
1623
diff
changeset
|
21 |
6720
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
22 case $with_included_regex in #( |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
23 yes|no) ac_use_included_regex=$with_included_regex |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
24 ;; |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
25 '') |
6939
c34c3fd8f414
Commentary sync from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6932
diff
changeset
|
26 # If the system regex support is good enough that it passes the |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
27 # following run test, then default to *not* using the included regex.c. |
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
28 # If cross compiling, assume the test would fail and use the included |
8113
0bd33ddd6bf3
* m4/regex.m4 (gl_REGEX): Check for glibc bug #3957.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8073
diff
changeset
|
29 # regex.c. |
17355
9855b352e525
regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents:
17310
diff
changeset
|
30 AC_CHECK_DECLS_ONCE([alarm]) |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
31 AC_CACHE_CHECK([for working re_compile_pattern], |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
32 [gl_cv_func_re_compile_pattern_working], |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
33 [AC_RUN_IFELSE( |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
34 [AC_LANG_PROGRAM( |
17310
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
35 [[#include <regex.h> |
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
36 |
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
37 #include <locale.h> |
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
38 #include <limits.h> |
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
39 #include <string.h> |
17355
9855b352e525
regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents:
17310
diff
changeset
|
40 #if HAVE_DECL_ALARM |
17310
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
41 # include <unistd.h> |
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
42 # include <signal.h> |
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
43 #endif |
a9f418d6d676
regex-tests, regex: fix bug: memset undeclared
Paul Eggert <eggert@cs.ucla.edu>
parents:
17306
diff
changeset
|
44 ]], |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
45 [[int result = 0; |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
46 static struct re_pattern_buffer regex; |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
47 unsigned char folded_chars[UCHAR_MAX + 1]; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
48 int i; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
49 const char *s; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
50 struct re_registers regs; |
7344
72030a247f35
* lib/regex_internal.c (re_string_reconstruct): Handle
Paul Eggert <eggert@cs.ucla.edu>
parents:
7172
diff
changeset
|
51 |
17355
9855b352e525
regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents:
17310
diff
changeset
|
52 #if HAVE_DECL_ALARM |
17305
19e841152153
regex: avoid infinite configure test
Eric Blake <eblake@redhat.com>
parents:
17302
diff
changeset
|
53 /* Some builds of glibc go into an infinite loop on this test. */ |
19e841152153
regex: avoid infinite configure test
Eric Blake <eblake@redhat.com>
parents:
17302
diff
changeset
|
54 signal (SIGALRM, SIG_DFL); |
19e841152153
regex: avoid infinite configure test
Eric Blake <eblake@redhat.com>
parents:
17302
diff
changeset
|
55 alarm (2); |
19e841152153
regex: avoid infinite configure test
Eric Blake <eblake@redhat.com>
parents:
17302
diff
changeset
|
56 #endif |
14186
cd4635d4dbe6
assume <ctype.h>, ..., <time.h> exist
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
57 if (setlocale (LC_ALL, "en_US.UTF-8")) |
cd4635d4dbe6
assume <ctype.h>, ..., <time.h> exist
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
58 { |
17302
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
59 { |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
60 /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
61 This test needs valgrind to catch the bug on Debian |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
62 GNU/Linux 3.1 x86, but it might catch the bug better |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
63 on other platforms and it shouldn't hurt to try the |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
64 test here. */ |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
65 static char const pat[] = "insert into"; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
66 static char const data[] = |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
67 "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK"; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
68 re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
69 | RE_ICASE); |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
70 memset (®ex, 0, sizeof regex); |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
71 s = re_compile_pattern (pat, sizeof pat - 1, ®ex); |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
72 if (s) |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
73 result |= 1; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
74 else if (re_search (®ex, data, sizeof data - 1, |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
75 0, sizeof data - 1, ®s) |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
76 != -1) |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
77 result |= 1; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
78 } |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
79 |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
80 { |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
81 /* This test is from glibc bug 15078. |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
82 The test case is from Andreas Schwab in |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
83 <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>. |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
84 */ |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
85 static char const pat[] = "[^x]x"; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
86 static char const data[] = |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
87 "\xe1\x80\x80\xe1\x80\xbb\xe1\x80\xbd\xe1\x80\x94\xe1\x80" |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
88 "\xba\xe1\x80\xaf\xe1\x80\x95\xe1\x80\xbax"; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
89 re_set_syntax (0); |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
90 memset (®ex, 0, sizeof regex); |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
91 s = re_compile_pattern (pat, sizeof pat - 1, ®ex); |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
92 if (s) |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
93 result |= 1; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
94 else if (re_search (®ex, data, sizeof data - 1, |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
95 0, sizeof data - 1, 0) |
17306
4894f045fd01
regex: fix off-by-one error in configure test
Paul Eggert <eggert@cs.ucla.edu>
parents:
17305
diff
changeset
|
96 != 21) |
17302
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
97 result |= 1; |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
98 } |
0e5a583a2a8d
regex: test for buffer overrun
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
99 |
14186
cd4635d4dbe6
assume <ctype.h>, ..., <time.h> exist
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
100 if (! setlocale (LC_ALL, "C")) |
cd4635d4dbe6
assume <ctype.h>, ..., <time.h> exist
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
101 return 1; |
cd4635d4dbe6
assume <ctype.h>, ..., <time.h> exist
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
102 } |
7344
72030a247f35
* lib/regex_internal.c (re_string_reconstruct): Handle
Paul Eggert <eggert@cs.ucla.edu>
parents:
7172
diff
changeset
|
103 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
104 /* This test is from glibc bug 3957, reported by Andrew Mackey. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
105 re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
106 memset (®ex, 0, sizeof regex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
107 s = re_compile_pattern ("a[^x]b", 6, ®ex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
108 if (s) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
109 result |= 2; |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
110 /* This should fail, but succeeds for glibc-2.5. */ |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
111 else if (re_search (®ex, "a\nb", 3, 0, 3, ®s) != -1) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
112 result |= 2; |
8113
0bd33ddd6bf3
* m4/regex.m4 (gl_REGEX): Check for glibc bug #3957.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8073
diff
changeset
|
113 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
114 /* This regular expression is from Spencer ere test number 75 |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
115 in grep-2.3. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
116 re_set_syntax (RE_SYNTAX_POSIX_EGREP); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
117 memset (®ex, 0, sizeof regex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
118 for (i = 0; i <= UCHAR_MAX; i++) |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
119 folded_chars[i] = i; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
120 regex.translate = folded_chars; |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
121 s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, ®ex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
122 /* This should fail with _Invalid character class name_ error. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
123 if (!s) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
124 result |= 4; |
2320
0439e930b0bf
Make sure re_compile_pattern accepts patterns like `{1'.
Jim Meyering <jim@meyering.net>
parents:
2253
diff
changeset
|
125 |
13013
91cd971b278e
regex.m4: correct the reversed range endpoint ([b-a]) test
Jim Meyering <meyering@redhat.com>
parents:
12846
diff
changeset
|
126 /* Ensure that [b-a] is diagnosed as invalid, when |
91cd971b278e
regex.m4: correct the reversed range endpoint ([b-a]) test
Jim Meyering <meyering@redhat.com>
parents:
12846
diff
changeset
|
127 using RE_NO_EMPTY_RANGES. */ |
91cd971b278e
regex.m4: correct the reversed range endpoint ([b-a]) test
Jim Meyering <meyering@redhat.com>
parents:
12846
diff
changeset
|
128 re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES); |
12846
47a829b330dc
ensure that the regexp [b-a] is diagnosed as invalid
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
129 memset (®ex, 0, sizeof regex); |
47a829b330dc
ensure that the regexp [b-a] is diagnosed as invalid
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
130 s = re_compile_pattern ("a[b-a]", 6, ®ex); |
47a829b330dc
ensure that the regexp [b-a] is diagnosed as invalid
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
131 if (s == 0) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
132 result |= 8; |
12846
47a829b330dc
ensure that the regexp [b-a] is diagnosed as invalid
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
133 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
134 /* This should succeed, but does not for glibc-2.1.3. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
135 memset (®ex, 0, sizeof regex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
136 s = re_compile_pattern ("{1", 2, ®ex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
137 if (s) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
138 result |= 8; |
3159
1bc481dd8d15
(jm_INCLUDED_REGEX): Add a test for the latest bug.
Jim Meyering <jim@meyering.net>
parents:
2958
diff
changeset
|
139 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
140 /* The following example is derived from a problem report |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
141 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
142 memset (®ex, 0, sizeof regex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
143 s = re_compile_pattern ("[an\371]*n", 7, ®ex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
144 if (s) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
145 result |= 8; |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
146 /* This should match, but does not for glibc-2.2.1. */ |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
147 else if (re_match (®ex, "an", 2, 0, ®s) != 2) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
148 result |= 8; |
3159
1bc481dd8d15
(jm_INCLUDED_REGEX): Add a test for the latest bug.
Jim Meyering <jim@meyering.net>
parents:
2958
diff
changeset
|
149 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
150 memset (®ex, 0, sizeof regex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
151 s = re_compile_pattern ("x", 1, ®ex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
152 if (s) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
153 result |= 8; |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
154 /* glibc-2.2.93 does not work with a negative RANGE argument. */ |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
155 else if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
156 result |= 8; |
4231
dc7c057d3930
(jm_INCLUDED_REGEX): Detect broken re_search in e.g. glibc-2.2.93.
Jim Meyering <jim@meyering.net>
parents:
4189
diff
changeset
|
157 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
158 /* The version of regex.c in older versions of gnulib |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
159 ignored RE_ICASE. Detect that problem too. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
160 re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
161 memset (®ex, 0, sizeof regex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
162 s = re_compile_pattern ("x", 1, ®ex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
163 if (s) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
164 result |= 16; |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
165 else if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
166 result |= 16; |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
167 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
168 /* Catch a bug reported by Vin Shelton in |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
169 http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
170 */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
171 re_set_syntax (RE_SYNTAX_POSIX_BASIC |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
172 & ~RE_CONTEXT_INVALID_DUP |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
173 & ~RE_NO_EMPTY_RANGES); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
174 memset (®ex, 0, sizeof regex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
175 s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
176 if (s) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
177 result |= 32; |
8975
b70a0b36c501
* m4/regex.m4 (gl_REGEX): Catch a bug with [[:alnum:]_-] reported by
Paul Eggert <eggert@cs.ucla.edu>
parents:
8921
diff
changeset
|
178 |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
179 /* REG_STARTEND was added to glibc on 2004-01-15. |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
180 Reject older versions. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
181 if (! REG_STARTEND) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
182 result |= 64; |
1698
4059f896cb68
Add a run-time Test for proper operation of re_compile_pattern.
Jim Meyering <jim@meyering.net>
parents:
1623
diff
changeset
|
183 |
13672
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
184 #if 0 |
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
185 /* It would be nice to reject hosts whose regoff_t values are too |
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
186 narrow (including glibc on hosts with 64-bit ptrdiff_t and |
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
187 32-bit int), but we should wait until glibc implements this |
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
188 feature. Otherwise, support for equivalence classes and |
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
189 multibyte collation symbols would always be broken except |
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
190 when compiling --without-included-regex. */ |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
191 if (sizeof (regoff_t) < sizeof (ptrdiff_t) |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
11409
diff
changeset
|
192 || sizeof (regoff_t) < sizeof (ssize_t)) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
193 result |= 64; |
13672
e07237e12926
regex: Pass the system regex if its only problem is 32-bit regoff_t.
Paolo Bonzini <pbonzini@redhat.com>
parents:
13013
diff
changeset
|
194 #endif |
6184
f1728546eca4
On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6121
diff
changeset
|
195 |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
196 return result; |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13672
diff
changeset
|
197 ]])], |
6720
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
198 [gl_cv_func_re_compile_pattern_working=yes], |
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
199 [gl_cv_func_re_compile_pattern_working=no], |
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
200 dnl When crosscompiling, assume it is not working. |
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
201 [gl_cv_func_re_compile_pattern_working=no])]) |
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
202 case $gl_cv_func_re_compile_pattern_working in #( |
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
203 yes) ac_use_included_regex=no;; #( |
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
204 no) ac_use_included_regex=yes;; |
af0d674cde4f
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
Paul Eggert <eggert@cs.ucla.edu>
parents:
6719
diff
changeset
|
205 esac |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
206 ;; |
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
207 *) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex]) |
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
208 ;; |
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
209 esac |
6083
7f315cf586d6
* regex.m4 (gl_INCLUDED_REGEX): Remove; no longer used.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6080
diff
changeset
|
210 |
6121
61e0b7c597d5
* m4/regex.m4: Add AC_PREREQ(2.50).
Paul Eggert <eggert@cs.ucla.edu>
parents:
6101
diff
changeset
|
211 if test $ac_use_included_regex = yes; then |
16650
8ad751eaba31
regex: allow inclusion of <regex.h> before <limits.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
212 AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1], |
8ad751eaba31
regex: allow inclusion of <regex.h> before <limits.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
213 [Define if you want <regex.h> to include <limits.h>, so that it |
8ad751eaba31
regex: allow inclusion of <regex.h> before <limits.h>
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
214 consistently overrides <limits.h>'s RE_DUP_MAX.]) |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10952
diff
changeset
|
215 AC_DEFINE([_REGEX_LARGE_OFFSETS], [1], |
6707
d0a48e08c98d
* lib/regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
Paul Eggert <eggert@cs.ucla.edu>
parents:
6461
diff
changeset
|
216 [Define if you want regoff_t to be at least as wide POSIX requires.]) |
6288
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
217 AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
218 [Define to rpl_re_syntax_options if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
219 AC_DEFINE([re_set_syntax], [rpl_re_set_syntax], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
220 [Define to rpl_re_set_syntax if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
221 AC_DEFINE([re_compile_pattern], [rpl_re_compile_pattern], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
222 [Define to rpl_re_compile_pattern if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
223 AC_DEFINE([re_compile_fastmap], [rpl_re_compile_fastmap], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
224 [Define to rpl_re_compile_fastmap if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
225 AC_DEFINE([re_search], [rpl_re_search], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
226 [Define to rpl_re_search if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
227 AC_DEFINE([re_search_2], [rpl_re_search_2], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
228 [Define to rpl_re_search_2 if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
229 AC_DEFINE([re_match], [rpl_re_match], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
230 [Define to rpl_re_match if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
231 AC_DEFINE([re_match_2], [rpl_re_match_2], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
232 [Define to rpl_re_match_2 if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
233 AC_DEFINE([re_set_registers], [rpl_re_set_registers], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
234 [Define to rpl_re_set_registers if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
235 AC_DEFINE([re_comp], [rpl_re_comp], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
236 [Define to rpl_re_comp if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
237 AC_DEFINE([re_exec], [rpl_re_exec], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
238 [Define to rpl_re_exec if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
239 AC_DEFINE([regcomp], [rpl_regcomp], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
240 [Define to rpl_regcomp if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
241 AC_DEFINE([regexec], [rpl_regexec], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
242 [Define to rpl_regexec if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
243 AC_DEFINE([regerror], [rpl_regerror], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
244 [Define to rpl_regerror if the replacement should be used.]) |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
245 AC_DEFINE([regfree], [rpl_regfree], |
a6b3996fab54
(gl_REGEX): If replacing, define regcomp to rpl_regcomp,
Paul Eggert <eggert@cs.ucla.edu>
parents:
6184
diff
changeset
|
246 [Define to rpl_regfree if the replacement should be used.]) |
6083
7f315cf586d6
* regex.m4 (gl_INCLUDED_REGEX): Remove; no longer used.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6080
diff
changeset
|
247 fi |
7f315cf586d6
* regex.m4 (gl_INCLUDED_REGEX): Remove; no longer used.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6080
diff
changeset
|
248 ]) |
4108
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3339
diff
changeset
|
249 |
5968
541fed6ae301
* modules/regex (Files): Add lib/regex_internal.c,
Paul Eggert <eggert@cs.ucla.edu>
parents:
5611
diff
changeset
|
250 # Prerequisites of lib/regex.c and lib/regex_internal.c. |
5016
7141ea4946af
Change jm_ to gl_ in AC_DEFINE'd names. Update all uses.
Jim Meyering <jim@meyering.net>
parents:
4673
diff
changeset
|
251 AC_DEFUN([gl_PREREQ_REGEX], |
4108
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3339
diff
changeset
|
252 [ |
9209
5a0294ce5372
Track CVS Autoconf on AC_USE_SYSTEM_EXTENSIONS.
Eric Blake <ebb9@byu.net>
parents:
8975
diff
changeset
|
253 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
12542
ea823743f290
Use AC_C_INLINE where necessary.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
254 AC_REQUIRE([AC_C_INLINE]) |
7099 | 255 AC_REQUIRE([AC_C_RESTRICT]) |
9809
b17288dc1d83
Fix regex compilation error on HP-UX 11.
Bruno Haible <bruno@clisp.org>
parents:
9209
diff
changeset
|
256 AC_REQUIRE([AC_TYPE_MBSTATE_T]) |
17235
e101c2620c25
regex: port to hosts where malloc (0) == NULL
Paul Eggert <eggert@cs.ucla.edu>
parents:
16650
diff
changeset
|
257 AC_REQUIRE([gl_EEMALLOC]) |
9910
048d2d32a55c
Check for libintl.h. Needed for HAVE_LIBINTL_H.
Bruno Haible <bruno@clisp.org>
parents:
9878
diff
changeset
|
258 AC_CHECK_HEADERS([libintl.h]) |
10952
43dfcdcad689
update regex to use the emulated mb*/wc* functions
Paolo Bonzini <bonzini@gnu.org>
parents:
9921
diff
changeset
|
259 AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll]) |
15618
9d4b273deacd
Properly quote AC_CHECK_DECLS' 4th argument.
Bruno Haible <bruno@clisp.org>
parents:
15078
diff
changeset
|
260 AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]]) |
4108
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3339
diff
changeset
|
261 ]) |