Merge remote-tracking branch 'origin/stable-2.0'
[bpt/guile.git] / m4 / string_h.m4
CommitLineData
24d56127
LC
1# Configure a GNU-like replacement for <string.h>.
2
5e69ceb7 3# Copyright (C) 2007-2014 Free Software Foundation, Inc.
24d56127
LC
4# This file is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved.
7
35428fb6 8# serial 21
24d56127
LC
9
10# Written by Paul Eggert.
11
12AC_DEFUN([gl_HEADER_STRING_H],
13[
14 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
15 dnl once only, before all statements that occur in other macros.
16 AC_REQUIRE([gl_HEADER_STRING_H_BODY])
17])
18
19AC_DEFUN([gl_HEADER_STRING_H_BODY],
20[
21 AC_REQUIRE([AC_C_RESTRICT])
22 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
49114fd4 23 gl_NEXT_HEADERS([string.h])
61cd9dc9
LC
24
25 dnl Check for declarations of anything we want to poison if the
26 dnl corresponding gnulib module is not in use, and which is not
27 dnl guaranteed by C89.
28 gl_WARN_ON_USE_PREPARE([[#include <string.h>
a927b6c1 29 ]],
35428fb6
LC
30 [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
31 strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
32 strerror_r strsignal strverscmp])
24d56127
LC
33])
34
35AC_DEFUN([gl_STRING_MODULE_INDICATOR],
36[
37 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
38 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
a927b6c1 39 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
f4c79b3c 40 dnl Define it also as a C macro, for the benefit of the unit tests.
a927b6c1 41 gl_MODULE_INDICATOR_FOR_TESTS([$1])
24d56127
LC
42])
43
44AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
45[
35428fb6
LC
46 GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL])
47 GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL])
ffca4c22 48 GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
24d56127
LC
49 GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
50 GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
51 GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
52 GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR])
53 GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY])
54 GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
55 GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
56 GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP])
a927b6c1 57 GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT])
24d56127
LC
58 GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP])
59 GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN])
60 GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK])
61 GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP])
62 GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR])
63 GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR])
64 GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R])
65 GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN])
66 GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN])
67 GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR])
68 GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR])
69 GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR])
70 GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP])
71 GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
72 GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
73 GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR])
74 GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN])
75 GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK])
76 GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN])
77 GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP])
78 GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
79 GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
0f00f2c3 80 GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R])
24d56127 81 GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
61cd9dc9
LC
82 GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
83 HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
24d56127 84 dnl Assume proper GNU behavior unless another module says otherwise.
35428fb6
LC
85 HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
86 HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
a927b6c1 87 HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
1cd4fffc
LC
88 HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
89 HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
90 HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
91 HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
92 HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
93 HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
94 HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
95 HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
96 HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
97 HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
98 HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
99 HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
100 HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
101 HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
0f00f2c3 102 HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R])
1cd4fffc
LC
103 HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
104 HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
105 REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
106 REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
a927b6c1 107 REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
1cd4fffc
LC
108 REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
109 REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
110 REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
dd7d0148 111 REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
1cd4fffc 112 REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
0f00f2c3 113 REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
a927b6c1 114 REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
1cd4fffc 115 REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
a927b6c1 116 REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
1cd4fffc
LC
117 REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
118 REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
119 UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
24d56127 120])