xref: /illumos-gate/usr/src/test/libc-tests/cfg/compilation.cfg (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2015 Garrett D'Amore <garrett@damore.org>
14# Copyright 2016 Joyent, Inc.
15# Copyright 2024 Oxide Computer Company
16#
17
18#
19# Compilation environments.
20#
21# Each compilation environment is declared using the keyword "env", like
22# this:
23#
24# env | <name> | <std> | <defs>
25#
26# <name> is just a symbolic name for environment.
27# <std>  indicates either c89 or c99, i.e. which C standard to compile
28#        under.  This infuences choice of compiler and switches.
29# <defs> is a list of CPP style -D or -U flags to define C preprocessor
30#        symbols.
31#
32# Groups of compilation environments can be named, using the "env_group"
33# keyword (this can also be used to create aliases):
34#
35# env_group | <name> | <envs>
36#
37# <name> is a name for the group or alias
38# <envs> is a whitespace separated list of previously declared environments
39#        or environment groups (or aliases).
40#
41
42env | XPG3		| c89 | -D_XOPEN_SOURCE
43env | XPG4		| c89 | -D_XOPEN_SOURCE -D_XOPEN_VERSION=4
44env | SUSv1		| c89 | -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1
45env | SUSv2		| c89 | -D_XOPEN_SOURCE=500
46env | SUSv3		| c99 | -D_XOPEN_SOURCE=600
47env | SUSv4		| c99 | -D_XOPEN_SOURCE=700
48env | SUSv5		| c17 | -D_XOPEN_SOURCE=800
49env | POSIX-1990	| c89 | -D_POSIX_SOURCE
50env | POSIX-1992	| c89 | -D_POSIX_SOURCE -D_POSIX_C_SOURCE=2
51env | POSIX-1993	| c89 | -D_POSIX_C_SOURCE=199309L
52env | POSIX-1995	| c89 | -D_POSIX_C_SOURCE=199506L
53env | POSIX-2001	| c99 | -D_POSIX_C_SOURCE=200112L
54env | POSIX-2008	| c99 | -D_POSIX_C_SOURCE=200809L
55env | POSIX-2024	| c17 | -D_POSIX_C_SOURCE=202405L
56env | C90		| c89 |
57env | C99		| c99 |
58env | C11		| c11 |
59env | C17		| c17 |
60
61#
62# These are ordered from less inclusive (most recent) to most inclusive.
63# This allows for us to "include" by reference. The reason that C99+ and
64# C17+ contain corresponding POSIX variants is because they incorporate
65# the C standard and therefore have corresponding visibility. For
66# example, POSIX-2024 expects a C17 environment. Therefore anything
67# visible in C17 will also be visible in POSIX-2024.
68#
69env_group | POSIX-2024+	| POSIX-2024
70env_group | POSIX-2008+	| POSIX-2024+ POSIX-2008
71env_group | POSIX-2001+	| POSIX-2008+ POSIX-2001
72env_group | POSIX-1995+ | POSIX-2001+ POSIX-1995
73env_group | POSIX-1993+ | POSIX-1995+ POSIX-1993
74env_group | POSIX-1992+ | POSIX-1993+ POSIX-1992
75env_group | POSIX-1990+ | POSIX-1992+ POSIX-1990
76env_group | POSIX+	| POSIX-1990+
77env_group | SUSv5+	| SUSv5 POSIX-2024+
78env_group | SUSv4+	| SUSv4 POSIX-2008+
79env_group | SUSv3+	| SUSv3 SUSv4+ POSIX-2001+
80env_group | SUSv2+	| SUSv2 SUSv3+
81env_group | SUSv1+	| SUSv1 SUSv2+
82env_group | SUS+	| SUSv1+
83env_group | XPG4+	| XPG4 SUSv1+
84env_group | XPG3+	| XPG3 XPG4+
85env_group | C17+	| C17 SUSv5+
86env_group | C11+	| C17+ C11
87env_group | C99+	| C99 C11+ POSIX-2001+ SUSv3+
88env_group | STDC	| C90 C99 C11 C17
89env_group | C+		| STDC POSIX+ SUS+
90env_group | ALL		| C+
91
92#
93# Aliases.
94#
95env_group | XPG4v2	| SUSv1
96env_group | XPG4v2+	| SUSv1+
97env_group | XPG5	| SUSv2
98env_group | XPG5+	| SUSv2+
99env_group | XPG6	| SUSv3
100env_group | XPG6+	| SUSv3+
101env_group | XPG7	| SUSv4
102env_group | XPG7+	| SUSv4+
103env_group | XPG8	| SUSv5
104env_group | XPG8+	| SUSv5+
105