Blame m4/strings_h.m4

Packit 8f70b4
# Configure a replacement for <strings.h>.
Packit 8f70b4
# serial 6
Packit 8f70b4
Packit 8f70b4
# Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
Packit 8f70b4
# This file is free software; the Free Software Foundation
Packit 8f70b4
# gives unlimited permission to copy and/or distribute it,
Packit 8f70b4
# with or without modifications, as long as this notice is preserved.
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_HEADER_STRINGS_H],
Packit 8f70b4
[
Packit 8f70b4
  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
Packit 8f70b4
  dnl once only, before all statements that occur in other macros.
Packit 8f70b4
  AC_REQUIRE([gl_HEADER_STRINGS_H_BODY])
Packit 8f70b4
])
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_HEADER_STRINGS_H_BODY],
Packit 8f70b4
[
Packit 8f70b4
  AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
Packit 8f70b4
Packit 8f70b4
  gl_CHECK_NEXT_HEADERS([strings.h])
Packit 8f70b4
  if test $ac_cv_header_strings_h = yes; then
Packit 8f70b4
    HAVE_STRINGS_H=1
Packit 8f70b4
  else
Packit 8f70b4
    HAVE_STRINGS_H=0
Packit 8f70b4
  fi
Packit 8f70b4
  AC_SUBST([HAVE_STRINGS_H])
Packit 8f70b4
Packit 8f70b4
  dnl Check for declarations of anything we want to poison if the
Packit 8f70b4
  dnl corresponding gnulib module is not in use.
Packit 8f70b4
  gl_WARN_ON_USE_PREPARE([[
Packit 8f70b4
    /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
Packit 8f70b4
       <strings.h>.  */
Packit 8f70b4
    #include <sys/types.h>
Packit 8f70b4
    #include <strings.h>
Packit 8f70b4
    ]], [ffs strcasecmp strncasecmp])
Packit 8f70b4
])
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
Packit 8f70b4
[
Packit 8f70b4
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit 8f70b4
  AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
Packit 8f70b4
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit 8f70b4
])
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS],
Packit 8f70b4
[
Packit 8f70b4
  GNULIB_FFS=0;            AC_SUBST([GNULIB_FFS])
Packit 8f70b4
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit 8f70b4
  HAVE_FFS=1;              AC_SUBST([HAVE_FFS])
Packit 8f70b4
  HAVE_STRCASECMP=1;       AC_SUBST([HAVE_STRCASECMP])
Packit 8f70b4
  HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP])
Packit 8f70b4
])