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 ifeq (environment
,$(origin UNAME_LEGACY
))
27 $(error do not run make under puname
, put it in Makefiles instead
)
30 export AUTOMAKE_VERSION
=1.15
31 export AUTOCONF_VERSION
=2.69
33 # The location of an internal mirror of community source archives that we build
34 # in this gate. This mirror has been seeded to include "custom" source archives
35 # for a few components where the communities either no longer provide matching
36 # source archives or we have changes that aren't reflected in their archives or
38 #INTERNAL_ARCHIVE_MIRROR = http://userland.us.oracle.com/source-archives
40 # The location of an external mirror of community source archives that we build
41 # in this gate. The external mirror is a replica of the internal mirror.
42 #EXTERNAL_ARCHIVE_MIRROR = \
43 # http://static.opensolaris.org/action/browse/userland/tarball/userland
45 DLC_ARCHIVE_MIRROR
= http
://dlc.openindiana.org
/oi-userland
/source-archives
47 # Default to looking for source archives on the internal mirror and the external
48 # mirror before we hammer on the community source archive repositories.
49 #export DOWNLOAD_SEARCH_PATH += $(INTERNAL_ARCHIVE_MIRROR)
50 #export DOWNLOAD_SEARCH_PATH += $(EXTERNAL_ARCHIVE_MIRROR)
52 # Look for file at DLC server as last resort
53 export DOWNLOAD_FALLBACK_PATH
= $(DLC_ARCHIVE_MIRROR
)
55 # The workspace starts at the mercurial root
56 ifeq ($(origin WS_TOP
), undefined
)
58 $(shell hg root
2>/dev
/null || git rev-parse
--show-toplevel
)
61 USERLAND_ARCHIVES ?
= $(WS_TOP
)/archives
/
62 WS_MACH
= $(WS_TOP
)/$(MACH
)
63 WS_LOGS
= $(WS_MACH
)/logs
64 WS_REPO
= $(WS_MACH
)/repo
65 WS_TOOLS
= $(WS_TOP
)/tools
66 WS_MAKE_RULES
= $(WS_TOP
)/make-rules
67 WS_COMPONENTS
= $(WS_TOP
)/components
68 WS_LICENSES
= $(WS_TOP
)/licenses
69 WS_INCORPORATIONS
= $(WS_TOP
)/incorporations
70 WS_LINT_CACHE
= $(WS_MACH
)/pkglint-cache
72 # we want our pkg piplines to fail if there is an error
73 # (like if pkgdepend fails in the middle of a pipe), but
74 # we don't want the builds or ./configure's failing as well.
75 # so we only set pipefail for the publish target and have
76 # to reset it for the others since they might be invoked
77 # as dependencies of publish.
82 publish
: SHELLOPTS
=pipefail
86 # This can be overridden to avoid rebuilding when you touch a Makefile
87 MAKEFILE_PREREQ
= Makefile
89 CONSOLIDATION
= userland
90 PUBLISHER ?
= $(CONSOLIDATION
)
91 PUBLISHER_LOCALIZABLE ?
= $(CONSOLIDATION
)-localizable
93 # Defines $(space) as a single blank space, so we can use it to convert
94 # space-separated paths to colon-separated paths in variables with
95 # $(subst $(space),:,$(strip $(SPATHS)))
97 space
:= $(empty
) $(empty
)
102 OS_VERSION
:= $(shell uname
-r
)
103 SOLARIS_VERSION
= 2.11
105 PKG_SOLARIS_VERSION ?
= 5.11
107 include $(WS_MAKE_RULES
)/ips-buildinfo.mk
113 PYTHON_VERSIONS
= 2.7
115 BASS_O_MATIC
= $(WS_TOOLS
)/bass-o-matic
117 CLONEY
= $(WS_TOOLS
)/cloney
119 CONFIG_SHELL
= /bin
/sh
121 PKG_REPO
= file
:$(WS_REPO
)
123 COMPONENT_SRC_NAME
= $(COMPONENT_NAME
)
125 COMPONENT_LICENSE_FILE ?
= $(COMPONENT_NAME
).license
127 COMPONENT_DIR
:= $(shell pwd
)
128 SOURCE_DIR
= $(COMPONENT_DIR
)/$(COMPONENT_SRC
)
129 BUILD_DIR
= $(COMPONENT_DIR
)/build
130 PROTO_DIR
= $(BUILD_DIR
)/prototype
/$(MACH
)
132 ARCHLIBSUBDIR32
= $(MACH32
)
134 ARCHLIBSUBDIR
= $(ARCHLIBSUBDIR
$(BITS
))
142 KERNELDRVDIR
= /kernel
/drv
143 KERNELDRVDIR32
=/kernel
/drv
144 KERNELDRVDIR64
=/kernel
/drv
/$(MACH64
)
145 USRBINDIR
= $(USRDIR
)/bin
146 USRBINDIR32
= $(USRDIR
)/bin
/$(MACH32
)
147 USRBINDIR64
= $(USRDIR
)/bin
/$(MACH64
)
148 USRSBINDIR
= $(USRDIR
)/sbin
149 USRSBINDIR32
= $(USRDIR
)/sbin
/$(MACH32
)
150 USRSBINDIR64
= $(USRDIR
)/sbin
/$(MACH64
)
151 USRLIBDIR
= $(USRDIR
)/lib
152 USRLIBDIR32
= $(USRDIR
)/lib
/$(MACH32
)
153 USRLIBDIR64
= $(USRDIR
)/lib
154 USRSHAREDIR
= $(USRDIR
)/share
155 USRINCDIR
= $(USRDIR
)/include
156 USRSHARELOCALEDIR
= $(USRSHAREDIR
)/locale
157 USRSHAREMANDIR
= $(USRSHAREDIR
)/man
158 USRSHAREDOCDIR
= $(USRSHAREDIR
)/doc
159 USRSHARELIBDIR
= $(USRSHAREDIR
)/lib
160 USRSHAREMAN1DIR
= $(USRSHAREMANDIR
)/man1
161 USRSHAREMAN1MDIR
= $(USRSHAREMANDIR
)/man1m
162 USRSHAREMAN3DIR
= $(USRSHAREMANDIR
)/man3
163 USRSHAREMAN4DIR
= $(USRSHAREMANDIR
)/man4
164 USRSHAREMAN5DIR
= $(USRSHAREMANDIR
)/man5
165 USRSHAREMAN8DIR
= $(USRSHAREMANDIR
)/man8
166 USRKERNELDRVDIR
= $(USRDIR
)/kernel
/drv
167 USRKERNELDRVDIR32
= $(USRDIR
)/kernel
/drv
168 USRKERNELDRVDIR64
= $(USRDIR
)/kernel
/drv
/$(MACH64
)
170 # The *.$(BITS) variables are different from those above (better suited for
171 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
172 USRBINDIR
.32 = $(USRBINDIR
)
173 USRBINDIR
.64 = $(USRBINDIR64
)
174 USRSBINDIR
.32 = $(USRSBINDIR
)
175 USRSBINDIR
.64 = $(USRSBINDIR64
)
176 USRLIBDIR
.32 = $(USRLIBDIR32
)
177 USRLIBDIR
.64 = $(USRLIBDIR64
)
179 PROTOETCDIR
= $(PROTO_DIR
)/$(ETCDIR
)
180 PROTOETCSECDIR
= $(PROTO_DIR
)/$(ETCDIR
)/security
181 PROTOUSRDIR
= $(PROTO_DIR
)/$(USRDIR
)
182 PROTOBINDIR
= $(PROTO_DIR
)/$(BINDIR
)
183 PROTOSBINDIR
= $(PROTO_DIR
)/$(SBINDIR
)
184 PROTOLIBDIR
= $(PROTO_DIR
)/$(LIBDIR
)
185 PROTOVARDIR
= $(PROTO_DIR
)/$(VARDIR
)
186 PROTOKERNELDRVDIR
= $(PROTO_DIR
)/$(KERNELDRVDIR
)
187 PROTOKERNELDRVDIR32
= $(PROTO_DIR
)/$(KERNELDRVDIR32
)
188 PROTOKERNELDRVDIR64
= $(PROTO_DIR
)/$(KERNELDRVDIR64
)
189 PROTOUSRBINDIR
= $(PROTO_DIR
)/$(USRBINDIR
)
190 PROTOUSRBINDIR32
= $(PROTO_DIR
)/$(USRBINDIR32
)
191 PROTOUSRBINDIR64
= $(PROTO_DIR
)/$(USRBINDIR64
)
192 PROTOUSRSBINDIR
= $(PROTO_DIR
)/$(USRSBINDIR
)
193 PROTOUSRSBINDIR32
= $(PROTO_DIR
)/$(USRSBINDIR32
)
194 PROTOUSRSBINDIR64
= $(PROTO_DIR
)/$(USRSBINDIR64
)
195 PROTOUSRLIBDIR
= $(PROTO_DIR
)/$(USRLIBDIR
)
196 PROTOUSRLIBDIR32
= $(PROTO_DIR
)/$(USRLIBDIR32
)
197 PROTOUSRLIBDIR64
= $(PROTO_DIR
)/$(USRLIBDIR64
)
198 PROTOUSRINCDIR
= $(PROTO_DIR
)/$(USRINCDIR
)
199 PROTOUSRSHAREDIR
= $(PROTO_DIR
)/$(USRSHAREDIR
)
200 PROTOUSRSHARELIBDIR
= $(PROTO_DIR
)/$(USRSHARELIBDIR
)
201 PROTOUSRSHAREMANDIR
= $(PROTO_DIR
)/$(USRSHAREMANDIR
)
202 PROTOUSRSHAREDOCDIR
= $(PROTO_DIR
)/$(USRSHAREDOCDIR
)
203 PROTOUSRSHAREMAN1DIR
= $(PROTO_DIR
)/$(USRSHAREMAN1DIR
)
204 PROTOUSRSHAREMAN1MDIR
= $(PROTO_DIR
)/$(USRSHAREMAN1MDIR
)
205 PROTOUSRSHAREMAN3DIR
= $(PROTO_DIR
)/$(USRSHAREMAN3DIR
)
206 PROTOUSRSHAREMAN4DIR
= $(PROTO_DIR
)/$(USRSHAREMAN4DIR
)
207 PROTOUSRSHAREMAN5DIR
= $(PROTO_DIR
)/$(USRSHAREMAN5DIR
)
208 PROTOUSRSHAREMAN8DIR
= $(PROTO_DIR
)/$(USRSHAREMAN8DIR
)
209 PROTOUSRSHARELOCALEDIR
= $(PROTO_DIR
)/$(USRSHARELOCALEDIR
)
210 PROTOUSRKERNELDRVDIR
= $(PROTO_DIR
)/$(USRKERNELDRVDIR
)
211 PROTOUSRKERNELDRVDIR32
= $(PROTO_DIR
)/$(USRKERNELDRVDIR32
)
212 PROTOUSRKERNELDRVDIR64
= $(PROTO_DIR
)/$(USRKERNELDRVDIR64
)
214 PROTOUSRBINDIR
.32 = $(PROTOUSRBINDIR
)
215 PROTOUSRBINDIR
.64 = $(PROTOUSRBINDIR64
)
216 PROTOUSRSBINDIR
.32 = $(PROTOUSRSBINDIR
)
217 PROTOUSRSBINDIR
.64 = $(PROTOUSRSBINDIR64
)
218 PROTOUSRLIBDIR
.32 = $(PROTOUSRLIBDIR32
)
219 PROTOUSRLIBDIR
.64 = $(PROTOUSRLIBDIR
)
221 # NOTE: We do not build SFW contents
222 # /usr/sfw/bin is just a historic artefact, containing symlinks
223 SFWBIN
= /usr
/sfw
/bin
225 SFWBIN64
= $(SFWBIN
)/$(MACH64
)
226 SFWSBIN
= /usr
/sfw
/sbin
227 SFWSBIN32
= $(SFWSBIN
)
228 SFWSBIN64
= $(SFWSBIN
)/$(MACH64
)
229 SFWINCLUDE
= /usr
/sfw
/include
230 SFWLIB
= /usr
/sfw
/lib
232 SFWLIB64
= $(SFWLIB
)/$(MACH64
)
233 SFWSHARE
= /usr
/sfw
/share
234 SFWSHAREMAN
= $(SFWSHARE
)/man
235 SFWSHAREMAN1
= $(SFWSHAREMAN
)/man1
236 PROTOSFWBIN
= $(PROTO_DIR
)/$(SFWBIN
)
237 PROTOSFWBIN32
= $(PROTO_DIR
)/$(SFWBIN32
)
238 PROTOSFWBIN64
= $(PROTO_DIR
)/$(SFWBIN64
)
239 PROTOSFWSBIN
= $(PROTO_DIR
)/$(SFWSBIN
)
240 PROTOSFWSBIN32
= $(PROTO_DIR
)/$(SFWSBIN32
)
241 PROTOSFWSBIN64
= $(PROTO_DIR
)/$(SFWSBIN64
)
242 PROTOSFWLIB
= $(PROTO_DIR
)/$(SFWLIB
)
243 PROTOSFWLIB32
= $(PROTO_DIR
)/$(SFWLIB32
)
244 PROTOSFWLIB64
= $(PROTO_DIR
)/$(SFWLIB64
)
245 PROTOSFWSHARE
= $(PROTO_DIR
)/$(SFWSHARE
)
246 PROTOSFWSHAREMAN
= $(PROTO_DIR
)/$(SFWSHAREMAN
)
247 PROTOSFWSHAREMAN1
= $(PROTO_DIR
)/$(SFWSHAREMAN1
)
248 PROTOSFWINCLUDE
= $(PROTO_DIR
)/$(SFWINCLUDE
)
250 # The *.$(BITS) variables are different from those above (better suited for
251 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
252 SFWBIN
.32 = $(SFWBIN
)
253 SFWBIN
.64 = $(SFWBIN64
)
254 SFWSBIN
.32 = $(SFWSBIN
)
255 SFWSBIN
.64 = $(SFWSBIN64
)
256 SFWLIB
.32 = $(SFWLIB
)
257 SFWLIB
.64 = $(SFWLIB64
)
258 PROTOSFWBIN
.32 = $(PROTOSFWBIN
)
259 PROTOSFWBIN
.64 = $(PROTOSFWBIN64
)
260 PROTOSFWSBIN
.32 = $(PROTOSFWSBIN
)
261 PROTOSFWSBIN
.64 = $(PROTOSFWSBIN64
)
262 PROTOSFWLIB
.32 = $(PROTOSFWLIB
)
263 PROTOSFWLIB
.64 = $(PROTOSFWLIB64
)
265 CLDIR
= /usr
/share
/common-lisp
266 PROTOCLDIR
= $(PROTO_DIR
)/$(CLDIR
)
269 GNUBIN
= $(GNUDIR
)/bin
270 GNUBIN32
= $(GNUBIN
)/$(MACH32
)
271 GNUBIN64
= $(GNUBIN
)/$(MACH64
)
272 GNUSBIN
= $(GNUDIR
)/sbin
273 GNUSBIN32
= $(GNUSBIN
)/$(MACH32
)
274 GNUSBIN64
= $(GNUSBIN
)/$(MACH64
)
275 GNULIB
= $(GNUDIR
)/lib
277 GNULIB64
= $(GNULIB
)/$(MACH64
)
278 GNUSHARE
= $(GNUDIR
)/share
279 GNUSHAREMAN
= $(GNUSHARE
)/man
280 GNUSHAREMAN1
= $(GNUSHAREMAN
)/man1
281 PROTOGNUBIN
= $(PROTO_DIR
)/$(GNUBIN
)
282 PROTOGNUBIN32
= $(PROTO_DIR
)/$(GNUBIN32
)
283 PROTOGNUBIN64
= $(PROTO_DIR
)/$(GNUBIN64
)
284 PROTOGNUSBIN
= $(PROTO_DIR
)/$(GNUSBIN
)
285 PROTOGNUSBIN32
= $(PROTO_DIR
)/$(GNUSBIN32
)
286 PROTOGNUSBIN64
= $(PROTO_DIR
)/$(GNUSBIN64
)
287 PROTOGNULIB
= $(PROTO_DIR
)/$(GNULIB
)
288 PROTOGNULIB32
= $(PROTO_DIR
)/$(GNULIB32
)
289 PROTOGNULIB64
= $(PROTO_DIR
)/$(GNULIB64
)
290 PROTOGNUSHARE
= $(PROTO_DIR
)/$(GNUSHARE
)
291 PROTOGNUSHAREMAN
= $(PROTO_DIR
)/$(GNUSHAREMAN
)
292 PROTOGNUSHAREMAN1
= $(PROTO_DIR
)/$(GNUSHAREMAN1
)
294 # The *.$(BITS) variables are different from those above (better suited for
295 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
296 GNUBIN
.32 = $(GNUBIN
)
297 GNUBIN
.64 = $(GNUBIN64
)
298 GNUSBIN
.32 = $(GNUSBIN
)
299 GNUSBIN
.64 = $(GNUSBIN64
)
300 GNULIB
.32 = $(GNULIB
)
301 GNULIB
.64 = $(GNULIB64
)
302 PROTOGNUBIN
.32 = $(PROTOGNUBIN
)
303 PROTOGNUBIN
.64 = $(PROTOGNUBIN64
)
304 PROTOGNUSBIN
.32 = $(PROTOGNUSBIN
)
305 PROTOGNUSBIN
.64 = $(PROTOGNUSBIN64
)
306 PROTOGNULIB
.32 = $(PROTOGNULIB
)
307 PROTOGNULIB
.64 = $(PROTOGNULIB64
)
309 # work around _TIME, _DATE, embedded date chatter in component builds
310 # to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME)
311 # to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV
312 CONSTANT_TIME
= LD_PRELOAD_32
=$(WS_TOOLS
)/time-
$(MACH32
).so
313 CONSTANT_TIME
+= LD_PRELOAD_64
=$(WS_TOOLS
)/time-
$(MACH64
).so
314 CONSTANT_TIME
+= TIME_CONSTANT
=$(TIME_CONSTANT
)
316 MACH
:= $(shell uname
-p
)
317 ifneq (amd64
,$(MACH
))
319 $(error invalid value for uname
-p
)
325 CONFIGURE_32
= $(BUILD_DIR_32
)/.configured
326 CONFIGURE_64
= $(BUILD_DIR_64
)/.configured
328 BUILD_DIR_32
= $(BUILD_DIR
)/$(MACH32
)
329 BUILD_DIR_64
= $(BUILD_DIR
)/$(MACH64
)
331 BUILD_32
= $(BUILD_DIR_32
)/.built
332 BUILD_64
= $(BUILD_DIR_64
)/.built
333 BUILD_32_and_64
= $(BUILD_32
) $(BUILD_64
)
334 $(BUILD_DIR_32
)/.built
: BITS
=32
335 $(BUILD_DIR_64
)/.built
: BITS
=64
337 INSTALL_32
= $(BUILD_DIR_32
)/.installed
338 INSTALL_64
= $(BUILD_DIR_64
)/.installed
339 INSTALL_32_and_64
= $(INSTALL_32
) $(INSTALL_64
)
340 $(BUILD_DIR_32
)/.installed
: BITS
=32
341 $(BUILD_DIR_64
)/.installed
: BITS
=64
343 # set the default target for installation of the component
344 COMPONENT_INSTALL_TARGETS
= install
346 # set the default build test results directory
347 COMPONENT_TEST_BUILD_DIR
= $(BUILD_DIR
)/test/$(MACH
$(BITS
))
349 # set the default master test results directory
350 COMPONENT_TEST_RESULTS_DIR
= $(COMPONENT_DIR
)/test
352 # set the default master test results file
353 COMPONENT_TEST_MASTER
= $(COMPONENT_TEST_RESULTS_DIR
)/results-
$(BITS
).master
355 # set the default test results output file
356 COMPONENT_TEST_OUTPUT
= $(COMPONENT_TEST_BUILD_DIR
)/test-
$(BITS
)-results
358 # set the default test results comparison diffs file
359 COMPONENT_TEST_DIFFS
= $(COMPONENT_TEST_BUILD_DIR
)/test-
$(BITS
)-diffs
361 # set the default test snapshot file
362 COMPONENT_TEST_SNAPSHOT
= $(COMPONENT_TEST_BUILD_DIR
)/results-
$(BITS
).snapshot
364 # Normally $(GSED) is simplest, but some results files need more power.
365 COMPONENT_TEST_TRANSFORMER
= $(GSED
)
367 # The set of default transforms to be applied to the test results to try
369 COMPONENT_TEST_TRANSFORMS
= \
370 '-e "s|$(@D)|\\$$(@D)|g" ' \
371 '-e "s|$(PERL)|\\$$(PERL)|g" ' \
372 '-e "s|$(SOURCE_DIR)|\\$$(SOURCE_DIR)|g" '
374 # set the default commands used to generate the file containing the set
375 # of transforms to be applied to the test results to try to normalize them.
376 COMPONENT_TEST_CREATE_TRANSFORMS
= \
377 if
[ -e
$(COMPONENT_TEST_MASTER
) ]; \
379 print "\#!/bin/sh" > $(COMPONENT_TEST_TRANSFORM_CMD
); \
380 print '$(COMPONENT_TEST_TRANSFORMER) ' \
381 $(COMPONENT_TEST_TRANSFORMS
) \
382 ' \\' >> $(COMPONENT_TEST_TRANSFORM_CMD
); \
383 print '$(COMPONENT_TEST_OUTPUT) \\' \
384 >> $(COMPONENT_TEST_TRANSFORM_CMD
); \
385 print '> $(COMPONENT_TEST_SNAPSHOT)' \
386 >> $(COMPONENT_TEST_TRANSFORM_CMD
); \
389 # set the default command for performing any test result munging
390 COMPONENT_TEST_TRANSFORM_CMD
= $(COMPONENT_TEST_BUILD_DIR
)/transform-
$(BITS
)-results
392 # set the default operation to run to perform test result normalization
393 COMPONENT_TEST_PERFORM_TRANSFORM
= \
394 if
[ -e
$(COMPONENT_TEST_MASTER
) ]; \
396 $(SHELL
) $(COMPONENT_TEST_TRANSFORM_CMD
); \
399 # set the default command used to compare the master results with the snapshot
400 COMPONENT_TEST_COMPARE_CMD
= $(GDIFF
) -uN
402 # set the default way that master and snapshot test results are compared
403 COMPONENT_TEST_COMPARE
= \
404 if
[ -e
$(COMPONENT_TEST_MASTER
) ]; \
406 $(COMPONENT_TEST_COMPARE_CMD
) \
407 $(COMPONENT_TEST_MASTER
) $(COMPONENT_TEST_SNAPSHOT
) \
408 > $(COMPONENT_TEST_DIFFS
); \
409 print "Test results in $(COMPONENT_TEST_OUTPUT)"; \
410 if
[ -s
$(COMPONENT_TEST_DIFFS
) ]; \
412 print "Differences found."; \
413 $(CAT
) $(COMPONENT_TEST_DIFFS
); \
416 print "No differences found."; \
420 # set the default env command to use for test of the component
421 COMPONENT_TEST_ENV_CMD
= $(ENV
)
423 # set the default command to use for test of the component
424 COMPONENT_TEST_CMD
= $(MAKE
)
426 # set the default target for test of the component
427 COMPONENT_TEST_TARGETS
= check
429 # set the default directory for test of the component
430 COMPONENT_TEST_DIR
= $(@D
)
432 # determine the type of tests we want to run.
433 ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR
)/results-
*.master
)),)
434 TEST_32
= $(BUILD_DIR_32
)/.tested
435 TEST_64
= $(BUILD_DIR_64
)/.tested
437 TEST_32
= $(BUILD_DIR_32
)/.tested-and-compared
438 TEST_64
= $(BUILD_DIR_64
)/.tested-and-compared
440 TEST_32_and_64
= $(TEST_32
) $(TEST_64
)
441 $(BUILD_DIR_32
)/.tested
: BITS
=32
442 $(BUILD_DIR_64
)/.tested
: BITS
=64
443 $(BUILD_DIR_32
)/.tested-and-compared
: BITS
=32
444 $(BUILD_DIR_64
)/.tested-and-compared
: BITS
=64
446 # BUILD_TOOLS is the root of all tools not normally installed on the system.
450 SPRO_ROOT
= $(BUILD_TOOLS
)/sunstudio
$(SPRO_VERSION
)
451 SPRO_VROOT
= $(SPRO_ROOT
)
453 PARFAIT_ROOT
= $(BUILD_TOOLS
)/parfait
/parfait-tools-1.0
.1/
454 PARFAIT
= $(PARFAIT_ROOT
)/bin
/parfait
455 export PARFAIT_NATIVESUNCC
=$(SPRO_VROOT
)/bin
/cc
456 export PARFAIT_NATIVESUNCXX
=$(SPRO_VROOT
)/bin
/CC
457 export PARFAIT_NATIVEGCC
=$(GCC_ROOT
)/bin
/gcc
458 export PARFAIT_NATIVEGXX
=$(GCC_ROOT
)/bin
/g
++
461 # The CCACHE makefile variable should evaluate to empty string or a pathname
462 # like /usr/bin/ccache depending on your PATH value and "which" implementation.
463 # The assignment via ":=" is important, to only do this once in a Makefile,
464 # and not on every reference to the value as "=" assignment would result in.
465 # Review `man ccache` for optional configuration tuning, like cache size etc.
467 # For production builds or suspected errors you can disable this feature by
468 # setting ENABLE_CCACHE=false (as makefile or environment variable, which
469 # is currently the default) to not even define the usage of wrapper in the
470 # userland-building makefile system.
471 # If you want to speed up your re-builds, you must set ENABLE_CCACHE=true.
472 # For legacy reasons, the CCACHE_DISABLE and CCACHE_NODISABLE variables (from
473 # configuration of the "ccache" program itself) are also supported, but direct
474 # use is discouraged, since their syntax and usage are counter-intuitive.
476 # Still, absence of ccache in PATH is not considered a fatal error since the
477 # build would just proceed well with original compiler.
478 # Note: In code below we fast-track if the makefile CCACHE variable is defined
479 # but fall back to shell executability tests if just envvar CCACHE is passed.
481 export CCACHE
:= $(shell \
482 if
test -n
"$(CCACHE)" ; then \
485 if
test x
"$${CCACHE_DISABLE-}" != x
-o x
"$(CCACHE_DISABLE)" != x \
486 -o x
"$${ENABLE_CCACHE-}" = xfalse
-o x
"$(ENABLE_CCACHE)" = xfalse \
488 echo
"NOT USING CCACHE FOR OI-USERLAND because explicitly disabled" >&2 ; \
490 if
test x
"$${CCACHE_NODISABLE-}" != x
-o x
"$(CCACHE_NODISABLE)" != x \
491 -o x
"$${ENABLE_CCACHE-}" = xtrue
-o x
"$(ENABLE_CCACHE)" = xtrue \
495 `which ccache 2>/dev/null | egrep '^/'` \
497 ; do if
test -n
"$$F" && test -x
"$$F" ; then \
499 echo
"USING CCACHE FOR OI-USERLAND: $$F" >&2 ; \
500 if
test x
"$${CCACHE_DISABLE-}" != x
; then \
501 echo
"WARNING: envvar CCACHE_DISABLE is set, so effectively ccache will not act!" >&2 ; \
506 echo
"NOT USING CCACHE FOR OI-USERLAND because not found" >&2 ; \
512 GCC_ROOT
= /usr
/gcc
/$(GCC_VERSION
)
514 CC.studio
.32 = $(SPRO_VROOT
)/bin
/cc
515 CXX.studio
.32 = $(SPRO_VROOT
)/bin
/CC
516 F77.studio
.32 = $(SPRO_VROOT
)/bin
/f77
517 FC.studio
.32 = $(SPRO_VROOT
)/bin
/f90
519 CC.studio
.64 = $(SPRO_VROOT
)/bin
/cc
520 CXX.studio
.64 = $(SPRO_VROOT
)/bin
/CC
521 F77.studio
.64 = $(SPRO_VROOT
)/bin
/f77
522 FC.studio
.64 = $(SPRO_VROOT
)/bin
/f90
524 CC.gcc
.32 = $(GCC_ROOT
)/bin
/gcc
-m32
525 CXX.gcc
.32 = $(GCC_ROOT
)/bin
/g
++ -m32
526 F77.gcc
.32 = $(GCC_ROOT
)/bin
/gfortran
-m32
527 FC.gcc
.32 = $(GCC_ROOT
)/bin
/gfortran
-m32
529 CC.gcc
.64 = $(GCC_ROOT
)/bin
/gcc
530 CXX.gcc
.64 = $(GCC_ROOT
)/bin
/g
++
531 F77.gcc
.64 = $(GCC_ROOT
)/bin
/gfortran
532 FC.gcc
.64 = $(GCC_ROOT
)/bin
/gfortran
534 ifneq ($(strip $(CCACHE
)),)
536 CCACHE_WRAP_ROOT
= $(WS_TOOLS
)/ccache-wrap
537 export CC_gcc_32
:= $(CC.gcc
.32)
538 export CC_gcc_64
:= $(CC.gcc
.64)
539 export CXX_gcc_32
:= $(CXX.gcc
.32)
540 export CXX_gcc_64
:= $(CXX.gcc
.64)
541 CC.gcc
.32 := $(CCACHE_WRAP_ROOT
)/CC.gcc
.32
542 CC.gcc
.64 := $(CCACHE_WRAP_ROOT
)/CC.gcc
.64
543 CXX.gcc
.32 := $(CCACHE_WRAP_ROOT
)/CXX.gcc
.32
544 CXX.gcc
.64 := $(CCACHE_WRAP_ROOT
)/CXX.gcc
.64
546 ifneq ($(strip $(CCACHE_DIR
)),)
547 export CCACHE_DIR
:= $(CCACHE_DIR
)
550 ifneq ($(strip $(CCACHE_LOGFILE
)),)
551 export CCACHE_LOGFILE
:= $(CCACHE_LOGFILE
)
556 lint
.32 = $(SPRO_VROOT
)/bin
/lint
-m32
557 lint
.64 = $(SPRO_VROOT
)/bin
/lint
-m64
559 LINT
= $(lint.
$(BITS
))
563 PYTHON
.2.7.VENDOR_PACKAGES
.32 = /usr
/lib
/python2.7
/vendor-packages
564 PYTHON
.2.7.VENDOR_PACKAGES
.64 = /usr
/lib
/python2.7
/vendor-packages
565 PYTHON
.2.7.VENDOR_PACKAGES
= $(PYTHON
.2.7.VENDOR_PACKAGES.
$(BITS
))
567 PYTHON
.3.4.VENDOR_PACKAGES
.32 = /usr
/lib
/python3.4
/vendor-packages
568 PYTHON
.3.4.VENDOR_PACKAGES
.64 = /usr
/lib
/python3.4
/vendor-packages
569 PYTHON
.3.4.VENDOR_PACKAGES
= $(PYTHON
.3.4.VENDOR_PACKAGES.
$(BITS
))
571 ifeq ($(strip $(PARFAIT_BUILD
)),yes
)
572 CC.studio
.32 = $(WS_TOOLS
)/parfait
/cc
573 CXX.studio
.32 = $(WS_TOOLS
)/parfait
/CC
574 CC.studio
.64 = $(WS_TOOLS
)/parfait
/cc
575 CXX.studio
.64 = $(WS_TOOLS
)/parfait
/CC
576 CC.gcc
.32 = $(WS_TOOLS
)/parfait
/gcc
577 CXX.gcc
.32 = $(WS_TOOLS
)/parfait
/g
++
578 CC.gcc
.64 = $(WS_TOOLS
)/parfait
/gcc
579 CXX.gcc
.64 = $(WS_TOOLS
)/parfait
/g
++
580 LD
= $(WS_TOOLS
)/parfait
/ld
583 CC
= $(CC.
$(COMPILER
).
$(BITS
))
584 CXX
= $(CXX.
$(COMPILER
).
$(BITS
))
585 F77
= $(F77.
$(COMPILER
).
$(BITS
))
586 FC
= $(FC.
$(COMPILER
).
$(BITS
))
589 RUBY_LIB_VERSION
.2.2 = 2.2.0
590 RUBY_LIB_VERSION
.2.3 = 2.3.0
591 RUBY
.2.2 = /usr
/ruby
/2.2/bin
/ruby
592 RUBY
.2.3 = /usr
/ruby
/2.3/bin
/ruby
593 RUBY
= $(RUBY.
$(RUBY_VERSION
))
594 RUBY_LIB_VERSION
= $(RUBY_LIB_VERSION.
$(RUBY_VERSION
))
596 # Transform Ruby scripts to call the supported
597 # version-specific ruby; used in multiple *.mk files
598 RUBY_SCRIPT_FIX_FUNC
= \
599 $(GNU_GREP
) -Rl
'^\#! */usr/bin/env ruby' | \
600 /usr
/bin
/xargs
-I\
{\
} $(GSED
) -i
-e \
601 '1s%^\#! */usr/bin/env ruby%\#!/usr/ruby/$(RUBY_VERSION)/bin/ruby%' \
604 # Use the ruby lib versions to represent the RUBY_VERSIONS that
605 # need to get built. This is done because during package transformations
606 # both the ruby version and the ruby library version are needed.
607 RUBY_VERSIONS
= $(RUBY_LIB_VERSION
)
609 PYTHON_VENDOR_PACKAGES
.32 = /usr
/lib
/python
$(PYTHON_VERSION
)/vendor-packages
610 PYTHON_VENDOR_PACKAGES
.64 = /usr
/lib
/python
$(PYTHON_VERSION
)/vendor-packages
611 PYTHON_VENDOR_PACKAGES
= $(PYTHON_VENDOR_PACKAGES.
$(BITS
))
613 PYTHON
.2.7.32 = /usr
/bin
/true
32-bit-python-disabled
614 PYTHON
.2.7.64 = /usr
/bin
/python2.7
616 PYTHON
.3.4.32 = /usr
/bin
/python3.4
617 PYTHON
.3.4.64 = /usr
/bin
/$(MACH64
)/python3.4
619 PYTHON
.32 = $(PYTHON.
$(PYTHON_VERSION
).32)
620 PYTHON
.64 = $(PYTHON.
$(PYTHON_VERSION
).64)
621 PYTHON
= $(PYTHON.
$(PYTHON_VERSION
).
$(BITS
))
623 # The default is site-packages, but that directory belongs to the end-user.
624 # Modules which are shipped by the OS but not with the core Python distribution
625 # belong in vendor-packages.
626 PYTHON_LIB
= /usr
/lib
/python
$(PYTHON_VERSION
)/vendor-packages
627 PYTHON_DATA
= $(PYTHON_LIB
)
629 JAVA7_HOME
= /usr
/jdk
/instances
/openjdk1.7
.0
630 JAVA8_HOME
= /usr
/jdk
/instances
/openjdk1.8
.0
631 JAVA_HOME
= $(JAVA8_HOME
)
633 # This is the default BUILD version of perl
634 # Not necessarily the system's default version, i.e. /usr/bin/perl
639 PERL
.5.22 = /usr
/perl5
/5.22/bin
/perl
640 PERL
.5.24 = /usr
/perl5
/5.24/bin
/perl
642 POD2MAN
.5.22 = /usr
/perl5
/5.22/bin
/pod2man
643 POD2MAN
.5.24 = /usr
/perl5
/5.24/bin
/pod2man
645 PERL
= $(PERL.
$(PERL_VERSION
))
646 POD2MAN
= $(POD2MAN.
$(PERL_VERSION
))
648 PERL_ARCH
:= $(shell $(PERL
) -e
'use Config; print $$Config{archname}')
649 PERL_ARCH_FUNC
= $(shell $(1) -e
'use Config; print $$Config{archname}')
650 # Optimally we should ask perl which C compiler was used but it doesn't
651 # result in a full path name. Only "c" is being recorded
652 # inside perl builds while we actually need a full path to
653 # the studio compiler.
654 #PERL_CC := $(shell $(PERL) -e 'use Config; print $$Config{cc}')
656 PKG_MACROS
+= PERL_ARCH
=$(PERL_ARCH
)
657 PKG_MACROS
+= PERL_VERSION
=$(PERL_VERSION
)
659 # Config magic for Postgres/EnterpriseDB/...
660 # Default DB version is the oldest one, for hopefully best built complatibility
662 PG_IMPLEM ?
= postgres
663 PG_VERNUM
= $(subst .
,,$(PG_VERSION
))
664 # For dependencies, including REQUIRED_PACKAGES if needed
665 PG_BASEPKG
= database
/$(PG_IMPLEM
)-$(PG_VERNUM
)
667 PG_HOME
= $(USRDIR
)/$(PG_IMPLEM
)/$(PG_VERSION
)
668 PG_BINDIR
.32 = $(PG_HOME
)/bin
669 PG_BINDIR
.64 = $(PG_HOME
)/bin
/$(MACH64
)
670 PG_BINDIR
= $(PG_BINDIR.
$(BITS
))
671 PG_INCDIR
= $(PG_HOME
)/include
672 PG_MANDIR
= $(PG_HOME
)/man
673 PG_SHAREDIR
= $(PG_HOME
)/share
674 PG_DOCDIR
= $(PG_HOME
)/doc
675 PG_LIBDIR
.32 = $(PG_HOME
)/lib
676 PG_LIBDIR
.64 = $(PG_HOME
)/lib
/$(MACH64
)
677 PG_LIBDIR
= $(PG_LIBDIR.
$(BITS
))
678 PG_CONFIG
.32 = $(PG_BINDIR
.32)/pg_config
679 PG_CONFIG
.64 = $(PG_BINDIR
.64)/pg_config
680 PG_CONFIG
= $(PG_CONFIG.
$(BITS
))
682 PKG_MACROS
+= PG_VERSION
=$(PG_VERSION
)
683 PKG_MACROS
+= PG_VERNUM
=$(PG_VERNUM
)
684 PKG_MACROS
+= PG_BASEPKG
=$(PG_BASEPKG
)
686 # Config magic for MySQL/MariaDB/Percona/...
687 # Default DB version is the oldest one, for hopefully best built compatibility
688 # NOTE: At this time the gate does not provide a recipe for actual "mysql"
689 # The "/usr/mysql/*" trees are mediated to preferred MariaDB or Percona variant
691 MYSQL_IMPLEM ?
= mariadb
692 MYSQL_VERNUM
= $(subst .
,,$(MYSQL_VERSION
))
693 # For dependencies, including REQUIRED_PACKAGES if needed
694 MYSQL_BASEPKG
= database
/$(MYSQL_IMPLEM
)-$(MYSQL_VERNUM
)
696 MYSQL_HOME
= $(USRDIR
)/$(MYSQL_IMPLEM
)/$(MYSQL_VERSION
)
697 MYSQL_BINDIR
.32 = $(MYSQL_HOME
)/bin
698 MYSQL_BINDIR
.64 = $(MYSQL_HOME
)/bin
/$(MACH64
)
699 MYSQL_BINDIR
= $(MYSQL_BINDIR.
$(BITS
))
700 MYSQL_INCDIR
= $(MYSQL_HOME
)/include
701 MYSQL_MANDIR
= $(MYSQL_HOME
)/man
702 MYSQL_SHAREDIR
= $(MYSQL_HOME
)/share
703 MYSQL_DOCDIR
= $(MYSQL_HOME
)/doc
704 MYSQL_LIBDIR
.32 = $(MYSQL_HOME
)/lib
705 MYSQL_LIBDIR
.64 = $(MYSQL_HOME
)/lib
/$(MACH64
)
706 MYSQL_LIBDIR
= $(MYSQL_LIBDIR.
$(BITS
))
707 MYSQL_CONFIG
.32 = $(MYSQL_BINDIR
.32)/mysql_config
708 MYSQL_CONFIG
.64 = $(MYSQL_BINDIR
.64)/mysql_config
709 MYSQL_CONFIG
= $(MYSQL_CONFIG.
$(BITS
))
711 PKG_MACROS
+= MYSQL_VERSION
=$(MYSQL_VERSION
)
712 PKG_MACROS
+= MYSQL_VERNUM
=$(MYSQL_VERNUM
)
713 PKG_MACROS
+= MYSQL_BASEPKG
=$(MYSQL_BASEPKG
)
715 # Default libjpeg implementation layout
716 JPEG_IMPLEM ?
= libjpeg8-turbo
717 JPEG_HOME
= $(USRLIBDIR
)/$(JPEG_IMPLEM
)
718 JPEG_BINDIR
.32 = $(JPEG_HOME
)/bin
719 JPEG_BINDIR
.64 = $(JPEG_HOME
)/bin
/$(MACH64
)
720 JPEG_BINDIR
= $(JPEG_BINDIR.
$(BITS
))
721 JPEG_INCDIR
= $(USRINCDIR
)/$(JPEG_IMPLEM
)
722 JPEG_LIBDIR
.32 = $(JPEG_HOME
)/lib
723 JPEG_LIBDIR
.64 = $(JPEG_HOME
)/lib
/$(MACH64
)
724 JPEG_LIBDIR
= $(JPEG_LIBDIR.
$(BITS
))
725 JPEG_CPPFLAGS
= -I
$(JPEG_INCDIR
)
726 JPEG_CFLAGS
.32 = -Wl
,-L
$(JPEG_LIBDIR
.32) -Wl
,-R
$(JPEG_LIBDIR
.32)
727 JPEG_CFLAGS
.64 = -Wl
,-L
$(JPEG_LIBDIR
.64) -Wl
,-R
$(JPEG_LIBDIR
.64)
728 JPEG_CFLAGS
= $(JPEG_CFLAGS.
$(BITS
))
729 JPEG_CXXFLAGS
.32 = -Wl
,-L
$(JPEG_LIBDIR
.32) -Wl
,-R
$(JPEG_LIBDIR
.32)
730 JPEG_CXXFLAGS
.64 = -Wl
,-L
$(JPEG_LIBDIR
.64) -Wl
,-R
$(JPEG_LIBDIR
.64)
731 JPEG_CXXFLAGS
= $(JPEG_CXXFLAGS.
$(BITS
))
732 JPEG_LDFLAGS
.32 = -L
$(JPEG_LIBDIR
.32) -R
$(JPEG_LIBDIR
.32)
733 JPEG_LDFLAGS
.64 = -L
$(JPEG_LIBDIR
.64) -R
$(JPEG_LIBDIR
.64)
734 JPEG_LDFLAGS
= $(JPEG_LDFLAGS.
$(BITS
))
736 # This is the default BUILD version of tcl
737 # Not necessarily the system's default version, i.e. /usr/bin/tclsh
739 TCLSH
.8.5.i386.32
= /usr
/bin
/i86
/tclsh8.5
740 TCLSH
.8.5.i386.64
= /usr
/bin
/amd64
/tclsh8.5
741 TCLSH
.8.5.sparc
.32 = /usr
/bin
/sparcv7
/tclsh8.5
742 TCLSH
.8.5.sparc
.64 = /usr
/bin
/sparcv9
/tclsh8.5
743 TCLSH
= $(TCLSH.
$(TCL_VERSION
).
$(MACH
).
$(BITS
))
745 CCSMAKE
= /usr
/bin
/dmake
746 GMAKE
= /usr
/gnu
/bin
/make
747 GPATCH
= /usr
/gnu
/bin
/patch
749 GPATCH_BACKUP
= --backup
--version-control
=numbered
750 GPATCH_FLAGS
= -p
$(PATCH_LEVEL
) $(GPATCH_BACKUP
)
752 GDIFF
= /usr
/gnu
/bin
/diff
753 GSORT
= /usr
/gnu
/bin
/sort
754 GUNZIP
= /usr
/bin
/gunzip
756 PKGREPO
= /usr
/bin
/pkgrepo
757 PKGSEND
= /usr
/bin
/pkgsend
758 ifeq ($(strip $(PKGLINT_COMPONENT
)),)
759 PKGLINT
= /usr
/bin
/pkglint
761 PKGLINT
= ${WS_TOOLS}/pkglint
764 ACLOCAL
= /usr
/bin
/aclocal-1.10
765 AUTOMAKE
= /usr
/bin
/automake-1.10
766 AUTORECONF
= /usr
/bin
/autoreconf
768 KSH93
= /usr
/bin
/ksh93
769 TOUCH
= /usr
/bin
/touch
770 MKDIR
= /bin
/mkdir
-p
779 INSTALL
= /usr
/bin
/install
780 GNU_GREP
= /usr
/gnu
/bin
/grep
781 CHMOD
= /usr
/bin
/chmod
784 GAS
= /usr
/gnu
/bin
/as
785 GTAR
= /usr
/gnu
/bin
/tar
786 STRIP
= /usr
/bin
/strip
787 IPS2TGZ
= $(WS_TOOLS
)/ips2tgz
789 INS.
dir= $(INSTALL
) -d
$@
790 INS.file
= $(INSTALL
) -m
444 $< $(@D
)
792 PKG_CONFIG_PATH
.32 = /usr
/lib
/$(MACH32
)/pkgconfig
793 PKG_CONFIG_PATH
.64 = /usr
/lib
/pkgconfig
794 PKG_CONFIG_PATH
= $(PKG_CONFIG_PATH.
$(BITS
))
796 # Set default path for environment modules
797 MODULE_VERSION
= 3.2.10
798 MODULE_PATH
= /usr
/share
/Modules
/modulefiles
799 MODULE_VERSIONS_PATH
= /usr
/share
/Modules
/versions
801 # Path to bash completions
802 BASH_COMPLETIONS_PATH
= /usr
/share
/bash-completion
/completions
805 # C preprocessor flag sets to ease feature selection. Add the required
806 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
807 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
811 # Enables visibility of some c99 math functions that aren't visible by default.
812 # What other side-effects are there?
813 CPP_C99_EXTENDED_MATH
= -D_STDC_99
815 # Enables some #pragma redefine_extname to POSIX-compliant Standard C Library
816 # functions. Also avoids the component's #define _POSIX_C_SOURCE to some value
817 # we currently do not support.
818 CPP_POSIX
= -D_POSIX_C_SOURCE
=200112L -D_POSIX_PTHREAD_SEMANTICS
820 # XPG6 mode. This option enables XPG6 conformance, plus extensions.
821 # Amongst other things, this option will cause system calls like
822 # popen (3C) and system (3C) to invoke the standards-conforming
823 # shell, /usr/xpg4/bin/sh, instead of /usr/bin/sh. Add studio_XPG6MODE to
824 # CFLAGS instead of using this directly
825 CPP_XPG6MODE
= -D_XOPEN_SOURCE
=600 -D__EXTENSIONS__
=1 -D_XPG6
827 # XPG5 mode. These options are specific for C++, where _XPG6,
828 # _XOPEN_SOURCE=600 and C99 are illegal. -D__EXTENSIONS__=1 is legal in C++.
829 CPP_XPG5MODE
= -D_XOPEN_SOURCE
=500 -D__EXTENSIONS__
=1 -D_XPG5
832 # Studio C compiler flag sets to ease feature selection. Add the required
833 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
834 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
837 # Generate 32/64 bit objects
840 # Code generation instruction set and optimization 'hints'. Use studio_XBITS
841 # and not the .arch.bits variety directly.
842 studio_XBITS.sparc
.32 = -xtarget
=ultra2
-xarch
=sparcvis
-xchip
=ultra2
843 studio_XBITS.sparc
.64 =
844 ifneq ($(strip $(PARFAIT_BUILD
)),yes
)
845 studio_XBITS.sparc
.64 += -xtarget
=ultra2
847 studio_XBITS.sparc
.64 += -xarch
=sparcvis
-xchip
=ultra2
848 studio_XBITS.i386.32
= -xchip
=pentium
849 studio_XBITS.i386.64
= -xchip
=generic
-Ui386
-U__i386
850 studio_XBITS
= $(studio_XBITS.
$(MACH
).
$(BITS
))
852 # Turn on recognition of supported C99 language features and enable the 1999 C
853 # standard library semantics of routines that appear in both the 1990 and
854 # 1999 C standard. To use set studio_C99MODE=$(studio_99_ENABLE) in your
855 # component Makefile.
856 studio_C99_ENABLE
= -xc99
=all
858 # Turn off recognition of C99 language features, and do not enable the 1999 C
859 # standard library semantics of routines that appeared in both the 1990 and
860 # 1999 C standard. To use set studio_C99MODE=$(studio_99_DISABLE) in your
861 # component Makefile.
862 studio_C99_DISABLE
= -xc99
=none
864 # Use the compiler default 'xc99=all,no_lib'
867 # For C++, compatibility with C99 (which is technically illegal) is
868 # enabled in a different way. So, we must use a different macro for it.
869 studio_cplusplus_C99_ENABLE
= -xlang
=c99
872 studio_cplusplus_C99_DISABLE
=
874 # And this is the macro you should actually use
875 studio_cplusplus_C99MODE
=
877 # Turn on C99 for gcc
878 gcc_C99_ENABLE
= -std
=c99
880 # Allow zero-sized struct/union declarations and void functions with return
882 studio_FEATURES_EXTENSIONS
= -features
=extensions
884 # Control the Studio optimization level.
885 studio_OPT.sparc
.32 = -xO4
886 studio_OPT.sparc
.64 = -xO4
887 studio_OPT.i386.32
= -xO4
888 studio_OPT.i386.64
= -xO4
889 studio_OPT
= $(studio_OPT.
$(MACH
).
$(BITS
))
891 # Studio PIC code generation. Use CC_PIC instead to select PIC code generation.
892 studio_PIC
= -KPIC
-DPIC
894 # The Sun Studio 11 compiler has changed the behaviour of integer
895 # wrap arounds and so a flag is needed to use the legacy behaviour
896 # (without this flag panics/hangs could be exposed within the source).
897 # This is used through studio_IROPTS, not the 'sparc' variety.
898 studio_IROPTS.sparc
= -W2
,-xwrap_int
899 studio_IROPTS
= $(studio_IROPTS.
$(MACH
))
901 # Control register usage for generated code. SPARC ABI requires system
902 # libraries not to use application registers. x86 requires 'no%frameptr' at
905 # We should just use -xregs but we need to workaround 7030022. Note
906 # that we can't use the (documented) -Wc,-xregs workaround because
907 # libtool really hates -Wc and thinks it should be -Wl. Instead
908 # we use an (undocumented) option which actually happens to be what
910 studio_XREGS.sparc
= -Qoption cg
-xregs
=no
%appl
911 studio_XREGS.i386
= -xregs
=no
%frameptr
912 studio_XREGS
= $(studio_XREGS.
$(MACH
))
914 gcc_XREGS.sparc
= -mno-app-regs
916 gcc_XREGS
= $(gcc_XREGS.
$(MACH
))
918 # Set data alignment on sparc to reasonable values, 8 byte alignment for 32 bit
919 # objects and 16 byte alignment for 64 bit objects. This is added to CFLAGS by
921 studio_ALIGN.sparc
.32 = -xmemalign
=8s
922 studio_ALIGN.sparc
.64 = -xmemalign
=16s
923 studio_ALIGN
= $(studio_ALIGN.
$(MACH
).
$(BITS
))
925 # Studio shorthand for building multi-threaded code, enables -D_REENTRANT and
926 # linking with threadin support. This is added to CFLAGS by default, override
927 # studio_MT to turn this off.
930 # See CPP_XPG6MODE comment above.
931 studio_XPG6MODE
= $(studio_C99MODE
) $(CPP_XPG6MODE
)
932 XPG6MODE
= $(studio_XPG6MODE
)
934 # See CPP_XPG5MODE comment above. You can only use this in C++, not in C99.
935 studio_XPG5MODE
= $(studio_cplusplus_C99MODE
) $(CPP_XPG5MODE
)
936 XPG5MODE
= $(studio_XPG5MODE
)
938 # Default Studio C compiler flags. Add the required feature to your Makefile
939 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
940 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it
941 # should not be necessary to add CFLAGS to any environment other than the
942 # configure environment.
943 CFLAGS.studio
+= $(studio_OPT
) $(studio_XBITS
) $(studio_XREGS
) \
944 $(studio_IROPTS
) $(studio_C99MODE
) $(studio_ALIGN
) \
948 # GNU C compiler flag sets to ease feature selection. Add the required
949 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
950 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
953 # GCC Compiler optimization flag
956 # GCC PIC code generation. Use CC_PIC instead to select PIC code generation.
957 gcc_PIC
= -fPIC
-DPIC
959 # Generic macro for PIC code generation. Use this macro instead of the
960 # compiler specific variant.
961 CC_PIC
= $($(COMPILER
)_PIC
)
964 # Default GNU C compiler flags. Add the required feature to your Makefile
965 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
966 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it
967 # should not be necessary to add CFLAGS to any environment other than the
968 # configure environment.
969 CFLAGS.gcc
+= $(gcc_OPT
)
970 CFLAGS.gcc
+= $(gcc_XREGS
)
973 # Build 32 or 64 bit objects.
976 # Add compiler specific 'default' features
977 CFLAGS
+= $(CFLAGS.
$(COMPILER
))
980 # Studio C++ requires -norunpath to avoid adding its location into the RUNPATH
981 # to C++ applications.
982 studio_NORUNPATH
= -norunpath
984 # To link in standard mode (the default mode) without any C++ libraries
985 # (except libCrun), use studio_LIBRARY_NONE in your component Makefile.
986 studio_LIBRARY_NONE
= -library
=%none
988 # Don't link C++ with any C++ Runtime or Standard C++ library
989 studio_CXXLIB_NONE
= -xnolib
991 # Link C++ with the Studio C++ Runtime and Standard C++ library. This is the
992 # default for "standard" mode.
993 studio_CXXLIB_CSTD
= -library
=Cstd
,Crun
995 # link C++ with the Studio C++ Runtime and Apache Standard C++ library
996 studio_CXXLIB_APACHE
= -library
=stdcxx4
,Crun
998 # Add the C++ ABI compatibility flags for older ABI compatibility. The default
999 # is "standard mode" (-compat=5)
1000 studio_COMPAT_VERSION_4
= -compat
=4
1002 # Tell the compiler that we don't want the studio runpath added to the
1003 # linker flags. We never want the Studio location added to the RUNPATH.
1004 CXXFLAGS
+= $($(COMPILER
)_NORUNPATH
)
1006 # Build 32 or 64 bit objects in C++ as well.
1007 CXXFLAGS
+= $(CC_BITS
)
1009 # Build 32 or 64 bit objects in FORTRAN as well.
1010 F77FLAGS
+= $(CC_BITS
)
1011 FCFLAGS
+= $(CC_BITS
)
1015 # Solaris linker flag sets to ease feature selection. Add the required
1016 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
1017 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar.
1020 # set the bittedness that we want to link
1024 LD_BITS
= $($(LINKER
).
ld.
$(BITS
))
1025 LDFLAGS
= $(LD_BITS
)
1027 # Reduce the symbol table size, effectively conflicting with -g. We should
1028 # get linker guidance here.
1029 LD_Z_REDLOCSYM
= -z redlocsym
1031 # Cause the linker to rescan archive libraries and resolve remaining unresolved
1032 # symbols recursively until all symbols are resolved. Components should be
1033 # linking in the libraries they need, in the required order. This should
1034 # only be required if the component's native build is horribly broken.
1035 LD_Z_RESCAN_NOW
= -z rescan-now
1037 LD_Z_TEXT
= -z direct
1039 # make sure that -lc is always present when building shared objects.
1042 # make sure all symbols are defined.
1045 # eliminate unreferenced dynamic dependencies
1046 LD_Z_IGNORE
= -z ignore
1048 # use direct binding
1049 LD_B_DIRECT
= -Bdirect
1051 # use generic macro names for enabling/disabling ASLR
1052 ASLR_ENABLE
= -z aslr
=enable
1053 ASLR_DISABLE
= -z aslr
=disable
1054 ASLR_MODE
= $(ASLR_DISABLE
)
1056 # by default, turn off Address Space Layout Randomization for ELF executables;
1057 # to explicitly enable ASLR, set ASLR_MODE = $(ASLR_ENABLE)
1058 # in that component's Makefile
1059 LD_Z_ASLR
= $(ASLR_MODE
)
1062 # More Solaris linker flags that we want to be sure that everyone gets. This
1063 # is automatically added to the calling environment during the 'build' and
1064 # 'install' phases of the component build. Each individual feature can be
1065 # turned off by adding FEATURE_MACRO= to the component Makefile.
1068 # Create a non-executable bss segment when linking.
1069 LD_MAP_NOEXBSS
= -M
/usr
/lib
/ld/map.noexbss
1072 LD_MAP_PAGEALIGN
= -M
/usr
/lib
/ld/map.pagealign
1074 # Linker options to add when only building libraries
1075 LD_OPTIONS_SO
+= $(LD_Z_DEFS
) $(LD_DEF_LIBS
)
1077 # Default linker options that everyone should get. Do not add additional
1078 # libraries to this macro, as it will apply to everything linked during the
1082 # only used on executables
1085 # Environment variables and arguments passed into the build and install
1086 # environment(s). These are the initial settings.
1087 COMPONENT_BUILD_ENV
= \
1088 LD_OPTIONS
="$(LD_OPTIONS)" \
1089 LD_EXEC_OPTIONS
="$(LD_EXEC_OPTIONS)"
1090 COMPONENT_INSTALL_ENV
= \
1091 LD_OPTIONS
="$(LD_OPTIONS)" \
1092 LD_EXEC_OPTIONS
="$(LD_EXEC_OPTIONS)"
1094 # PERL options which depend on C options should be placed here
1095 # Don't trust Perl $Config{optimize}, we can get Studio flags
1096 PERL_OPTIMIZE
=$(gcc_OPT
)
1098 # We need this to overwrite options of perl used to compile illumos-gate
1099 PERL_STUDIO_OVERWRITE
= cc="$(CC)" cccdlflags
="$(CC_PIC)" ld="$(CC)" ccname
="$(shell basename $(CC))" optimize
="$(gcc_OPT)"
1101 # Allow user to override default maximum number of archives
1102 NUM_EXTRA_ARCHIVES
= 1 2 3 4 5 6 7 8 9 10
1104 # Rewrite absolute source-code paths into relative for ccache, so that any
1105 # workspace with a shared CCACHE_DIR can benefit when compiling a component
1106 ifneq ($(strip $(CCACHE
)),)
1107 export CCACHE_BASEDIR
= $(BUILD_DIR_
$(BITS
))
1108 COMPONENT_BUILD_ENV
+= CCACHE
="$(CCACHE)"
1109 COMPONENT_INSTALL_ENV
+= CCACHE
="$(CCACHE)"
1110 COMPONENT_TEST_ENV
+= CCACHE
="$(CCACHE)"
1111 COMPONENT_BUILD_ENV
+= CC_gcc_32
="$(CC_gcc_32)"
1112 COMPONENT_BUILD_ENV
+= CC_gcc_64
="$(CC_gcc_32)"
1113 COMPONENT_BUILD_ENV
+= CXX_gcc_32
="$(CXX_gcc_64)"
1114 COMPONENT_BUILD_ENV
+= CXX_gcc_64
="$(CXX_gcc_64)"
1115 COMPONENT_INSTALL_ENV
+= CC_gcc_32
="$(CC_gcc_32)"
1116 COMPONENT_INSTALL_ENV
+= CC_gcc_64
="$(CC_gcc_32)"
1117 COMPONENT_INSTALL_ENV
+= CXX_gcc_32
="$(CXX_gcc_64)"
1118 COMPONENT_INSTALL_ENV
+= CXX_gcc_64
="$(CXX_gcc_64)"
1119 COMPONENT_TEST_ENV
+= CC_gcc_32
="$(CC_gcc_32)"
1120 COMPONENT_TEST_ENV
+= CC_gcc_64
="$(CC_gcc_32)"
1121 COMPONENT_TEST_ENV
+= CXX_gcc_32
="$(CXX_gcc_64)"
1122 COMPONENT_TEST_ENV
+= CXX_gcc_64
="$(CXX_gcc_64)"
1123 COMPONENT_BUILD_ENV.
$(BITS
) += CCACHE_BASEDIR
="$(BUILD_DIR_$(BITS))"
1124 COMPONENT_INSTALL_ENV.
$(BITS
) += CCACHE_BASEDIR
="$(BUILD_DIR_$(BITS))"
1125 COMPONENT_TEST_ENV.
$(BITS
) += CCACHE_BASEDIR
="$(BUILD_DIR_$(BITS))"
1127 ifneq ($(strip $(CCACHE_DIR
)),)
1128 COMPONENT_BUILD_ENV
+= CCACHE_DIR
="$(CCACHE_DIR)"
1129 COMPONENT_INSTALL_ENV
+= CCACHE_DIR
="$(CCACHE_DIR)"
1130 COMPONENT_TEST_ENV
+= CCACHE_DIR
="$(CCACHE_DIR)"
1133 ifneq ($(strip $(CCACHE_LOGFILE
)),)
1134 COMPONENT_BUILD_ENV
+= CCACHE_LOGFILE
="$(CCACHE_LOGFILE)"
1135 COMPONENT_INSTALL_ENV
+= CCACHE_LOGFILE
="$(CCACHE_LOGFILE)"
1136 COMPONENT_TEST_ENV
+= CCACHE_LOGFILE
="$(CCACHE_LOGFILE)"
1141 # Add any bit-specific settings
1142 COMPONENT_BUILD_ENV
+= $(COMPONENT_BUILD_ENV.
$(BITS
))
1143 COMPONENT_BUILD_ARGS
+= $(COMPONENT_BUILD_ARGS.
$(BITS
))
1144 COMPONENT_INSTALL_ENV
+= $(COMPONENT_INSTALL_ENV.
$(BITS
))
1145 COMPONENT_INSTALL_ARGS
+= $(COMPONENT_INSTALL_ARGS.
$(BITS
))
1147 # declare these phony so that we avoid filesystem conflicts.
1148 .PHONY
: prep build
install publish
test clean clobber parfait
1150 # If there are no tests to execute
1151 NO_TESTS
= test-nothing
1153 @echo
"There are no tests available at this time."
1155 # default behaviour for 'component-hook' target is to echo the component
1156 # name and version information, but more complex behaviour can be implemented
1157 # via command line setting of the COMPONENT_HOOK macro.
1158 COMPONENT_HOOK ?
= echo
$(COMPONENT_NAME
) $(COMPONENT_VERSION
)
1164 # Packages with tools that are required to build Userland components
1166 REQUIRED_PACKAGES
+= metapackages
/build-essential
1168 # Only a default dependency if component being built produces binaries.
1169 ifneq ($(strip $(BUILD_BITS
)),NO_ARCH
)
1170 REQUIRED_PACKAGES
+= system
/library
1173 include $(WS_MAKE_RULES
)/environment.mk
1175 # A simple rule to print the value of any macro. Ex:
1176 # $ gmake print-REQUIRED_PACKAGES
1177 # Note that some macros are set on a per target basis, so what you see
1178 # is not always what you get.
1180 @echo
'$(subst ','\'',$*=$($*)) (origin: $(origin $*), flavor
: $(flavor
$*))'