* m4/string_h.m4 (gl_STRING_MODULE_INDICATOR): Correct m4 usage
[gnulib.git] / m4 / string_h.m4
1 # Configure a GNU-like replacement for <string.h>.
2
3 # Copyright (C) 2007 Free Software Foundation, Inc.
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
8 # Written by Paul Eggert.
9
10 AC_DEFUN([gl_HEADER_STRING_H],
11 [
12   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
13   dnl once only, before all statements that occur in other macros.
14   AC_REQUIRE([gl_HEADER_STRING_H_BODY])
15 ])
16
17 AC_DEFUN([gl_HEADER_STRING_H_BODY],
18 [
19   AC_REQUIRE([AC_C_RESTRICT])
20   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
21   AC_REQUIRE([gl_STRING_MODULE_INDICATOR_DEFAULTS])
22   gl_ABSOLUTE_HEADER([string.h])
23   ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\"
24   AC_SUBST([ABSOLUTE_STRING_H])
25 ])
26
27 AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
28 [
29   dnl Assume proper GNU behavior unless another module says otherwise.
30   HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
31   HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
32   HAVE_DECL_MEMRCHR=1;          AC_SUBST([HAVE_DECL_MEMRCHR])
33   HAVE_STPCPY=1;                AC_SUBST([HAVE_STPCPY])
34   HAVE_STPNCPY=1;               AC_SUBST([HAVE_STPNCPY])
35   HAVE_DECL_STRNCASECMP=1;      AC_SUBST([HAVE_DECL_STRNCASECMP])
36   HAVE_STRCHRNUL=1;             AC_SUBST([HAVE_STRCHRNUL])
37   HAVE_DECL_STRDUP=1;           AC_SUBST([HAVE_DECL_STRDUP])
38   HAVE_STRNDUP=1;               AC_SUBST([HAVE_STRNDUP])
39   HAVE_DECL_STRNDUP=1;          AC_SUBST([HAVE_DECL_STRNDUP])
40   HAVE_DECL_STRNLEN=1;          AC_SUBST([HAVE_DECL_STRNLEN])
41   HAVE_STRPBRK=1;               AC_SUBST([HAVE_STRPBRK])
42   HAVE_STRSEP=1;                AC_SUBST([HAVE_STRSEP])
43   HAVE_DECL_STRTOK_R=1;         AC_SUBST([HAVE_DECL_STRTOK_R])
44   REPLACE_STRCASECMP=0;         AC_SUBST([REPLACE_STRCASECMP])
45   REPLACE_STRSTR=0;             AC_SUBST([REPLACE_STRSTR])
46   REPLACE_STRCASESTR=0;         AC_SUBST([REPLACE_STRCASESTR])
47 ])
48
49 AC_DEFUN([gl_STRING_MODULE_INDICATOR],
50 [
51   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
52   AC_REQUIRE([gl_STRING_MODULE_INDICATOR_DEFAULTS])
53   GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
54 ])
55
56 AC_DEFUN([gl_STRING_MODULE_INDICATOR_DEFAULTS],
57 [
58   GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
59   GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
60   GNULIB_MEMRCHR=0;     AC_SUBST([GNULIB_MEMRCHR])
61   GNULIB_STPCPY=0;      AC_SUBST([GNULIB_STPCPY])
62   GNULIB_STPNCPY=0;     AC_SUBST([GNULIB_STPNCPY])
63   GNULIB_STRCASE=0;     AC_SUBST([GNULIB_STRCASE])
64   GNULIB_STRCHRNUL=0;   AC_SUBST([GNULIB_STRCHRNUL])
65   GNULIB_STRDUP=0;      AC_SUBST([GNULIB_STRDUP])
66   GNULIB_STRNDUP=0;     AC_SUBST([GNULIB_STRNDUP])
67   GNULIB_STRNLEN=0;     AC_SUBST([GNULIB_STRNLEN])
68   GNULIB_STRPBRK=0;     AC_SUBST([GNULIB_STRPBRK])
69   GNULIB_STRSEP=0;      AC_SUBST([GNULIB_STRSEP])
70   GNULIB_STRSTR=0;      AC_SUBST([GNULIB_STRSTR])
71   GNULIB_STRCASESTR=0;  AC_SUBST([GNULIB_STRCASESTR])
72   GNULIB_STRTOK_R=0;    AC_SUBST([GNULIB_STRTOK_R])
73 ])