Debian Codegraph @

gnulib/m4/strings_h.m4

raw
1 # strings_h.m4
2 # serial 9
3 dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 # Configure a replacement for <strings.h>.
9
10 AC_DEFUN_ONCE([gl_STRINGS_H],
11 [
12 dnl Ensure to expand the default settings once only, before all statements
13 dnl that occur in other macros.
14 AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
15
16 gl_CHECK_NEXT_HEADERS([strings.h])
17 if test $ac_cv_header_strings_h = yes; then
18 HAVE_STRINGS_H=1
19 else
20 HAVE_STRINGS_H=0
21 fi
22 AC_SUBST([HAVE_STRINGS_H])
23
24 dnl Check for declarations of anything we want to poison if the
25 dnl corresponding gnulib module is not in use.
26 gl_WARN_ON_USE_PREPARE([[
27 /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
28 <strings.h>. */
29 #include <sys/types.h>
30 #include <strings.h>
31 ]], [ffs strcasecmp strncasecmp])
32 ])
33
34 # gl_STRINGS_MODULE_INDICATOR([modulename])
35 # sets the shell variable that indicates the presence of the given module
36 # to a C preprocessor expression that will evaluate to 1.
37 # This macro invocation must not occur in macros that are AC_REQUIREd.
38 AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
39 [
40 dnl Ensure to expand the default settings once only.
41 gl_STRINGS_H_REQUIRE_DEFAULTS
42 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
43 ])
44
45 # Initializes the default values for AC_SUBSTed shell variables.
46 # This macro must not be AC_REQUIREd. It must only be invoked, and only
47 # outside of macros or in macros that are not AC_REQUIREd.
48 AC_DEFUN([gl_STRINGS_H_REQUIRE_DEFAULTS],
49 [
50 m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS], [
51 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFS])
52 ])
53 m4_require(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS])
54 AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
55 ])
56
57 AC_DEFUN([gl_STRINGS_H_DEFAULTS],
58 [
59 dnl Assume proper GNU behavior unless another module says otherwise.
60 HAVE_FFS=1; AC_SUBST([HAVE_FFS])
61 HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP])
62 HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP])
63 ])