commit | author | age
|
9c75c0
|
1 |
# |
NJ |
2 |
# CDDL HEADER START |
|
3 |
# |
|
4 |
# The contents of this file are subject to the terms of the |
|
5 |
# Common Development and Distribution License (the "License"). |
|
6 |
# You may not use this file except in compliance with the License. |
|
7 |
# |
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
# or http://www.opensolaris.org/os/licensing. |
|
10 |
# See the License for the specific language governing permissions |
|
11 |
# and limitations under the License. |
|
12 |
# |
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
# |
|
19 |
# CDDL HEADER END |
|
20 |
# |
702558
|
21 |
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. |
9c75c0
|
22 |
# |
NJ |
23 |
|
a325d4
|
24 |
PATH=/usr/bin:/usr/gnu/bin |
NJ |
25 |
|
b643a2
|
26 |
# The location of an internal mirror of community source archives that we build |
NJ |
27 |
# in this gate. This mirror has been seeded to include "custom" source archives |
|
28 |
# for a few components where the communities either no longer provide matching |
|
29 |
# source archives or we have changes that aren't reflected in their archives or |
|
30 |
# anywhere else. |
58c0dd
|
31 |
#INTERNAL_ARCHIVE_MIRROR = http://userland.us.oracle.com/source-archives |
b643a2
|
32 |
|
NJ |
33 |
# The location of an external mirror of community source archives that we build |
|
34 |
# in this gate. The external mirror is a replica of the internal mirror. |
58c0dd
|
35 |
#EXTERNAL_ARCHIVE_MIRROR = \ |
AS |
36 |
# http://static.opensolaris.org/action/browse/userland/tarball/userland |
b643a2
|
37 |
|
NJ |
38 |
# Default to looking for source archives on the internal mirror and the external |
|
39 |
# mirror before we hammer on the community source archive repositories. |
|
40 |
export DOWNLOAD_SEARCH_PATH += $(INTERNAL_ARCHIVE_MIRROR) |
|
41 |
export DOWNLOAD_SEARCH_PATH += $(EXTERNAL_ARCHIVE_MIRROR) |
9aea33
|
42 |
|
NJ |
43 |
# The workspace starts at the mercurial root |
5ada66
|
44 |
ifeq ($(origin WS_TOP), undefined) |
58c0dd
|
45 |
export WS_TOP := \ |
AS |
46 |
$(shell hg root 2>/dev/null || git rev-parse --show-toplevel) |
5ada66
|
47 |
endif |
9aea33
|
48 |
|
4cfb92
|
49 |
WS_LOGS = $(WS_TOP)/$(MACH)/logs |
NJ |
50 |
WS_REPO = $(WS_TOP)/$(MACH)/repo |
|
51 |
WS_TOOLS = $(WS_TOP)/tools |
|
52 |
WS_MAKE_RULES = $(WS_TOP)/make-rules |
|
53 |
WS_COMPONENTS = $(WS_TOP)/components |
|
54 |
WS_INCORPORATIONS = $(WS_TOP)/incorporations |
|
55 |
WS_LINT_CACHE = $(WS_TOP)/$(MACH)/pkglint-cache |
|
56 |
|
5c422f
|
57 |
# we want our pkg piplines to fail if there is an error |
MS |
58 |
# (like if pkgdepend fails in the middle of a pipe), but |
|
59 |
# we don't want the builds or ./configure's failing as well. |
|
60 |
# so we only set pipefail for the publish target and have |
|
61 |
# to reset it for the others since they might be invoked |
|
62 |
# as dependencies of publish. |
|
63 |
export SHELLOPTS |
|
64 |
build: SHELLOPTS= |
|
65 |
test: SHELLOPTS= |
|
66 |
install: SHELLOPTS= |
|
67 |
publish: SHELLOPTS=pipefail |
|
68 |
|
b602c5
|
69 |
SHELL= /bin/bash |
MS |
70 |
|
9c75c0
|
71 |
CONSOLIDATION = userland |
d05a6f
|
72 |
PUBLISHER ?= $(CONSOLIDATION) |
c4768d
|
73 |
PUBLISHER_LOCALIZABLE ?= $(CONSOLIDATION)-localizable |
6514ee
|
74 |
|
3dc823
|
75 |
ROOT = / |
NJ |
76 |
|
097eb5
|
77 |
# Native OS version |
5ada66
|
78 |
OS_VERSION := $(shell uname -r) |
6514ee
|
79 |
SOLARIS_VERSION = $(OS_VERSION:5.%=2.%) |
097eb5
|
80 |
# Target OS version |
52d240
|
81 |
PKG_SOLARIS_VERSION ?= 5.11 |
9c75c0
|
82 |
|
4cfb92
|
83 |
include $(WS_MAKE_RULES)/ips-buildinfo.mk |
3dc823
|
84 |
|
2eec07
|
85 |
COMPILER = gcc |
72a528
|
86 |
LINKER = gcc |
80b1b4
|
87 |
BITS = 32 |
9c75c0
|
88 |
PYTHON_VERSION = 2.6 |
467609
|
89 |
PYTHON_VERSIONS = 2.6 2.7 |
9c75c0
|
90 |
|
79b849
|
91 |
BASS_O_MATIC = $(WS_TOOLS)/bass-o-matic |
NJ |
92 |
|
81cc19
|
93 |
CLONEY = $(WS_TOOLS)/cloney |
MS |
94 |
|
b73714
|
95 |
CONFIG_SHELL = /bin/bash |
CM |
96 |
|
79b849
|
97 |
PKG_REPO = file:$(WS_REPO) |
74300c
|
98 |
|
a93d79
|
99 |
COMPONENT_SRC_NAME = $(COMPONENT_NAME) |
RB |
100 |
|
5ada66
|
101 |
COMPONENT_DIR := $(shell pwd) |
c843eb
|
102 |
SOURCE_DIR = $(COMPONENT_DIR)/$(COMPONENT_SRC) |
PS |
103 |
BUILD_DIR = $(COMPONENT_DIR)/build |
74300c
|
104 |
PROTO_DIR = $(BUILD_DIR)/prototype/$(MACH) |
9c75c0
|
105 |
|
38e5af
|
106 |
ETCDIR = /etc |
4f8cfa
|
107 |
USRDIR = /usr |
MS |
108 |
BINDIR = /bin |
f685ac
|
109 |
SBINDIR = /sbin |
4f8cfa
|
110 |
LIBDIR = /lib |
ffaa30
|
111 |
VARDIR = /var |
AL |
112 |
KERNELDRVDIR = /kernel/drv |
|
113 |
KERNELDRVDIR64 =/kernel/drv/$(MACH64) |
4f8cfa
|
114 |
USRBINDIR = $(USRDIR)/bin |
2cda1c
|
115 |
USRBINDIR64 = $(USRDIR)/bin/$(MACH64) |
8a614a
|
116 |
USRSBINDIR = $(USRDIR)/sbin |
4f8cfa
|
117 |
USRLIBDIR = $(USRDIR)/lib |
ffaa30
|
118 |
USRLIBDIR64 = $(USRDIR)/lib/$(MACH64) |
4f8cfa
|
119 |
USRSHAREDIR = $(USRDIR)/share |
f685ac
|
120 |
USRINCDIR = $(USRDIR)/include |
JS |
121 |
USRSHARELOCALEDIR = $(USRSHAREDIR)/locale |
4f8cfa
|
122 |
USRSHAREMANDIR = $(USRSHAREDIR)/man |
8a614a
|
123 |
USRSHAREDOCDIR = $(USRSHAREDIR)/doc |
93837d
|
124 |
USRSHARELIBDIR = $(USRSHAREDIR)/lib |
4f8cfa
|
125 |
USRSHAREMAN1DIR = $(USRSHAREMANDIR)/man1 |
8a614a
|
126 |
USRSHAREMAN1MDIR = $(USRSHAREMANDIR)/man1m |
4f8cfa
|
127 |
USRSHAREMAN3DIR = $(USRSHAREMANDIR)/man3 |
f1282e
|
128 |
USRSHAREMAN4DIR = $(USRSHAREMANDIR)/man4 |
5bb235
|
129 |
USRSHAREMAN5DIR = $(USRSHAREMANDIR)/man5 |
ffaa30
|
130 |
USRKERNELDRVDIR = $(USRDIR)/kernel/drv |
AL |
131 |
USRKERNELDRVDIR64 = $(USRDIR)/kernel/drv/$(MACH64) |
|
132 |
|
38e5af
|
133 |
PROTOETCDIR = $(PROTO_DIR)/$(ETCDIR) |
8a614a
|
134 |
PROTOETCSECDIR = $(PROTO_DIR)/$(ETCDIR)/security |
4f8cfa
|
135 |
PROTOUSRDIR = $(PROTO_DIR)/$(USRDIR) |
ffaa30
|
136 |
PROTOBINDIR = $(PROTO_DIR)/$(BINDIR) |
AL |
137 |
PROTOSBINDIR = $(PROTO_DIR)/$(SBINDIR) |
8a614a
|
138 |
PROTOLIBDIR = $(PROTO_DIR)/$(LIBDIR) |
ffaa30
|
139 |
PROTOVARDIR = $(PROTO_DIR)/$(VARDIR) |
AL |
140 |
PROTOKERNELDRVDIR = $(PROTO_DIR)/$(KERNELDRVDIR) |
|
141 |
PROTOKERNELDRVDIR64 = $(PROTO_DIR)/$(KERNELDRVDIR64) |
4f8cfa
|
142 |
PROTOUSRBINDIR = $(PROTO_DIR)/$(USRBINDIR) |
2cda1c
|
143 |
PROTOUSRBINDIR64 = $(PROTO_DIR)/$(USRBINDIR64) |
8a614a
|
144 |
PROTOUSRSBINDIR = $(PROTO_DIR)/$(USRSBINDIR) |
4f8cfa
|
145 |
PROTOUSRLIBDIR = $(PROTO_DIR)/$(USRLIBDIR) |
MS |
146 |
PROTOUSRLIBDIR64 = $(PROTO_DIR)/$(USRLIBDIR64) |
f685ac
|
147 |
PROTOUSRINCDIR = $(PROTO_DIR)/$(USRINCDIR) |
4f8cfa
|
148 |
PROTOUSRSHAREDIR = $(PROTO_DIR)/$(USRSHAREDIR) |
93837d
|
149 |
PROTOUSRSHARELIBDIR = $(PROTO_DIR)/$(USRSHARELIBDIR) |
4f8cfa
|
150 |
PROTOUSRSHAREMANDIR = $(PROTO_DIR)/$(USRSHAREMANDIR) |
8a614a
|
151 |
PROTOUSRSHAREDOCDIR = $(PROTO_DIR)/$(USRSHAREDOCDIR) |
4f8cfa
|
152 |
PROTOUSRSHAREMAN1DIR = $(PROTO_DIR)/$(USRSHAREMAN1DIR) |
8a614a
|
153 |
PROTOUSRSHAREMAN1MDIR = $(PROTO_DIR)/$(USRSHAREMAN1MDIR) |
4f8cfa
|
154 |
PROTOUSRSHAREMAN3DIR = $(PROTO_DIR)/$(USRSHAREMAN3DIR) |
f1282e
|
155 |
PROTOUSRSHAREMAN4DIR = $(PROTO_DIR)/$(USRSHAREMAN4DIR) |
CM |
156 |
PROTOUSRSHAREMAN5DIR = $(PROTO_DIR)/$(USRSHAREMAN5DIR) |
f685ac
|
157 |
PROTOUSRSHARELOCALEDIR = $(PROTO_DIR)/$(USRSHARELOCALEDIR) |
ffaa30
|
158 |
PROTOUSRKERNELDRVDIR = $(PROTO_DIR)/$(USRKERNELDRVDIR) |
AL |
159 |
PROTOUSRKERNELDRVDIR64 = $(PROTO_DIR)/$(USRKERNELDRVDIR64) |
4f8cfa
|
160 |
|
MS |
161 |
|
3d7f8d
|
162 |
SFWBIN = /usr/sfw/bin |
f685ac
|
163 |
SFWINCLUDE = /usr/sfw/include |
3d7f8d
|
164 |
SFWLIB = /usr/sfw/lib |
d92147
|
165 |
SFWLIB64 = /usr/sfw/lib/$(MACH64) |
1932c6
|
166 |
SFWSHARE = /usr/sfw/share |
MS |
167 |
SFWSHAREMAN = /usr/sfw/share/man |
|
168 |
SFWSHAREMAN1 = /usr/sfw/share/man/man1 |
3d7f8d
|
169 |
PROTOSFWBIN = $(PROTO_DIR)/$(SFWBIN) |
NJ |
170 |
PROTOSFWLIB = $(PROTO_DIR)/$(SFWLIB) |
d92147
|
171 |
PROTOSFWLIB64 = $(PROTO_DIR)/$(SFWLIB64) |
1932c6
|
172 |
PROTOSFWSHARE = $(PROTO_DIR)/$(SFWSHARE) |
MS |
173 |
PROTOSFWSHAREMAN = $(PROTO_DIR)/$(SFWSHAREMAN) |
|
174 |
PROTOSFWSHAREMAN1 = $(PROTO_DIR)/$(SFWSHAREMAN1) |
f685ac
|
175 |
PROTOSFWINCLUDE = $(PROTO_DIR)/$(SFWINCLUDE) |
1932c6
|
176 |
|
MS |
177 |
GNUBIN = /usr/gnu/bin |
d1c159
|
178 |
GNULIB = /usr/gnu/lib |
RB |
179 |
GNULIB64 = /usr/gnu/lib/$(MACH64) |
1932c6
|
180 |
GNUSHARE = /usr/gnu/share |
MS |
181 |
GNUSHAREMAN = /usr/gnu/share/man |
|
182 |
GNUSHAREMAN1 = /usr/gnu/share/man/man1 |
|
183 |
PROTOGNUBIN = $(PROTO_DIR)/$(GNUBIN) |
|
184 |
PROTOGNUSHARE = $(PROTO_DIR)/$(GNUSHARE) |
|
185 |
PROTOGNUSHAREMAN = $(PROTO_DIR)/$(GNUSHAREMAN) |
|
186 |
PROTOGNUSHAREMAN1 = $(PROTO_DIR)/$(GNUSHAREMAN1) |
3d7f8d
|
187 |
|
61c373
|
188 |
# work around _TIME, _DATE, embedded date chatter in component builds |
NJ |
189 |
# to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME) |
|
190 |
# to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV |
79b849
|
191 |
CONSTANT_TIME = LD_PRELOAD_32=$(WS_TOOLS)/time-$(MACH32).so |
NJ |
192 |
CONSTANT_TIME += LD_PRELOAD_64=$(WS_TOOLS)/time-$(MACH64).so |
61c373
|
193 |
CONSTANT_TIME += TIME_CONSTANT=$(TIME_CONSTANT) |
80b1b4
|
194 |
|
5d461f
|
195 |
# set MACH from uname -p to either sparc or i386 |
5ada66
|
196 |
MACH := $(shell uname -p) |
5d461f
|
197 |
|
NJ |
198 |
# set MACH32 from MACH to either sparcv7 or i86 |
|
199 |
MACH32_1 = $(MACH:sparc=sparcv7) |
|
200 |
MACH32 = $(MACH32_1:i386=i86) |
|
201 |
|
|
202 |
# set MACH64 from MACH to either sparcv9 or amd64 |
|
203 |
MACH64_1 = $(MACH:sparc=sparcv9) |
|
204 |
MACH64 = $(MACH64_1:i386=amd64) |
|
205 |
|
c2319a
|
206 |
CONFIGURE_32 = $(BUILD_DIR_32)/.configured |
BC |
207 |
CONFIGURE_64 = $(BUILD_DIR_64)/.configured |
|
208 |
|
4f8cfa
|
209 |
BUILD_DIR_32 = $(BUILD_DIR)/$(MACH32) |
MS |
210 |
BUILD_DIR_64 = $(BUILD_DIR)/$(MACH64) |
|
211 |
|
|
212 |
BUILD_32 = $(BUILD_DIR_32)/.built |
|
213 |
BUILD_64 = $(BUILD_DIR_64)/.built |
5d461f
|
214 |
BUILD_32_and_64 = $(BUILD_32) $(BUILD_64) |
4158c0
|
215 |
$(BUILD_DIR_32)/.built: BITS=32 |
NJ |
216 |
$(BUILD_DIR_64)/.built: BITS=64 |
5d461f
|
217 |
|
4f8cfa
|
218 |
INSTALL_32 = $(BUILD_DIR_32)/.installed |
MS |
219 |
INSTALL_64 = $(BUILD_DIR_64)/.installed |
5d461f
|
220 |
INSTALL_32_and_64 = $(INSTALL_32) $(INSTALL_64) |
a7cc57
|
221 |
$(BUILD_DIR_32)/.installed: BITS=32 |
AC |
222 |
$(BUILD_DIR_64)/.installed: BITS=64 |
4158c0
|
223 |
|
NJ |
224 |
# set the default target for installation of the component |
|
225 |
COMPONENT_INSTALL_TARGETS = install |
9c75c0
|
226 |
|
8d70f8
|
227 |
# set the default test results directory |
RB |
228 |
COMPONENT_TEST_RESULTS_DIR = $(COMPONENT_DIR)/test |
|
229 |
|
|
230 |
# set the default master test results file |
|
231 |
COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(BITS).master |
|
232 |
|
|
233 |
# set the default test results output file |
|
234 |
COMPONENT_TEST_OUTPUT = $(COMPONENT_TEST_RESULTS_DIR)/test-$(BITS)-results |
|
235 |
|
|
236 |
# set the default test results comparison diffs file |
|
237 |
COMPONENT_TEST_DIFFS = $(COMPONENT_TEST_RESULTS_DIR)/test-$(BITS)-diffs |
|
238 |
|
|
239 |
# set the default test snapshot file |
|
240 |
COMPONENT_TEST_SNAPSHOT = $(COMPONENT_TEST_RESULTS_DIR)/results-$(BITS).snapshot |
|
241 |
|
|
242 |
# The set of default transforms to be applied to the test results to try |
|
243 |
# to normalize them. |
|
244 |
COMPONENT_TEST_TRANSFORMS = \ |
|
245 |
'-e "s|$(@D)|\\$$(@D)|g" ' \ |
|
246 |
'-e "s|$(PERL)|\\$$(PERL)|g" ' \ |
|
247 |
'-e "s|$(SOURCE_DIR)|\\$$(SOURCE_DIR)|g" ' |
|
248 |
|
|
249 |
# set the default commands used to generate the file containing the set |
|
250 |
# of transforms to be applied to the test results to try to normalize them. |
|
251 |
COMPONENT_TEST_CREATE_TRANSFORMS = \ |
|
252 |
if [ -e $(COMPONENT_TEST_MASTER) ]; \ |
|
253 |
then \ |
|
254 |
print "\#!/bin/sh" > $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
255 |
print '$(GSED) ' \ |
|
256 |
$(COMPONENT_TEST_TRANSFORMS) \ |
|
257 |
' \\' >> $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
258 |
print '$(COMPONENT_TEST_OUTPUT) \\' \ |
|
259 |
>> $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
260 |
print '> $(COMPONENT_TEST_SNAPSHOT)' \ |
|
261 |
>> $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
262 |
fi |
|
263 |
|
|
264 |
# set the default command for performing any test result munging |
|
265 |
COMPONENT_TEST_TRANSFORM_CMD = $(COMPONENT_TEST_RESULTS_DIR)/transform-$(BITS)-results |
|
266 |
|
|
267 |
# set the default operation to run to perform test result normalization |
|
268 |
COMPONENT_TEST_PERFORM_TRANSFORM = \ |
|
269 |
if [ -e $(COMPONENT_TEST_MASTER) ]; \ |
|
270 |
then \ |
|
271 |
$(SHELL) $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
272 |
fi |
|
273 |
|
|
274 |
# set the default command used to compare the master results with the snapshot |
|
275 |
COMPONENT_TEST_COMPARE_CMD = $(GDIFF) -uN |
|
276 |
|
|
277 |
# set the default way that master and snapshot test results are compared |
|
278 |
COMPONENT_TEST_COMPARE = \ |
|
279 |
if [ -e $(COMPONENT_TEST_MASTER) ]; \ |
|
280 |
then \ |
|
281 |
$(COMPONENT_TEST_COMPARE_CMD) \ |
|
282 |
$(COMPONENT_TEST_MASTER) $(COMPONENT_TEST_SNAPSHOT) \ |
|
283 |
> $(COMPONENT_TEST_DIFFS); \ |
|
284 |
print "Test results in $(COMPONENT_TEST_OUTPUT)"; \ |
|
285 |
if [ -s $(COMPONENT_TEST_DIFFS) ]; \ |
|
286 |
then \ |
|
287 |
print "Differences found."; \ |
|
288 |
$(CAT) $(COMPONENT_TEST_DIFFS); \ |
|
289 |
exit 2; \ |
|
290 |
else \ |
|
291 |
print "No differences found."; \ |
|
292 |
fi \ |
|
293 |
fi |
|
294 |
|
|
295 |
# set the default env command to use for test of the component |
|
296 |
COMPONENT_TEST_ENV_CMD = $(ENV) |
|
297 |
|
|
298 |
# set the default command to use for test of the component |
|
299 |
COMPONENT_TEST_CMD = $(GMAKE) |
4158c0
|
300 |
|
NJ |
301 |
# set the default target for test of the component |
|
302 |
COMPONENT_TEST_TARGETS = check |
35a012
|
303 |
|
702558
|
304 |
# set the default directory for test of the component |
AP |
305 |
COMPONENT_TEST_DIR = $(@D) |
8d70f8
|
306 |
|
RB |
307 |
# determine the type of tests we want to run. |
|
308 |
ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),) |
|
309 |
TEST_32 = $(BUILD_DIR_32)/.tested |
|
310 |
TEST_64 = $(BUILD_DIR_64)/.tested |
|
311 |
else |
|
312 |
TEST_32 = $(BUILD_DIR_32)/.tested-and-compared |
|
313 |
TEST_64 = $(BUILD_DIR_64)/.tested-and-compared |
|
314 |
endif |
|
315 |
TEST_32_and_64 = $(TEST_32) $(TEST_64) |
|
316 |
$(BUILD_DIR_32)/.tested: BITS=32 |
|
317 |
$(BUILD_DIR_64)/.tested: BITS=64 |
|
318 |
$(BUILD_DIR_32)/.tested-and-compared: BITS=32 |
|
319 |
$(BUILD_DIR_64)/.tested-and-compared: BITS=64 |
702558
|
320 |
|
50cda8
|
321 |
# BUILD_TOOLS is the root of all tools not normally installed on the system. |
617c23
|
322 |
BUILD_TOOLS ?= /opt |
50cda8
|
323 |
|
617c23
|
324 |
SPRO_ROOT = $(BUILD_TOOLS)/sunstudio12.1 |
AS |
325 |
SPRO_VROOT = $(SPRO_ROOT) |
50cda8
|
326 |
|
0c2d4d
|
327 |
PARFAIT_ROOT = $(BUILD_TOOLS)/parfait/parfait-tools-1.0.1/ |
7999b2
|
328 |
PARFAIT= $(PARFAIT_ROOT)/bin/parfait |
MS |
329 |
export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc |
|
330 |
export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC |
|
331 |
export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc |
|
332 |
export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++ |
|
333 |
|
16546f
|
334 |
GCC_ROOT = /usr/gcc/4.8 |
9c75c0
|
335 |
|
35a012
|
336 |
CC.studio.32 = $(SPRO_VROOT)/bin/cc |
3cec7d
|
337 |
CXX.studio.32 = $(SPRO_VROOT)/bin/CC |
dcd7ba
|
338 |
F77.studio.32 = $(SPRO_VROOT)/bin/f77 |
bd9d92
|
339 |
FC.studio.32 = $(SPRO_VROOT)/bin/f90 |
9c75c0
|
340 |
|
35a012
|
341 |
CC.studio.64 = $(SPRO_VROOT)/bin/cc |
3cec7d
|
342 |
CXX.studio.64 = $(SPRO_VROOT)/bin/CC |
dcd7ba
|
343 |
F77.studio.64 = $(SPRO_VROOT)/bin/f77 |
bd9d92
|
344 |
FC.studio.64 = $(SPRO_VROOT)/bin/f90 |
9c75c0
|
345 |
|
bd9d92
|
346 |
CC.gcc.32 = $(GCC_ROOT)/bin/gcc |
3cec7d
|
347 |
CXX.gcc.32 = $(GCC_ROOT)/bin/g++ |
dcd7ba
|
348 |
F77.gcc.32 = $(GCC_ROOT)/bin/gfortran |
bd9d92
|
349 |
FC.gcc.32 = $(GCC_ROOT)/bin/gfortran |
9c75c0
|
350 |
|
bd9d92
|
351 |
CC.gcc.64 = $(GCC_ROOT)/bin/gcc |
3cec7d
|
352 |
CXX.gcc.64 = $(GCC_ROOT)/bin/g++ |
dcd7ba
|
353 |
F77.gcc.64 = $(GCC_ROOT)/bin/gfortran |
bd9d92
|
354 |
FC.gcc.64 = $(GCC_ROOT)/bin/gfortran |
9c75c0
|
355 |
|
NJ |
356 |
|
4f8cfa
|
357 |
lint.32 = $(SPRO_VROOT)/bin/lint -m32 |
MS |
358 |
lint.64 = $(SPRO_VROOT)/bin/lint -m64 |
|
359 |
|
|
360 |
LINT = $(lint.$(BITS)) |
|
361 |
|
61c373
|
362 |
LD = /usr/bin/ld |
9c75c0
|
363 |
|
fa74c0
|
364 |
PYTHON.2.6.VENDOR_PACKAGES.32 = /usr/lib/python2.6/vendor-packages |
NJ |
365 |
PYTHON.2.6.VENDOR_PACKAGES.64 = /usr/lib/python2.6/vendor-packages/64 |
|
366 |
PYTHON.2.6.VENDOR_PACKAGES = $(PYTHON.2.6.VENDOR_PACKAGES.$(BITS)) |
|
367 |
|
|
368 |
PYTHON.2.7.VENDOR_PACKAGES.32 = /usr/lib/python2.7/vendor-packages |
|
369 |
PYTHON.2.7.VENDOR_PACKAGES.64 = /usr/lib/python2.7/vendor-packages/64 |
|
370 |
PYTHON.2.7.VENDOR_PACKAGES = $(PYTHON.2.7.VENDOR_PACKAGES.$(BITS)) |
7999b2
|
371 |
|
MS |
372 |
ifeq ($(strip $(PARFAIT_BUILD)),yes) |
|
373 |
CC.studio.32 = $(WS_TOOLS)/parfait/cc |
|
374 |
CXX.studio.32 = $(WS_TOOLS)/parfait/CC |
|
375 |
CC.studio.64 = $(WS_TOOLS)/parfait/cc |
|
376 |
CXX.studio.64 = $(WS_TOOLS)/parfait/CC |
|
377 |
CC.gcc.32 = $(WS_TOOLS)/parfait/gcc |
|
378 |
CXX.gcc.32 = $(WS_TOOLS)/parfait/g++ |
|
379 |
CC.gcc.64 = $(WS_TOOLS)/parfait/gcc |
|
380 |
CXX.gcc.64 = $(WS_TOOLS)/parfait/g++ |
|
381 |
LD = $(WS_TOOLS)/parfait/ld |
|
382 |
endif |
|
383 |
|
|
384 |
CC = $(CC.$(COMPILER).$(BITS)) |
|
385 |
CXX = $(CXX.$(COMPILER).$(BITS)) |
dcd7ba
|
386 |
F77 = $(F77.$(COMPILER).$(BITS)) |
AL |
387 |
FC = $(FC.$(COMPILER).$(BITS)) |
7999b2
|
388 |
|
18b823
|
389 |
RUBY_VERSION = 1.9 |
AP |
390 |
RUBY_LIB_VERSION = 1.9.1 |
|
391 |
RUBY.1.9 = /usr/ruby/1.9/bin/ruby |
|
392 |
RUBY = $(RUBY.$(RUBY_VERSION)) |
|
393 |
# Use the ruby lib versions to represent the RUBY_VERSIONS that |
|
394 |
# need to get built. This is done because during package transformations |
|
395 |
# both the ruby version and the ruby library version are needed. |
|
396 |
RUBY_VERSIONS = $(RUBY_LIB_VERSION) |
fa74c0
|
397 |
|
a0613d
|
398 |
PYTHON_VENDOR_PACKAGES.32 = /usr/lib/python$(PYTHON_VERSION)/vendor-packages |
NJ |
399 |
PYTHON_VENDOR_PACKAGES.64 = /usr/lib/python$(PYTHON_VERSION)/vendor-packages/64 |
|
400 |
PYTHON_VENDOR_PACKAGES = $(PYTHON_VENDOR_PACKAGES.$(BITS)) |
|
401 |
|
9c75c0
|
402 |
PYTHON.2.6.32 = /usr/bin/python2.6 |
ca4d33
|
403 |
PYTHON.2.6.64 = /usr/bin/$(MACH64)/python2.6 |
fa74c0
|
404 |
|
NJ |
405 |
PYTHON.2.7.32 = /usr/bin/python2.7 |
|
406 |
PYTHON.2.7.64 = /usr/bin/$(MACH64)/python2.7 |
9c75c0
|
407 |
|
4e6f9b
|
408 |
PYTHON.32 = $(PYTHON.$(PYTHON_VERSION).32) |
RB |
409 |
PYTHON.64 = $(PYTHON.$(PYTHON_VERSION).64) |
a0613d
|
410 |
PYTHON = $(PYTHON.$(PYTHON_VERSION).$(BITS)) |
9c75c0
|
411 |
|
5bdc52
|
412 |
# The default is site-packages, but that directory belongs to the end-user. |
SS |
413 |
# Modules which are shipped by the OS but not with the core Python distribution |
|
414 |
# belong in vendor-packages. |
|
415 |
PYTHON_LIB= /usr/lib/python$(PYTHON_VERSION)/vendor-packages |
fa74c0
|
416 |
PYTHON_DATA= $(PYTHON_LIB) |
5bdc52
|
417 |
|
6d69e0
|
418 |
JAVA7_HOME = /usr/jdk/instances/jdk1.7.0 |
MS |
419 |
JAVA6_HOME = /usr/jdk/instances/jdk1.6.0 |
|
420 |
JAVA_HOME = $(JAVA7_HOME) |
61a323
|
421 |
|
6bc9bf
|
422 |
# This is the default BUILD version of perl |
CM |
423 |
# Not necessarily the system's default version, i.e. /usr/bin/perl |
cacdb3
|
424 |
#PERL_VERSION = 5.10.0 |
AP |
425 |
PERL_VERSION = 5.16 |
9aea33
|
426 |
|
cacdb3
|
427 |
#PERL_VERSIONS = 5.10.0 5.12 5.16 |
389f85
|
428 |
PERL_VERSIONS = 5.16 |
6bc9bf
|
429 |
|
32b206
|
430 |
PERL.5.10.0 = /usr/perl5/5.10.0/bin/perl |
6bc9bf
|
431 |
PERL.5.12 = /usr/perl5/5.12/bin/perl |
9581d1
|
432 |
PERL.5.16 = /usr/perl5/5.16/bin/perl |
6bc9bf
|
433 |
|
CM |
434 |
PERL = $(PERL.$(PERL_VERSION)) |
|
435 |
|
5ada66
|
436 |
PERL_ARCH := $(shell $(PERL) -e 'use Config; print $$Config{archname}') |
9581d1
|
437 |
PERL_ARCH_FUNC= $(shell $(1) -e 'use Config; print $$Config{archname}') |
6bc9bf
|
438 |
# Optimally we should ask perl which C compiler was used but it doesn't |
CM |
439 |
# result in a full path name. Only "c" is being recorded |
|
440 |
# inside perl builds while we actually need a full path to |
|
441 |
# the studio compiler. |
5ada66
|
442 |
#PERL_CC := $(shell $(PERL) -e 'use Config; print $$Config{cc}') |
6bc9bf
|
443 |
|
CM |
444 |
PKG_MACROS += PERL_ARCH=$(PERL_ARCH) |
|
445 |
PKG_MACROS += PERL_VERSION=$(PERL_VERSION) |
|
446 |
|
7fd1f9
|
447 |
PG_VERSION ?= 9.3 |
AP |
448 |
PG_VERNUM = $(subst .,,$(PG_VERSION)) |
|
449 |
PG_HOME = /usr/postgres/$(PG_VERSION) |
|
450 |
PG_BINDIR.32 = $(PG_HOME)/bin |
|
451 |
PG_BINDIR.64 = $(PG_HOME)/bin/$(MACH64) |
|
452 |
PG_INCDIR = $(PG_HOME)/include |
|
453 |
PG_MANDIR = $(PG_HOME)/man |
|
454 |
PG_SHAREDIR = $(PG_HOME)/share |
|
455 |
PG_DOCDIR = $(PG_HOME)/doc |
|
456 |
PG_LIBDIR.32 = $(PG_HOME)/lib |
|
457 |
PG_LIBDIR.64 = $(PG_HOME)/lib/$(MACH64) |
|
458 |
PG_CONFIG.32 = $(PG_BINDIR.32)/pg_config |
|
459 |
PG_CONFIG.64 = $(PG_BINDIR.64)/pg_config |
|
460 |
|
|
461 |
PKG_MACROS += PG_VERSION=$(PG_VERSION) |
|
462 |
PKG_MACROS += PG_VERNUM=$(PG_VERNUM) |
|
463 |
|
23aaef
|
464 |
# This is the default BUILD version of tcl |
DL |
465 |
# Not necessarily the system's default version, i.e. /usr/bin/tclsh |
|
466 |
TCL_VERSION = 8.5 |
|
467 |
TCLSH.8.5.i386.32 = /usr/bin/i86/tclsh8.5 |
|
468 |
TCLSH.8.5.i386.64 = /usr/bin/amd64/tclsh8.5 |
|
469 |
TCLSH.8.5.sparc.32 = /usr/bin/sparcv7/tclsh8.5 |
|
470 |
TCLSH.8.5.sparc.64 = /usr/bin/sparcv9/tclsh8.5 |
|
471 |
TCLSH = $(TCLSH.$(TCL_VERSION).$(MACH).$(BITS)) |
|
472 |
|
6bc9bf
|
473 |
CCSMAKE = /usr/ccs/bin/make |
9c75c0
|
474 |
GMAKE = /usr/gnu/bin/make |
NJ |
475 |
GPATCH = /usr/gnu/bin/patch |
ff1c63
|
476 |
PATCH_LEVEL = 1 |
35a012
|
477 |
GPATCH_BACKUP = --backup --version-control=numbered |
NJ |
478 |
GPATCH_FLAGS = -p$(PATCH_LEVEL) $(GPATCH_BACKUP) |
960e5b
|
479 |
GSED = /usr/gnu/bin/sed |
8d70f8
|
480 |
GDIFF = /usr/gnu/bin/diff |
RB |
481 |
GSORT = /usr/gnu/bin/sort |
9c75c0
|
482 |
|
dd0336
|
483 |
PKGREPO = /usr/bin/pkgrepo |
9c75c0
|
484 |
PKGSEND = /usr/bin/pkgsend |
7bf47e
|
485 |
ifeq ($(strip $(PKGLINT_COMPONENT)),) |
d08673
|
486 |
PKGLINT = /usr/bin/pkglint |
7bf47e
|
487 |
else |
MS |
488 |
PKGLINT = ${WS_TOOLS}/pkglint |
|
489 |
endif |
9c75c0
|
490 |
|
b06748
|
491 |
ACLOCAL = /usr/bin/aclocal-1.10 |
VM |
492 |
AUTOMAKE = /usr/bin/automake-1.10 |
|
493 |
AUTORECONF = /usr/bin/autoreconf |
|
494 |
|
9b6169
|
495 |
KSH93 = /usr/bin/ksh93 |
9c75c0
|
496 |
TOUCH = /usr/bin/touch |
NJ |
497 |
MKDIR = /bin/mkdir -p |
|
498 |
RM = /bin/rm -f |
153732
|
499 |
CP = /bin/cp -f |
2515dc
|
500 |
MV = /bin/mv -f |
3d7f8d
|
501 |
LN = /bin/ln |
8d70f8
|
502 |
CAT = /bin/cat |
3d7f8d
|
503 |
SYMLINK = /bin/ln -s |
61c373
|
504 |
ENV = /usr/bin/env |
3d7f8d
|
505 |
INSTALL = /usr/bin/ginstall |
81db49
|
506 |
CHMOD = /usr/bin/chmod |
e5e44e
|
507 |
NAWK = /usr/bin/nawk |
SM |
508 |
TEE = /usr/bin/tee |
617c23
|
509 |
IPS2TGZ = $(WS_TOOLS)/ips2tgz |
4f8cfa
|
510 |
|
MS |
511 |
INS.dir= $(INSTALL) -d $@ |
|
512 |
INS.file= $(INSTALL) -m 444 $< $(@D) |
3cec7d
|
513 |
|
NJ |
514 |
PKG_CONFIG_PATH.32 = /usr/lib/pkgconfig |
|
515 |
PKG_CONFIG_PATH.64 = /usr/lib/$(MACH64)/pkgconfig |
4e6f9b
|
516 |
PKG_CONFIG_PATH = $(PKG_CONFIG_PATH.$(BITS)) |
3cec7d
|
517 |
|
b55e44
|
518 |
# Set default path for environment modules |
AL |
519 |
MODULE_VERSION = 3.2.10 |
|
520 |
MODULE_PATH = /usr/share/Modules/modulefiles |
|
521 |
MODULE_VERSIONS_PATH = /usr/share/Modules/versions |
|
522 |
|
|
523 |
# Path to bash completions |
|
524 |
BASH_COMPLETIONS_PATH = /usr/share/bash-completion/completions |
4f8cfa
|
525 |
|
MS |
526 |
# |
35a012
|
527 |
# C preprocessor flag sets to ease feature selection. Add the required |
NJ |
528 |
# feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to |
|
529 |
# the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or |
|
530 |
# similiar. |
|
531 |
# |
4f8cfa
|
532 |
|
35a012
|
533 |
# Enables visibility of some c99 math functions that aren't visible by default. |
NJ |
534 |
# What other side-effects are there? |
|
535 |
CPP_C99_EXTENDED_MATH = -D_STDC_99 |
e4bbaf
|
536 |
|
35a012
|
537 |
# Enables large file support for components that have no other means of doing |
NJ |
538 |
# so. Use CPP_LARGEFILES and not the .32/.64 variety directly |
5ada66
|
539 |
CPP_LARGEFILES.32 := $(shell getconf LFS_CFLAGS) |
DD |
540 |
CPP_LARGEFILES.64 := $(shell getconf LFS64_CFLAGS) |
35a012
|
541 |
CPP_LARGEFILES = $(CPP_LARGEFILES.$(BITS)) |
4f8cfa
|
542 |
|
35a012
|
543 |
# Enables some #pragma redefine_extname to POSIX-compliant Standard C Library |
NJ |
544 |
# functions. Also avoids the component's #define _POSIX_C_SOURCE to some value |
|
545 |
# we currently do not support. |
|
546 |
CPP_POSIX = -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS |
4f8cfa
|
547 |
|
MS |
548 |
# XPG6 mode. This option enables XPG6 conformance, plus extensions. |
|
549 |
# Amongst other things, this option will cause system calls like |
|
550 |
# popen (3C) and system (3C) to invoke the standards-conforming |
35a012
|
551 |
# shell, /usr/xpg4/bin/sh, instead of /usr/bin/sh. Add studio_XPG6MODE to |
NJ |
552 |
# CFLAGS instead of using this directly |
|
553 |
CPP_XPG6MODE= -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6 |
4f8cfa
|
554 |
|
0aeacd
|
555 |
# XPG5 mode. These options are specific for C++, where _XPG6, |
ST |
556 |
# _XOPEN_SOURCE=600 and C99 are illegal. -D__EXTENSIONS__=1 is legal in C++. |
|
557 |
CPP_XPG5MODE= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__=1 -D_XPG5 |
35a012
|
558 |
|
NJ |
559 |
# |
|
560 |
# Studio C compiler flag sets to ease feature selection. Add the required |
|
561 |
# feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the |
|
562 |
# component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. |
|
563 |
# |
|
564 |
|
|
565 |
# Generate 32/64 bit objects |
|
566 |
CC_BITS = -m$(BITS) |
|
567 |
|
|
568 |
# Code generation instruction set and optimization 'hints'. Use studio_XBITS |
|
569 |
# and not the .arch.bits variety directly. |
|
570 |
studio_XBITS.sparc.32 = -xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 |
65f457
|
571 |
studio_XBITS.sparc.64 = |
MS |
572 |
ifneq ($(strip $(PARFAIT_BUILD)),yes) |
|
573 |
studio_XBITS.sparc.64 += -xtarget=ultra2 |
|
574 |
endif |
|
575 |
studio_XBITS.sparc.64 += -xarch=sparcvis -xchip=ultra2 |
780aa6
|
576 |
studio_XBITS.i386.32 = -xchip=pentium |
63f346
|
577 |
studio_XBITS.i386.64 = -xchip=generic -Ui386 -U__i386 |
780aa6
|
578 |
studio_XBITS = $(studio_XBITS.$(MACH).$(BITS)) |
35a012
|
579 |
|
NJ |
580 |
# Turn on recognition of supported C99 language features and enable the 1999 C |
|
581 |
# standard library semantics of routines that appear in both the 1990 and |
|
582 |
# 1999 C standard. To use set studio_C99MODE=$(studio_99_ENABLE) in your |
|
583 |
# component Makefile. |
|
584 |
studio_C99_ENABLE = -xc99=all |
|
585 |
|
|
586 |
# Turn off recognition of C99 language features, and do not enable the 1999 C |
|
587 |
# standard library semantics of routines that appeared in both the 1990 and |
|
588 |
# 1999 C standard. To use set studio_C99MODE=$(studio_99_DISABLE) in your |
|
589 |
# component Makefile. |
|
590 |
studio_C99_DISABLE = -xc99=none |
|
591 |
|
|
592 |
# Use the compiler default 'xc99=all,no_lib' |
|
593 |
studio_C99MODE = |
0aeacd
|
594 |
|
ST |
595 |
# For C++, compatibility with C99 (which is technically illegal) is |
|
596 |
# enabled in a different way. So, we must use a different macro for it. |
|
597 |
studio_cplusplus_C99_ENABLE = -xlang=c99 |
|
598 |
|
|
599 |
# Turn it off. |
|
600 |
studio_cplusplus_C99_DISABLE = |
|
601 |
|
|
602 |
# And this is the macro you should actually use |
|
603 |
studio_cplusplus_C99MODE = |
35a012
|
604 |
|
9d5dbf
|
605 |
# Turn on C99 for gcc |
DH |
606 |
gcc_C99_ENABLE = -std=c99 |
|
607 |
|
35a012
|
608 |
# Allow zero-sized struct/union declarations and void functions with return |
NJ |
609 |
# statements. |
|
610 |
studio_FEATURES_EXTENSIONS = -features=extensions |
9b6169
|
611 |
|
35a012
|
612 |
# Control the Studio optimization level. |
780aa6
|
613 |
studio_OPT.sparc.32 = -xO4 |
NJ |
614 |
studio_OPT.sparc.64 = -xO4 |
|
615 |
studio_OPT.i386.32 = -xO4 |
|
616 |
studio_OPT.i386.64 = -xO4 |
|
617 |
studio_OPT = $(studio_OPT.$(MACH).$(BITS)) |
35a012
|
618 |
|
NJ |
619 |
# Studio PIC code generation. Use CC_PIC instead to select PIC code generation. |
|
620 |
studio_PIC = -KPIC -DPIC |
4f8cfa
|
621 |
|
MS |
622 |
# The Sun Studio 11 compiler has changed the behaviour of integer |
|
623 |
# wrap arounds and so a flag is needed to use the legacy behaviour |
|
624 |
# (without this flag panics/hangs could be exposed within the source). |
35a012
|
625 |
# This is used through studio_IROPTS, not the 'sparc' variety. |
NJ |
626 |
studio_IROPTS.sparc = -W2,-xwrap_int |
780aa6
|
627 |
studio_IROPTS = $(studio_IROPTS.$(MACH)) |
35a012
|
628 |
|
NJ |
629 |
# Control register usage for generated code. SPARC ABI requires system |
|
630 |
# libraries not to use application registers. x86 requires 'no%frameptr' at |
|
631 |
# x04 or higher. |
15d3df
|
632 |
|
MS |
633 |
# We should just use -xregs but we need to workaround 7030022. Note |
|
634 |
# that we can't use the (documented) -Wc,-xregs workaround because |
|
635 |
# libtool really hates -Wc and thinks it should be -Wl. Instead |
|
636 |
# we use an (undocumented) option which actually happens to be what |
|
637 |
# CC would use. |
|
638 |
studio_XREGS.sparc = -Qoption cg -xregs=no%appl |
35a012
|
639 |
studio_XREGS.i386 = -xregs=no%frameptr |
780aa6
|
640 |
studio_XREGS = $(studio_XREGS.$(MACH)) |
15d3df
|
641 |
|
MS |
642 |
gcc_XREGS.sparc = -mno-app-regs |
|
643 |
gcc_XREGS.i386 = |
|
644 |
gcc_XREGS = $(gcc_XREGS.$(MACH)) |
35a012
|
645 |
|
24dc68
|
646 |
# Set data alignment on sparc to reasonable values, 8 byte alignment for 32 bit |
NJ |
647 |
# objects and 16 byte alignment for 64 bit objects. This is added to CFLAGS by |
|
648 |
# default. |
|
649 |
studio_ALIGN.sparc.32 = -xmemalign=8s |
|
650 |
studio_ALIGN.sparc.64 = -xmemalign=16s |
|
651 |
studio_ALIGN = $(studio_ALIGN.$(MACH).$(BITS)) |
|
652 |
|
|
653 |
# Studio shorthand for building multi-threaded code, enables -D_REENTRANT and |
|
654 |
# linking with threadin support. This is added to CFLAGS by default, override |
|
655 |
# studio_MT to turn this off. |
|
656 |
studio_MT = -mt |
|
657 |
|
35a012
|
658 |
# See CPP_XPG6MODE comment above. |
NJ |
659 |
studio_XPG6MODE = $(studio_C99MODE) $(CPP_XPG6MODE) |
|
660 |
XPG6MODE = $(studio_XPG6MODE) |
|
661 |
|
0aeacd
|
662 |
# See CPP_XPG5MODE comment above. You can only use this in C++, not in C99. |
ST |
663 |
studio_XPG5MODE = $(studio_cplusplus_C99MODE) $(CPP_XPG5MODE) |
|
664 |
XPG5MODE = $(studio_XPG5MODE) |
|
665 |
|
35a012
|
666 |
# Default Studio C compiler flags. Add the required feature to your Makefile |
NJ |
667 |
# with CFLAGS += $(FEATURE_MACRO) and add to the component build with |
|
668 |
# CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it |
|
669 |
# should not be necessary to add CFLAGS to any environment other than the |
|
670 |
# configure environment. |
|
671 |
CFLAGS.studio += $(studio_OPT) $(studio_XBITS) $(studio_XREGS) \ |
24dc68
|
672 |
$(studio_IROPTS) $(studio_C99MODE) $(studio_ALIGN) \ |
NJ |
673 |
$(studio_MT) |
35a012
|
674 |
|
4f8cfa
|
675 |
# |
35a012
|
676 |
# GNU C compiler flag sets to ease feature selection. Add the required |
NJ |
677 |
# feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the |
|
678 |
# component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. |
|
679 |
# |
4f8cfa
|
680 |
|
35a012
|
681 |
# GCC Compiler optimization flag |
NJ |
682 |
gcc_OPT = -O3 |
4f8cfa
|
683 |
|
35a012
|
684 |
# GCC PIC code generation. Use CC_PIC instead to select PIC code generation. |
NJ |
685 |
gcc_PIC = -fPIC -DPIC |
4f8cfa
|
686 |
|
35a012
|
687 |
# Generic macro for PIC code generation. Use this macro instead of the |
NJ |
688 |
# compiler specific variant. |
|
689 |
CC_PIC = $($(COMPILER)_PIC) |
4f8cfa
|
690 |
|
MS |
691 |
|
35a012
|
692 |
# Default GNU C compiler flags. Add the required feature to your Makefile |
NJ |
693 |
# with CFLAGS += $(FEATURE_MACRO) and add to the component build with |
|
694 |
# CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it |
|
695 |
# should not be necessary to add CFLAGS to any environment other than the |
|
696 |
# configure environment. |
|
697 |
CFLAGS.gcc += $(gcc_OPT) |
15d3df
|
698 |
CFLAGS.gcc += $(gcc_XREGS) |
4f8cfa
|
699 |
|
35a012
|
700 |
|
NJ |
701 |
# Build 32 or 64 bit objects. |
|
702 |
CFLAGS += $(CC_BITS) |
|
703 |
|
|
704 |
# Add compiler specific 'default' features |
|
705 |
CFLAGS += $(CFLAGS.$(COMPILER)) |
|
706 |
|
|
707 |
|
3cec7d
|
708 |
# Studio C++ requires -norunpath to avoid adding its location into the RUNPATH |
NJ |
709 |
# to C++ applications. |
|
710 |
studio_NORUNPATH = -norunpath |
|
711 |
|
|
712 |
# To link in standard mode (the default mode) without any C++ libraries |
|
713 |
# (except libCrun), use studio_LIBRARY_NONE in your component Makefile. |
|
714 |
studio_LIBRARY_NONE = -library=%none |
|
715 |
|
|
716 |
# Don't link C++ with any C++ Runtime or Standard C++ library |
|
717 |
studio_CXXLIB_NONE = -xnolib |
|
718 |
|
|
719 |
# Link C++ with the Studio C++ Runtime and Standard C++ library. This is the |
|
720 |
# default for "standard" mode. |
|
721 |
studio_CXXLIB_CSTD = -library=Cstd,Crun |
|
722 |
|
|
723 |
# link C++ with the Studio C++ Runtime and Apache Standard C++ library |
|
724 |
studio_CXXLIB_APACHE = -library=stdcxx4,Crun |
|
725 |
|
|
726 |
# Add the C++ ABI compatibility flags for older ABI compatibility. The default |
|
727 |
# is "standard mode" (-compat=5) |
|
728 |
studio_COMPAT_VERSION_4 = -compat=4 |
|
729 |
|
|
730 |
# Tell the compiler that we don't want the studio runpath added to the |
|
731 |
# linker flags. We never want the Studio location added to the RUNPATH. |
|
732 |
CXXFLAGS += $($(COMPILER)_NORUNPATH) |
|
733 |
|
614c6a
|
734 |
# Build 32 or 64 bit objects in C++ as well. |
ST |
735 |
CXXFLAGS += $(CC_BITS) |
|
736 |
|
dcd7ba
|
737 |
# Build 32 or 64 bit objects in FORTRAN as well. |
AL |
738 |
F77FLAGS += $(CC_BITS) |
|
739 |
FCFLAGS += $(CC_BITS) |
|
740 |
|
|
741 |
|
35a012
|
742 |
# |
NJ |
743 |
# Solaris linker flag sets to ease feature selection. Add the required |
|
744 |
# feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the |
|
745 |
# component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar. |
|
746 |
# |
3cec7d
|
747 |
|
NJ |
748 |
# set the bittedness that we want to link |
db2ec7
|
749 |
ccs.ld.64 = -64 |
AS |
750 |
gcc.ld.32 = -m32 |
|
751 |
gcc.ld.64 = -m64 |
|
752 |
LD_BITS = $($(LINKER).ld.$(BITS)) |
|
753 |
LDFLAGS = $(LD_BITS) |
35a012
|
754 |
|
NJ |
755 |
# Reduce the symbol table size, effectively conflicting with -g. We should |
|
756 |
# get linker guidance here. |
|
757 |
LD_Z_REDLOCSYM = -z redlocsym |
|
758 |
|
|
759 |
# Cause the linker to rescan archive libraries and resolve remaining unresolved |
|
760 |
# symbols recursively until all symbols are resolved. Components should be |
|
761 |
# linking in the libraries they need, in the required order. This should |
|
762 |
# only be required if the component's native build is horribly broken. |
|
763 |
LD_Z_RESCAN_NOW = -z rescan-now |
|
764 |
|
|
765 |
LD_Z_TEXT = -z direct |
|
766 |
|
3a5b3f
|
767 |
# make sure that -lc is always present when building shared objects. |
RB |
768 |
LD_DEF_LIBS += -lc |
|
769 |
|
35a012
|
770 |
# make sure all symbols are defined. |
NJ |
771 |
LD_Z_DEFS = -z defs |
|
772 |
|
17fc9e
|
773 |
# eliminate unreferenced dynamic dependencies |
NJ |
774 |
LD_Z_IGNORE = -z ignore |
|
775 |
|
35a012
|
776 |
# use direct binding |
NJ |
777 |
LD_B_DIRECT = -Bdirect |
|
778 |
|
0f1b63
|
779 |
# use generic macro names for enabling/disabling ASLR |
AC |
780 |
ASLR_ENABLE = -z aslr=enable |
|
781 |
ASLR_DISABLE = -z aslr=disable |
|
782 |
ASLR_MODE = $(ASLR_DISABLE) |
|
783 |
|
|
784 |
# by default, turn off Address Space Layout Randomization for ELF executables; |
|
785 |
# to explicitly enable ASLR, set ASLR_MODE = $(ASLR_ENABLE) |
|
786 |
# in that component's Makefile |
|
787 |
LD_Z_ASLR = $(ASLR_MODE) |
|
788 |
|
35a012
|
789 |
# |
NJ |
790 |
# More Solaris linker flags that we want to be sure that everyone gets. This |
|
791 |
# is automatically added to the calling environment during the 'build' and |
|
792 |
# 'install' phases of the component build. Each individual feature can be |
|
793 |
# turned off by adding FEATURE_MACRO= to the component Makefile. |
|
794 |
# |
|
795 |
|
|
796 |
# Create a non-executable stack when linking. |
ad8773
|
797 |
LD_MAP_NOEXSTK.i386 = -M /usr/lib/ld/map.noexstk |
AB |
798 |
LD_MAP_NOEXSTK.sparc = -M /usr/lib/ld/map.noexstk |
35a012
|
799 |
|
NJ |
800 |
# Create a non-executable bss segment when linking. |
|
801 |
LD_MAP_NOEXBSS = -M /usr/lib/ld/map.noexbss |
|
802 |
|
|
803 |
# Create a non-executable data segment when linking. Due to PLT needs, the |
|
804 |
# data segment must be executable on sparc, but the bss does not. |
|
805 |
# see mapfile comments for more information |
|
806 |
LD_MAP_NOEXDATA.i386 = -M /usr/lib/ld/map.noexdata |
|
807 |
LD_MAP_NOEXDATA.sparc = $(LD_MAP_NOEXBSS) |
|
808 |
|
|
809 |
# Page alignment |
|
810 |
LD_MAP_PAGEALIGN = -M /usr/lib/ld/map.pagealign |
|
811 |
|
|
812 |
# Linker options to add when only building libraries |
3a5b3f
|
813 |
LD_OPTIONS_SO += $(LD_Z_TEXT) $(LD_Z_DEFS) $(LD_DEF_LIBS) |
35a012
|
814 |
|
NJ |
815 |
# Default linker options that everyone should get. Do not add additional |
|
816 |
# libraries to this macro, as it will apply to everything linked during the |
|
817 |
# component build. |
ad8773
|
818 |
LD_OPTIONS += $(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \ |
17fc9e
|
819 |
$(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE) |
1932c6
|
820 |
|
0f1b63
|
821 |
# only used on executables |
AC |
822 |
LD_EXEC_OPTIONS = $(LD_Z_ASLR) |
|
823 |
|
e83e52
|
824 |
# Environment variables and arguments passed into the build and install |
1932c6
|
825 |
# environment(s). These are the initial settings. |
MS |
826 |
COMPONENT_BUILD_ENV= \ |
0f1b63
|
827 |
LD_OPTIONS="$(LD_OPTIONS)" \ |
AC |
828 |
LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" |
1932c6
|
829 |
COMPONENT_INSTALL_ENV= \ |
0f1b63
|
830 |
LD_OPTIONS="$(LD_OPTIONS)" \ |
AC |
831 |
LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" |
1932c6
|
832 |
|
1a7b67
|
833 |
# PERL options which depend on C options should be placed here |
AP |
834 |
# Don't trust Perl $Config{optimize}, we can get Studio flags |
|
835 |
PERL_OPTIMIZE =$(gcc_OPT) |
|
836 |
|
|
837 |
# We need this to overwrite options of perl used to compile illumos-gate |
|
838 |
PERL_STUDIO_OVERWRITE = cc="$(CC)" cccdlflags="$(CC_PIC)" ld="$(CC)" ccname="$(shell basename $(CC))" optimize="$(gcc_OPT)" |
|
839 |
|
a2af51
|
840 |
# Allow user to override default maximum number of archives |
8bcaef
|
841 |
NUM_EXTRA_ARCHIVES= 1 2 3 4 5 6 7 8 9 10 |
AP |
842 |
|
1932c6
|
843 |
# Add any bit-specific settings |
e83e52
|
844 |
COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS)) |
NJ |
845 |
COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS)) |
|
846 |
COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS)) |
|
847 |
COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS)) |
4158c0
|
848 |
|
3cec7d
|
849 |
# declare these phony so that we avoid filesystem conflicts. |
7999b2
|
850 |
.PHONY: prep build install publish test clean clobber parfait |
3cec7d
|
851 |
|
4158c0
|
852 |
# If there are no tests to execute |
NJ |
853 |
NO_TESTS = test-nothing |
|
854 |
test-nothing: |
|
855 |
@echo "There are no tests available at this time." |
764663
|
856 |
|
NJ |
857 |
# default behaviour for 'component-hook' target is to echo the component |
|
858 |
# name and version information, but more complex behaviour can be implemented |
|
859 |
# via command line setting of the COMPONENT_HOOK macro. |
|
860 |
COMPONENT_HOOK ?= echo $(COMPONENT_NAME) $(COMPONENT_VERSION) |
|
861 |
|
|
862 |
component-hook: |
|
863 |
@$(COMPONENT_HOOK) |
|
864 |
|