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