2N/A# Configure a GNU-like replacement for <string.h>.
2N/A
2N/A# Copyright (C) 2007-2010 Free Software Foundation, Inc.
2N/A# This file is free software; the Free Software Foundation
2N/A# gives unlimited permission to copy and/or distribute it,
2N/A# with or without modifications, as long as this notice is preserved.
2N/A
2N/A# serial 17
2N/A
2N/A# Written by Paul Eggert.
2N/A
2N/AAC_DEFUN([gl_HEADER_STRING_H],
2N/A[
2N/A dnl Use AC_REQUIRE here, so that the default behavior below is expanded
2N/A dnl once only, before all statements that occur in other macros.
2N/A AC_REQUIRE([gl_HEADER_STRING_H_BODY])
2N/A])
2N/A
2N/AAC_DEFUN([gl_HEADER_STRING_H_BODY],
2N/A[
2N/A AC_REQUIRE([AC_C_RESTRICT])
2N/A AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
2N/A gl_CHECK_NEXT_HEADERS([string.h])
2N/A
2N/A dnl Check for declarations of anything we want to poison if the
2N/A dnl corresponding gnulib module is not in use, and which is not
2N/A dnl guaranteed by C89.
2N/A gl_WARN_ON_USE_PREPARE([[#include <string.h>
2N/A ]],
2N/A [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
2N/A strncat strndup strnlen strpbrk strsep strcasestr strtok_r strsignal
2N/A strverscmp])
2N/A])
2N/A
2N/AAC_DEFUN([gl_STRING_MODULE_INDICATOR],
2N/A[
2N/A dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
2N/A AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
2N/A gl_MODULE_INDICATOR_SET_VARIABLE([$1])
2N/A dnl Define it also as a C macro, for the benefit of the unit tests.
2N/A gl_MODULE_INDICATOR_FOR_TESTS([$1])
2N/A])
2N/A
2N/AAC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
2N/A[
2N/A GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
2N/A GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
2N/A GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
2N/A GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
2N/A GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR])
2N/A GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY])
2N/A GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
2N/A GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
2N/A GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP])
2N/A GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT])
2N/A GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP])
2N/A GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN])
2N/A GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK])
2N/A GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP])
2N/A GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR])
2N/A GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR])
2N/A GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R])
2N/A GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN])
2N/A GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN])
2N/A GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR])
2N/A GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR])
2N/A GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR])
2N/A GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP])
2N/A GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
2N/A GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
2N/A GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR])
2N/A GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN])
2N/A GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK])
2N/A GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN])
2N/A GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP])
2N/A GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
2N/A GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
2N/A GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
2N/A GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
2N/A HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
2N/A dnl Assume proper GNU behavior unless another module says otherwise.
2N/A HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
2N/A HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
2N/A HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
2N/A HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
2N/A HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
2N/A HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
2N/A HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
2N/A HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
2N/A HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
2N/A HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
2N/A HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
2N/A HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
2N/A HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
2N/A HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
2N/A HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
2N/A HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
2N/A HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
2N/A REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
2N/A REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
2N/A REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
2N/A REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
2N/A REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
2N/A REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
2N/A REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
2N/A REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
2N/A REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
2N/A REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
2N/A REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
2N/A REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
2N/A UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
2N/A])