strings_h.m4 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Configure a replacement for <strings.h>.
  2. # serial 6
  3. # Copyright (C) 2007, 2009-2017 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. AC_DEFUN([gl_HEADER_STRINGS_H],
  8. [
  9. dnl Use AC_REQUIRE here, so that the default behavior below is expanded
  10. dnl once only, before all statements that occur in other macros.
  11. AC_REQUIRE([gl_HEADER_STRINGS_H_BODY])
  12. ])
  13. AC_DEFUN([gl_HEADER_STRINGS_H_BODY],
  14. [
  15. AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
  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. dnl Check for declarations of anything we want to poison if the
  24. dnl corresponding gnulib module is not in use.
  25. gl_WARN_ON_USE_PREPARE([[
  26. /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
  27. <strings.h>. */
  28. #include <sys/types.h>
  29. #include <strings.h>
  30. ]], [ffs strcasecmp strncasecmp])
  31. ])
  32. AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
  33. [
  34. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  35. AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
  36. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  37. ])
  38. AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS],
  39. [
  40. GNULIB_FFS=0; AC_SUBST([GNULIB_FFS])
  41. dnl Assume proper GNU behavior unless another module says otherwise.
  42. HAVE_FFS=1; AC_SUBST([HAVE_FFS])
  43. HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP])
  44. HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP])
  45. ])