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.
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.
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]
21 # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
24 PATH
=/usr
/bin
:/usr
/gnu
/bin
26 # The location of an internal mirror of community source archives that we build
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
31 #INTERNAL_ARCHIVE_MIRROR = http://userland.us.oracle.com/source-archives
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.
35 #EXTERNAL_ARCHIVE_MIRROR = \
36 # http://static.opensolaris.org/action/browse/userland/tarball/userland
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)
43 # The workspace starts at the mercurial root
44 ifeq ($(origin WS_TOP
), undefined
)
46 $(shell hg root
2>/dev
/null || git rev-parse
--show-toplevel
)
49 USERLAND_ARCHIVES ?
= $(WS_TOP
)/archives
/
50 WS_MACH
= $(WS_TOP
)/$(MACH
)
51 WS_LOGS
= $(WS_MACH
)/logs
52 WS_REPO
= $(WS_MACH
)/repo
53 WS_TOOLS
= $(WS_TOP
)/tools
54 WS_MAKE_RULES
= $(WS_TOP
)/make-rules
55 WS_COMPONENTS
= $(WS_TOP
)/components
56 WS_LICENSES
= $(WS_TOP
)/licenses
57 WS_INCORPORATIONS
= $(WS_TOP
)/incorporations
58 WS_LINT_CACHE
= $(WS_MACH
)/pkglint-cache
60 # we want our pkg piplines to fail if there is an error
61 # (like if pkgdepend fails in the middle of a pipe), but
62 # we don't want the builds or ./configure's failing as well.
63 # so we only set pipefail for the publish target and have
64 # to reset it for the others since they might be invoked
65 # as dependencies of publish.
70 publish
: SHELLOPTS
=pipefail
74 # This can be overridden to avoid rebuilding when you touch a Makefile
75 MAKEFILE_PREREQ
= Makefile
77 CONSOLIDATION
= userland
78 PUBLISHER ?
= $(CONSOLIDATION
)
79 PUBLISHER_LOCALIZABLE ?
= $(CONSOLIDATION
)-localizable
81 # Defines $(space) as a single blank space, so we can use it to convert
82 # space-separated paths to colon-separated paths in variables with
83 # $(subst $(space),:,$(strip $(SPATHS)))
85 space
:= $(empty
) $(empty
)
90 OS_VERSION
:= $(shell uname
-r
)
91 SOLARIS_VERSION
= 2.11
93 PKG_SOLARIS_VERSION ?
= 5.11
95 include $(WS_MAKE_RULES
)/ips-buildinfo.mk
101 PYTHON_VERSIONS
= 2.7
103 BASS_O_MATIC
= $(WS_TOOLS
)/bass-o-matic
105 CLONEY
= $(WS_TOOLS
)/cloney
107 CONFIG_SHELL
= /bin
/sh
109 PUNAME
= /usr
/bin
/puname
111 PKG_REPO
= file
:$(WS_REPO
)
113 COMPONENT_SRC_NAME
= $(COMPONENT_NAME
)
115 COMPONENT_LICENSE_FILE ?
= $(COMPONENT_NAME
).license
117 COMPONENT_DIR
:= $(shell pwd
)
118 SOURCE_DIR
= $(COMPONENT_DIR
)/$(COMPONENT_SRC
)
119 BUILD_DIR
= $(COMPONENT_DIR
)/build
120 PROTO_DIR
= $(BUILD_DIR
)/prototype
/$(MACH
)
123 ARCHLIBSUBDIR64
= $(MACH64
)
124 ARCHLIBSUBDIR
= $(ARCHLIBSUBDIR
$(BITS
))
132 KERNELDRVDIR
= /kernel
/drv
133 KERNELDRVDIR32
=/kernel
/drv
134 KERNELDRVDIR64
=/kernel
/drv
/$(MACH64
)
135 USRBINDIR
= $(USRDIR
)/bin
136 USRBINDIR32
= $(USRDIR
)/bin
/$(MACH32
)
137 USRBINDIR64
= $(USRDIR
)/bin
/$(MACH64
)
138 USRSBINDIR
= $(USRDIR
)/sbin
139 USRSBINDIR32
= $(USRDIR
)/sbin
/$(MACH32
)
140 USRSBINDIR64
= $(USRDIR
)/sbin
/$(MACH64
)
141 USRLIBDIR
= $(USRDIR
)/lib
142 USRLIBDIR32
= $(USRDIR
)/lib
143 USRLIBDIR64
= $(USRDIR
)/lib
/$(MACH64
)
144 USRSHAREDIR
= $(USRDIR
)/share
145 USRINCDIR
= $(USRDIR
)/include
146 USRSHARELOCALEDIR
= $(USRSHAREDIR
)/locale
147 USRSHAREMANDIR
= $(USRSHAREDIR
)/man
148 USRSHAREDOCDIR
= $(USRSHAREDIR
)/doc
149 USRSHARELIBDIR
= $(USRSHAREDIR
)/lib
150 USRSHAREMAN1DIR
= $(USRSHAREMANDIR
)/man1
151 USRSHAREMAN1MDIR
= $(USRSHAREMANDIR
)/man1m
152 USRSHAREMAN3DIR
= $(USRSHAREMANDIR
)/man3
153 USRSHAREMAN4DIR
= $(USRSHAREMANDIR
)/man4
154 USRSHAREMAN5DIR
= $(USRSHAREMANDIR
)/man5
155 USRSHAREMAN8DIR
= $(USRSHAREMANDIR
)/man8
156 USRKERNELDRVDIR
= $(USRDIR
)/kernel
/drv
157 USRKERNELDRVDIR32
= $(USRDIR
)/kernel
/drv
158 USRKERNELDRVDIR64
= $(USRDIR
)/kernel
/drv
/$(MACH64
)
160 # The *.$(BITS) variables are different from those above (better suited for
161 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
162 USRBINDIR
.32 = $(USRBINDIR
)
163 USRBINDIR
.64 = $(USRBINDIR64
)
164 USRSBINDIR
.32 = $(USRSBINDIR
)
165 USRSBINDIR
.64 = $(USRSBINDIR64
)
166 USRLIBDIR
.32 = $(USRLIBDIR
)
167 USRLIBDIR
.64 = $(USRLIBDIR64
)
169 PROTOETCDIR
= $(PROTO_DIR
)/$(ETCDIR
)
170 PROTOETCSECDIR
= $(PROTO_DIR
)/$(ETCDIR
)/security
171 PROTOUSRDIR
= $(PROTO_DIR
)/$(USRDIR
)
172 PROTOBINDIR
= $(PROTO_DIR
)/$(BINDIR
)
173 PROTOSBINDIR
= $(PROTO_DIR
)/$(SBINDIR
)
174 PROTOLIBDIR
= $(PROTO_DIR
)/$(LIBDIR
)
175 PROTOVARDIR
= $(PROTO_DIR
)/$(VARDIR
)
176 PROTOKERNELDRVDIR
= $(PROTO_DIR
)/$(KERNELDRVDIR
)
177 PROTOKERNELDRVDIR32
= $(PROTO_DIR
)/$(KERNELDRVDIR32
)
178 PROTOKERNELDRVDIR64
= $(PROTO_DIR
)/$(KERNELDRVDIR64
)
179 PROTOUSRBINDIR
= $(PROTO_DIR
)/$(USRBINDIR
)
180 PROTOUSRBINDIR32
= $(PROTO_DIR
)/$(USRBINDIR32
)
181 PROTOUSRBINDIR64
= $(PROTO_DIR
)/$(USRBINDIR64
)
182 PROTOUSRSBINDIR
= $(PROTO_DIR
)/$(USRSBINDIR
)
183 PROTOUSRSBINDIR32
= $(PROTO_DIR
)/$(USRSBINDIR32
)
184 PROTOUSRSBINDIR64
= $(PROTO_DIR
)/$(USRSBINDIR64
)
185 PROTOUSRLIBDIR
= $(PROTO_DIR
)/$(USRLIBDIR
)
186 PROTOUSRLIBDIR32
= $(PROTO_DIR
)/$(USRLIBDIR32
)
187 PROTOUSRLIBDIR64
= $(PROTO_DIR
)/$(USRLIBDIR64
)
188 PROTOUSRINCDIR
= $(PROTO_DIR
)/$(USRINCDIR
)
189 PROTOUSRSHAREDIR
= $(PROTO_DIR
)/$(USRSHAREDIR
)
190 PROTOUSRSHARELIBDIR
= $(PROTO_DIR
)/$(USRSHARELIBDIR
)
191 PROTOUSRSHAREMANDIR
= $(PROTO_DIR
)/$(USRSHAREMANDIR
)
192 PROTOUSRSHAREDOCDIR
= $(PROTO_DIR
)/$(USRSHAREDOCDIR
)
193 PROTOUSRSHAREMAN1DIR
= $(PROTO_DIR
)/$(USRSHAREMAN1DIR
)
194 PROTOUSRSHAREMAN1MDIR
= $(PROTO_DIR
)/$(USRSHAREMAN1MDIR
)
195 PROTOUSRSHAREMAN3DIR
= $(PROTO_DIR
)/$(USRSHAREMAN3DIR
)
196 PROTOUSRSHAREMAN4DIR
= $(PROTO_DIR
)/$(USRSHAREMAN4DIR
)
197 PROTOUSRSHAREMAN5DIR
= $(PROTO_DIR
)/$(USRSHAREMAN5DIR
)
198 PROTOUSRSHAREMAN8DIR
= $(PROTO_DIR
)/$(USRSHAREMAN8DIR
)
199 PROTOUSRSHARELOCALEDIR
= $(PROTO_DIR
)/$(USRSHARELOCALEDIR
)
200 PROTOUSRKERNELDRVDIR
= $(PROTO_DIR
)/$(USRKERNELDRVDIR
)
201 PROTOUSRKERNELDRVDIR32
= $(PROTO_DIR
)/$(USRKERNELDRVDIR32
)
202 PROTOUSRKERNELDRVDIR64
= $(PROTO_DIR
)/$(USRKERNELDRVDIR64
)
204 PROTOUSRBINDIR
.32 = $(PROTOUSRBINDIR
)
205 PROTOUSRBINDIR
.64 = $(PROTOUSRBINDIR64
)
206 PROTOUSRSBINDIR
.32 = $(PROTOUSRSBINDIR
)
207 PROTOUSRSBINDIR
.64 = $(PROTOUSRSBINDIR64
)
208 PROTOUSRLIBDIR
.32 = $(PROTOUSRLIBDIR
)
209 PROTOUSRLIBDIR
.64 = $(PROTOUSRLIBDIR64
)
211 # NOTE: We do not build SFW contents
212 # /usr/sfw/bin is just a historic artefact, containing symlinks
213 SFWBIN
= /usr
/sfw
/bin
215 SFWBIN64
= $(SFWBIN
)/$(MACH64
)
216 SFWSBIN
= /usr
/sfw
/sbin
217 SFWSBIN32
= $(SFWSBIN
)
218 SFWSBIN64
= $(SFWSBIN
)/$(MACH64
)
219 SFWINCLUDE
= /usr
/sfw
/include
220 SFWLIB
= /usr
/sfw
/lib
222 SFWLIB64
= $(SFWLIB
)/$(MACH64
)
223 SFWSHARE
= /usr
/sfw
/share
224 SFWSHAREMAN
= $(SFWSHARE
)/man
225 SFWSHAREMAN1
= $(SFWSHAREMAN
)/man1
226 PROTOSFWBIN
= $(PROTO_DIR
)/$(SFWBIN
)
227 PROTOSFWBIN32
= $(PROTO_DIR
)/$(SFWBIN32
)
228 PROTOSFWBIN64
= $(PROTO_DIR
)/$(SFWBIN64
)
229 PROTOSFWSBIN
= $(PROTO_DIR
)/$(SFWSBIN
)
230 PROTOSFWSBIN32
= $(PROTO_DIR
)/$(SFWSBIN32
)
231 PROTOSFWSBIN64
= $(PROTO_DIR
)/$(SFWSBIN64
)
232 PROTOSFWLIB
= $(PROTO_DIR
)/$(SFWLIB
)
233 PROTOSFWLIB32
= $(PROTO_DIR
)/$(SFWLIB32
)
234 PROTOSFWLIB64
= $(PROTO_DIR
)/$(SFWLIB64
)
235 PROTOSFWSHARE
= $(PROTO_DIR
)/$(SFWSHARE
)
236 PROTOSFWSHAREMAN
= $(PROTO_DIR
)/$(SFWSHAREMAN
)
237 PROTOSFWSHAREMAN1
= $(PROTO_DIR
)/$(SFWSHAREMAN1
)
238 PROTOSFWINCLUDE
= $(PROTO_DIR
)/$(SFWINCLUDE
)
240 # The *.$(BITS) variables are different from those above (better suited for
241 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
242 SFWBIN
.32 = $(SFWBIN
)
243 SFWBIN
.64 = $(SFWBIN64
)
244 SFWSBIN
.32 = $(SFWSBIN
)
245 SFWSBIN
.64 = $(SFWSBIN64
)
246 SFWLIB
.32 = $(SFWLIB
)
247 SFWLIB
.64 = $(SFWLIB64
)
248 PROTOSFWBIN
.32 = $(PROTOSFWBIN
)
249 PROTOSFWBIN
.64 = $(PROTOSFWBIN64
)
250 PROTOSFWSBIN
.32 = $(PROTOSFWSBIN
)
251 PROTOSFWSBIN
.64 = $(PROTOSFWSBIN64
)
252 PROTOSFWLIB
.32 = $(PROTOSFWLIB
)
253 PROTOSFWLIB
.64 = $(PROTOSFWLIB64
)
255 CLDIR
= /usr
/share
/common-lisp
256 PROTOCLDIR
= $(PROTO_DIR
)/$(CLDIR
)
259 GNUBIN
= $(GNUDIR
)/bin
260 GNUBIN32
= $(GNUBIN
)/$(MACH32
)
261 GNUBIN64
= $(GNUBIN
)/$(MACH64
)
262 GNUSBIN
= $(GNUDIR
)/sbin
263 GNUSBIN32
= $(GNUSBIN
)/$(MACH32
)
264 GNUSBIN64
= $(GNUSBIN
)/$(MACH64
)
265 GNULIB
= $(GNUDIR
)/lib
267 GNULIB64
= $(GNULIB
)/$(MACH64
)
268 GNUSHARE
= $(GNUDIR
)/share
269 GNUSHAREMAN
= $(GNUSHARE
)/man
270 GNUSHAREMAN1
= $(GNUSHAREMAN
)/man1
271 PROTOGNUBIN
= $(PROTO_DIR
)/$(GNUBIN
)
272 PROTOGNUBIN32
= $(PROTO_DIR
)/$(GNUBIN32
)
273 PROTOGNUBIN64
= $(PROTO_DIR
)/$(GNUBIN64
)
274 PROTOGNUSBIN
= $(PROTO_DIR
)/$(GNUSBIN
)
275 PROTOGNUSBIN32
= $(PROTO_DIR
)/$(GNUSBIN32
)
276 PROTOGNUSBIN64
= $(PROTO_DIR
)/$(GNUSBIN64
)
277 PROTOGNULIB
= $(PROTO_DIR
)/$(GNULIB
)
278 PROTOGNULIB32
= $(PROTO_DIR
)/$(GNULIB32
)
279 PROTOGNULIB64
= $(PROTO_DIR
)/$(GNULIB64
)
280 PROTOGNUSHARE
= $(PROTO_DIR
)/$(GNUSHARE
)
281 PROTOGNUSHAREMAN
= $(PROTO_DIR
)/$(GNUSHAREMAN
)
282 PROTOGNUSHAREMAN1
= $(PROTO_DIR
)/$(GNUSHAREMAN1
)
284 # The *.$(BITS) variables are different from those above (better suited for
285 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
286 GNUBIN
.32 = $(GNUBIN
)
287 GNUBIN
.64 = $(GNUBIN64
)
288 GNUSBIN
.32 = $(GNUSBIN
)
289 GNUSBIN
.64 = $(GNUSBIN64
)
290 GNULIB
.32 = $(GNULIB
)
291 GNULIB
.64 = $(GNULIB64
)
292 PROTOGNUBIN
.32 = $(PROTOGNUBIN
)
293 PROTOGNUBIN
.64 = $(PROTOGNUBIN64
)
294 PROTOGNUSBIN
.32 = $(PROTOGNUSBIN
)
295 PROTOGNUSBIN
.64 = $(PROTOGNUSBIN64
)
296 PROTOGNULIB
.32 = $(PROTOGNULIB
)
297 PROTOGNULIB
.64 = $(PROTOGNULIB64
)
299 # work around _TIME, _DATE, embedded date chatter in component builds
300 # to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME)
301 # to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV
302 CONSTANT_TIME
= LD_PRELOAD_32
=$(WS_TOOLS
)/time-
$(MACH32
).so
303 CONSTANT_TIME
+= LD_PRELOAD_64
=$(WS_TOOLS
)/time-
$(MACH64
).so
304 CONSTANT_TIME
+= TIME_CONSTANT
=$(TIME_CONSTANT
)
306 # set MACH from uname -p to either sparc or i386
307 MACH
:= $(shell uname
-p
)
309 # set MACH32 from MACH to either sparcv7 or i86
310 MACH32_1
= $(MACH
:sparc
=sparcv7
)
311 MACH32
= $(MACH32_1
:i386
=i86
)
313 # set MACH64 from MACH to either sparcv9 or amd64
314 MACH64_1
= $(MACH
:sparc
=sparcv9
)
315 MACH64
= $(MACH64_1
:i386
=amd64
)
317 CONFIGURE_32
= $(BUILD_DIR_32
)/.configured
318 CONFIGURE_64
= $(BUILD_DIR_64
)/.configured
320 BUILD_DIR_32
= $(BUILD_DIR
)/$(MACH32
)
321 BUILD_DIR_64
= $(BUILD_DIR
)/$(MACH64
)
323 BUILD_32
= $(BUILD_DIR_32
)/.built
324 BUILD_64
= $(BUILD_DIR_64
)/.built
325 BUILD_32_and_64
= $(BUILD_32
) $(BUILD_64
)
326 $(BUILD_DIR_32
)/.built
: BITS
=32
327 $(BUILD_DIR_64
)/.built
: BITS
=64
329 INSTALL_32
= $(BUILD_DIR_32
)/.installed
330 INSTALL_64
= $(BUILD_DIR_64
)/.installed
331 INSTALL_32_and_64
= $(INSTALL_32
) $(INSTALL_64
)
332 $(BUILD_DIR_32
)/.installed
: BITS
=32
333 $(BUILD_DIR_64
)/.installed
: BITS
=64
335 # set the default target for installation of the component
336 COMPONENT_INSTALL_TARGETS
= install
338 # set the default build test results directory
339 COMPONENT_TEST_BUILD_DIR
= $(BUILD_DIR
)/test/$(MACH
$(BITS
))
341 # set the default master test results directory
342 COMPONENT_TEST_RESULTS_DIR
= $(COMPONENT_DIR
)/test
344 # set the default master test results file
345 COMPONENT_TEST_MASTER
= $(COMPONENT_TEST_RESULTS_DIR
)/results-
$(BITS
).master
347 # set the default test results output file
348 COMPONENT_TEST_OUTPUT
= $(COMPONENT_TEST_BUILD_DIR
)/test-
$(BITS
)-results
350 # set the default test results comparison diffs file
351 COMPONENT_TEST_DIFFS
= $(COMPONENT_TEST_BUILD_DIR
)/test-
$(BITS
)-diffs
353 # set the default test snapshot file
354 COMPONENT_TEST_SNAPSHOT
= $(COMPONENT_TEST_BUILD_DIR
)/results-
$(BITS
).snapshot
356 # Normally $(GSED) is simplest, but some results files need more power.
357 COMPONENT_TEST_TRANSFORMER
= $(GSED
)
359 # The set of default transforms to be applied to the test results to try
361 COMPONENT_TEST_TRANSFORMS
= \
362 '-e "s|$(@D)|\\$$(@D)|g" ' \
363 '-e "s|$(PERL)|\\$$(PERL)|g" ' \
364 '-e "s|$(SOURCE_DIR)|\\$$(SOURCE_DIR)|g" '
366 # set the default commands used to generate the file containing the set
367 # of transforms to be applied to the test results to try to normalize them.
368 COMPONENT_TEST_CREATE_TRANSFORMS
= \
369 if
[ -e
$(COMPONENT_TEST_MASTER
) ]; \
371 print "\#!/bin/sh" > $(COMPONENT_TEST_TRANSFORM_CMD
); \
372 print '$(COMPONENT_TEST_TRANSFORMER) ' \
373 $(COMPONENT_TEST_TRANSFORMS
) \
374 ' \\' >> $(COMPONENT_TEST_TRANSFORM_CMD
); \
375 print '$(COMPONENT_TEST_OUTPUT) \\' \
376 >> $(COMPONENT_TEST_TRANSFORM_CMD
); \
377 print '> $(COMPONENT_TEST_SNAPSHOT)' \
378 >> $(COMPONENT_TEST_TRANSFORM_CMD
); \
381 # set the default command for performing any test result munging
382 COMPONENT_TEST_TRANSFORM_CMD
= $(COMPONENT_TEST_BUILD_DIR
)/transform-
$(BITS
)-results
384 # set the default operation to run to perform test result normalization
385 COMPONENT_TEST_PERFORM_TRANSFORM
= \
386 if
[ -e
$(COMPONENT_TEST_MASTER
) ]; \
388 $(SHELL
) $(COMPONENT_TEST_TRANSFORM_CMD
); \
391 # set the default command used to compare the master results with the snapshot
392 COMPONENT_TEST_COMPARE_CMD
= $(GDIFF
) -uN
394 # set the default way that master and snapshot test results are compared
395 COMPONENT_TEST_COMPARE
= \
396 if
[ -e
$(COMPONENT_TEST_MASTER
) ]; \
398 $(COMPONENT_TEST_COMPARE_CMD
) \
399 $(COMPONENT_TEST_MASTER
) $(COMPONENT_TEST_SNAPSHOT
) \
400 > $(COMPONENT_TEST_DIFFS
); \
401 print "Test results in $(COMPONENT_TEST_OUTPUT)"; \
402 if
[ -s
$(COMPONENT_TEST_DIFFS
) ]; \
404 print "Differences found."; \
405 $(CAT
) $(COMPONENT_TEST_DIFFS
); \
408 print "No differences found."; \
412 # set the default env command to use for test of the component
413 COMPONENT_TEST_ENV_CMD
= $(ENV
)
415 # set the default command to use for test of the component
416 COMPONENT_TEST_CMD
= $(GMAKE
)
418 # set the default target for test of the component
419 COMPONENT_TEST_TARGETS
= check
421 # set the default directory for test of the component
422 COMPONENT_TEST_DIR
= $(@D
)
424 # determine the type of tests we want to run.
425 ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR
)/results-
*.master
)),)
426 TEST_32
= $(BUILD_DIR_32
)/.tested
427 TEST_64
= $(BUILD_DIR_64
)/.tested
429 TEST_32
= $(BUILD_DIR_32
)/.tested-and-compared
430 TEST_64
= $(BUILD_DIR_64
)/.tested-and-compared
432 TEST_32_and_64
= $(TEST_32
) $(TEST_64
)
433 $(BUILD_DIR_32
)/.tested
: BITS
=32
434 $(BUILD_DIR_64
)/.tested
: BITS
=64
435 $(BUILD_DIR_32
)/.tested-and-compared
: BITS
=32
436 $(BUILD_DIR_64
)/.tested-and-compared
: BITS
=64
438 # BUILD_TOOLS is the root of all tools not normally installed on the system.
442 SPRO_ROOT
= $(BUILD_TOOLS
)/sunstudio
$(SPRO_VERSION
)
443 SPRO_VROOT
= $(SPRO_ROOT
)
445 PARFAIT_ROOT
= $(BUILD_TOOLS
)/parfait
/parfait-tools-1.0
.1/
446 PARFAIT
= $(PARFAIT_ROOT
)/bin
/parfait
447 export PARFAIT_NATIVESUNCC
=$(SPRO_VROOT
)/bin
/cc
448 export PARFAIT_NATIVESUNCXX
=$(SPRO_VROOT
)/bin
/CC
449 export PARFAIT_NATIVEGCC
=$(GCC_ROOT
)/bin
/gcc
450 export PARFAIT_NATIVEGXX
=$(GCC_ROOT
)/bin
/g
++
453 # The CCACHE makefile variable should evaluate to empty string or a pathname
454 # like /usr/bin/ccache depending on your PATH value and "which" implementation.
455 # The assignment via ":=" is important, to only do this once in a Makefile,
456 # and not on every reference to the value as "=" assignment would result in.
457 # Review `man ccache` for optional configuration tuning, like cache size etc.
459 # For production builds or suspected errors you can disable this feature by
460 # setting ENABLE_CCACHE=false (as makefile or environment variable, which
461 # is currently the default) to not even define the usage of wrapper in the
462 # userland-building makefile system.
463 # If you want to speed up your re-builds, you must set ENABLE_CCACHE=true.
464 # For legacy reasons, the CCACHE_DISABLE and CCACHE_NODISABLE variables (from
465 # configuration of the "ccache" program itself) are also supported, but direct
466 # use is discouraged, since their syntax and usage are counter-intuitive.
468 # Still, absence of ccache in PATH is not considered a fatal error since the
469 # build would just proceed well with original compiler.
470 # Note: In code below we fast-track if the makefile CCACHE variable is defined
471 # but fall back to shell executability tests if just envvar CCACHE is passed.
473 export CCACHE
:= $(shell \
474 if
test -n
"$(CCACHE)" ; then \
477 if
test x
"$${CCACHE_DISABLE-}" != x
-o x
"$(CCACHE_DISABLE)" != x \
478 -o x
"$${ENABLE_CCACHE-}" = xfalse
-o x
"$(ENABLE_CCACHE)" = xfalse \
480 echo
"NOT USING CCACHE FOR OI-USERLAND because explicitly disabled" >&2 ; \
482 if
test x
"$${CCACHE_NODISABLE-}" != x
-o x
"$(CCACHE_NODISABLE)" != x \
483 -o x
"$${ENABLE_CCACHE-}" = xtrue
-o x
"$(ENABLE_CCACHE)" = xtrue \
487 `which ccache 2>/dev/null | egrep '^/'` \
489 ; do if
test -n
"$$F" && test -x
"$$F" ; then \
491 echo
"USING CCACHE FOR OI-USERLAND: $$F" >&2 ; \
492 if
test x
"$${CCACHE_DISABLE-}" != x
; then \
493 echo
"WARNING: envvar CCACHE_DISABLE is set, so effectively ccache will not act!" >&2 ; \
498 echo
"NOT USING CCACHE FOR OI-USERLAND because not found" >&2 ; \
504 GCC_ROOT
= /usr
/gcc
/$(GCC_VERSION
)
506 CC.studio
.32 = $(SPRO_VROOT
)/bin
/cc
507 CXX.studio
.32 = $(SPRO_VROOT
)/bin
/CC
508 F77.studio
.32 = $(SPRO_VROOT
)/bin
/f77
509 FC.studio
.32 = $(SPRO_VROOT
)/bin
/f90
511 CC.studio
.64 = $(SPRO_VROOT
)/bin
/cc
512 CXX.studio
.64 = $(SPRO_VROOT
)/bin
/CC
513 F77.studio
.64 = $(SPRO_VROOT
)/bin
/f77
514 FC.studio
.64 = $(SPRO_VROOT
)/bin
/f90
516 CC.gcc
.32 = $(GCC_ROOT
)/bin
/gcc
517 CXX.gcc
.32 = $(GCC_ROOT
)/bin
/g
++
518 F77.gcc
.32 = $(GCC_ROOT
)/bin
/gfortran
519 FC.gcc
.32 = $(GCC_ROOT
)/bin
/gfortran
521 CC.gcc
.64 = $(GCC_ROOT
)/bin
/gcc
522 CXX.gcc
.64 = $(GCC_ROOT
)/bin
/g
++
523 F77.gcc
.64 = $(GCC_ROOT
)/bin
/gfortran
524 FC.gcc
.64 = $(GCC_ROOT
)/bin
/gfortran
526 ifneq ($(strip $(CCACHE
)),)
528 CCACHE_WRAP_ROOT
= $(WS_TOOLS
)/ccache-wrap
529 export CC_gcc_32
:= $(CC.gcc
.32)
530 export CC_gcc_64
:= $(CC.gcc
.64)
531 export CXX_gcc_32
:= $(CXX.gcc
.32)
532 export CXX_gcc_64
:= $(CXX.gcc
.64)
533 CC.gcc
.32 := $(CCACHE_WRAP_ROOT
)/CC.gcc
.32
534 CC.gcc
.64 := $(CCACHE_WRAP_ROOT
)/CC.gcc
.64
535 CXX.gcc
.32 := $(CCACHE_WRAP_ROOT
)/CXX.gcc
.32
536 CXX.gcc
.64 := $(CCACHE_WRAP_ROOT
)/CXX.gcc
.64
538 ifneq ($(strip $(CCACHE_DIR
)),)
539 export CCACHE_DIR
:= $(CCACHE_DIR
)
542 ifneq ($(strip $(CCACHE_LOGFILE
)),)
543 export CCACHE_LOGFILE
:= $(CCACHE_LOGFILE
)
548 lint
.32 = $(SPRO_VROOT
)/bin
/lint
-m32
549 lint
.64 = $(SPRO_VROOT
)/bin
/lint
-m64
551 LINT
= $(lint.
$(BITS
))
555 PYTHON
.2.7.VENDOR_PACKAGES
.32 = /usr
/lib
/python2.7
/vendor-packages
556 PYTHON
.2.7.VENDOR_PACKAGES
.64 = /usr
/lib
/python2.7
/vendor-packages
/64
557 PYTHON
.2.7.VENDOR_PACKAGES
= $(PYTHON
.2.7.VENDOR_PACKAGES.
$(BITS
))
559 PYTHON
.3.4.VENDOR_PACKAGES
.32 = /usr
/lib
/python3.4
/vendor-packages
560 PYTHON
.3.4.VENDOR_PACKAGES
.64 = /usr
/lib
/python3.4
/vendor-packages
/64
561 PYTHON
.3.4.VENDOR_PACKAGES
= $(PYTHON
.3.4.VENDOR_PACKAGES.
$(BITS
))
563 ifeq ($(strip $(PARFAIT_BUILD
)),yes
)
564 CC.studio
.32 = $(WS_TOOLS
)/parfait
/cc
565 CXX.studio
.32 = $(WS_TOOLS
)/parfait
/CC
566 CC.studio
.64 = $(WS_TOOLS
)/parfait
/cc
567 CXX.studio
.64 = $(WS_TOOLS
)/parfait
/CC
568 CC.gcc
.32 = $(WS_TOOLS
)/parfait
/gcc
569 CXX.gcc
.32 = $(WS_TOOLS
)/parfait
/g
++
570 CC.gcc
.64 = $(WS_TOOLS
)/parfait
/gcc
571 CXX.gcc
.64 = $(WS_TOOLS
)/parfait
/g
++
572 LD
= $(WS_TOOLS
)/parfait
/ld
575 CC
= $(CC.
$(COMPILER
).
$(BITS
))
576 CXX
= $(CXX.
$(COMPILER
).
$(BITS
))
577 F77
= $(F77.
$(COMPILER
).
$(BITS
))
578 FC
= $(FC.
$(COMPILER
).
$(BITS
))
581 RUBY_LIB_VERSION
.2.2 = 2.2.0
582 RUBY_LIB_VERSION
.2.3 = 2.3.0
583 RUBY
.2.2 = /usr
/ruby
/2.2/bin
/ruby
584 RUBY
.2.3 = /usr
/ruby
/2.3/bin
/ruby
585 RUBY
= $(RUBY.
$(RUBY_VERSION
))
586 RUBY_LIB_VERSION
= $(RUBY_LIB_VERSION.
$(RUBY_VERSION
))
588 # Transform Ruby scripts to call the supported
589 # version-specific ruby; used in multiple *.mk files
590 RUBY_SCRIPT_FIX_FUNC
= \
591 $(GNU_GREP
) -Rl
'^\#! */usr/bin/env ruby' | \
592 /usr
/bin
/xargs
-I\
{\
} $(GSED
) -i
-e \
593 '1s%^\#! */usr/bin/env ruby%\#!/usr/ruby/$(RUBY_VERSION)/bin/ruby%' \
596 # Use the ruby lib versions to represent the RUBY_VERSIONS that
597 # need to get built. This is done because during package transformations
598 # both the ruby version and the ruby library version are needed.
599 RUBY_VERSIONS
= $(RUBY_LIB_VERSION
)
601 PYTHON_VENDOR_PACKAGES
.32 = /usr
/lib
/python
$(PYTHON_VERSION
)/vendor-packages
602 PYTHON_VENDOR_PACKAGES
.64 = /usr
/lib
/python
$(PYTHON_VERSION
)/vendor-packages
/64
603 PYTHON_VENDOR_PACKAGES
= $(PYTHON_VENDOR_PACKAGES.
$(BITS
))
605 PYTHON
.2.7.32 = /usr
/bin
/python2.7
606 PYTHON
.2.7.64 = /usr
/bin
/$(MACH64
)/python2.7
608 PYTHON
.3.4.32 = /usr
/bin
/python3.4
609 PYTHON
.3.4.64 = /usr
/bin
/$(MACH64
)/python3.4
611 PYTHON
.32 = $(PYTHON.
$(PYTHON_VERSION
).32)
612 PYTHON
.64 = $(PYTHON.
$(PYTHON_VERSION
).64)
613 PYTHON
= $(PYTHON.
$(PYTHON_VERSION
).
$(BITS
))
615 # The default is site-packages, but that directory belongs to the end-user.
616 # Modules which are shipped by the OS but not with the core Python distribution
617 # belong in vendor-packages.
618 PYTHON_LIB
= /usr
/lib
/python
$(PYTHON_VERSION
)/vendor-packages
619 PYTHON_DATA
= $(PYTHON_LIB
)
621 JAVA7_HOME
= /usr
/jdk
/instances
/openjdk1.7
.0
622 JAVA8_HOME
= /usr
/jdk
/instances
/openjdk1.8
.0
623 JAVA_HOME
= $(JAVA8_HOME
)
625 # This is the default BUILD version of perl
626 # Not necessarily the system's default version, i.e. /usr/bin/perl
631 PERL
.5.22 = /usr
/perl5
/5.22/bin
/perl
632 PERL
.5.24 = /usr
/perl5
/5.24/bin
/perl
634 POD2MAN
.5.22 = /usr
/perl5
/5.22/bin
/pod2man
635 POD2MAN
.5.24 = /usr
/perl5
/5.24/bin
/pod2man
637 PERL
= $(PERL.
$(PERL_VERSION
))
638 POD2MAN
= $(POD2MAN.
$(PERL_VERSION
))
640 PERL_ARCH
:= $(shell $(PERL
) -e
'use Config; print $$Config{archname}')
641 PERL_ARCH_FUNC
= $(shell $(1) -e
'use Config; print $$Config{archname}')
642 # Optimally we should ask perl which C compiler was used but it doesn't
643 # result in a full path name. Only "c" is being recorded
644 # inside perl builds while we actually need a full path to
645 # the studio compiler.
646 #PERL_CC := $(shell $(PERL) -e 'use Config; print $$Config{cc}')
648 PKG_MACROS
+= PERL_ARCH
=$(PERL_ARCH
)
649 PKG_MACROS
+= PERL_VERSION
=$(PERL_VERSION
)
651 # Config magic for Postgres/EnterpriseDB/...
652 # Default DB version is the oldest one, for hopefully best built complatibility
654 PG_IMPLEM ?
= postgres
655 PG_VERNUM
= $(subst .
,,$(PG_VERSION
))
656 # For dependencies, including REQUIRED_PACKAGES if needed
657 PG_BASEPKG
= database
/$(PG_IMPLEM
)-$(PG_VERNUM
)
659 PG_HOME
= $(USRDIR
)/$(PG_IMPLEM
)/$(PG_VERSION
)
660 PG_BINDIR
.32 = $(PG_HOME
)/bin
661 PG_BINDIR
.64 = $(PG_HOME
)/bin
/$(MACH64
)
662 PG_BINDIR
= $(PG_BINDIR.
$(BITS
))
663 PG_INCDIR
= $(PG_HOME
)/include
664 PG_MANDIR
= $(PG_HOME
)/man
665 PG_SHAREDIR
= $(PG_HOME
)/share
666 PG_DOCDIR
= $(PG_HOME
)/doc
667 PG_LIBDIR
.32 = $(PG_HOME
)/lib
668 PG_LIBDIR
.64 = $(PG_HOME
)/lib
/$(MACH64
)
669 PG_LIBDIR
= $(PG_LIBDIR.
$(BITS
))
670 PG_CONFIG
.32 = $(PG_BINDIR
.32)/pg_config
671 PG_CONFIG
.64 = $(PG_BINDIR
.64)/pg_config
672 PG_CONFIG
= $(PG_CONFIG.
$(BITS
))
674 PKG_MACROS
+= PG_VERSION
=$(PG_VERSION
)
675 PKG_MACROS
+= PG_VERNUM
=$(PG_VERNUM
)
676 PKG_MACROS
+= PG_BASEPKG
=$(PG_BASEPKG
)
678 # Config magic for MySQL/MariaDB/Percona/...
679 # Default DB version is the oldest one, for hopefully best built compatibility
680 # NOTE: At this time the gate does not provide a recipe for actual "mysql"
681 # The "/usr/mysql/*" trees are mediated to preferred MariaDB or Percona variant
683 MYSQL_IMPLEM ?
= mariadb
684 MYSQL_VERNUM
= $(subst .
,,$(MYSQL_VERSION
))
685 # For dependencies, including REQUIRED_PACKAGES if needed
686 MYSQL_BASEPKG
= database
/$(MYSQL_IMPLEM
)-$(MYSQL_VERNUM
)
688 MYSQL_HOME
= $(USRDIR
)/$(MYSQL_IMPLEM
)/$(MYSQL_VERSION
)
689 MYSQL_BINDIR
.32 = $(MYSQL_HOME
)/bin
690 MYSQL_BINDIR
.64 = $(MYSQL_HOME
)/bin
/$(MACH64
)
691 MYSQL_BINDIR
= $(MYSQL_BINDIR.
$(BITS
))
692 MYSQL_INCDIR
= $(MYSQL_HOME
)/include
693 MYSQL_MANDIR
= $(MYSQL_HOME
)/man
694 MYSQL_SHAREDIR
= $(MYSQL_HOME
)/share
695 MYSQL_DOCDIR
= $(MYSQL_HOME
)/doc
696 MYSQL_LIBDIR
.32 = $(MYSQL_HOME
)/lib
697 MYSQL_LIBDIR
.64 = $(MYSQL_HOME
)/lib
/$(MACH64
)
698 MYSQL_LIBDIR
= $(MYSQL_LIBDIR.
$(BITS
))
699 MYSQL_CONFIG
.32 = $(MYSQL_BINDIR
.32)/mysql_config
700 MYSQL_CONFIG
.64 = $(MYSQL_BINDIR
.64)/mysql_config
701 MYSQL_CONFIG
= $(MYSQL_CONFIG.
$(BITS
))
703 PKG_MACROS
+= MYSQL_VERSION
=$(MYSQL_VERSION
)
704 PKG_MACROS
+= MYSQL_VERNUM
=$(MYSQL_VERNUM
)
705 PKG_MACROS
+= MYSQL_BASEPKG
=$(MYSQL_BASEPKG
)
707 # Default libjpeg implementation layout
708 JPEG_IMPLEM ?
= libjpeg8-turbo
709 JPEG_HOME
= $(USRLIBDIR
)/$(JPEG_IMPLEM
)
710 JPEG_BINDIR
.32 = $(JPEG_HOME
)/bin
711 JPEG_BINDIR
.64 = $(JPEG_HOME
)/bin
/$(MACH64
)
712 JPEG_BINDIR
= $(JPEG_BINDIR.
$(BITS
))
713 JPEG_INCDIR
= $(USRINCDIR
)/$(JPEG_IMPLEM
)
714 JPEG_LIBDIR
.32 = $(JPEG_HOME
)/lib
715 JPEG_LIBDIR
.64 = $(JPEG_HOME
)/lib
/$(MACH64
)
716 JPEG_LIBDIR
= $(JPEG_LIBDIR.
$(BITS
))
717 JPEG_CPPFLAGS
= -I
$(JPEG_INCDIR
)
718 JPEG_CFLAGS
.32 = -Wl
,-L
$(JPEG_LIBDIR
.32) -Wl
,-R
$(JPEG_LIBDIR
.32)
719 JPEG_CFLAGS
.64 = -Wl
,-L
$(JPEG_LIBDIR
.64) -Wl
,-R
$(JPEG_LIBDIR
.64)
720 JPEG_CFLAGS
= $(JPEG_CFLAGS.
$(BITS
))
721 JPEG_CXXFLAGS
.32 = -Wl
,-L
$(JPEG_LIBDIR
.32) -Wl
,-R
$(JPEG_LIBDIR
.32)
722 JPEG_CXXFLAGS
.64 = -Wl
,-L
$(JPEG_LIBDIR
.64) -Wl
,-R
$(JPEG_LIBDIR
.64)
723 JPEG_CXXFLAGS
= $(JPEG_CXXFLAGS.
$(BITS
))
724 JPEG_LDFLAGS
.32 = -L
$(JPEG_LIBDIR
.32) -R
$(JPEG_LIBDIR
.32)
725 JPEG_LDFLAGS
.64 = -L
$(JPEG_LIBDIR
.64) -R
$(JPEG_LIBDIR
.64)
726 JPEG_LDFLAGS
= $(JPEG_LDFLAGS.
$(BITS
))
728 # This is the default BUILD version of tcl
729 # Not necessarily the system's default version, i.e. /usr/bin/tclsh
731 TCLSH
.8.5.i386.32
= /usr
/bin
/i86
/tclsh8.5
732 TCLSH
.8.5.i386.64
= /usr
/bin
/amd64
/tclsh8.5
733 TCLSH
.8.5.sparc
.32 = /usr
/bin
/sparcv7
/tclsh8.5
734 TCLSH
.8.5.sparc
.64 = /usr
/bin
/sparcv9
/tclsh8.5
735 TCLSH
= $(TCLSH.
$(TCL_VERSION
).
$(MACH
).
$(BITS
))
737 CCSMAKE
= /usr
/bin
/dmake
738 GMAKE
= /usr
/gnu
/bin
/make
739 GPATCH
= /usr
/gnu
/bin
/patch
741 GPATCH_BACKUP
= --backup
--version-control
=numbered
742 GPATCH_FLAGS
= -p
$(PATCH_LEVEL
) $(GPATCH_BACKUP
)
744 GDIFF
= /usr
/gnu
/bin
/diff
745 GSORT
= /usr
/gnu
/bin
/sort
746 GUNZIP
= /usr
/bin
/gunzip
748 PKGREPO
= /usr
/bin
/pkgrepo
749 PKGSEND
= /usr
/bin
/pkgsend
750 ifeq ($(strip $(PKGLINT_COMPONENT
)),)
751 PKGLINT
= /usr
/bin
/pkglint
753 PKGLINT
= ${WS_TOOLS}/pkglint
756 ACLOCAL
= /usr
/bin
/aclocal-1.10
757 AUTOMAKE
= /usr
/bin
/automake-1.10
758 AUTORECONF
= /usr
/bin
/autoreconf
760 KSH93
= /usr
/bin
/ksh93
761 TOUCH
= /usr
/bin
/touch
762 MKDIR
= /bin
/mkdir
-p
771 INSTALL
= /usr
/bin
/install
772 GNU_GREP
= /usr
/gnu
/bin
/grep
773 CHMOD
= /usr
/bin
/chmod
776 GAS
= /usr
/gnu
/bin
/as
777 GTAR
= /usr
/gnu
/bin
/tar
778 STRIP
= /usr
/bin
/strip
779 IPS2TGZ
= $(WS_TOOLS
)/ips2tgz
781 INS.
dir= $(INSTALL
) -d
$@
782 INS.file
= $(INSTALL
) -m
444 $< $(@D
)
784 PKG_CONFIG_PATH
.32 = /usr
/lib
/pkgconfig
785 PKG_CONFIG_PATH
.64 = /usr
/lib
/$(MACH64
)/pkgconfig
786 PKG_CONFIG_PATH
= $(PKG_CONFIG_PATH.
$(BITS
))
788 # Set default path for environment modules
789 MODULE_VERSION
= 3.2.10
790 MODULE_PATH
= /usr
/share
/Modules
/modulefiles
791 MODULE_VERSIONS_PATH
= /usr
/share
/Modules
/versions
793 # Path to bash completions
794 BASH_COMPLETIONS_PATH
= /usr
/share
/bash-completion
/completions
797 # C preprocessor flag sets to ease feature selection. Add the required
798 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
799 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
803 # Enables visibility of some c99 math functions that aren't visible by default.
804 # What other side-effects are there?
805 CPP_C99_EXTENDED_MATH
= -D_STDC_99
807 # Enables large file support for components that have no other means of doing
808 # so. Use CPP_LARGEFILES and not the .32/.64 variety directly
809 CPP_LARGEFILES
.32 := $(shell getconf LFS_CFLAGS
)
810 CPP_LARGEFILES
.64 := $(shell getconf LFS64_CFLAGS
)
811 CPP_LARGEFILES
= $(CPP_LARGEFILES.
$(BITS
))
813 # Enables some #pragma redefine_extname to POSIX-compliant Standard C Library
814 # functions. Also avoids the component's #define _POSIX_C_SOURCE to some value
815 # we currently do not support.
816 CPP_POSIX
= -D_POSIX_C_SOURCE
=200112L -D_POSIX_PTHREAD_SEMANTICS
818 # XPG6 mode. This option enables XPG6 conformance, plus extensions.
819 # Amongst other things, this option will cause system calls like
820 # popen (3C) and system (3C) to invoke the standards-conforming
821 # shell, /usr/xpg4/bin/sh, instead of /usr/bin/sh. Add studio_XPG6MODE to
822 # CFLAGS instead of using this directly
823 CPP_XPG6MODE
= -D_XOPEN_SOURCE
=600 -D__EXTENSIONS__
=1 -D_XPG6
825 # XPG5 mode. These options are specific for C++, where _XPG6,
826 # _XOPEN_SOURCE=600 and C99 are illegal. -D__EXTENSIONS__=1 is legal in C++.
827 CPP_XPG5MODE
= -D_XOPEN_SOURCE
=500 -D__EXTENSIONS__
=1 -D_XPG5
830 # Studio C compiler flag sets to ease feature selection. Add the required
831 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
832 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
835 # Generate 32/64 bit objects
838 # Code generation instruction set and optimization 'hints'. Use studio_XBITS
839 # and not the .arch.bits variety directly.
840 studio_XBITS.sparc
.32 = -xtarget
=ultra2
-xarch
=sparcvis
-xchip
=ultra2
841 studio_XBITS.sparc
.64 =
842 ifneq ($(strip $(PARFAIT_BUILD
)),yes
)
843 studio_XBITS.sparc
.64 += -xtarget
=ultra2
845 studio_XBITS.sparc
.64 += -xarch
=sparcvis
-xchip
=ultra2
846 studio_XBITS.i386.32
= -xchip
=pentium
847 studio_XBITS.i386.64
= -xchip
=generic
-Ui386
-U__i386
848 studio_XBITS
= $(studio_XBITS.
$(MACH
).
$(BITS
))
850 # Turn on recognition of supported C99 language features and enable the 1999 C
851 # standard library semantics of routines that appear in both the 1990 and
852 # 1999 C standard. To use set studio_C99MODE=$(studio_99_ENABLE) in your
853 # component Makefile.
854 studio_C99_ENABLE
= -xc99
=all
856 # Turn off recognition of C99 language features, and do not enable the 1999 C
857 # standard library semantics of routines that appeared in both the 1990 and
858 # 1999 C standard. To use set studio_C99MODE=$(studio_99_DISABLE) in your
859 # component Makefile.
860 studio_C99_DISABLE
= -xc99
=none
862 # Use the compiler default 'xc99=all,no_lib'
865 # For C++, compatibility with C99 (which is technically illegal) is
866 # enabled in a different way. So, we must use a different macro for it.
867 studio_cplusplus_C99_ENABLE
= -xlang
=c99
870 studio_cplusplus_C99_DISABLE
=
872 # And this is the macro you should actually use
873 studio_cplusplus_C99MODE
=
875 # Turn on C99 for gcc
876 gcc_C99_ENABLE
= -std
=c99
878 # Allow zero-sized struct/union declarations and void functions with return
880 studio_FEATURES_EXTENSIONS
= -features
=extensions
882 # Control the Studio optimization level.
883 studio_OPT.sparc
.32 = -xO4
884 studio_OPT.sparc
.64 = -xO4
885 studio_OPT.i386.32
= -xO4
886 studio_OPT.i386.64
= -xO4
887 studio_OPT
= $(studio_OPT.
$(MACH
).
$(BITS
))
889 # Studio PIC code generation. Use CC_PIC instead to select PIC code generation.
890 studio_PIC
= -KPIC
-DPIC
892 # The Sun Studio 11 compiler has changed the behaviour of integer
893 # wrap arounds and so a flag is needed to use the legacy behaviour
894 # (without this flag panics/hangs could be exposed within the source).
895 # This is used through studio_IROPTS, not the 'sparc' variety.
896 studio_IROPTS.sparc
= -W2
,-xwrap_int
897 studio_IROPTS
= $(studio_IROPTS.
$(MACH
))
899 # Control register usage for generated code. SPARC ABI requires system
900 # libraries not to use application registers. x86 requires 'no%frameptr' at
903 # We should just use -xregs but we need to workaround 7030022. Note
904 # that we can't use the (documented) -Wc,-xregs workaround because
905 # libtool really hates -Wc and thinks it should be -Wl. Instead
906 # we use an (undocumented) option which actually happens to be what
908 studio_XREGS.sparc
= -Qoption cg
-xregs
=no
%appl
909 studio_XREGS.i386
= -xregs
=no
%frameptr
910 studio_XREGS
= $(studio_XREGS.
$(MACH
))
912 gcc_XREGS.sparc
= -mno-app-regs
914 gcc_XREGS
= $(gcc_XREGS.
$(MACH
))
916 # Set data alignment on sparc to reasonable values, 8 byte alignment for 32 bit
917 # objects and 16 byte alignment for 64 bit objects. This is added to CFLAGS by
919 studio_ALIGN.sparc
.32 = -xmemalign
=8s
920 studio_ALIGN.sparc
.64 = -xmemalign
=16s
921 studio_ALIGN
= $(studio_ALIGN.
$(MACH
).
$(BITS
))
923 # Studio shorthand for building multi-threaded code, enables -D_REENTRANT and
924 # linking with threadin support. This is added to CFLAGS by default, override
925 # studio_MT to turn this off.
928 # See CPP_XPG6MODE comment above.
929 studio_XPG6MODE
= $(studio_C99MODE
) $(CPP_XPG6MODE
)
930 XPG6MODE
= $(studio_XPG6MODE
)
932 # See CPP_XPG5MODE comment above. You can only use this in C++, not in C99.
933 studio_XPG5MODE
= $(studio_cplusplus_C99MODE
) $(CPP_XPG5MODE
)
934 XPG5MODE
= $(studio_XPG5MODE
)
936 # Default Studio C compiler flags. Add the required feature to your Makefile
937 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
938 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it
939 # should not be necessary to add CFLAGS to any environment other than the
940 # configure environment.
941 CFLAGS.studio
+= $(studio_OPT
) $(studio_XBITS
) $(studio_XREGS
) \
942 $(studio_IROPTS
) $(studio_C99MODE
) $(studio_ALIGN
) \
946 # GNU C compiler flag sets to ease feature selection. Add the required
947 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
948 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
951 # GCC Compiler optimization flag
954 # GCC PIC code generation. Use CC_PIC instead to select PIC code generation.
955 gcc_PIC
= -fPIC
-DPIC
957 # Generic macro for PIC code generation. Use this macro instead of the
958 # compiler specific variant.
959 CC_PIC
= $($(COMPILER
)_PIC
)
962 # Default GNU C compiler flags. Add the required feature to your Makefile
963 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
964 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it
965 # should not be necessary to add CFLAGS to any environment other than the
966 # configure environment.
967 CFLAGS.gcc
+= $(gcc_OPT
)
968 CFLAGS.gcc
+= $(gcc_XREGS
)
971 # Build 32 or 64 bit objects.
974 # Add compiler specific 'default' features
975 CFLAGS
+= $(CFLAGS.
$(COMPILER
))
978 # Studio C++ requires -norunpath to avoid adding its location into the RUNPATH
979 # to C++ applications.
980 studio_NORUNPATH
= -norunpath
982 # To link in standard mode (the default mode) without any C++ libraries
983 # (except libCrun), use studio_LIBRARY_NONE in your component Makefile.
984 studio_LIBRARY_NONE
= -library
=%none
986 # Don't link C++ with any C++ Runtime or Standard C++ library
987 studio_CXXLIB_NONE
= -xnolib
989 # Link C++ with the Studio C++ Runtime and Standard C++ library. This is the
990 # default for "standard" mode.
991 studio_CXXLIB_CSTD
= -library
=Cstd
,Crun
993 # link C++ with the Studio C++ Runtime and Apache Standard C++ library
994 studio_CXXLIB_APACHE
= -library
=stdcxx4
,Crun
996 # Add the C++ ABI compatibility flags for older ABI compatibility. The default
997 # is "standard mode" (-compat=5)
998 studio_COMPAT_VERSION_4
= -compat
=4
1000 # Tell the compiler that we don't want the studio runpath added to the
1001 # linker flags. We never want the Studio location added to the RUNPATH.
1002 CXXFLAGS
+= $($(COMPILER
)_NORUNPATH
)
1004 # Build 32 or 64 bit objects in C++ as well.
1005 CXXFLAGS
+= $(CC_BITS
)
1007 # Build 32 or 64 bit objects in FORTRAN as well.
1008 F77FLAGS
+= $(CC_BITS
)
1009 FCFLAGS
+= $(CC_BITS
)
1013 # Solaris linker flag sets to ease feature selection. Add the required
1014 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
1015 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar.
1018 # set the bittedness that we want to link
1022 LD_BITS
= $($(LINKER
).
ld.
$(BITS
))
1023 LDFLAGS
= $(LD_BITS
)
1025 # Reduce the symbol table size, effectively conflicting with -g. We should
1026 # get linker guidance here.
1027 LD_Z_REDLOCSYM
= -z redlocsym
1029 # Cause the linker to rescan archive libraries and resolve remaining unresolved
1030 # symbols recursively until all symbols are resolved. Components should be
1031 # linking in the libraries they need, in the required order. This should
1032 # only be required if the component's native build is horribly broken.
1033 LD_Z_RESCAN_NOW
= -z rescan-now
1035 LD_Z_TEXT
= -z direct
1037 # make sure that -lc is always present when building shared objects.
1040 # make sure all symbols are defined.
1043 # eliminate unreferenced dynamic dependencies
1044 LD_Z_IGNORE
= -z ignore
1046 # use direct binding
1047 LD_B_DIRECT
= -Bdirect
1049 # use generic macro names for enabling/disabling ASLR
1050 ASLR_ENABLE
= -z aslr
=enable
1051 ASLR_DISABLE
= -z aslr
=disable
1052 ASLR_MODE
= $(ASLR_DISABLE
)
1054 # by default, turn off Address Space Layout Randomization for ELF executables;
1055 # to explicitly enable ASLR, set ASLR_MODE = $(ASLR_ENABLE)
1056 # in that component's Makefile
1057 LD_Z_ASLR
= $(ASLR_MODE
)
1060 # More Solaris linker flags that we want to be sure that everyone gets. This
1061 # is automatically added to the calling environment during the 'build' and
1062 # 'install' phases of the component build. Each individual feature can be
1063 # turned off by adding FEATURE_MACRO= to the component Makefile.
1066 # Create a non-executable bss segment when linking.
1067 LD_MAP_NOEXBSS
= -M
/usr
/lib
/ld/map.noexbss
1070 LD_MAP_PAGEALIGN
= -M
/usr
/lib
/ld/map.pagealign
1072 # Linker options to add when only building libraries
1073 LD_OPTIONS_SO
+= $(LD_Z_TEXT
) $(LD_Z_DEFS
) $(LD_DEF_LIBS
)
1075 # Default linker options that everyone should get. Do not add additional
1076 # libraries to this macro, as it will apply to everything linked during the
1078 LD_OPTIONS
+= $(LD_MAP_PAGEALIGN
) $(LD_B_DIRECT
) $(LD_Z_IGNORE
)
1080 # only used on executables
1081 LD_EXEC_OPTIONS
= $(LD_Z_ASLR
)
1083 # Environment variables and arguments passed into the build and install
1084 # environment(s). These are the initial settings.
1085 COMPONENT_BUILD_ENV
= \
1086 LD_OPTIONS
="$(LD_OPTIONS)" \
1087 LD_EXEC_OPTIONS
="$(LD_EXEC_OPTIONS)"
1088 COMPONENT_INSTALL_ENV
= \
1089 LD_OPTIONS
="$(LD_OPTIONS)" \
1090 LD_EXEC_OPTIONS
="$(LD_EXEC_OPTIONS)"
1092 # PERL options which depend on C options should be placed here
1093 # Don't trust Perl $Config{optimize}, we can get Studio flags
1094 PERL_OPTIMIZE
=$(gcc_OPT
)
1096 # We need this to overwrite options of perl used to compile illumos-gate
1097 PERL_STUDIO_OVERWRITE
= cc="$(CC)" cccdlflags
="$(CC_PIC)" ld="$(CC)" ccname
="$(shell basename $(CC))" optimize
="$(gcc_OPT)"
1099 # Allow user to override default maximum number of archives
1100 NUM_EXTRA_ARCHIVES
= 1 2 3 4 5 6 7 8 9 10
1102 # Rewrite absolute source-code paths into relative for ccache, so that any
1103 # workspace with a shared CCACHE_DIR can benefit when compiling a component
1104 ifneq ($(strip $(CCACHE
)),)
1105 export CCACHE_BASEDIR
= $(BUILD_DIR_
$(BITS
))
1106 COMPONENT_BUILD_ENV
+= CCACHE
="$(CCACHE)"
1107 COMPONENT_INSTALL_ENV
+= CCACHE
="$(CCACHE)"
1108 COMPONENT_TEST_ENV
+= CCACHE
="$(CCACHE)"
1109 COMPONENT_BUILD_ENV
+= CC_gcc_32
="$(CC_gcc_32)"
1110 COMPONENT_BUILD_ENV
+= CC_gcc_64
="$(CC_gcc_32)"
1111 COMPONENT_BUILD_ENV
+= CXX_gcc_32
="$(CXX_gcc_64)"
1112 COMPONENT_BUILD_ENV
+= CXX_gcc_64
="$(CXX_gcc_64)"
1113 COMPONENT_INSTALL_ENV
+= CC_gcc_32
="$(CC_gcc_32)"
1114 COMPONENT_INSTALL_ENV
+= CC_gcc_64
="$(CC_gcc_32)"
1115 COMPONENT_INSTALL_ENV
+= CXX_gcc_32
="$(CXX_gcc_64)"
1116 COMPONENT_INSTALL_ENV
+= CXX_gcc_64
="$(CXX_gcc_64)"
1117 COMPONENT_TEST_ENV
+= CC_gcc_32
="$(CC_gcc_32)"
1118 COMPONENT_TEST_ENV
+= CC_gcc_64
="$(CC_gcc_32)"
1119 COMPONENT_TEST_ENV
+= CXX_gcc_32
="$(CXX_gcc_64)"
1120 COMPONENT_TEST_ENV
+= CXX_gcc_64
="$(CXX_gcc_64)"
1121 COMPONENT_BUILD_ENV.
$(BITS
) += CCACHE_BASEDIR
="$(BUILD_DIR_$(BITS))"
1122 COMPONENT_INSTALL_ENV.
$(BITS
) += CCACHE_BASEDIR
="$(BUILD_DIR_$(BITS))"
1123 COMPONENT_TEST_ENV.
$(BITS
) += CCACHE_BASEDIR
="$(BUILD_DIR_$(BITS))"
1125 ifneq ($(strip $(CCACHE_DIR
)),)
1126 COMPONENT_BUILD_ENV
+= CCACHE_DIR
="$(CCACHE_DIR)"
1127 COMPONENT_INSTALL_ENV
+= CCACHE_DIR
="$(CCACHE_DIR)"
1128 COMPONENT_TEST_ENV
+= CCACHE_DIR
="$(CCACHE_DIR)"
1131 ifneq ($(strip $(CCACHE_LOGFILE
)),)
1132 COMPONENT_BUILD_ENV
+= CCACHE_LOGFILE
="$(CCACHE_LOGFILE)"
1133 COMPONENT_INSTALL_ENV
+= CCACHE_LOGFILE
="$(CCACHE_LOGFILE)"
1134 COMPONENT_TEST_ENV
+= CCACHE_LOGFILE
="$(CCACHE_LOGFILE)"
1139 # Add any bit-specific settings
1140 COMPONENT_BUILD_ENV
+= $(COMPONENT_BUILD_ENV.
$(BITS
))
1141 COMPONENT_BUILD_ARGS
+= $(COMPONENT_BUILD_ARGS.
$(BITS
))
1142 COMPONENT_INSTALL_ENV
+= $(COMPONENT_INSTALL_ENV.
$(BITS
))
1143 COMPONENT_INSTALL_ARGS
+= $(COMPONENT_INSTALL_ARGS.
$(BITS
))
1145 # declare these phony so that we avoid filesystem conflicts.
1146 .PHONY
: prep build
install publish
test clean clobber parfait
1148 # If there are no tests to execute
1149 NO_TESTS
= test-nothing
1151 @echo
"There are no tests available at this time."
1153 # default behaviour for 'component-hook' target is to echo the component
1154 # name and version information, but more complex behaviour can be implemented
1155 # via command line setting of the COMPONENT_HOOK macro.
1156 COMPONENT_HOOK ?
= echo
$(COMPONENT_NAME
) $(COMPONENT_VERSION
)
1162 # Packages with tools that are required to build Userland components
1164 REQUIRED_PACKAGES
+= metapackages
/build-essential
1166 # Only a default dependency if component being built produces binaries.
1167 ifneq ($(strip $(BUILD_BITS
)),NO_ARCH
)
1168 REQUIRED_PACKAGES
+= system
/library
1171 include $(WS_MAKE_RULES
)/environment.mk
1173 # A simple rule to print the value of any macro. Ex:
1174 # $ gmake print-REQUIRED_PACKAGES
1175 # Note that some macros are set on a per target basis, so what you see
1176 # is not always what you get.
1178 @echo
'$(subst ','\'',$*=$($*)) (origin: $(origin $*), flavor
: $(flavor
$*))'