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