1 | /* Handle POSIX compilation environments that may or may not be present. |
2 | Copyright (C) 2012-2024 Free Software Foundation, Inc. |
3 | This file is part of the GNU C Library. |
4 | |
5 | The GNU C Library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public |
7 | License as published by the Free Software Foundation; either |
8 | version 2.1 of the License, or (at your option) any later version. |
9 | |
10 | The GNU C Library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Lesser General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Lesser General Public |
16 | License along with the GNU C Library; if not, see |
17 | <https://www.gnu.org/licenses/>. */ |
18 | |
19 | /* Before including this file, the including file must have included |
20 | <bits/environments.h> (generally via <unistd.h>) and must have |
21 | defined the following macros, exactly one of which will be called |
22 | for each POSIX environment: |
23 | |
24 | KNOWN_PRESENT_ENVIRONMENT, for POSIX environments that are known to |
25 | be supported in this libc. |
26 | |
27 | KNOWN_ABSENT_ENVIRONMENT, for POSIX environments that are known not |
28 | to be supported on this system. |
29 | |
30 | UNKNOWN_ENVIRONMENT, for POSIX environments not supported in this |
31 | libc but possibly supported by another libc on the same system, |
32 | that can be selected using the same compiler but different |
33 | compilation options. |
34 | |
35 | Each macro has arguments (SC_PREFIX, ENV_PREFIX, SUFFIX). The |
36 | corresponding argument to sysconf is _SC_##SC_PREFIX##_##SUFFIX. |
37 | The environment name, as used with getconf, is |
38 | ENV_PREFIX##_##SUFFIX, and the corresponding macro is the same with |
39 | a leading "_". |
40 | |
41 | In addition, the macros START_ENV_GROUP and END_ENV_GROUP must be |
42 | defined. These are called with arguments V5, V6, V7 before and |
43 | after the relevant groups of environments. */ |
44 | |
45 | #define NEED_SPEC_ARRAY 0 |
46 | #include <posix-conf-vars.h> |
47 | |
48 | START_ENV_GROUP (V7) |
49 | |
50 | #if CONF_IS_DEFINED_SET (_POSIX_V7_ILP32_OFF32) |
51 | KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32) |
52 | #elif CONF_IS_DEFINED (_POSIX_V7_ILP32_OFF32) |
53 | KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32) |
54 | #else |
55 | UNKNOWN_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32) |
56 | #endif |
57 | |
58 | #if CONF_IS_DEFINED_SET (_POSIX_V7_ILP32_OFFBIG) |
59 | KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG) |
60 | #elif CONF_IS_DEFINED (_POSIX_V7_ILP32_OFFBIG) |
61 | KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG) |
62 | #else |
63 | UNKNOWN_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG) |
64 | #endif |
65 | |
66 | #if CONF_IS_DEFINED_SET (_POSIX_V7_LP64_OFF64) |
67 | KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64) |
68 | #elif CONF_IS_DEFINED (_POSIX_V7_LP64_OFF64) |
69 | KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64) |
70 | #else |
71 | UNKNOWN_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64) |
72 | #endif |
73 | |
74 | #if CONF_IS_DEFINED_SET (_POSIX_V7_LPBIG_OFFBIG) |
75 | KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG) |
76 | #elif CONF_IS_DEFINED (_POSIX_V7_LPBIG_OFFBIG) |
77 | KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG) |
78 | #else |
79 | UNKNOWN_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG) |
80 | #endif |
81 | |
82 | END_ENV_GROUP (V7) |
83 | |
84 | START_ENV_GROUP (V6) |
85 | |
86 | #if CONF_IS_DEFINED_SET (_POSIX_V6_ILP32_OFF32) |
87 | KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32) |
88 | #elif CONF_IS_DEFINED (_POSIX_V6_ILP32_OFF32) |
89 | KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32) |
90 | #else |
91 | UNKNOWN_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32) |
92 | #endif |
93 | |
94 | #if CONF_IS_DEFINED_SET (_POSIX_V6_ILP32_OFFBIG) |
95 | KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG) |
96 | #elif CONF_IS_DEFINED (_POSIX_V6_ILP32_OFFBIG) |
97 | KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG) |
98 | #else |
99 | UNKNOWN_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG) |
100 | #endif |
101 | |
102 | #if CONF_IS_DEFINED_SET (_POSIX_V6_LP64_OFF64) |
103 | KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64) |
104 | #elif CONF_IS_DEFINED (_POSIX_V6_LP64_OFF64) |
105 | KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64) |
106 | #else |
107 | UNKNOWN_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64) |
108 | #endif |
109 | |
110 | #if CONF_IS_DEFINED_SET (_POSIX_V6_LPBIG_OFFBIG) |
111 | KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG) |
112 | #elif CONF_IS_DEFINED (_POSIX_V6_LPBIG_OFFBIG) |
113 | KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG) |
114 | #else |
115 | UNKNOWN_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG) |
116 | #endif |
117 | |
118 | END_ENV_GROUP (V6) |
119 | |
120 | START_ENV_GROUP (V5) |
121 | |
122 | #if CONF_IS_DEFINED_SET (_XBS5_ILP32_OFF32) |
123 | KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32) |
124 | #elif CONF_IS_DEFINED (_XBS5_ILP32_OFF32) |
125 | KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32) |
126 | #else |
127 | UNKNOWN_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32) |
128 | #endif |
129 | |
130 | #if CONF_IS_DEFINED_SET (_XBS5_ILP32_OFFBIG) |
131 | KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG) |
132 | #elif CONF_IS_DEFINED (_XBS5_ILP32_OFFBIG) |
133 | KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG) |
134 | #else |
135 | UNKNOWN_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG) |
136 | #endif |
137 | |
138 | #if CONF_IS_DEFINED_SET (_XBS5_LP64_OFF64) |
139 | KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, LP64_OFF64) |
140 | #elif CONF_IS_DEFINED (_XBS5_LP64_OFF64) |
141 | KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, LP64_OFF64) |
142 | #else |
143 | UNKNOWN_ENVIRONMENT (XBS5, XBS5, LP64_OFF64) |
144 | #endif |
145 | |
146 | #if CONF_IS_DEFINED_SET (_XBS5_LPBIG_OFFBIG) |
147 | KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG) |
148 | #elif CONF_IS_DEFINED (_XBS5_LPBIG_OFFBIG) |
149 | KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG) |
150 | #else |
151 | UNKNOWN_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG) |
152 | #endif |
153 | |
154 | END_ENV_GROUP (V5) |
155 | |