]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/bsd.mkopt.mk
Add ELF flag to disable ASLR stack gap.
[FreeBSD/FreeBSD.git] / share / mk / bsd.mkopt.mk
1 #
2 # $FreeBSD$
3 #
4 # Generic mechanism to deal with WITH and WITHOUT options and turn
5 # them into MK_ options.
6 #
7 # For each option FOO in __DEFAULT_YES_OPTIONS, MK_FOO is set to
8 # "yes", unless WITHOUT_FOO is defined, in which case it is set to
9 # "no".
10 #
11 # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no",
12 # unless WITH_FOO is defined, in which case it is set to "yes".
13 #
14 # For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS,
15 # MK_FOO is set to "no" if WITHOUT_FOO is defined,
16 # "yes" if WITH_FOO is defined, otherwise the value of MK_BAR.
17 #
18 # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
19 # MK_FOO is set to "no" regardless of which list it was in.
20 #
21 # All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and
22 # __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing,
23 # allowing this file to be included multiple times with different lists.
24 #
25 # Other parts of the build system will set BROKEN_OPTIONS to a list
26 # of options that are broken on this platform. This will not be unset
27 # before returning. Clients are expected to always += this variable.
28 #
29 # Users should generally define WITH_FOO or WITHOUT_FOO, but the build
30 # system should use MK_FOO={yes,no} when it needs to override the
31 # user's desires or default behavior.
32 #
33
34 #
35 # MK_* options which default to "yes".
36 #
37 .for var in ${__DEFAULT_YES_OPTIONS}
38 .if !defined(MK_${var})
39 .if defined(WITHOUT_${var})                     # WITHOUT always wins
40 MK_${var}:=     no
41 .else
42 MK_${var}:=     yes
43 .endif
44 .else
45 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
46 .error "Illegal value for MK_${var}: ${MK_${var}}"
47 .endif
48 .endif # !defined(MK_${var})
49 .endfor
50 .undef __DEFAULT_YES_OPTIONS
51
52 #
53 # MK_* options which default to "no".
54 #
55 .for var in ${__DEFAULT_NO_OPTIONS}
56 .if !defined(MK_${var})
57 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
58 MK_${var}:=     yes
59 .else
60 MK_${var}:=     no
61 .endif
62 .else
63 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
64 .error "Illegal value for MK_${var}: ${MK_${var}}"
65 .endif
66 .endif # !defined(MK_${var})
67 .endfor
68 .undef __DEFAULT_NO_OPTIONS
69
70 #
71 # MK_* options which are always no, usually because they are
72 # unsupported/badly broken on this architecture.
73 #
74 .for var in ${BROKEN_OPTIONS}
75 MK_${var}:=     no
76 .endfor
77
78 .for vv in ${__DEFAULT_DEPENDENT_OPTIONS}
79 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
80 MK_${vv:H}?= no
81 .elif defined(WITH_${vv:H})
82 MK_${vv:H}?= yes
83 .elif defined(WITHOUT_${vv:H})
84 MK_${vv:H}?= no
85 .else
86 MK_${vv:H}?= ${MK_${vv:T}}
87 .endif
88 MK_${vv:H}:= ${MK_${vv:H}}
89 .endfor
90 .undef __DEFAULT_DEPENDENT_OPTIONS