stdlib_h.m4 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # stdlib_h.m4 serial 42
  2. dnl Copyright (C) 2007-2014 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. AC_DEFUN([gl_STDLIB_H],
  7. [
  8. AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
  9. gl_NEXT_HEADERS([stdlib.h])
  10. dnl Check for declarations of anything we want to poison if the
  11. dnl corresponding gnulib module is not in use, and which is not
  12. dnl guaranteed by C89.
  13. gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
  14. #if HAVE_SYS_LOADAVG_H
  15. # include <sys/loadavg.h>
  16. #endif
  17. #if HAVE_RANDOM_H
  18. # include <random.h>
  19. #endif
  20. ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
  21. initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
  22. posix_openpt ptsname ptsname_r random random_r realpath rpmatch
  23. secure_getenv setenv setstate setstate_r srandom srandom_r
  24. strtod strtoll strtoull unlockpt unsetenv])
  25. ])
  26. AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
  27. [
  28. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  29. AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
  30. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  31. dnl Define it also as a C macro, for the benefit of the unit tests.
  32. gl_MODULE_INDICATOR_FOR_TESTS([$1])
  33. ])
  34. AC_DEFUN([gl_STDLIB_H_DEFAULTS],
  35. [
  36. GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT])
  37. GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL])
  38. GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX])
  39. GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
  40. GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG])
  41. GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT])
  42. GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT])
  43. GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX])
  44. GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC])
  45. GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
  46. GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP])
  47. GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS])
  48. GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
  49. GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS])
  50. GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT])
  51. GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME])
  52. GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R])
  53. GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
  54. GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM])
  55. GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R])
  56. GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
  57. GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH])
  58. GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
  59. GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
  60. GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
  61. GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
  62. GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL])
  63. GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL])
  64. GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX])
  65. GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT])
  66. GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
  67. GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB])
  68. dnl Assume proper GNU behavior unless another module says otherwise.
  69. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT])
  70. HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
  71. HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
  72. HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
  73. HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
  74. HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
  75. HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
  76. HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
  77. HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
  78. HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
  79. HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
  80. HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
  81. HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
  82. HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R])
  83. HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM])
  84. HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
  85. HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
  86. HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
  87. HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
  88. HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
  89. HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
  90. HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
  91. HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
  92. HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
  93. HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
  94. HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
  95. HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
  96. HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
  97. HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
  98. REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
  99. REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
  100. REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
  101. REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
  102. REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
  103. REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
  104. REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
  105. REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
  106. REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
  107. REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC])
  108. REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
  109. REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
  110. REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
  111. REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
  112. REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
  113. ])