| @@ -1,1084 +1,1090 @@ | | | @@ -1,1084 +1,1090 @@ |
1 | # $NetBSD: gcc.mk,v 1.264 2023/11/07 09:54:49 nia Exp $ | | 1 | # $NetBSD: gcc.mk,v 1.265 2023/11/07 11:36:57 nia Exp $ |
2 | # | | 2 | # |
3 | # This is the compiler definition for the GNU Compiler Collection. | | 3 | # This is the compiler definition for the GNU Compiler Collection. |
4 | # | | 4 | # |
5 | # User-settable variables: | | 5 | # User-settable variables: |
6 | # | | 6 | # |
7 | # GCCBASE | | 7 | # GCCBASE |
8 | # If using a native GCC and the compiler is not in $PATH then | | 8 | # If using a native GCC and the compiler is not in $PATH then |
9 | # this should be set to the base installation directory. | | 9 | # this should be set to the base installation directory. |
10 | # | | 10 | # |
11 | # USE_NATIVE_GCC | | 11 | # USE_NATIVE_GCC |
12 | # When set to "yes", the native gcc is used, no matter which | | 12 | # When set to "yes", the native gcc is used, no matter which |
13 | # compiler version a package requires. | | 13 | # compiler version a package requires. |
14 | # | | 14 | # |
15 | # USE_PKGSRC_GCC | | 15 | # USE_PKGSRC_GCC |
16 | # When set to "yes", use an appropriate version of GCC from | | 16 | # When set to "yes", use an appropriate version of GCC from |
17 | # pkgsrc based on GCC_REQD instead of the native compiler. | | 17 | # pkgsrc based on GCC_REQD instead of the native compiler. |
18 | # | | 18 | # |
19 | # USE_PKGSRC_GCC_RUNTIME | | 19 | # USE_PKGSRC_GCC_RUNTIME |
20 | # When set to "yes", the runtime gcc libraries (libgcc, libstdc++ | | 20 | # When set to "yes", the runtime gcc libraries (libgcc, libstdc++ |
21 | # etc) will be used from pkgsrc rather than the native compiler. | | 21 | # etc) will be used from pkgsrc rather than the native compiler. |
22 | # | | 22 | # |
23 | # GCC_VERSION_SUFFIX | | 23 | # GCC_VERSION_SUFFIX |
24 | # Optional suffix for GCC binaries, i.e. if the installed names are like | | 24 | # Optional suffix for GCC binaries, i.e. if the installed names are like |
25 | # /usr/bin/g++-5, /usr/bin/gcc-5 etc. | | 25 | # /usr/bin/g++-5, /usr/bin/gcc-5 etc. |
26 | | | 26 | |
27 | # Package-settable variables: | | 27 | # Package-settable variables: |
28 | # | | 28 | # |
29 | # GCC_REQD | | 29 | # GCC_REQD |
30 | # The minimum version of the GNU Compiler Collection that is | | 30 | # The minimum version of the GNU Compiler Collection that is |
31 | # required to build this package. Setting this variable doesn't | | 31 | # required to build this package. Setting this variable doesn't |
32 | # change the compiler that is used for building packages. See | | 32 | # change the compiler that is used for building packages. See |
33 | # ONLY_FOR_COMPILER for that purpose. This is a list of version | | 33 | # ONLY_FOR_COMPILER for that purpose. This is a list of version |
34 | # numbers, of which the maximum version is the definitive one. | | 34 | # numbers, of which the maximum version is the definitive one. |
35 | # | | 35 | # |
36 | # This variable can also be set by the user when USE_PKGSRC_GCC | | 36 | # This variable can also be set by the user when USE_PKGSRC_GCC |
37 | # is in effect to ensure that a specific compiler is used for | | 37 | # is in effect to ensure that a specific compiler is used for |
38 | # packages which do not specify a higher version. | | 38 | # packages which do not specify a higher version. |
39 | # | | 39 | # |
40 | # USE_GCC_RUNTIME | | 40 | # USE_GCC_RUNTIME |
41 | # Packages which build shared libraries but do not use libtool to | | 41 | # Packages which build shared libraries but do not use libtool to |
42 | # do so should define this variable. It is used to determine whether | | 42 | # do so should define this variable. It is used to determine whether |
43 | # the gcc runtime should be depended upon when a user has enabled | | 43 | # the gcc runtime should be depended upon when a user has enabled |
44 | # USE_PKGSRC_GCC_RUNTIME. | | 44 | # USE_PKGSRC_GCC_RUNTIME. |
45 | # | | 45 | # |
46 | # System-defined variables: | | 46 | # System-defined variables: |
47 | # | | 47 | # |
48 | # CC_VERSION | | 48 | # CC_VERSION |
49 | # A string of the form "gcc-4.3.2" | | 49 | # A string of the form "gcc-4.3.2" |
50 | # | | 50 | # |
51 | # CC_VERSION_STRING | | 51 | # CC_VERSION_STRING |
52 | # The same(?) as CC_VERSION. FIXME: What's the difference between | | 52 | # The same(?) as CC_VERSION. FIXME: What's the difference between |
53 | # the two? | | 53 | # the two? |
54 | # | | 54 | # |
55 | # Keywords: gcc | | 55 | # Keywords: gcc |
56 | # | | 56 | # |
57 | | | 57 | |
58 | .if !defined(COMPILER_GCC_MK) | | 58 | .if !defined(COMPILER_GCC_MK) |
59 | COMPILER_GCC_MK= defined | | 59 | COMPILER_GCC_MK= defined |
60 | | | 60 | |
61 | _VARGROUPS+= gcc | | 61 | _VARGROUPS+= gcc |
62 | _USER_VARS.gcc= \ | | 62 | _USER_VARS.gcc= \ |
63 | USE_NATIVE_GCC USE_PKGSRC_GCC USE_PKGSRC_GCC_RUNTIME \ | | 63 | USE_NATIVE_GCC USE_PKGSRC_GCC USE_PKGSRC_GCC_RUNTIME \ |
64 | GCCBASE GCC_VERSION_SUFFIX \ | | 64 | GCCBASE GCC_VERSION_SUFFIX \ |
65 | TOOLS_USE_CROSS_COMPILE \ | | 65 | TOOLS_USE_CROSS_COMPILE \ |
66 | PKGSRC_USE_FORTIFY PKGSRC_USE_RELRO PKGSRC_USE_SSP \ | | 66 | PKGSRC_USE_FORTIFY PKGSRC_USE_RELRO PKGSRC_USE_SSP \ |
67 | COMPILER_USE_SYMLINKS CC | | 67 | COMPILER_USE_SYMLINKS CC |
68 | _PKG_VARS.gcc= \ | | 68 | _PKG_VARS.gcc= \ |
69 | GCC_REQD USE_GCC_RUNTIME USE_LANGUAGES | | 69 | GCC_REQD USE_GCC_RUNTIME USE_LANGUAGES |
70 | _SYS_VARS.gcc= \ | | 70 | _SYS_VARS.gcc= \ |
71 | CC_VERSION CC_VERSION_STRING LANGUAGES.gcc \ | | 71 | CC_VERSION CC_VERSION_STRING LANGUAGES.gcc \ |
72 | CCPATH CPPPATH CXXPATH F77PATH FCPATH \ | | 72 | CCPATH CPPPATH CXXPATH F77PATH FCPATH \ |
73 | PKG_CC PKG_CPP PKG_CXX PKG_FC FC PKGSRC_FORTRAN \ | | 73 | PKG_CC PKG_CPP PKG_CXX PKG_FC FC PKGSRC_FORTRAN \ |
74 | ADAPATH GMKPATH GLKPATH GBDPATH CHPPATH GLSPATH GNTPATH PRPPATH | | 74 | ADAPATH GMKPATH GLKPATH GBDPATH CHPPATH GLSPATH GNTPATH PRPPATH |
75 | _DEF_VARS.gcc= \ | | 75 | _DEF_VARS.gcc= \ |
76 | MAKEFLAGS IMAKEOPTS \ | | 76 | MAKEFLAGS IMAKEOPTS \ |
77 | CFLAGS LDFLAGS \ | | 77 | CFLAGS LDFLAGS \ |
78 | PREPEND_PATH \ | | 78 | PREPEND_PATH \ |
79 | COMPILER_INCLUDE_DIRS COMPILER_LIB_DIRS \ | | 79 | COMPILER_INCLUDE_DIRS COMPILER_LIB_DIRS \ |
80 | CWRAPPERS_APPEND.cc CWRAPPERS_APPEND.cxx CWRAPPERS_APPEND.ld \ | | 80 | CWRAPPERS_APPEND.cc CWRAPPERS_APPEND.cxx CWRAPPERS_APPEND.ld \ |
81 | PKG_ADA PKG_GMK PKG_GLK PKG_GBD PKG_CHP PKG_GNT PKG_GLS PKG_PRP \ | | 81 | PKG_ADA PKG_GMK PKG_GLK PKG_GBD PKG_CHP PKG_GNT PKG_GLS PKG_PRP \ |
82 | PKGSRC_ADA PKGSRC_GMK PKGSRC_GLK PKGSRC_GBD PKGSRC_CHP PKGSRC_GNT PKGSRC_GLS PKGSRC_PRP \ | | 82 | PKGSRC_ADA PKGSRC_GMK PKGSRC_GLK PKGSRC_GBD PKGSRC_CHP PKGSRC_GNT PKGSRC_GLS PKGSRC_PRP \ |
83 | _CC _COMPILER_RPATH_FLAG _COMPILER_STRIP_VARS \ | | 83 | _CC _COMPILER_RPATH_FLAG _COMPILER_STRIP_VARS \ |
84 | _GCCBINDIR _GCC_ARCHDIR _GCC_BIN_PREFIX _GCC_CFLAGS \ | | 84 | _GCCBINDIR _GCC_ARCHDIR _GCC_BIN_PREFIX _GCC_CFLAGS \ |
85 | _GCC_CC _GCC_CPP _GCC_CXX _GCC_DEPENDENCY _GCC_DEPENDS \ | | 85 | _GCC_CC _GCC_CPP _GCC_CXX _GCC_DEPENDENCY _GCC_DEPENDS \ |
86 | _GCC_DIST_NAME _GCC_DIST_VERSION \ | | 86 | _GCC_DIST_NAME _GCC_DIST_VERSION \ |
87 | _GCC_FC _GCC_LDFLAGS _GCC_LIBDIRS _GCC_PKG \ | | 87 | _GCC_FC _GCC_LDFLAGS _GCC_LIBDIRS _GCC_PKG \ |
88 | _GCC_PKGBASE _GCC_PKGSRCDIR _GCC_PKG_SATISFIES_DEP \ | | 88 | _GCC_PKGBASE _GCC_PKGSRCDIR _GCC_PKG_SATISFIES_DEP \ |
89 | _GCC_PREFIX _GCC_REQD _GCC_STRICTEST_REQD _GCC_SUBPREFIX \ | | 89 | _GCC_PREFIX _GCC_REQD _GCC_STRICTEST_REQD _GCC_SUBPREFIX \ |
90 | _GCC_TEST_DEPENDS _GCC_NEEDS_A_FORTRAN _GCC_VARS _GCC_VERSION \ | | 90 | _GCC_TEST_DEPENDS _GCC_NEEDS_A_FORTRAN _GCC_VARS _GCC_VERSION \ |
91 | _GCC_VERSION_STRING \ | | 91 | _GCC_VERSION_STRING \ |
92 | _GCC_ADA _GCC_GMK _GCC_GLK _GCC_GBD _GCC_CHP _GCC_GLS _GCC_GNT _GCC_PRP \ | | 92 | _GCC_ADA _GCC_GMK _GCC_GLK _GCC_GBD _GCC_CHP _GCC_GLS _GCC_GNT _GCC_PRP \ |
93 | _IGNORE_GCC \ | | 93 | _IGNORE_GCC \ |
94 | _IS_BUILTIN_GCC \ | | 94 | _IS_BUILTIN_GCC \ |
95 | _LANGUAGES.gcc \ | | 95 | _LANGUAGES.gcc \ |
96 | _LINKER_RPATH_FLAG \ | | 96 | _LINKER_RPATH_FLAG \ |
97 | _NEED_GCC6 _NEED_GCC7 _NEED_GCC8 _NEED_GCC9 \ | | 97 | _NEED_GCC6 _NEED_GCC7 _NEED_GCC8 _NEED_GCC9 \ |
98 | _NEED_GCC10 _NEED_GCC12 _NEED_GCC13 \ | | 98 | _NEED_GCC10 _NEED_GCC12 _NEED_GCC13 \ |
99 | _NEED_GCC_AUX _NEED_NEWER_GCC \ | | 99 | _NEED_GCC_AUX _NEED_NEWER_GCC \ |
100 | _PKGSRC_GCC_VERSION \ | | 100 | _PKGSRC_GCC_VERSION \ |
101 | _USE_GCC_SHLIB _USE_PKGSRC_GCC \ | | 101 | _USE_GCC_SHLIB _USE_PKGSRC_GCC \ |
102 | _WRAP_EXTRA_ARGS.CC \ | | 102 | _WRAP_EXTRA_ARGS.CC \ |
103 | _EXTRA_CC_DIRS \ | | 103 | _EXTRA_CC_DIRS \ |
104 | _C_STD_VERSIONS \ | | 104 | _C_STD_VERSIONS \ |
105 | ${_C_STD_VERSIONS:@std@_C_STD_FLAG.${std}@} \ | | 105 | ${_C_STD_VERSIONS:@std@_C_STD_FLAG.${std}@} \ |
106 | _CXX_STD_VERSIONS \ | | 106 | _CXX_STD_VERSIONS \ |
107 | ${_CXX_STD_VERSIONS:@std@_CXX_STD_FLAG.${std}@} \ | | 107 | ${_CXX_STD_VERSIONS:@std@_CXX_STD_FLAG.${std}@} \ |
108 | _MKPIE_CFLAGS.gcc _MKPIE_LDFLAGS \ | | 108 | _MKPIE_CFLAGS.gcc _MKPIE_LDFLAGS \ |
109 | _FORTIFY_CFLAGS _RELRO_LDFLAGS _STACK_CHECK_CFLAGS \ | | 109 | _FORTIFY_CFLAGS _RELRO_LDFLAGS _STACK_CHECK_CFLAGS \ |
110 | _CTF_CFLAGS \ | | 110 | _CTF_CFLAGS \ |
111 | _GCC_DIR \ | | 111 | _GCC_DIR \ |
112 | _ALIASES.CC _ALIASES.CPP _ALIASES.CXX _ALIASES.FC \ | | 112 | _ALIASES.CC _ALIASES.CPP _ALIASES.CXX _ALIASES.FC \ |
113 | _ALIASES.ADA _ALIASES.GMK _ALIASES.GLK _ALIASES.GBD \ | | 113 | _ALIASES.ADA _ALIASES.GMK _ALIASES.GLK _ALIASES.GBD \ |
114 | _ALIASES.CHP _ALIASES.PRP _ALIASES.GLS _ALIASES.GNT \ | | 114 | _ALIASES.CHP _ALIASES.PRP _ALIASES.GLS _ALIASES.GNT \ |
115 | _COMPILER_ABI_FLAG.32 _COMPILER_ABI_FLAG.64 \ | | 115 | _COMPILER_ABI_FLAG.32 _COMPILER_ABI_FLAG.64 \ |
116 | _COMPILER_ABI_FLAG.n32 _COMPILER_ABI_FLAG.o32 \ | | 116 | _COMPILER_ABI_FLAG.n32 _COMPILER_ABI_FLAG.o32 \ |
117 | _SSP_CFLAGS \ | | 117 | _SSP_CFLAGS \ |
118 | _CXX_STD_FLAG.c++03 _CXX_STD_FLAG.gnu++03 | | 118 | _CXX_STD_FLAG.c++03 _CXX_STD_FLAG.gnu++03 |
119 | _USE_VARS.gcc= \ | | 119 | _USE_VARS.gcc= \ |
120 | MACHINE_ARCH PATH DRAGONFLY_CCVER OPSYS TOOLBASE \ | | 120 | MACHINE_ARCH PATH DRAGONFLY_CCVER OPSYS TOOLBASE \ |
121 | USE_LIBTOOL \ | | 121 | USE_LIBTOOL \ |
122 | LIBABISUFFIX \ | | 122 | LIBABISUFFIX \ |
123 | COMPILER_RPATH_FLAG \ | | 123 | COMPILER_RPATH_FLAG \ |
124 | MACHINE_GNU_PLATFORM \ | | 124 | MACHINE_GNU_PLATFORM \ |
125 | WRKDIR MACHINE_PLATFORM PKGPATH \ | | 125 | WRKDIR MACHINE_PLATFORM PKGPATH \ |
126 | _PKGSRC_MKPIE _PKGSRC_MKREPRO _MKREPRO_CFLAGS.gcc \ | | 126 | _PKGSRC_MKPIE _PKGSRC_MKREPRO _MKREPRO_CFLAGS.gcc \ |
127 | _PKGSRC_USE_FORTIFY _PKGSRC_USE_RELRO _PKGSRC_USE_STACK_CHECK \ | | 127 | _PKGSRC_USE_FORTIFY _PKGSRC_USE_RELRO _PKGSRC_USE_STACK_CHECK \ |
128 | _OPSYS_INCLUDE_DIRS _OPSYS_LIB_DIRS | | 128 | _OPSYS_INCLUDE_DIRS _OPSYS_LIB_DIRS |
129 | _IGN_VARS.gcc= \ | | 129 | _IGN_VARS.gcc= \ |
130 | _GCC6_PATTERNS _GCC7_PATTERNS _GCC8_PATTERNS _GCC9_PATTERNS \ | | 130 | _GCC6_PATTERNS _GCC7_PATTERNS _GCC8_PATTERNS _GCC9_PATTERNS \ |
131 | _GCC10_PATTERNS _GCC12_PATTERNS _GCC13_PATTERNS _GCC_AUX_PATTERNS | | 131 | _GCC10_PATTERNS _GCC12_PATTERNS _GCC13_PATTERNS _GCC_AUX_PATTERNS |
132 | _LISTED_VARS.gcc= \ | | 132 | _LISTED_VARS.gcc= \ |
133 | MAKEFLAGS IMAKEOPTS LDFLAGS PREPEND_PATH | | 133 | MAKEFLAGS IMAKEOPTS LDFLAGS PREPEND_PATH |
134 | .include "../../mk/bsd.prefs.mk" | | 134 | .include "../../mk/bsd.prefs.mk" |
135 | | | 135 | |
136 | USE_NATIVE_GCC?= no | | 136 | USE_NATIVE_GCC?= no |
137 | USE_PKGSRC_GCC?= no | | 137 | USE_PKGSRC_GCC?= no |
138 | USE_PKGSRC_GCC_RUNTIME?=no | | 138 | USE_PKGSRC_GCC_RUNTIME?=no |
139 | | | 139 | |
140 | # | | 140 | # |
141 | # Each successive GCC_REQD has an associated cost below when executing | | 141 | # Each successive GCC_REQD has an associated cost below when executing |
142 | # pkg_admin to determine if it's suitable, so only add these incredibly | | 142 | # pkg_admin to determine if it's suitable, so only add these incredibly |
143 | # old versions if we haven't already set one. | | 143 | # old versions if we haven't already set one. |
144 | # | | 144 | # |
145 | .if !defined(GCC_REQD) | | 145 | .if !defined(GCC_REQD) |
146 | . if !empty(USE_LANGUAGES:Mc99) || ${MACHINE_ARCH} == "x86_64" | | 146 | . if !empty(USE_LANGUAGES:Mc99) || ${MACHINE_ARCH} == "x86_64" |
147 | GCC_REQD+= 3.0 | | 147 | GCC_REQD+= 3.0 |
148 | . else | | 148 | . else |
149 | GCC_REQD+= 2.8.0 | | 149 | GCC_REQD+= 2.8.0 |
150 | . endif | | 150 | . endif |
151 | .endif | | 151 | .endif |
152 | | | 152 | |
153 | .include "gcc-style-args.mk" | | 153 | .include "gcc-style-args.mk" |
154 | | | 154 | |
155 | # | | 155 | # |
156 | # Most of the time, GCC adds support for features of new C and C++ | | 156 | # Most of the time, GCC adds support for features of new C and C++ |
157 | # standards incrementally, so USE_CXX_FEATURES= c++XX is for | | 157 | # standards incrementally, so USE_CXX_FEATURES= c++XX is for |
158 | # establishing an idealistic baseline, usually based on compiler | | 158 | # establishing an idealistic baseline, usually based on compiler |
159 | # versions shipped with NetBSD. | | 159 | # versions shipped with NetBSD. |
160 | # | | 160 | # |
161 | # Resources: | | 161 | # Resources: |
162 | # https://gcc.gnu.org/projects/cxx-status.html | | 162 | # https://gcc.gnu.org/projects/cxx-status.html |
163 | # https://gcc.gnu.org/wiki/C11Status | | 163 | # https://gcc.gnu.org/wiki/C11Status |
164 | # https://gcc.gnu.org/c99status.html | | 164 | # https://gcc.gnu.org/c99status.html |
165 | # | | 165 | # |
166 | | | 166 | |
167 | .if !empty(USE_CXX_FEATURES:Mc++20) | | 167 | .if !empty(USE_CXX_FEATURES:Mc++20) |
168 | # GCC 10 is chosen because it is planned to be shipped with NetBSD 10, | | 168 | # GCC 10 is chosen because it is planned to be shipped with NetBSD 10, |
169 | # so is fairly battle-hardened with pkgsrc. | | 169 | # so is fairly battle-hardened with pkgsrc. |
170 | # | | 170 | # |
171 | # We hope that it remains OK for most C++20 in the future... | | 171 | # We hope that it remains OK for most C++20 in the future... |
172 | GCC_REQD+= 10 | | 172 | GCC_REQD+= 10 |
173 | .endif | | 173 | .endif |
174 | | | 174 | |
175 | .if !empty(USE_CXX_FEATURES:Mc++17) | | 175 | .if !empty(USE_CXX_FEATURES:Mc++17) |
176 | # GCC 7 is chosen because it shipped with NetBSD 9, so is fairly | | 176 | # GCC 7 is chosen because it shipped with NetBSD 9, so is fairly |
177 | # battle-hardened with pkgsrc. | | 177 | # battle-hardened with pkgsrc. |
178 | GCC_REQD+= 7 | | 178 | GCC_REQD+= 7 |
179 | .endif | | 179 | .endif |
180 | | | 180 | |
181 | .if !empty(USE_CXX_FEATURES:Mc++14) | | 181 | .if !empty(USE_CXX_FEATURES:Mc++14) |
182 | # GCC 5 is chosen because it shipped with NetBSD 8, so is fairly | | 182 | # GCC 5 is chosen because it shipped with NetBSD 8, so is fairly |
183 | # battle-hardened with pkgsrc. | | 183 | # battle-hardened with pkgsrc. |
184 | GCC_REQD+= 5 | | 184 | GCC_REQD+= 5 |
185 | .endif | | 185 | .endif |
186 | | | 186 | |
187 | .if !empty(USE_CXX_FEATURES:Mc++11) | | 187 | .if !empty(USE_CXX_FEATURES:Mc++11) |
188 | # While gcc "technically" added experimental C++11 support earlier | | 188 | # While gcc "technically" added experimental C++11 support earlier |
189 | # (and there was previously a lot of cargo-culted GCC_REQD in pkgsrc | | 189 | # (and there was previously a lot of cargo-culted GCC_REQD in pkgsrc |
190 | # as a result), earlier compiler versions are not so well-tested any more. | | 190 | # as a result), earlier compiler versions are not so well-tested any more. |
191 | # | | 191 | # |
192 | # GCC 4.8 was the version shipped with NetBSD 7 and CentOS 7, so is fairly | | 192 | # GCC 4.8 was the version shipped with NetBSD 7 and CentOS 7, so is fairly |
193 | # battle-hardened with pkgsrc. | | 193 | # battle-hardened with pkgsrc. |
194 | # | | 194 | # |
195 | # Versions before GCC 4.7 do not accept -std=c++11. | | 195 | # Versions before GCC 4.7 do not accept -std=c++11. |
196 | GCC_REQD+= 4.8 | | 196 | GCC_REQD+= 4.8 |
197 | .endif | | 197 | .endif |
198 | | | 198 | |
199 | .if !empty(USE_CXX_FEATURES:Mhas_include) || \ | | 199 | .if !empty(USE_CXX_FEATURES:Mhas_include) || \ |
200 | !empty(USE_CC_FEATURES:Mhas_include) | | 200 | !empty(USE_CC_FEATURES:Mhas_include) |
201 | GCC_REQD+= 5 | | 201 | GCC_REQD+= 5 |
202 | .endif | | 202 | .endif |
203 | | | 203 | |
204 | .if !empty(USE_CC_FEATURES:Mc99) | | 204 | .if !empty(USE_CC_FEATURES:Mc99) |
205 | GCC_REQD+= 3 | | 205 | GCC_REQD+= 3 |
206 | .endif | | 206 | .endif |
207 | | | 207 | |
208 | .if !empty(USE_CC_FEATURES:Mc11) | | 208 | .if !empty(USE_CC_FEATURES:Mc11) |
209 | GCC_REQD+= 4.9 | | 209 | GCC_REQD+= 4.9 |
210 | .endif | | 210 | .endif |
211 | | | 211 | |
212 | .if !empty(USE_CXX_FEATURES:Munique_ptr) | | 212 | .if !empty(USE_CXX_FEATURES:Munique_ptr) |
213 | GCC_REQD+= 4.9 | | 213 | GCC_REQD+= 4.9 |
214 | .endif | | 214 | .endif |
215 | | | 215 | |
216 | .if !empty(USE_CXX_FEATURES:Mregex) | | 216 | .if !empty(USE_CXX_FEATURES:Mregex) |
217 | GCC_REQD+= 4.9 | | 217 | GCC_REQD+= 4.9 |
218 | .endif | | 218 | .endif |
219 | | | 219 | |
220 | .if !empty(USE_CXX_FEATURES:Mput_time) | | 220 | .if !empty(USE_CXX_FEATURES:Mput_time) |
221 | GCC_REQD+= 5 | | 221 | GCC_REQD+= 5 |
222 | .endif | | 222 | .endif |
223 | | | 223 | |
224 | .if !empty(USE_CXX_FEATURES:Mis_trivially_copy_constructible) | | 224 | .if !empty(USE_CXX_FEATURES:Mis_trivially_copy_constructible) |
225 | GCC_REQD+= 5 | | 225 | GCC_REQD+= 5 |
226 | .endif | | 226 | .endif |
227 | | | 227 | |
228 | .if !empty(USE_CXX_FEATURES:Mfilesystem) | | 228 | .if !empty(USE_CXX_FEATURES:Mfilesystem) |
229 | # GCC 7 supports filesystem under an experimental header, this is not | | 229 | # GCC 7 supports filesystem under an experimental header, this is not |
230 | # part of GCC 7 as shipped with NetBSD 9. | | 230 | # part of GCC 7 as shipped with NetBSD 9. |
231 | # | | 231 | # |
232 | # GCC 8 supports filesystem with explicit linking to the libstdc++fs | | 232 | # GCC 8 supports filesystem with explicit linking to the libstdc++fs |
233 | # library, which many packages do not do. | | 233 | # library, which many packages do not do. |
234 | GCC_REQD+= 10 | | 234 | GCC_REQD+= 10 |
235 | .endif | | 235 | .endif |
236 | | | 236 | |
237 | .if !empty(USE_CXX_FEATURES:Mparallelism_ts) | | 237 | .if !empty(USE_CXX_FEATURES:Mparallelism_ts) |
238 | GCC_REQD+= 10 | | 238 | GCC_REQD+= 10 |
239 | .endif | | 239 | .endif |
240 | | | 240 | |
241 | .if !empty(USE_CXX_FEATURES:Mcharconv) | | 241 | .if !empty(USE_CXX_FEATURES:Mcharconv) |
242 | GCC_REQD+= 8 | | 242 | GCC_REQD+= 8 |
243 | .endif | | 243 | .endif |
244 | | | 244 | |
245 | # Only one compiler defined here supports Ada: lang/gcc6-aux | | 245 | # Only one compiler defined here supports Ada: lang/gcc6-aux |
246 | # If the Ada language is requested, force lang/gcc6-aux to be selected | | 246 | # If the Ada language is requested, force lang/gcc6-aux to be selected |
247 | .if !empty(USE_LANGUAGES:Mada) | | 247 | .if !empty(USE_LANGUAGES:Mada) |
248 | GCC_REQD+= 20160822 | | 248 | GCC_REQD+= 20160822 |
249 | .endif | | 249 | .endif |
250 | | | 250 | |
251 | # _GCC_DIST_VERSION is the highest version of GCC installed by the pkgsrc | | 251 | # _GCC_DIST_VERSION is the highest version of GCC installed by the pkgsrc |
252 | # without the PKGREVISIONs. | | 252 | # without the PKGREVISIONs. |
253 | _GCC_DIST_NAME:= gcc13 | | 253 | _GCC_DIST_NAME:= gcc13 |
254 | .include "../../lang/${_GCC_DIST_NAME}/version.mk" | | 254 | .include "../../lang/${_GCC_DIST_NAME}/version.mk" |
255 | _GCC_DIST_VERSION:= ${${_GCC_DIST_NAME:tu}_DIST_VERSION} | | 255 | _GCC_DIST_VERSION:= ${${_GCC_DIST_NAME:tu}_DIST_VERSION} |
256 | | | 256 | |
257 | # _GCC6_PATTERNS matches N s.t. N < 7. | | 257 | # _GCC6_PATTERNS matches N s.t. N < 7. |
258 | _GCC6_PATTERNS= 5 6 [0-6].* | | 258 | _GCC6_PATTERNS= 5 6 [0-6].* |
259 | | | 259 | |
260 | # _GCC7_PATTERNS matches N s.t. 7.0 <= N < 8. | | 260 | # _GCC7_PATTERNS matches N s.t. 7.0 <= N < 8. |
261 | _GCC7_PATTERNS= 7 7.* | | 261 | _GCC7_PATTERNS= 7 7.* |
262 | | | 262 | |
263 | # _GCC8_PATTERNS matches N s.t. 8.0 <= N < 9. | | 263 | # _GCC8_PATTERNS matches N s.t. 8.0 <= N < 9. |
264 | _GCC8_PATTERNS= 8 8.* | | 264 | _GCC8_PATTERNS= 8 8.* |
265 | | | 265 | |
266 | # _GCC9_PATTERNS matches N s.t. 9.0 <= N < 10. | | 266 | # _GCC9_PATTERNS matches N s.t. 9.0 <= N < 10. |
267 | _GCC9_PATTERNS= 9 9.* | | 267 | _GCC9_PATTERNS= 9 9.* |
268 | | | 268 | |
269 | # _GCC10_PATTERNS matches N s.t. 10.0 <= N < 11. | | 269 | # _GCC10_PATTERNS matches N s.t. 10.0 <= N < 11. |
270 | _GCC10_PATTERNS= 10 10.* | | 270 | _GCC10_PATTERNS= 10 10.* |
271 | | | 271 | |
272 | # _GCC12_PATTERNS matches N s.t. 12.0 <= N < 13. | | 272 | # _GCC12_PATTERNS matches N s.t. 12.0 <= N < 13. |
273 | # gcc 11.x is not packaged, so depend on gcc12 in that case too | | 273 | # gcc 11.x is not packaged, so depend on gcc12 in that case too |
274 | _GCC12_PATTERNS= 11 11.* 12 12.* | | 274 | _GCC12_PATTERNS= 11 11.* 12 12.* |
275 | | | 275 | |
276 | # _GCC13_PATTERNS matches N s.t. 13.0 <= N < 14. | | 276 | # _GCC13_PATTERNS matches N s.t. 13.0 <= N < 14. |
277 | _GCC13_PATTERNS= 13 13.* | | 277 | _GCC13_PATTERNS= 13 13.* |
278 | | | 278 | |
279 | # _GCC_AUX_PATTERNS matches 8-digit date YYYYMMDD* | | 279 | # _GCC_AUX_PATTERNS matches 8-digit date YYYYMMDD* |
280 | _GCC_AUX_PATTERNS= 20[1-2][0-9][0-1][0-9][0-3][0-9]* | | 280 | _GCC_AUX_PATTERNS= 20[1-2][0-9][0-1][0-9][0-3][0-9]* |
281 | | | 281 | |
282 | # Override the default from sys.mk if necessary. | | 282 | # Override the default from sys.mk if necessary. |
283 | .if ${CC} == cc && ${GCCBASE:U} && !exists(${GCCBASE}/bin/${CC}) && exists(${GCCBASE}/bin/gcc) | | 283 | .if ${CC} == cc && ${GCCBASE:U} && !exists(${GCCBASE}/bin/${CC}) && exists(${GCCBASE}/bin/gcc) |
284 | CC= gcc | | 284 | CC= gcc |
285 | .endif | | 285 | .endif |
286 | | | 286 | |
287 | # _CC is the full path to the compiler named by ${CC} if it can be found. | | 287 | # _CC is the full path to the compiler named by ${CC} if it can be found. |
288 | .if !defined(_CC) | | 288 | .if !defined(_CC) |
289 | _CC:= ${CC:[1]} | | 289 | _CC:= ${CC:[1]} |
290 | . if !empty(GCCBASE) && exists(${GCCBASE}/bin) | | 290 | . if !empty(GCCBASE) && exists(${GCCBASE}/bin) |
291 | _EXTRA_CC_DIRS= ${GCCBASE}/bin | | 291 | _EXTRA_CC_DIRS= ${GCCBASE}/bin |
292 | . endif | | 292 | . endif |
293 | . for _dir_ in ${_EXTRA_CC_DIRS} ${PATH:C/\:/ /g} | | 293 | . for _dir_ in ${_EXTRA_CC_DIRS} ${PATH:C/\:/ /g} |
294 | . if empty(_CC:M/*) | | 294 | . if empty(_CC:M/*) |
295 | . if exists(${_dir_}/${CC:[1]}) | | 295 | . if exists(${_dir_}/${CC:[1]}) |
296 | _CC:= ${_dir_}/${CC:[1]} | | 296 | _CC:= ${_dir_}/${CC:[1]} |
297 | . endif | | 297 | . endif |
298 | . endif | | 298 | . endif |
299 | . endfor | | 299 | . endfor |
300 | . if ${TOOLS_USE_CROSS_COMPILE:tl} == "no" | | 300 | . if ${TOOLS_USE_CROSS_COMPILE:tl} == "no" |
301 | # Pass along _CC only if we're working on native packages -- don't pass | | 301 | # Pass along _CC only if we're working on native packages -- don't pass |
302 | # the cross-compiler on to submakes for building native packages. | | 302 | # the cross-compiler on to submakes for building native packages. |
303 | MAKEFLAGS+= _CC=${_CC:Q} | | 303 | MAKEFLAGS+= _CC=${_CC:Q} |
304 | . endif | | 304 | . endif |
305 | .endif | | 305 | .endif |
306 | | | 306 | |
307 | .if !defined(_GCC_VERSION) | | 307 | .if !defined(_GCC_VERSION) |
308 | # | | 308 | # |
309 | # FIXME: Ideally we'd use PKGSRC_SETENV here, but not enough of the tools | | 309 | # FIXME: Ideally we'd use PKGSRC_SETENV here, but not enough of the tools |
310 | # infrastructure is loaded for SETENV to be defined when mk/compiler.mk is | | 310 | # infrastructure is loaded for SETENV to be defined when mk/compiler.mk is |
311 | # included first. LC_ALL is required here for similar reasons, as ALL_ENV | | 311 | # included first. LC_ALL is required here for similar reasons, as ALL_ENV |
312 | # is not defined at this stage. | | 312 | # is not defined at this stage. |
313 | # | | 313 | # |
314 | _GCC_VERSION_STRING!= \ | | 314 | _GCC_VERSION_STRING!= \ |
315 | ( env LC_ALL=C ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || ${ECHO} 0 | | 315 | ( env LC_ALL=C ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || ${ECHO} 0 |
316 | . if !empty(_GCC_VERSION_STRING:Megcs*) | | 316 | . if !empty(_GCC_VERSION_STRING:Megcs*) |
317 | _GCC_VERSION= 2.8.1 # egcs is considered to be gcc-2.8.1. | | 317 | _GCC_VERSION= 2.8.1 # egcs is considered to be gcc-2.8.1. |
318 | . elif !empty(DRAGONFLY_CCVER) && ${OPSYS} == "DragonFly" | | 318 | . elif !empty(DRAGONFLY_CCVER) && ${OPSYS} == "DragonFly" |
319 | _GCC_VERSION!= env CCVER=${DRAGONFLY_CCVER} ${_CC} -dumpversion | | 319 | _GCC_VERSION!= env CCVER=${DRAGONFLY_CCVER} ${_CC} -dumpversion |
320 | . elif !empty(_GCC_VERSION_STRING:Mgcc*) | | 320 | . elif !empty(_GCC_VERSION_STRING:Mgcc*) |
321 | _GCC_VERSION!= ${_CC} -dumpversion | | 321 | _GCC_VERSION!= ${_CC} -dumpversion |
322 | . else | | 322 | . else |
323 | _GCC_VERSION= 0 | | 323 | _GCC_VERSION= 0 |
324 | . endif | | 324 | . endif |
325 | .endif | | 325 | .endif |
326 | _GCC_PKG= gcc-${_GCC_VERSION:C/-.*$//} | | 326 | _GCC_PKG= gcc-${_GCC_VERSION:C/-.*$//} |
327 | | | 327 | |
328 | .if !empty(_GCC_VERSION:M[23]\..*) || !empty(_GCC_VERSION:M4.[01]\..*) | | 328 | .if !empty(_GCC_VERSION:M[23]\..*) || !empty(_GCC_VERSION:M4.[01]\..*) |
329 | # A lot of packages attempt to do this as a workaround for a | | 329 | # A lot of packages attempt to do this as a workaround for a |
330 | # well-intentioned default in XCode 12+, but it's a common cause of | | 330 | # well-intentioned default in XCode 12+, but it's a common cause of |
331 | # build failures on old versions of Darwin which use gcc and don't | | 331 | # build failures on old versions of Darwin which use gcc and don't |
332 | # understand this syntax. | | 332 | # understand this syntax. |
333 | # | | 333 | # |
334 | # Note that pkgsrc also sets this flag itself for Darwin+clang. | | 334 | # Note that pkgsrc also sets this flag itself for Darwin+clang. |
335 | BUILDLINK_TRANSFORM+= rm:-Wno-error=implicit-function-declaration | | 335 | BUILDLINK_TRANSFORM+= rm:-Wno-error=implicit-function-declaration |
336 | .endif | | 336 | .endif |
337 | | | 337 | |
| | | 338 | .if !empty(_GCC_VERSION:M[23]\..*) || !empty(_GCC_VERSION:M4.[0-8]\..*) |
| | | 339 | COMPILER_HAS_C11?= no |
| | | 340 | .else |
| | | 341 | COMPILER_HAS_C11?= yes |
| | | 342 | .endif |
| | | 343 | |
338 | .for _version_ in ${_C_STD_VERSIONS} | | 344 | .for _version_ in ${_C_STD_VERSIONS} |
339 | _C_STD_FLAG.${_version_}?= -std=${_version_} | | 345 | _C_STD_FLAG.${_version_}?= -std=${_version_} |
340 | .endfor | | 346 | .endfor |
341 | # XXX: pkgsrc historically hardcoded c99=gnu99 so we retain that for now, but | | 347 | # XXX: pkgsrc historically hardcoded c99=gnu99 so we retain that for now, but |
342 | # we should look at removing this and be explicit in packages where required. | | 348 | # we should look at removing this and be explicit in packages where required. |
343 | _C_STD_FLAG.c99= -std=gnu99 | | 349 | _C_STD_FLAG.c99= -std=gnu99 |
344 | | | 350 | |
345 | .for _version_ in ${_CXX_STD_VERSIONS} | | 351 | .for _version_ in ${_CXX_STD_VERSIONS} |
346 | _CXX_STD_FLAG.${_version_}?= -std=${_version_} | | 352 | _CXX_STD_FLAG.${_version_}?= -std=${_version_} |
347 | .endfor | | 353 | .endfor |
348 | .if !empty(_GCC_VERSION:M[34].[1234].*) | | 354 | .if !empty(_GCC_VERSION:M[34].[1234].*) |
349 | _CXX_STD_FLAG.c++03= -std=c++0x | | 355 | _CXX_STD_FLAG.c++03= -std=c++0x |
350 | _CXX_STD_FLAG.gnu++03= -std=gnu++0x | | 356 | _CXX_STD_FLAG.gnu++03= -std=gnu++0x |
351 | .endif | | 357 | .endif |
352 | | | 358 | |
353 | .if !empty(_CC:M${TOOLBASE}/*) | | 359 | .if !empty(_CC:M${TOOLBASE}/*) |
354 | _IS_BUILTIN_GCC= NO | | 360 | _IS_BUILTIN_GCC= NO |
355 | GCC_REQD+= ${_GCC_VERSION} | | 361 | GCC_REQD+= ${_GCC_VERSION} |
356 | .else | | 362 | .else |
357 | . if !empty(_CC:M/*) | | 363 | . if !empty(_CC:M/*) |
358 | # | | 364 | # |
359 | # GCC in older versions of Darwin report "Apple Computer ... based on gcc | | 365 | # GCC in older versions of Darwin report "Apple Computer ... based on gcc |
360 | # version ...", so we can't just grep for "^gcc". | | 366 | # version ...", so we can't just grep for "^gcc". |
361 | # | | 367 | # |
362 | . if ${_GCC_VERSION} != "0" | | 368 | . if ${_GCC_VERSION} != "0" |
363 | _IS_BUILTIN_GCC= YES | | 369 | _IS_BUILTIN_GCC= YES |
364 | . else | | 370 | . else |
365 | _IS_BUILTIN_GCC= NO | | 371 | _IS_BUILTIN_GCC= NO |
366 | . endif | | 372 | . endif |
367 | . else | | 373 | . else |
368 | _IS_BUILTIN_GCC= NO | | 374 | _IS_BUILTIN_GCC= NO |
369 | . endif | | 375 | . endif |
370 | .endif | | 376 | .endif |
371 | | | 377 | |
372 | # Distill the GCC_REQD list into a single _GCC_REQD value that is the | | 378 | # Distill the GCC_REQD list into a single _GCC_REQD value that is the |
373 | # highest version of GCC required. | | 379 | # highest version of GCC required. |
374 | # | | 380 | # |
375 | _GCC_STRICTEST_REQD?= none | | 381 | _GCC_STRICTEST_REQD?= none |
376 | .for _version_ in ${GCC_REQD} | | 382 | .for _version_ in ${GCC_REQD} |
377 | . for _pkg_ in gcc-${_version_} | | 383 | . for _pkg_ in gcc-${_version_} |
378 | . if ${_GCC_STRICTEST_REQD} == "none" | | 384 | . if ${_GCC_STRICTEST_REQD} == "none" |
379 | _GCC_PKG_SATISFIES_DEP= YES | | 385 | _GCC_PKG_SATISFIES_DEP= YES |
380 | . for _vers_ in ${GCC_REQD} | | 386 | . for _vers_ in ${GCC_REQD} |
381 | . if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) | | 387 | . if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) |
382 | _GCC_PKG_SATISFIES_DEP!= \ | | 388 | _GCC_PKG_SATISFIES_DEP!= \ |
383 | if ${PKG_ADMIN} pmatch 'gcc>=${_vers_}' ${_pkg_} 2>/dev/null; then \ | | 389 | if ${PKG_ADMIN} pmatch 'gcc>=${_vers_}' ${_pkg_} 2>/dev/null; then \ |
384 | ${ECHO} "YES"; \ | | 390 | ${ECHO} "YES"; \ |
385 | else \ | | 391 | else \ |
386 | ${ECHO} "NO"; \ | | 392 | ${ECHO} "NO"; \ |
387 | fi | | 393 | fi |
388 | . endif | | 394 | . endif |
389 | . endfor | | 395 | . endfor |
390 | . if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) | | 396 | . if !empty(_GCC_PKG_SATISFIES_DEP:M[yY][eE][sS]) |
391 | _GCC_STRICTEST_REQD= ${_version_} | | 397 | _GCC_STRICTEST_REQD= ${_version_} |
392 | . endif | | 398 | . endif |
393 | . endif | | 399 | . endif |
394 | . endfor | | 400 | . endfor |
395 | .endfor | | 401 | .endfor |
396 | _GCC_REQD= ${_GCC_STRICTEST_REQD} | | 402 | _GCC_REQD= ${_GCC_STRICTEST_REQD} |
397 | | | 403 | |
398 | # Determine which GCC version is required by examining _GCC_REQD. | | 404 | # Determine which GCC version is required by examining _GCC_REQD. |
399 | _NEED_GCC6?= no | | 405 | _NEED_GCC6?= no |
400 | .for _pattern_ in ${_GCC6_PATTERNS} | | 406 | .for _pattern_ in ${_GCC6_PATTERNS} |
401 | . if !empty(_GCC_REQD:M${_pattern_}) | | 407 | . if !empty(_GCC_REQD:M${_pattern_}) |
402 | # XXX this won't work without adjustments elsewhere because of how | | 408 | # XXX this won't work without adjustments elsewhere because of how |
403 | # _GCC_REQD is processed. | | 409 | # _GCC_REQD is processed. |
404 | #. if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 089937 | | 410 | #. if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 089937 |
405 | #USE_PKGSRC_GCC= yes | | 411 | #USE_PKGSRC_GCC= yes |
406 | #USE_PKGSRC_GCC_RUNTIME= yes | | 412 | #USE_PKGSRC_GCC_RUNTIME= yes |
407 | #. endif | | 413 | #. endif |
408 | _NEED_GCC6= yes | | 414 | _NEED_GCC6= yes |
409 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" | | 415 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" |
410 | PKG_FAIL_REASON+= "Package requires at least gcc 6 to build" | | 416 | PKG_FAIL_REASON+= "Package requires at least gcc 6 to build" |
411 | . endif | | 417 | . endif |
412 | . endif | | 418 | . endif |
413 | .endfor | | 419 | .endfor |
414 | _NEED_GCC7?= no | | 420 | _NEED_GCC7?= no |
415 | .for _pattern_ in ${_GCC7_PATTERNS} | | 421 | .for _pattern_ in ${_GCC7_PATTERNS} |
416 | . if !empty(_GCC_REQD:M${_pattern_}) | | 422 | . if !empty(_GCC_REQD:M${_pattern_}) |
417 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 089937 | | 423 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 089937 |
418 | USE_PKGSRC_GCC= yes | | 424 | USE_PKGSRC_GCC= yes |
419 | USE_PKGSRC_GCC_RUNTIME= yes | | 425 | USE_PKGSRC_GCC_RUNTIME= yes |
420 | . endif | | 426 | . endif |
421 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" | | 427 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" |
422 | PKG_FAIL_REASON+= "Package requires at least gcc 7 to build" | | 428 | PKG_FAIL_REASON+= "Package requires at least gcc 7 to build" |
423 | . endif | | 429 | . endif |
424 | _NEED_GCC7= yes | | 430 | _NEED_GCC7= yes |
425 | . endif | | 431 | . endif |
426 | .endfor | | 432 | .endfor |
427 | _NEED_GCC8?= no | | 433 | _NEED_GCC8?= no |
428 | .for _pattern_ in ${_GCC8_PATTERNS} | | 434 | .for _pattern_ in ${_GCC8_PATTERNS} |
429 | . if !empty(_GCC_REQD:M${_pattern_}) | | 435 | . if !empty(_GCC_REQD:M${_pattern_}) |
430 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099917 | | 436 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099917 |
431 | USE_PKGSRC_GCC= yes | | 437 | USE_PKGSRC_GCC= yes |
432 | USE_PKGSRC_GCC_RUNTIME= yes | | 438 | USE_PKGSRC_GCC_RUNTIME= yes |
433 | . endif | | 439 | . endif |
434 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" | | 440 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" |
435 | PKG_FAIL_REASON+= "Package requires at least gcc 8 to build" | | 441 | PKG_FAIL_REASON+= "Package requires at least gcc 8 to build" |
436 | . endif | | 442 | . endif |
437 | _NEED_GCC8= yes | | 443 | _NEED_GCC8= yes |
438 | . endif | | 444 | . endif |
439 | .endfor | | 445 | .endfor |
440 | _NEED_GCC9?= no | | 446 | _NEED_GCC9?= no |
441 | .for _pattern_ in ${_GCC9_PATTERNS} | | 447 | .for _pattern_ in ${_GCC9_PATTERNS} |
442 | . if !empty(_GCC_REQD:M${_pattern_}) | | 448 | . if !empty(_GCC_REQD:M${_pattern_}) |
443 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099976 | | 449 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099976 |
444 | USE_PKGSRC_GCC= yes | | 450 | USE_PKGSRC_GCC= yes |
445 | USE_PKGSRC_GCC_RUNTIME= yes | | 451 | USE_PKGSRC_GCC_RUNTIME= yes |
446 | . endif | | 452 | . endif |
447 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" | | 453 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" |
448 | PKG_FAIL_REASON+= "Package requires at least gcc 9 to build" | | 454 | PKG_FAIL_REASON+= "Package requires at least gcc 9 to build" |
449 | . endif | | 455 | . endif |
450 | _NEED_GCC9= yes | | 456 | _NEED_GCC9= yes |
451 | . endif | | 457 | . endif |
452 | .endfor | | 458 | .endfor |
453 | _NEED_GCC10?= no | | 459 | _NEED_GCC10?= no |
454 | .for _pattern_ in ${_GCC10_PATTERNS} | | 460 | .for _pattern_ in ${_GCC10_PATTERNS} |
455 | . if !empty(_GCC_REQD:M${_pattern_}) | | 461 | . if !empty(_GCC_REQD:M${_pattern_}) |
456 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099982 | | 462 | . if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099982 |
457 | USE_PKGSRC_GCC= yes | | 463 | USE_PKGSRC_GCC= yes |
458 | USE_PKGSRC_GCC_RUNTIME= yes | | 464 | USE_PKGSRC_GCC_RUNTIME= yes |
459 | . endif | | 465 | . endif |
460 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" | | 466 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" |
461 | PKG_FAIL_REASON+= "Package requires at least gcc 10 to build" | | 467 | PKG_FAIL_REASON+= "Package requires at least gcc 10 to build" |
462 | . endif | | 468 | . endif |
463 | _NEED_GCC10= yes | | 469 | _NEED_GCC10= yes |
464 | . endif | | 470 | . endif |
465 | .endfor | | 471 | .endfor |
466 | _NEED_GCC12?= no | | 472 | _NEED_GCC12?= no |
467 | .for _pattern_ in ${_GCC12_PATTERNS} | | 473 | .for _pattern_ in ${_GCC12_PATTERNS} |
468 | . if !empty(_GCC_REQD:M${_pattern_}) | | 474 | . if !empty(_GCC_REQD:M${_pattern_}) |
469 | # XXX: pin to a version when NetBSD switches to gcc12 | | 475 | # XXX: pin to a version when NetBSD switches to gcc12 |
470 | . if ${OPSYS} == "NetBSD" | | 476 | . if ${OPSYS} == "NetBSD" |
471 | USE_PKGSRC_GCC= yes | | 477 | USE_PKGSRC_GCC= yes |
472 | USE_PKGSRC_GCC_RUNTIME= yes | | 478 | USE_PKGSRC_GCC_RUNTIME= yes |
473 | . endif | | 479 | . endif |
474 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" | | 480 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" |
475 | PKG_FAIL_REASON+= "Package requires at least gcc 12 to build" | | 481 | PKG_FAIL_REASON+= "Package requires at least gcc 12 to build" |
476 | . endif | | 482 | . endif |
477 | _NEED_GCC12= yes | | 483 | _NEED_GCC12= yes |
478 | . endif | | 484 | . endif |
479 | .endfor | | 485 | .endfor |
480 | _NEED_GCC13?= no | | 486 | _NEED_GCC13?= no |
481 | .for _pattern_ in ${_GCC13_PATTERNS} | | 487 | .for _pattern_ in ${_GCC13_PATTERNS} |
482 | . if !empty(_GCC_REQD:M${_pattern_}) | | 488 | . if !empty(_GCC_REQD:M${_pattern_}) |
483 | # XXX: pin to a version when NetBSD switches to gcc13 | | 489 | # XXX: pin to a version when NetBSD switches to gcc13 |
484 | . if ${OPSYS} == "NetBSD" | | 490 | . if ${OPSYS} == "NetBSD" |
485 | USE_PKGSRC_GCC= yes | | 491 | USE_PKGSRC_GCC= yes |
486 | USE_PKGSRC_GCC_RUNTIME= yes | | 492 | USE_PKGSRC_GCC_RUNTIME= yes |
487 | . endif | | 493 | . endif |
488 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" | | 494 | . if ${ALLOW_NEWER_COMPILER:tl} != "yes" |
489 | PKG_FAIL_REASON+= "Package requires at least gcc 13 to build" | | 495 | PKG_FAIL_REASON+= "Package requires at least gcc 13 to build" |
490 | . endif | | 496 | . endif |
491 | _NEED_GCC13= yes | | 497 | _NEED_GCC13= yes |
492 | . endif | | 498 | . endif |
493 | .endfor | | 499 | .endfor |
494 | _NEED_GCC_AUX?= no | | 500 | _NEED_GCC_AUX?= no |
495 | .for _pattern_ in ${_GCC_AUX_PATTERNS} | | 501 | .for _pattern_ in ${_GCC_AUX_PATTERNS} |
496 | . if !empty(_GCC_REQD:M${_pattern_}) | | 502 | . if !empty(_GCC_REQD:M${_pattern_}) |
497 | _NEED_GCC_AUX= yes | | 503 | _NEED_GCC_AUX= yes |
498 | _NEED_NEWER_GCC=NO | | 504 | _NEED_NEWER_GCC=NO |
499 | . endif | | 505 | . endif |
500 | .endfor | | 506 | .endfor |
501 | .if !empty(_NEED_GCC6:M[nN][oO]) && !empty(_NEED_GCC7:M[nN][oO]) && \ | | 507 | .if !empty(_NEED_GCC6:M[nN][oO]) && !empty(_NEED_GCC7:M[nN][oO]) && \ |
502 | !empty(_NEED_GCC8:M[nN][oO]) && !empty(_NEED_GCC9:M[nN][oO]) && \ | | 508 | !empty(_NEED_GCC8:M[nN][oO]) && !empty(_NEED_GCC9:M[nN][oO]) && \ |
503 | !empty(_NEED_GCC10:M[nN][oO]) && !empty(_NEED_GCC12:M[nN][oO]) && \ | | 509 | !empty(_NEED_GCC10:M[nN][oO]) && !empty(_NEED_GCC12:M[nN][oO]) && \ |
504 | !empty(_NEED_GCC13:M[nN][oO]) && !empty(_NEED_GCC_AUX:M[nN][oO]) | | 510 | !empty(_NEED_GCC13:M[nN][oO]) && !empty(_NEED_GCC_AUX:M[nN][oO]) |
505 | _NEED_GCC8= yes | | 511 | _NEED_GCC8= yes |
506 | .endif | | 512 | .endif |
507 | | | 513 | |
508 | # April 2022: GCC below 10 from pkgsrc is broken on 32-bit arm NetBSD. | | 514 | # April 2022: GCC below 10 from pkgsrc is broken on 32-bit arm NetBSD. |
509 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-earm*) && \ | | 515 | .if !empty(MACHINE_PLATFORM:MNetBSD-*-earm*) && \ |
510 | ${OPSYS_VERSION} < 099900 && \ | | 516 | ${OPSYS_VERSION} < 099900 && \ |
511 | (${_NEED_GCC8:tl} == "yes" || ${_NEED_GCC9:tl} == "yes") | | 517 | (${_NEED_GCC8:tl} == "yes" || ${_NEED_GCC9:tl} == "yes") |
512 | _NEED_GCC6= no | | 518 | _NEED_GCC6= no |
513 | _NEED_GCC7= no | | 519 | _NEED_GCC7= no |
514 | _NEED_GCC8= no | | 520 | _NEED_GCC8= no |
515 | _NEED_GCC9= no | | 521 | _NEED_GCC9= no |
516 | _NEED_GCC10= yes | | 522 | _NEED_GCC10= yes |
517 | _NEED_GCC12= yes | | 523 | _NEED_GCC12= yes |
518 | _NEED_GCC13= yes | | 524 | _NEED_GCC13= yes |
519 | .endif | | 525 | .endif |
520 | | | 526 | |
521 | # Assume by default that GCC will only provide a C compiler. | | 527 | # Assume by default that GCC will only provide a C compiler. |
522 | LANGUAGES.gcc?= c | | 528 | LANGUAGES.gcc?= c |
523 | .if !empty(_NEED_GCC6:M[yY][eE][sS]) | | 529 | .if !empty(_NEED_GCC6:M[yY][eE][sS]) |
524 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ | | 530 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ |
525 | .elif !empty(_NEED_GCC7:M[yY][eE][sS]) | | 531 | .elif !empty(_NEED_GCC7:M[yY][eE][sS]) |
526 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ | | 532 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ |
527 | .elif !empty(_NEED_GCC8:M[yY][eE][sS]) | | 533 | .elif !empty(_NEED_GCC8:M[yY][eE][sS]) |
528 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ | | 534 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ |
529 | .elif !empty(_NEED_GCC9:M[yY][eE][sS]) | | 535 | .elif !empty(_NEED_GCC9:M[yY][eE][sS]) |
530 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ | | 536 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ |
531 | .elif !empty(_NEED_GCC10:M[yY][eE][sS]) | | 537 | .elif !empty(_NEED_GCC10:M[yY][eE][sS]) |
532 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ | | 538 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ |
533 | .elif !empty(_NEED_GCC12:M[yY][eE][sS]) | | 539 | .elif !empty(_NEED_GCC12:M[yY][eE][sS]) |
534 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ | | 540 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ |
535 | .elif !empty(_NEED_GCC13:M[yY][eE][sS]) | | 541 | .elif !empty(_NEED_GCC13:M[yY][eE][sS]) |
536 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ | | 542 | LANGUAGES.gcc= c c++ fortran fortran77 go java objc obj-c++ |
537 | .elif !empty(_NEED_GCC_AUX:M[yY][eE][sS]) | | 543 | .elif !empty(_NEED_GCC_AUX:M[yY][eE][sS]) |
538 | LANGUAGES.gcc= c c++ fortran fortran77 objc ada | | 544 | LANGUAGES.gcc= c c++ fortran fortran77 objc ada |
539 | .endif | | 545 | .endif |
540 | _LANGUAGES.gcc= # empty | | 546 | _LANGUAGES.gcc= # empty |
541 | .for _lang_ in ${USE_LANGUAGES} | | 547 | .for _lang_ in ${USE_LANGUAGES} |
542 | _LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}} | | 548 | _LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}} |
543 | .endfor | | 549 | .endfor |
544 | | | 550 | |
545 | .if ${_PKGSRC_USE_STACK_CHECK} == "yes" | | 551 | .if ${_PKGSRC_USE_STACK_CHECK} == "yes" |
546 | _STACK_CHECK_CFLAGS= -fstack-check | | 552 | _STACK_CHECK_CFLAGS= -fstack-check |
547 | _GCC_CFLAGS+= ${_STACK_CHECK_CFLAGS} | | 553 | _GCC_CFLAGS+= ${_STACK_CHECK_CFLAGS} |
548 | .elif ${_PKGSRC_USE_STACK_CHECK} == "stack-clash" | | 554 | .elif ${_PKGSRC_USE_STACK_CHECK} == "stack-clash" |
549 | _STACK_CHECK_CFLAGS= -fstack-clash-protection | | 555 | _STACK_CHECK_CFLAGS= -fstack-clash-protection |
550 | _GCC_CFLAGS+= ${_STACK_CHECK_CFLAGS} | | 556 | _GCC_CFLAGS+= ${_STACK_CHECK_CFLAGS} |
551 | .endif | | 557 | .endif |
552 | | | 558 | |
553 | .if ${_PKGSRC_MKPIE} == "yes" | | 559 | .if ${_PKGSRC_MKPIE} == "yes" |
554 | _MKPIE_FCFLAGS= -fPIC | | 560 | _MKPIE_FCFLAGS= -fPIC |
555 | . if ${PKGSRC_OVERRIDE_MKPIE:tl} == "no" | | 561 | . if ${PKGSRC_OVERRIDE_MKPIE:tl} == "no" |
556 | _GCC_FCFLAGS+= ${_MKPIE_FCFLAGS} | | 562 | _GCC_FCFLAGS+= ${_MKPIE_FCFLAGS} |
557 | . endif | | 563 | . endif |
558 | .endif | | 564 | .endif |
559 | | | 565 | |
560 | # GCC has this annoying behaviour where it advocates in a multi-line | | 566 | # GCC has this annoying behaviour where it advocates in a multi-line |
561 | # banner the use of "#include" over "#import" when including headers. | | 567 | # banner the use of "#include" over "#import" when including headers. |
562 | # This generates a huge number of warnings when building practically all | | 568 | # This generates a huge number of warnings when building practically all |
563 | # Objective-C code where it is convention to use "#import". Suppress | | 569 | # Objective-C code where it is convention to use "#import". Suppress |
564 | # the warning if we're building Objective-C code using GCC. | | 570 | # the warning if we're building Objective-C code using GCC. |
565 | # | | 571 | # |
566 | .if !empty(_LANGUAGES.gcc:Mobjc) | | 572 | .if !empty(_LANGUAGES.gcc:Mobjc) |
567 | CFLAGS+= -Wno-import | | 573 | CFLAGS+= -Wno-import |
568 | .endif | | 574 | .endif |
569 | | | 575 | |
570 | CFLAGS+= ${_GCC_CFLAGS} | | 576 | CFLAGS+= ${_GCC_CFLAGS} |
571 | FCFLAGS+= ${_GCC_FCFLAGS} | | 577 | FCFLAGS+= ${_GCC_FCFLAGS} |
572 | | | 578 | |
573 | .if !empty(_NEED_GCC6:M[yY][eE][sS]) | | 579 | .if !empty(_NEED_GCC6:M[yY][eE][sS]) |
574 | # | | 580 | # |
575 | # We require gcc-6.x in the lang/gcc6-* directory. | | 581 | # We require gcc-6.x in the lang/gcc6-* directory. |
576 | # | | 582 | # |
577 | _GCC_PKGBASE= gcc6 | | 583 | _GCC_PKGBASE= gcc6 |
578 | . if ${PKGPATH} == lang/gcc6 | | 584 | . if ${PKGPATH} == lang/gcc6 |
579 | _IGNORE_GCC= yes | | 585 | _IGNORE_GCC= yes |
580 | MAKEFLAGS+= _IGNORE_GCC=yes | | 586 | MAKEFLAGS+= _IGNORE_GCC=yes |
581 | . endif | | 587 | . endif |
582 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 588 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
583 | _GCC_PKGSRCDIR= ../../lang/gcc6 | | 589 | _GCC_PKGSRCDIR= ../../lang/gcc6 |
584 | _GCC_DEPENDENCY= gcc6>=${_GCC_REQD}:../../lang/gcc6 | | 590 | _GCC_DEPENDENCY= gcc6>=${_GCC_REQD}:../../lang/gcc6 |
585 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 591 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
586 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 592 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
587 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 593 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
588 | !empty(_LANGUAGES.gcc:Mgo) || \ | | 594 | !empty(_LANGUAGES.gcc:Mgo) || \ |
589 | !empty(_LANGUAGES.gcc:Mobjc) || \ | | 595 | !empty(_LANGUAGES.gcc:Mobjc) || \ |
590 | !empty(_LANGUAGES.gcc:Mobj-c++) | | 596 | !empty(_LANGUAGES.gcc:Mobj-c++) |
591 | _USE_GCC_SHLIB?= yes | | 597 | _USE_GCC_SHLIB?= yes |
592 | . endif | | 598 | . endif |
593 | . endif | | 599 | . endif |
594 | .elif !empty(_NEED_GCC7:M[yY][eE][sS]) | | 600 | .elif !empty(_NEED_GCC7:M[yY][eE][sS]) |
595 | # | | 601 | # |
596 | # We require gcc-7.x in the lang/gcc7-* directory. | | 602 | # We require gcc-7.x in the lang/gcc7-* directory. |
597 | # | | 603 | # |
598 | _GCC_PKGBASE= gcc7 | | 604 | _GCC_PKGBASE= gcc7 |
599 | . if ${PKGPATH} == lang/gcc7 | | 605 | . if ${PKGPATH} == lang/gcc7 |
600 | _IGNORE_GCC= yes | | 606 | _IGNORE_GCC= yes |
601 | MAKEFLAGS+= _IGNORE_GCC=yes | | 607 | MAKEFLAGS+= _IGNORE_GCC=yes |
602 | . endif | | 608 | . endif |
603 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 609 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
604 | _GCC_PKGSRCDIR= ../../lang/gcc7 | | 610 | _GCC_PKGSRCDIR= ../../lang/gcc7 |
605 | _GCC_DEPENDENCY= gcc7>=${_GCC_REQD}:../../lang/gcc7 | | 611 | _GCC_DEPENDENCY= gcc7>=${_GCC_REQD}:../../lang/gcc7 |
606 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 612 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
607 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 613 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
608 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 614 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
609 | !empty(_LANGUAGES.gcc:Mgo) || \ | | 615 | !empty(_LANGUAGES.gcc:Mgo) || \ |
610 | !empty(_LANGUAGES.gcc:Mobjc) || \ | | 616 | !empty(_LANGUAGES.gcc:Mobjc) || \ |
611 | !empty(_LANGUAGES.gcc:Mobj-c++) | | 617 | !empty(_LANGUAGES.gcc:Mobj-c++) |
612 | _USE_GCC_SHLIB?= yes | | 618 | _USE_GCC_SHLIB?= yes |
613 | . endif | | 619 | . endif |
614 | . endif | | 620 | . endif |
615 | .elif !empty(_NEED_GCC8:M[yY][eE][sS]) | | 621 | .elif !empty(_NEED_GCC8:M[yY][eE][sS]) |
616 | # | | 622 | # |
617 | # We require gcc-8.x in the lang/gcc8-* directory. | | 623 | # We require gcc-8.x in the lang/gcc8-* directory. |
618 | # | | 624 | # |
619 | _GCC_PKGBASE= gcc8 | | 625 | _GCC_PKGBASE= gcc8 |
620 | . if ${PKGPATH} == lang/gcc8 | | 626 | . if ${PKGPATH} == lang/gcc8 |
621 | _IGNORE_GCC= yes | | 627 | _IGNORE_GCC= yes |
622 | MAKEFLAGS+= _IGNORE_GCC=yes | | 628 | MAKEFLAGS+= _IGNORE_GCC=yes |
623 | . endif | | 629 | . endif |
624 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 630 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
625 | _GCC_PKGSRCDIR= ../../lang/gcc8 | | 631 | _GCC_PKGSRCDIR= ../../lang/gcc8 |
626 | _GCC_DEPENDENCY= gcc8>=${_GCC_REQD}:../../lang/gcc8 | | 632 | _GCC_DEPENDENCY= gcc8>=${_GCC_REQD}:../../lang/gcc8 |
627 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 633 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
628 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 634 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
629 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 635 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
630 | !empty(_LANGUAGES.gcc:Mgo) || \ | | 636 | !empty(_LANGUAGES.gcc:Mgo) || \ |
631 | !empty(_LANGUAGES.gcc:Mobjc) || \ | | 637 | !empty(_LANGUAGES.gcc:Mobjc) || \ |
632 | !empty(_LANGUAGES.gcc:Mobj-c++) | | 638 | !empty(_LANGUAGES.gcc:Mobj-c++) |
633 | _USE_GCC_SHLIB?= yes | | 639 | _USE_GCC_SHLIB?= yes |
634 | . endif | | 640 | . endif |
635 | . endif | | 641 | . endif |
636 | .elif !empty(_NEED_GCC9:M[yY][eE][sS]) | | 642 | .elif !empty(_NEED_GCC9:M[yY][eE][sS]) |
637 | # | | 643 | # |
638 | # We require gcc-9.x in the lang/gcc9-* directory. | | 644 | # We require gcc-9.x in the lang/gcc9-* directory. |
639 | # | | 645 | # |
640 | _GCC_PKGBASE= gcc9 | | 646 | _GCC_PKGBASE= gcc9 |
641 | . if ${PKGPATH} == lang/gcc9 | | 647 | . if ${PKGPATH} == lang/gcc9 |
642 | _IGNORE_GCC= yes | | 648 | _IGNORE_GCC= yes |
643 | MAKEFLAGS+= _IGNORE_GCC=yes | | 649 | MAKEFLAGS+= _IGNORE_GCC=yes |
644 | . endif | | 650 | . endif |
645 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 651 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
646 | _GCC_PKGSRCDIR= ../../lang/gcc9 | | 652 | _GCC_PKGSRCDIR= ../../lang/gcc9 |
647 | _GCC_DEPENDENCY= gcc9>=${_GCC_REQD}:../../lang/gcc9 | | 653 | _GCC_DEPENDENCY= gcc9>=${_GCC_REQD}:../../lang/gcc9 |
648 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 654 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
649 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 655 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
650 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 656 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
651 | !empty(_LANGUAGES.gcc:Mgo) || \ | | 657 | !empty(_LANGUAGES.gcc:Mgo) || \ |
652 | !empty(_LANGUAGES.gcc:Mobjc) || \ | | 658 | !empty(_LANGUAGES.gcc:Mobjc) || \ |
653 | !empty(_LANGUAGES.gcc:Mobj-c++) | | 659 | !empty(_LANGUAGES.gcc:Mobj-c++) |
654 | _USE_GCC_SHLIB?= yes | | 660 | _USE_GCC_SHLIB?= yes |
655 | . endif | | 661 | . endif |
656 | . endif | | 662 | . endif |
657 | .elif !empty(_NEED_GCC10:M[yY][eE][sS]) | | 663 | .elif !empty(_NEED_GCC10:M[yY][eE][sS]) |
658 | # | | 664 | # |
659 | # We require gcc-10.x in the lang/gcc10-* directory. | | 665 | # We require gcc-10.x in the lang/gcc10-* directory. |
660 | # | | 666 | # |
661 | _GCC_PKGBASE= gcc10 | | 667 | _GCC_PKGBASE= gcc10 |
662 | . if ${PKGPATH} == lang/gcc10 | | 668 | . if ${PKGPATH} == lang/gcc10 |
663 | _IGNORE_GCC= yes | | 669 | _IGNORE_GCC= yes |
664 | MAKEFLAGS+= _IGNORE_GCC=yes | | 670 | MAKEFLAGS+= _IGNORE_GCC=yes |
665 | . endif | | 671 | . endif |
666 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 672 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
667 | _GCC_PKGSRCDIR= ../../lang/gcc10 | | 673 | _GCC_PKGSRCDIR= ../../lang/gcc10 |
668 | _GCC_DEPENDENCY= gcc10>=${_GCC_REQD}:../../lang/gcc10 | | 674 | _GCC_DEPENDENCY= gcc10>=${_GCC_REQD}:../../lang/gcc10 |
669 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 675 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
670 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 676 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
671 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 677 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
672 | !empty(_LANGUAGES.gcc:Mgo) || \ | | 678 | !empty(_LANGUAGES.gcc:Mgo) || \ |
673 | !empty(_LANGUAGES.gcc:Mobjc) || \ | | 679 | !empty(_LANGUAGES.gcc:Mobjc) || \ |
674 | !empty(_LANGUAGES.gcc:Mobj-c++) | | 680 | !empty(_LANGUAGES.gcc:Mobj-c++) |
675 | _USE_GCC_SHLIB?= yes | | 681 | _USE_GCC_SHLIB?= yes |
676 | . endif | | 682 | . endif |
677 | . endif | | 683 | . endif |
678 | .elif !empty(_NEED_GCC12:M[yY][eE][sS]) | | 684 | .elif !empty(_NEED_GCC12:M[yY][eE][sS]) |
679 | # | | 685 | # |
680 | # We require gcc-12.x in the lang/gcc12-* directory. | | 686 | # We require gcc-12.x in the lang/gcc12-* directory. |
681 | # | | 687 | # |
682 | _GCC_PKGBASE= gcc12 | | 688 | _GCC_PKGBASE= gcc12 |
683 | . if ${PKGPATH} == lang/gcc12 | | 689 | . if ${PKGPATH} == lang/gcc12 |
684 | _IGNORE_GCC= yes | | 690 | _IGNORE_GCC= yes |
685 | MAKEFLAGS+= _IGNORE_GCC=yes | | 691 | MAKEFLAGS+= _IGNORE_GCC=yes |
686 | . endif | | 692 | . endif |
687 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 693 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
688 | _GCC_PKGSRCDIR= ../../lang/gcc12 | | 694 | _GCC_PKGSRCDIR= ../../lang/gcc12 |
689 | _GCC_DEPENDENCY= gcc12>=${_GCC_REQD}:../../lang/gcc12 | | 695 | _GCC_DEPENDENCY= gcc12>=${_GCC_REQD}:../../lang/gcc12 |
690 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 696 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
691 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 697 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
692 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 698 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
693 | !empty(_LANGUAGES.gcc:Mgo) || \ | | 699 | !empty(_LANGUAGES.gcc:Mgo) || \ |
694 | !empty(_LANGUAGES.gcc:Mobjc) || \ | | 700 | !empty(_LANGUAGES.gcc:Mobjc) || \ |
695 | !empty(_LANGUAGES.gcc:Mobj-c++) | | 701 | !empty(_LANGUAGES.gcc:Mobj-c++) |
696 | _USE_GCC_SHLIB?= yes | | 702 | _USE_GCC_SHLIB?= yes |
697 | . endif | | 703 | . endif |
698 | . endif | | 704 | . endif |
699 | .elif !empty(_NEED_GCC13:M[yY][eE][sS]) | | 705 | .elif !empty(_NEED_GCC13:M[yY][eE][sS]) |
700 | # | | 706 | # |
701 | # We require gcc-13.x in the lang/gcc13-* directory. | | 707 | # We require gcc-13.x in the lang/gcc13-* directory. |
702 | # | | 708 | # |
703 | _GCC_PKGBASE= gcc13 | | 709 | _GCC_PKGBASE= gcc13 |
704 | . if ${PKGPATH} == lang/gcc13 | | 710 | . if ${PKGPATH} == lang/gcc13 |
705 | _IGNORE_GCC= yes | | 711 | _IGNORE_GCC= yes |
706 | MAKEFLAGS+= _IGNORE_GCC=yes | | 712 | MAKEFLAGS+= _IGNORE_GCC=yes |
707 | . endif | | 713 | . endif |
708 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 714 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
709 | _GCC_PKGSRCDIR= ../../lang/gcc13 | | 715 | _GCC_PKGSRCDIR= ../../lang/gcc13 |
710 | _GCC_DEPENDENCY= gcc13>=${_GCC_REQD}:../../lang/gcc13 | | 716 | _GCC_DEPENDENCY= gcc13>=${_GCC_REQD}:../../lang/gcc13 |
711 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 717 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
712 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 718 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
713 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 719 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
714 | !empty(_LANGUAGES.gcc:Mgo) || \ | | 720 | !empty(_LANGUAGES.gcc:Mgo) || \ |
715 | !empty(_LANGUAGES.gcc:Mobjc) || \ | | 721 | !empty(_LANGUAGES.gcc:Mobjc) || \ |
716 | !empty(_LANGUAGES.gcc:Mobj-c++) | | 722 | !empty(_LANGUAGES.gcc:Mobj-c++) |
717 | _USE_GCC_SHLIB?= yes | | 723 | _USE_GCC_SHLIB?= yes |
718 | . endif | | 724 | . endif |
719 | . endif | | 725 | . endif |
720 | .elif !empty(_NEED_GCC_AUX:M[yY][eE][sS]) | | 726 | .elif !empty(_NEED_GCC_AUX:M[yY][eE][sS]) |
721 | # | | 727 | # |
722 | # We require Ada-capable compiler in the lang/gcc6-aux directory. | | 728 | # We require Ada-capable compiler in the lang/gcc6-aux directory. |
723 | # | | 729 | # |
724 | _GCC_PKGBASE= gcc6-aux | | 730 | _GCC_PKGBASE= gcc6-aux |
725 | . if ${PKGPATH} == lang/gcc6-aux | | 731 | . if ${PKGPATH} == lang/gcc6-aux |
726 | _IGNORE_GCC= yes | | 732 | _IGNORE_GCC= yes |
727 | MAKEFLAGS+= _IGNORE_GCC=yes | | 733 | MAKEFLAGS+= _IGNORE_GCC=yes |
728 | . endif | | 734 | . endif |
729 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) | | 735 | . if !defined(_IGNORE_GCC) && !empty(_LANGUAGES.gcc) |
730 | _GCC_PKGSRCDIR= ../../lang/gcc6-aux | | 736 | _GCC_PKGSRCDIR= ../../lang/gcc6-aux |
731 | _GCC_DEPENDENCY= gcc6-aux>=${_GCC_REQD}:../../lang/gcc6-aux | | 737 | _GCC_DEPENDENCY= gcc6-aux>=${_GCC_REQD}:../../lang/gcc6-aux |
732 | . if !empty(_LANGUAGES.gcc:Mc++) || \ | | 738 | . if !empty(_LANGUAGES.gcc:Mc++) || \ |
733 | !empty(_LANGUAGES.gcc:Mfortran) || \ | | 739 | !empty(_LANGUAGES.gcc:Mfortran) || \ |
734 | !empty(_LANGUAGES.gcc:Mfortran77) || \ | | 740 | !empty(_LANGUAGES.gcc:Mfortran77) || \ |
735 | !empty(_LANGUAGES.gcc:Mada) || \ | | 741 | !empty(_LANGUAGES.gcc:Mada) || \ |
736 | !empty(_LANGUAGES.gcc:Mobjc) | | 742 | !empty(_LANGUAGES.gcc:Mobjc) |
737 | _USE_GCC_SHLIB?= yes | | 743 | _USE_GCC_SHLIB?= yes |
738 | . endif | | 744 | . endif |
739 | . endif | | 745 | . endif |
740 | .endif | | 746 | .endif |
741 | _GCC_DEPENDS= ${_GCC_PKGBASE}>=${_GCC_REQD} | | 747 | _GCC_DEPENDS= ${_GCC_PKGBASE}>=${_GCC_REQD} |
742 | | | 748 | |
743 | # When not using the GNU linker, gcc will always link shared libraries against | | 749 | # When not using the GNU linker, gcc will always link shared libraries against |
744 | # the shared version of libgcc, and so _USE_GCC_SHLIB needs to be enabled on | | 750 | # the shared version of libgcc, and so _USE_GCC_SHLIB needs to be enabled on |
745 | # platforms with non-GNU linkers, such as SunOS. | | 751 | # platforms with non-GNU linkers, such as SunOS. |
746 | # | | 752 | # |
747 | # However, we cannot simply do this by default as it will create circular | | 753 | # However, we cannot simply do this by default as it will create circular |
748 | # dependencies in packages which are required to build gcc itself, and so we | | 754 | # dependencies in packages which are required to build gcc itself, and so we |
749 | # enable it based on USE_LIBTOOL for the majority of packages, and support | | 755 | # enable it based on USE_LIBTOOL for the majority of packages, and support |
750 | # USE_GCC_RUNTIME for packages which create shared libraries but do not use | | 756 | # USE_GCC_RUNTIME for packages which create shared libraries but do not use |
751 | # libtool to do so. | | 757 | # libtool to do so. |
752 | # | | 758 | # |
753 | .if (${OPSYS} == "Darwin" || ${OPSYS} == "SunOS") && \ | | 759 | .if (${OPSYS} == "Darwin" || ${OPSYS} == "SunOS") && \ |
754 | (defined(USE_LIBTOOL) || defined(USE_GCC_RUNTIME)) | | 760 | (defined(USE_LIBTOOL) || defined(USE_GCC_RUNTIME)) |
755 | _USE_GCC_SHLIB= yes | | 761 | _USE_GCC_SHLIB= yes |
756 | .endif | | 762 | .endif |
757 | | | 763 | |
758 | .if !empty(USE_NATIVE_GCC:M[yY][eE][sS]) && !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) | | 764 | .if !empty(USE_NATIVE_GCC:M[yY][eE][sS]) && !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) |
759 | _USE_PKGSRC_GCC= no | | 765 | _USE_PKGSRC_GCC= no |
760 | .elif !empty(USE_PKGSRC_GCC:M[yY][eE][sS]) | | 766 | .elif !empty(USE_PKGSRC_GCC:M[yY][eE][sS]) |
761 | # For environments where there is an external gcc too, but pkgsrc | | 767 | # For environments where there is an external gcc too, but pkgsrc |
762 | # should use the pkgsrc one for consistency. | | 768 | # should use the pkgsrc one for consistency. |
763 | _USE_PKGSRC_GCC= yes | | 769 | _USE_PKGSRC_GCC= yes |
764 | .endif | | 770 | .endif |
765 | | | 771 | |
766 | .if defined(_IGNORE_GCC) | | 772 | .if defined(_IGNORE_GCC) |
767 | _USE_PKGSRC_GCC= NO | | 773 | _USE_PKGSRC_GCC= NO |
768 | .endif | | 774 | .endif |
769 | | | 775 | |
770 | .if !defined(_USE_PKGSRC_GCC) | | 776 | .if !defined(_USE_PKGSRC_GCC) |
771 | _USE_PKGSRC_GCC= YES | | 777 | _USE_PKGSRC_GCC= YES |
772 | . if !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) | | 778 | . if !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) |
773 | _GCC_TEST_DEPENDS= gcc>=${_GCC_REQD} | | 779 | _GCC_TEST_DEPENDS= gcc>=${_GCC_REQD} |
774 | _USE_PKGSRC_GCC!= \ | | 780 | _USE_PKGSRC_GCC!= \ |
775 | if ${PKG_ADMIN} pmatch '${_GCC_TEST_DEPENDS}' ${_GCC_PKG} 2>/dev/null; then \ | | 781 | if ${PKG_ADMIN} pmatch '${_GCC_TEST_DEPENDS}' ${_GCC_PKG} 2>/dev/null; then \ |
776 | ${ECHO} "NO"; \ | | 782 | ${ECHO} "NO"; \ |
777 | else \ | | 783 | else \ |
778 | ${ECHO} "YES"; \ | | 784 | ${ECHO} "YES"; \ |
779 | fi | | 785 | fi |
780 | . endif | | 786 | . endif |
781 | .endif | | 787 | .endif |
782 | | | 788 | |
783 | # Check if any of the versions of GCC in pkgsrc can satisfy the _GCC_REQD | | 789 | # Check if any of the versions of GCC in pkgsrc can satisfy the _GCC_REQD |
784 | # requirement. | | 790 | # requirement. |
785 | # | | 791 | # |
786 | .if !defined(_NEED_NEWER_GCC) | | 792 | .if !defined(_NEED_NEWER_GCC) |
787 | _PKGSRC_GCC_VERSION= ${_GCC_PKGBASE}-${_GCC_DIST_VERSION} | | 793 | _PKGSRC_GCC_VERSION= ${_GCC_PKGBASE}-${_GCC_DIST_VERSION} |
788 | _NEED_NEWER_GCC!= \ | | 794 | _NEED_NEWER_GCC!= \ |
789 | if ${PKG_ADMIN} pmatch '${_GCC_DEPENDS}' ${_PKGSRC_GCC_VERSION} 2>/dev/null; then \ | | 795 | if ${PKG_ADMIN} pmatch '${_GCC_DEPENDS}' ${_PKGSRC_GCC_VERSION} 2>/dev/null; then \ |
790 | ${ECHO} "NO"; \ | | 796 | ${ECHO} "NO"; \ |
791 | else \ | | 797 | else \ |
792 | ${ECHO} "YES"; \ | | 798 | ${ECHO} "YES"; \ |
793 | fi | | 799 | fi |
794 | #MAKEFLAGS+= _NEED_NEWER_GCC=${_NEED_NEWER_GCC} | | 800 | #MAKEFLAGS+= _NEED_NEWER_GCC=${_NEED_NEWER_GCC} |
795 | .endif | | 801 | .endif |
796 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && \ | | 802 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && \ |
797 | !empty(_NEED_NEWER_GCC:M[yY][eE][sS]) | | 803 | !empty(_NEED_NEWER_GCC:M[yY][eE][sS]) |
798 | PKG_FAIL_REASON+= "Unable to satisfy dependency: ${_GCC_DEPENDS}" | | 804 | PKG_FAIL_REASON+= "Unable to satisfy dependency: ${_GCC_DEPENDS}" |
799 | .endif | | 805 | .endif |
800 | | | 806 | |
801 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) | | 807 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) |
802 | # | | 808 | # |
803 | # Ensure that the correct rpath is passed to the linker if we need to | | 809 | # Ensure that the correct rpath is passed to the linker if we need to |
804 | # link against gcc shared libs. | | 810 | # link against gcc shared libs. |
805 | # | | 811 | # |
806 | # XXX cross-compilation -- is this TOOLBASE or LOCALBASE? | | 812 | # XXX cross-compilation -- is this TOOLBASE or LOCALBASE? |
807 | # | | 813 | # |
808 | _GCC_SUBPREFIX!= \ | | 814 | _GCC_SUBPREFIX!= \ |
809 | if ${PKG_INFO} -qe ${_GCC_PKGBASE}; then \ | | 815 | if ${PKG_INFO} -qe ${_GCC_PKGBASE}; then \ |
810 | ${PKG_INFO} -f ${_GCC_PKGBASE} | \ | | 816 | ${PKG_INFO} -f ${_GCC_PKGBASE} | \ |
811 | ${GREP} "File:.*bin/gcc" | \ | | 817 | ${GREP} "File:.*bin/gcc" | \ |
812 | ${GREP} -v "/gcc[0-9][0-9]*-.*" | \ | | 818 | ${GREP} -v "/gcc[0-9][0-9]*-.*" | \ |
813 | ${SED} -e "s/.*File: *//;s/bin\/gcc.*//;q"; \ | | 819 | ${SED} -e "s/.*File: *//;s/bin\/gcc.*//;q"; \ |
814 | else \ | | 820 | else \ |
815 | case ${_CC} in \ | | 821 | case ${_CC} in \ |
816 | ${LOCALBASE}/*) \ | | 822 | ${LOCALBASE}/*) \ |
817 | subprefix="${_CC:H:S/\/bin$//:S/${LOCALBASE}\///:S/${LOCALBASE}//}"; \ | | 823 | subprefix="${_CC:H:S/\/bin$//:S/${LOCALBASE}\///:S/${LOCALBASE}//}"; \ |
818 | case "$${subprefix}" in \ | | 824 | case "$${subprefix}" in \ |
819 | "") ${ECHO} "$${subprefix}" ;; \ | | 825 | "") ${ECHO} "$${subprefix}" ;; \ |
820 | *) ${ECHO} "$${subprefix}/" ;; \ | | 826 | *) ${ECHO} "$${subprefix}/" ;; \ |
821 | esac; \ | | 827 | esac; \ |
822 | ;; \ | | 828 | ;; \ |
823 | *) \ | | 829 | *) \ |
824 | ${ECHO} "_GCC_SUBPREFIX_not_found/"; \ | | 830 | ${ECHO} "_GCC_SUBPREFIX_not_found/"; \ |
825 | ;; \ | | 831 | ;; \ |
826 | esac; \ | | 832 | esac; \ |
827 | fi | | 833 | fi |
828 | _GCC_PREFIX= ${LOCALBASE}/${_GCC_SUBPREFIX} | | 834 | _GCC_PREFIX= ${LOCALBASE}/${_GCC_SUBPREFIX} |
829 | _GCC_ARCHDIR!= \ | | 835 | _GCC_ARCHDIR!= \ |
830 | if [ -x ${_GCC_PREFIX}bin/gcc ]; then \ | | 836 | if [ -x ${_GCC_PREFIX}bin/gcc ]; then \ |
831 | ${DIRNAME} `${_GCC_PREFIX}bin/gcc -print-libgcc-file-name 2>/dev/null`; \ | | 837 | ${DIRNAME} `${_GCC_PREFIX}bin/gcc -print-libgcc-file-name 2>/dev/null`; \ |
832 | else \ | | 838 | else \ |
833 | ${ECHO} "_GCC_ARCHDIR_not_found"; \ | | 839 | ${ECHO} "_GCC_ARCHDIR_not_found"; \ |
834 | fi | | 840 | fi |
835 | _GCC_LIBDIRS= ${_GCC_ARCHDIR} | | 841 | _GCC_LIBDIRS= ${_GCC_ARCHDIR} |
836 | . if empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss]) | | 842 | . if empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss]) |
837 | _GCC_LIBDIRS+= ${_GCC_PREFIX}lib${LIBABISUFFIX} | | 843 | _GCC_LIBDIRS+= ${_GCC_PREFIX}lib${LIBABISUFFIX} |
838 | . endif | | 844 | . endif |
839 | _GCC_LDFLAGS= # empty | | 845 | _GCC_LDFLAGS= # empty |
840 | . for _dir_ in ${_GCC_LIBDIRS:N*not_found*} | | 846 | . for _dir_ in ${_GCC_LIBDIRS:N*not_found*} |
841 | _GCC_LDFLAGS+= -L${_dir_} ${COMPILER_RPATH_FLAG}${_dir_} | | 847 | _GCC_LDFLAGS+= -L${_dir_} ${COMPILER_RPATH_FLAG}${_dir_} |
842 | . endfor | | 848 | . endfor |
843 | .endif | | 849 | .endif |
844 | | | 850 | |
845 | LDFLAGS+= ${_GCC_LDFLAGS} | | 851 | LDFLAGS+= ${_GCC_LDFLAGS} |
846 | | | 852 | |
847 | # Point the variables that specify the compiler to the installed | | 853 | # Point the variables that specify the compiler to the installed |
848 | # GCC executables. | | 854 | # GCC executables. |
849 | # | | 855 | # |
850 | _GCC_DIR= ${WRKDIR}/.gcc | | 856 | _GCC_DIR= ${WRKDIR}/.gcc |
851 | _GCC_VARS= # empty | | 857 | _GCC_VARS= # empty |
852 | | | 858 | |
853 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) | | 859 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) |
854 | _GCCBINDIR= ${_GCC_PREFIX}bin | | 860 | _GCCBINDIR= ${_GCC_PREFIX}bin |
855 | .elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) | | 861 | .elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS]) |
856 | _GCCBINDIR= ${_CC:H} | | 862 | _GCCBINDIR= ${_CC:H} |
857 | .endif | | 863 | .endif |
858 | .if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS]) | | 864 | .if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS]) |
859 | _GCC_BIN_PREFIX= ${MACHINE_GNU_PLATFORM}- | | 865 | _GCC_BIN_PREFIX= ${MACHINE_GNU_PLATFORM}- |
860 | .endif | | 866 | .endif |
861 | _GCC_BIN_PREFIX?= # empty | | 867 | _GCC_BIN_PREFIX?= # empty |
862 | GCC_VERSION_SUFFIX?= # empty | | 868 | GCC_VERSION_SUFFIX?= # empty |
863 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}gcc${GCC_VERSION_SUFFIX}) | | 869 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}gcc${GCC_VERSION_SUFFIX}) |
864 | _GCC_VARS+= CC | | 870 | _GCC_VARS+= CC |
865 | _GCC_CC= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gcc${GCC_VERSION_SUFFIX} | | 871 | _GCC_CC= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gcc${GCC_VERSION_SUFFIX} |
866 | _ALIASES.CC= cc gcc | | 872 | _ALIASES.CC= cc gcc |
867 | CCPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gcc${GCC_VERSION_SUFFIX} | | 873 | CCPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gcc${GCC_VERSION_SUFFIX} |
868 | PKG_CC:= ${_GCC_CC} | | 874 | PKG_CC:= ${_GCC_CC} |
869 | .endif | | 875 | .endif |
870 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}cpp${GCC_VERSION_SUFFIX}) | | 876 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}cpp${GCC_VERSION_SUFFIX}) |
871 | _GCC_VARS+= CPP | | 877 | _GCC_VARS+= CPP |
872 | _GCC_CPP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}cpp${GCC_VERSION_SUFFIX} | | 878 | _GCC_CPP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}cpp${GCC_VERSION_SUFFIX} |
873 | _ALIASES.CPP= cpp | | 879 | _ALIASES.CPP= cpp |
874 | CPPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}cpp${GCC_VERSION_SUFFIX} | | 880 | CPPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}cpp${GCC_VERSION_SUFFIX} |
875 | PKG_CPP:= ${_GCC_CPP} | | 881 | PKG_CPP:= ${_GCC_CPP} |
876 | .endif | | 882 | .endif |
877 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}g++${GCC_VERSION_SUFFIX}) | | 883 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}g++${GCC_VERSION_SUFFIX}) |
878 | _GCC_VARS+= CXX | | 884 | _GCC_VARS+= CXX |
879 | _GCC_CXX= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}g++${GCC_VERSION_SUFFIX} | | 885 | _GCC_CXX= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}g++${GCC_VERSION_SUFFIX} |
880 | _ALIASES.CXX= c++ g++ | | 886 | _ALIASES.CXX= c++ g++ |
881 | CXXPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}g++${GCC_VERSION_SUFFIX} | | 887 | CXXPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}g++${GCC_VERSION_SUFFIX} |
882 | PKG_CXX:= ${_GCC_CXX} | | 888 | PKG_CXX:= ${_GCC_CXX} |
883 | .endif | | 889 | .endif |
884 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX}) | | 890 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX}) |
885 | _GCC_VARS+= FC | | 891 | _GCC_VARS+= FC |
886 | _GCC_FC= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX} | | 892 | _GCC_FC= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX} |
887 | _ALIASES.FC= f77 g77 | | 893 | _ALIASES.FC= f77 g77 |
888 | FC= g77 | | 894 | FC= g77 |
889 | FCPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX} | | 895 | FCPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX} |
890 | F77PATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX} | | 896 | F77PATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}g77${GCC_VERSION_SUFFIX} |
891 | PKG_FC:= ${_GCC_FC} | | 897 | PKG_FC:= ${_GCC_FC} |
892 | PKGSRC_FORTRAN?= g77 | | 898 | PKGSRC_FORTRAN?= g77 |
893 | .endif | | 899 | .endif |
894 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX}) | | 900 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX}) |
895 | _GCC_VARS+= FC | | 901 | _GCC_VARS+= FC |
896 | _GCC_FC= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX} | | 902 | _GCC_FC= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX} |
897 | _ALIASES.FC= gfortran | | 903 | _ALIASES.FC= gfortran |
898 | FC= gfortran | | 904 | FC= gfortran |
899 | FCPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX} | | 905 | FCPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX} |
900 | F77PATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX} | | 906 | F77PATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran${GCC_VERSION_SUFFIX} |
901 | PKG_FC:= ${_GCC_FC} | | 907 | PKG_FC:= ${_GCC_FC} |
902 | PKGSRC_FORTRAN?= gfortran | | 908 | PKGSRC_FORTRAN?= gfortran |
903 | .endif | | 909 | .endif |
904 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada) | | 910 | .if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada) |
905 | _GCC_VARS+= ADA GMK GLK GBD CHP PRP GLS GNT | | 911 | _GCC_VARS+= ADA GMK GLK GBD CHP PRP GLS GNT |
906 | _GCC_ADA= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}ada | | 912 | _GCC_ADA= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}ada |
907 | _GCC_GMK= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatmake | | 913 | _GCC_GMK= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatmake |
908 | _GCC_GLK= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatlink | | 914 | _GCC_GLK= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatlink |
909 | _GCC_GBD= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatbind | | 915 | _GCC_GBD= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatbind |
910 | _GCC_CHP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatchop | | 916 | _GCC_CHP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatchop |
911 | _GCC_PRP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatprep | | 917 | _GCC_PRP= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatprep |
912 | _GCC_GLS= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatls | | 918 | _GCC_GLS= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatls |
913 | _GCC_GNT= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnat | | 919 | _GCC_GNT= ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnat |
914 | _ALIASES.ADA= ada | | 920 | _ALIASES.ADA= ada |
915 | _ALIASES.GMK= gnatmake | | 921 | _ALIASES.GMK= gnatmake |
916 | _ALIASES.GLK= gnatlink | | 922 | _ALIASES.GLK= gnatlink |
917 | _ALIASES.GBD= gnatbind | | 923 | _ALIASES.GBD= gnatbind |
918 | _ALIASES.CHP= gnatchop | | 924 | _ALIASES.CHP= gnatchop |
919 | _ALIASES.PRP= gnatprep | | 925 | _ALIASES.PRP= gnatprep |
920 | _ALIASES.GLS= gnatls | | 926 | _ALIASES.GLS= gnatls |
921 | _ALIASES.GNT= gnat | | 927 | _ALIASES.GNT= gnat |
922 | ADAPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada | | 928 | ADAPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada |
923 | GMKPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatmake | | 929 | GMKPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatmake |
924 | GLKPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatlink | | 930 | GLKPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatlink |
925 | GBDPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatbind | | 931 | GBDPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatbind |
926 | CHPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatchop | | 932 | CHPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatchop |
927 | PRPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatprep | | 933 | PRPPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatprep |
928 | GLSPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatls | | 934 | GLSPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatls |
929 | GNTPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnat | | 935 | GNTPATH= ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnat |
930 | PKG_ADA:= ${_GCC_ADA} | | 936 | PKG_ADA:= ${_GCC_ADA} |
931 | PKG_GMK:= ${_GCC_GMK} | | 937 | PKG_GMK:= ${_GCC_GMK} |
932 | PKG_GLK:= ${_GCC_GLK} | | 938 | PKG_GLK:= ${_GCC_GLK} |
933 | PKG_GBD:= ${_GCC_GBD} | | 939 | PKG_GBD:= ${_GCC_GBD} |
934 | PKG_CHP:= ${_GCC_CHP} | | 940 | PKG_CHP:= ${_GCC_CHP} |
935 | PKG_PRP:= ${_GCC_PRP} | | 941 | PKG_PRP:= ${_GCC_PRP} |
936 | PKG_GLS:= ${_GCC_GLS} | | 942 | PKG_GLS:= ${_GCC_GLS} |
937 | PKG_GNT:= ${_GCC_GNT} | | 943 | PKG_GNT:= ${_GCC_GNT} |
938 | PKGSRC_ADA?= ada | | 944 | PKGSRC_ADA?= ada |
939 | PKGSRC_GMK?= gnatmake | | 945 | PKGSRC_GMK?= gnatmake |
940 | PKGSRC_GLK?= gnatlink | | 946 | PKGSRC_GLK?= gnatlink |
941 | PKGSRC_GBD?= gnatbind | | 947 | PKGSRC_GBD?= gnatbind |
942 | PKGSRC_CHP?= gnatchop | | 948 | PKGSRC_CHP?= gnatchop |
943 | PKGSRC_PRP?= gnatprep | | 949 | PKGSRC_PRP?= gnatprep |
944 | PKGSRC_GLS?= gnatls | | 950 | PKGSRC_GLS?= gnatls |
945 | PKGSRC_GNT?= gnat | | 951 | PKGSRC_GNT?= gnat |
946 | .endif | | 952 | .endif |
947 | _COMPILER_STRIP_VARS+= ${_GCC_VARS} | | 953 | _COMPILER_STRIP_VARS+= ${_GCC_VARS} |
948 | | | 954 | |
949 | # Pass the required flags to imake to tell it we're using gcc on Solaris. | | 955 | # Pass the required flags to imake to tell it we're using gcc on Solaris. |
950 | .if ${OPSYS} == "SunOS" | | 956 | .if ${OPSYS} == "SunOS" |
951 | IMAKEOPTS+= -DHasGcc2=YES -DHasGcc2ForCplusplus=YES | | 957 | IMAKEOPTS+= -DHasGcc2=YES -DHasGcc2ForCplusplus=YES |
952 | .endif | | 958 | .endif |
953 | | | 959 | |
954 | .if ${OPSYS} == "AIX" | | 960 | .if ${OPSYS} == "AIX" |
955 | # On AIX the GCC toolchain recognizes -maix32 and -maix64, | | 961 | # On AIX the GCC toolchain recognizes -maix32 and -maix64, |
956 | # -m32 or -m64 are not recognized. | | 962 | # -m32 or -m64 are not recognized. |
957 | _COMPILER_ABI_FLAG.32= -maix32 | | 963 | _COMPILER_ABI_FLAG.32= -maix32 |
958 | _COMPILER_ABI_FLAG.64= -maix64 | | 964 | _COMPILER_ABI_FLAG.64= -maix64 |
959 | # On HP-UX the GCC toolchain must be specifically targeted to an ABI, | | 965 | # On HP-UX the GCC toolchain must be specifically targeted to an ABI, |
960 | # -m32 or -m64 are not recognized. | | 966 | # -m32 or -m64 are not recognized. |
961 | .elif ${OPSYS} == "HPUX" | | 967 | .elif ${OPSYS} == "HPUX" |
962 | _COMPILER_ABI_FLAG.32= # empty | | 968 | _COMPILER_ABI_FLAG.32= # empty |
963 | _COMPILER_ABI_FLAG.64= # empty | | 969 | _COMPILER_ABI_FLAG.64= # empty |
964 | .elif !empty(MACHINE_ARCH:Mmips*) | | 970 | .elif !empty(MACHINE_ARCH:Mmips*) |
965 | _COMPILER_ABI_FLAG.32= -mabi=n32 # ABI == "32" == "n32" | | 971 | _COMPILER_ABI_FLAG.32= -mabi=n32 # ABI == "32" == "n32" |
966 | _COMPILER_ABI_FLAG.n32= -mabi=n32 | | 972 | _COMPILER_ABI_FLAG.n32= -mabi=n32 |
967 | _COMPILER_ABI_FLAG.o32= -mabi=32 | | 973 | _COMPILER_ABI_FLAG.o32= -mabi=32 |
968 | _COMPILER_ABI_FLAG.64= -mabi=64 | | 974 | _COMPILER_ABI_FLAG.64= -mabi=64 |
969 | .elif !empty(MACHINE_ARCH:Maarch64*) | | 975 | .elif !empty(MACHINE_ARCH:Maarch64*) |
970 | _COMPILER_ABI_FLAG.32= -m32 | | 976 | _COMPILER_ABI_FLAG.32= -m32 |
971 | _COMPILER_ABI_FLAG.64= # empty | | 977 | _COMPILER_ABI_FLAG.64= # empty |
972 | .else | | 978 | .else |
973 | _COMPILER_ABI_FLAG.32= -m32 | | 979 | _COMPILER_ABI_FLAG.32= -m32 |
974 | _COMPILER_ABI_FLAG.64= -m64 | | 980 | _COMPILER_ABI_FLAG.64= -m64 |
975 | .endif | | 981 | .endif |
976 | | | 982 | |
977 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) | | 983 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) |
978 | . if exists(${CCPATH}) | | 984 | . if exists(${CCPATH}) |
979 | CC_VERSION_STRING!= ${CCPATH} -v 2>&1 | | 985 | CC_VERSION_STRING!= ${CCPATH} -v 2>&1 |
980 | CC_VERSION!= \ | | 986 | CC_VERSION!= \ |
981 | if ${CCPATH} -dumpversion > /dev/null 2>&1; then \ | | 987 | if ${CCPATH} -dumpversion > /dev/null 2>&1; then \ |
982 | ${ECHO} "gcc-`${CCPATH} -dumpversion`"; \ | | 988 | ${ECHO} "gcc-`${CCPATH} -dumpversion`"; \ |
983 | else \ | | 989 | else \ |
984 | ${ECHO} "gcc-${_GCC_REQD}"; \ | | 990 | ${ECHO} "gcc-${_GCC_REQD}"; \ |
985 | fi | | 991 | fi |
986 | | | 992 | |
987 | . else | | 993 | . else |
988 | CC_VERSION_STRING= ${CC_VERSION} | | 994 | CC_VERSION_STRING= ${CC_VERSION} |
989 | CC_VERSION= gcc-${_GCC_REQD} | | 995 | CC_VERSION= gcc-${_GCC_REQD} |
990 | . endif | | 996 | . endif |
991 | .else | | 997 | .else |
992 | CC_VERSION_STRING= ${CC_VERSION} | | 998 | CC_VERSION_STRING= ${CC_VERSION} |
993 | CC_VERSION= ${_GCC_PKG} | | 999 | CC_VERSION= ${_GCC_PKG} |
994 | .endif | | 1000 | .endif |
995 | | | 1001 | |
996 | # Prepend the path to the compiler to the PATH. | | 1002 | # Prepend the path to the compiler to the PATH. |
997 | .if !empty(_LANGUAGES.gcc) | | 1003 | .if !empty(_LANGUAGES.gcc) |
998 | PREPEND_PATH+= ${_GCC_DIR}/bin | | 1004 | PREPEND_PATH+= ${_GCC_DIR}/bin |
999 | .endif | | 1005 | .endif |
1000 | | | 1006 | |
1001 | # Add the dependency on GCC. | | 1007 | # Add the dependency on GCC. |
1002 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) | | 1008 | .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) |
1003 | . for _dir_ in ${_GCC_PKGSRCDIR} | | 1009 | . for _dir_ in ${_GCC_PKGSRCDIR} |
1004 | . include "${_dir_}/buildlink3.mk" | | 1010 | . include "${_dir_}/buildlink3.mk" |
1005 | . endfor | | 1011 | . endfor |
1006 | .endif | | 1012 | .endif |
1007 | | | 1013 | |
1008 | # Add dependency on GCC libraries if requested. | | 1014 | # Add dependency on GCC libraries if requested. |
1009 | .if (defined(_USE_GCC_SHLIB) && !empty(_USE_GCC_SHLIB:M[Yy][Ee][Ss])) && !empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss]) | | 1015 | .if (defined(_USE_GCC_SHLIB) && !empty(_USE_GCC_SHLIB:M[Yy][Ee][Ss])) && !empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss]) |
1010 | # Special case packages which are themselves a dependency of gcc runtime. | | 1016 | # Special case packages which are themselves a dependency of gcc runtime. |
1011 | . if ${PKGPATH} != devel/libtool-base && ${PKGPATH} != devel/binutils && \ | | 1017 | . if ${PKGPATH} != devel/libtool-base && ${PKGPATH} != devel/binutils && \ |
1012 | empty(PKGPATH:Mlang/gcc4?) && empty(PKGPATH:Mlang/gcc[5-9]) && \ | | 1018 | empty(PKGPATH:Mlang/gcc4?) && empty(PKGPATH:Mlang/gcc[5-9]) && \ |
1013 | empty(PKGPATH:Mlang/gcc10) && empty(PKGPATH:Mlang/gcc12) && \ | | 1019 | empty(PKGPATH:Mlang/gcc10) && empty(PKGPATH:Mlang/gcc12) && \ |
1014 | empty(PKGPATH:Mlang/gcc13) | | 1020 | empty(PKGPATH:Mlang/gcc13) |
1015 | . if !empty(_GCC_PKGBASE:Mgcc6) | | 1021 | . if !empty(_GCC_PKGBASE:Mgcc6) |
1016 | . include "../../lang/gcc6-libs/buildlink3.mk" | | 1022 | . include "../../lang/gcc6-libs/buildlink3.mk" |
1017 | . elif !empty(_GCC_PKGBASE:Mgcc7) | | 1023 | . elif !empty(_GCC_PKGBASE:Mgcc7) |
1018 | . include "../../lang/gcc7-libs/buildlink3.mk" | | 1024 | . include "../../lang/gcc7-libs/buildlink3.mk" |
1019 | . elif !empty(_GCC_PKGBASE:Mgcc8) | | 1025 | . elif !empty(_GCC_PKGBASE:Mgcc8) |
1020 | . include "../../lang/gcc8-libs/buildlink3.mk" | | 1026 | . include "../../lang/gcc8-libs/buildlink3.mk" |
1021 | . elif !empty(_GCC_PKGBASE:Mgcc9) | | 1027 | . elif !empty(_GCC_PKGBASE:Mgcc9) |
1022 | . include "../../lang/gcc9-libs/buildlink3.mk" | | 1028 | . include "../../lang/gcc9-libs/buildlink3.mk" |
1023 | . elif !empty(_GCC_PKGBASE:Mgcc10) | | 1029 | . elif !empty(_GCC_PKGBASE:Mgcc10) |
1024 | . include "../../lang/gcc10-libs/buildlink3.mk" | | 1030 | . include "../../lang/gcc10-libs/buildlink3.mk" |
1025 | . elif !empty(_GCC_PKGBASE:Mgcc12) | | 1031 | . elif !empty(_GCC_PKGBASE:Mgcc12) |
1026 | . include "../../lang/gcc12-libs/buildlink3.mk" | | 1032 | . include "../../lang/gcc12-libs/buildlink3.mk" |
1027 | . elif !empty(_GCC_PKGBASE:Mgcc13) | | 1033 | . elif !empty(_GCC_PKGBASE:Mgcc13) |
1028 | . include "../../lang/gcc13-libs/buildlink3.mk" | | 1034 | . include "../../lang/gcc13-libs/buildlink3.mk" |
1029 | . else | | 1035 | . else |
1030 | PKG_FAIL_REASON+= "No USE_PKGSRC_GCC_RUNTIME support for ${CC_VERSION}" | | 1036 | PKG_FAIL_REASON+= "No USE_PKGSRC_GCC_RUNTIME support for ${CC_VERSION}" |
1031 | . endif | | 1037 | . endif |
1032 | . endif | | 1038 | . endif |
1033 | .endif | | 1039 | .endif |
1034 | | | 1040 | |
1035 | .for _var_ in ${_GCC_VARS} | | 1041 | .for _var_ in ${_GCC_VARS} |
1036 | . if !target(${_GCC_${_var_}}) | | 1042 | . if !target(${_GCC_${_var_}}) |
1037 | override-tools: ${_GCC_${_var_}} | | 1043 | override-tools: ${_GCC_${_var_}} |
1038 | ${_GCC_${_var_}}: | | 1044 | ${_GCC_${_var_}}: |
1039 | ${RUN}${MKDIR} ${.TARGET:H} | | 1045 | ${RUN}${MKDIR} ${.TARGET:H} |
1040 | . if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss]) | | 1046 | . if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss]) |
1041 | ${RUN}${RM} -f ${.TARGET} | | 1047 | ${RUN}${RM} -f ${.TARGET} |
1042 | ${RUN}${LN} -s ${_GCCBINDIR}/${.TARGET:T} ${.TARGET} | | 1048 | ${RUN}${LN} -s ${_GCCBINDIR}/${.TARGET:T} ${.TARGET} |
1043 | . else | | 1049 | . else |
1044 | ${RUN} \ | | 1050 | ${RUN} \ |
1045 | (${ECHO} '#!${TOOLS_SHELL}'; \ | | 1051 | (${ECHO} '#!${TOOLS_SHELL}'; \ |
1046 | ${ECHO} 'exec ${_GCCBINDIR}/${.TARGET:T} "$$@"'; \ | | 1052 | ${ECHO} 'exec ${_GCCBINDIR}/${.TARGET:T} "$$@"'; \ |
1047 | ) > ${.TARGET} | | 1053 | ) > ${.TARGET} |
1048 | ${RUN}${CHMOD} +x ${.TARGET} | | 1054 | ${RUN}${CHMOD} +x ${.TARGET} |
1049 | . endif | | 1055 | . endif |
1050 | . for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//} | | 1056 | . for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//} |
1051 | ${RUN} \ | | 1057 | ${RUN} \ |
1052 | if [ ! -x "${_alias_}" ]; then \ | | 1058 | if [ ! -x "${_alias_}" ]; then \ |
1053 | ${LN} -f -s ${.TARGET:T} ${_alias_}; \ | | 1059 | ${LN} -f -s ${.TARGET:T} ${_alias_}; \ |
1054 | fi | | 1060 | fi |
1055 | . endfor | | 1061 | . endfor |
1056 | . endif | | 1062 | . endif |
1057 | .endfor | | 1063 | .endfor |
1058 | | | 1064 | |
1059 | # On systems without a Fortran compiler, pull one in if needed. | | 1065 | # On systems without a Fortran compiler, pull one in if needed. |
1060 | PKGSRC_FORTRAN?=gfortran | | 1066 | PKGSRC_FORTRAN?=gfortran |
1061 | | | 1067 | |
1062 | _GCC_NEEDS_A_FORTRAN= no | | 1068 | _GCC_NEEDS_A_FORTRAN= no |
1063 | .if empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && !(defined(FCPATH) && exists(${FCPATH})) | | 1069 | .if empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && !(defined(FCPATH) && exists(${FCPATH})) |
1064 | _GCC_NEEDS_A_FORTRAN= yes | | 1070 | _GCC_NEEDS_A_FORTRAN= yes |
1065 | .else | | 1071 | .else |
1066 | . for _pattern_ in 0.* 1.[0-4] 1.[0-4].* | | 1072 | . for _pattern_ in 0.* 1.[0-4] 1.[0-4].* |
1067 | . if !empty(MACHINE_PLATFORM:MNetBSD-${_pattern_}-*) | | 1073 | . if !empty(MACHINE_PLATFORM:MNetBSD-${_pattern_}-*) |
1068 | _GCC_NEEDS_A_FORTRAN= yes | | 1074 | _GCC_NEEDS_A_FORTRAN= yes |
1069 | . endif | | 1075 | . endif |
1070 | . endfor | | 1076 | . endfor |
1071 | .endif | | 1077 | .endif |
1072 | .if !empty(_GCC_NEEDS_A_FORTRAN:M[yY][eE][sS]) | | 1078 | .if !empty(_GCC_NEEDS_A_FORTRAN:M[yY][eE][sS]) |
1073 | . include "../../mk/compiler/${PKGSRC_FORTRAN}.mk" | | 1079 | . include "../../mk/compiler/${PKGSRC_FORTRAN}.mk" |
1074 | .endif | | 1080 | .endif |
1075 | | | 1081 | |
1076 | .if ${OPSYS} == "Interix" && !empty(_GCCBINDIR:M/opt/gcc.*) | | 1082 | .if ${OPSYS} == "Interix" && !empty(_GCCBINDIR:M/opt/gcc.*) |
1077 | COMPILER_INCLUDE_DIRS= ${_GCCBINDIR:H}/include ${_OPSYS_INCLUDE_DIRS} | | 1083 | COMPILER_INCLUDE_DIRS= ${_GCCBINDIR:H}/include ${_OPSYS_INCLUDE_DIRS} |
1078 | COMPILER_LIB_DIRS= ${_GCCBINDIR:H}/lib ${_OPSYS_LIB_DIRS} | | 1084 | COMPILER_LIB_DIRS= ${_GCCBINDIR:H}/lib ${_OPSYS_LIB_DIRS} |
1079 | .endif | | 1085 | .endif |
1080 | | | 1086 | |
1081 | #.READONLY: GCC_REQD | | 1087 | #.READONLY: GCC_REQD |
1082 | _GCC_REQD_EFFECTIVE:= ${GCC_REQD} | | 1088 | _GCC_REQD_EFFECTIVE:= ${GCC_REQD} |
1083 | | | 1089 | |
1084 | .endif # COMPILER_GCC_MK | | 1090 | .endif # COMPILER_GCC_MK |