1
1
# Configure a GNU-like replacement for <string.h>.
3
# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
3
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
4
4
# This file is free software; the Free Software Foundation
5
5
# gives unlimited permission to copy and/or distribute it,
6
6
# with or without modifications, as long as this notice is preserved.
10
10
# Written by Paul Eggert.
21
21
AC_REQUIRE([AC_C_RESTRICT])
22
22
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
23
23
gl_CHECK_NEXT_HEADERS([string.h])
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>
30
[memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
31
strncat strndup strnlen strpbrk strsep strcasestr strtok_r strsignal
26
35
AC_DEFUN([gl_STRING_MODULE_INDICATOR],
28
37
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
29
38
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
30
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
39
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
40
dnl Define it also as a C macro, for the benefit of the unit tests.
41
gl_MODULE_INDICATOR_FOR_TESTS([$1])
33
44
AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
64
76
GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
65
77
GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
66
78
GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
67
GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
79
GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
80
HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
68
81
dnl Assume proper GNU behavior unless another module says otherwise.
69
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
70
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
71
HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
72
HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
73
HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
74
HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
75
HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
76
HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
77
HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
78
HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
79
HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
80
HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
81
HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
82
HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
83
HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR])
84
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
85
HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
86
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
87
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
88
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
89
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
90
REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
91
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
92
REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
93
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
94
REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
95
UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
82
HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
83
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
84
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
85
HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
86
HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
87
HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
88
HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
89
HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
90
HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
91
HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
92
HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
93
HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
94
HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
95
HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
96
HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
97
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
98
HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
99
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
100
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
101
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
102
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
103
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
104
REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
105
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
106
REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
107
REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
108
REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
109
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
110
REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
111
UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])