Wed Sep 18 06:46:13 2019 UTC ()
mk/compiler/gcc.mk: add missing variables to _VARGROUPS section


(rillig)
diff -r1.206 -r1.207 pkgsrc/mk/compiler/gcc.mk

cvs diff -r1.206 -r1.207 pkgsrc/mk/compiler/gcc.mk (switch to unified diff)

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