Srinivasa Sarva
2012-09-26 2cda1cfc0e292cf0e5000d818a4c905d79969ee3
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 #
fa74c0 21 # Copyright (c) 2010, 2012, 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.
31 INTERNAL_ARCHIVE_MIRROR =    http://userland.us.oracle.com/source-archives
32
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
37
38 # Default to looking for source archives on the internal mirror and the external
39 # mirror before we hammer on the community source archive repositories.
40 export DOWNLOAD_SEARCH_PATH +=    $(INTERNAL_ARCHIVE_MIRROR)
41 export DOWNLOAD_SEARCH_PATH +=    $(EXTERNAL_ARCHIVE_MIRROR)
9aea33 42
NJ 43 # The workspace starts at the mercurial root
44 export WS_TOP ?=        $(shell hg root)
45
4cfb92 46 WS_LOGS =    $(WS_TOP)/$(MACH)/logs
NJ 47 WS_REPO =    $(WS_TOP)/$(MACH)/repo
48 WS_TOOLS =    $(WS_TOP)/tools
49 WS_MAKE_RULES =    $(WS_TOP)/make-rules
50 WS_COMPONENTS =    $(WS_TOP)/components
51 WS_INCORPORATIONS =    $(WS_TOP)/incorporations
52 WS_LINT_CACHE =    $(WS_TOP)/$(MACH)/pkglint-cache
53
5c422f 54 # we want our pkg piplines to fail if there is an error
MS 55 # (like if pkgdepend fails in the middle of a pipe), but
56 # we don't want the builds or ./configure's failing as well.
57 # so we only set pipefail for the publish target and have
58 # to reset it for the others since they might be invoked
59 # as dependencies of publish.
60 export SHELLOPTS
61 build:        SHELLOPTS=
62 test:        SHELLOPTS=
63 install:    SHELLOPTS=
64 publish:    SHELLOPTS=pipefail
65
b602c5 66 SHELL=    /bin/bash
MS 67
9c75c0 68 CONSOLIDATION =    userland
d05a6f 69 PUBLISHER ?=    $(CONSOLIDATION)
c4768d 70 PUBLISHER_LOCALIZABLE ?=    $(CONSOLIDATION)-localizable
6514ee 71
3dc823 72 ROOT =            /
NJ 73
097eb5 74 # Native OS version
6514ee 75 OS_VERSION =        $(shell uname -r)
NJ 76 SOLARIS_VERSION =    $(OS_VERSION:5.%=2.%)
097eb5 77 # Target OS version
MS 78 PKG_SOLARIS_VERSION ?= 5.12
9c75c0 79
4cfb92 80 include $(WS_MAKE_RULES)/ips-buildinfo.mk
3dc823 81
9c75c0 82 COMPILER =        studio
80b1b4 83 BITS =            32
9c75c0 84 PYTHON_VERSION =    2.6
fa74c0 85 PYTHON_VERSIONS =    2.7 2.6
9c75c0 86
79b849 87 BASS_O_MATIC =    $(WS_TOOLS)/bass-o-matic
NJ 88
81cc19 89 CLONEY =    $(WS_TOOLS)/cloney
MS 90
b73714 91 CONFIG_SHELL =    /bin/bash
CM 92
79b849 93 PKG_REPO =    file:$(WS_REPO)
74300c 94
c843eb 95 COMPONENT_DIR =    $(shell pwd)
PS 96 SOURCE_DIR =    $(COMPONENT_DIR)/$(COMPONENT_SRC)
97 BUILD_DIR =    $(COMPONENT_DIR)/build
74300c 98 PROTO_DIR =    $(BUILD_DIR)/prototype/$(MACH)
9c75c0 99
38e5af 100 ETCDIR =    /etc
4f8cfa 101 USRDIR =    /usr
MS 102 BINDIR =    /bin
f685ac 103 SBINDIR =    /sbin
4f8cfa 104 LIBDIR =    /lib
MS 105 USRBINDIR =    $(USRDIR)/bin
2cda1c 106 USRBINDIR64 =    $(USRDIR)/bin/$(MACH64)
8a614a 107 USRSBINDIR =    $(USRDIR)/sbin
4f8cfa 108 USRLIBDIR =    $(USRDIR)/lib
MS 109 USRSHAREDIR =    $(USRDIR)/share
f685ac 110 USRINCDIR =    $(USRDIR)/include
JS 111 USRSHARELOCALEDIR =    $(USRSHAREDIR)/locale
4f8cfa 112 USRSHAREMANDIR =    $(USRSHAREDIR)/man
8a614a 113 USRSHAREDOCDIR =    $(USRSHAREDIR)/doc
93837d 114 USRSHARELIBDIR =    $(USRSHAREDIR)/lib
4f8cfa 115 USRSHAREMAN1DIR =    $(USRSHAREMANDIR)/man1
8a614a 116 USRSHAREMAN1MDIR =    $(USRSHAREMANDIR)/man1m
4f8cfa 117 USRSHAREMAN3DIR =    $(USRSHAREMANDIR)/man3
f1282e 118 USRSHAREMAN4DIR =    $(USRSHAREMANDIR)/man4
5bb235 119 USRSHAREMAN5DIR =    $(USRSHAREMANDIR)/man5
4f8cfa 120 USRLIBDIR64 =    $(USRDIR)/lib/$(MACH64)
f685ac 121 PROTOBINDIR =    $(PROTO_DIR)/$(BINDIR)
38e5af 122 PROTOETCDIR =    $(PROTO_DIR)/$(ETCDIR)
8a614a 123 PROTOETCSECDIR = $(PROTO_DIR)/$(ETCDIR)/security
4f8cfa 124 PROTOUSRDIR =    $(PROTO_DIR)/$(USRDIR)
8a614a 125 PROTOLIBDIR =    $(PROTO_DIR)/$(LIBDIR)
4f8cfa 126 PROTOUSRBINDIR =    $(PROTO_DIR)/$(USRBINDIR)
2cda1c 127 PROTOUSRBINDIR64 =    $(PROTO_DIR)/$(USRBINDIR64)
8a614a 128 PROTOUSRSBINDIR =    $(PROTO_DIR)/$(USRSBINDIR)
4f8cfa 129 PROTOUSRLIBDIR =    $(PROTO_DIR)/$(USRLIBDIR)
MS 130 PROTOUSRLIBDIR64 =    $(PROTO_DIR)/$(USRLIBDIR64)
f685ac 131 PROTOUSRINCDIR =    $(PROTO_DIR)/$(USRINCDIR)
4f8cfa 132 PROTOUSRSHAREDIR =    $(PROTO_DIR)/$(USRSHAREDIR)
93837d 133 PROTOUSRSHARELIBDIR =    $(PROTO_DIR)/$(USRSHARELIBDIR)
4f8cfa 134 PROTOUSRSHAREMANDIR =    $(PROTO_DIR)/$(USRSHAREMANDIR)
8a614a 135 PROTOUSRSHAREDOCDIR =    $(PROTO_DIR)/$(USRSHAREDOCDIR)
4f8cfa 136 PROTOUSRSHAREMAN1DIR =    $(PROTO_DIR)/$(USRSHAREMAN1DIR)
8a614a 137 PROTOUSRSHAREMAN1MDIR =    $(PROTO_DIR)/$(USRSHAREMAN1MDIR)
4f8cfa 138 PROTOUSRSHAREMAN3DIR =    $(PROTO_DIR)/$(USRSHAREMAN3DIR)
f1282e 139 PROTOUSRSHAREMAN4DIR =    $(PROTO_DIR)/$(USRSHAREMAN4DIR)
CM 140 PROTOUSRSHAREMAN5DIR =    $(PROTO_DIR)/$(USRSHAREMAN5DIR)
f685ac 141 PROTOUSRSHARELOCALEDIR =    $(PROTO_DIR)/$(USRSHARELOCALEDIR)
4f8cfa 142
MS 143
3d7f8d 144 SFWBIN =    /usr/sfw/bin
f685ac 145 SFWINCLUDE =    /usr/sfw/include
3d7f8d 146 SFWLIB =    /usr/sfw/lib
d92147 147 SFWLIB64 =    /usr/sfw/lib/$(MACH64)
1932c6 148 SFWSHARE =    /usr/sfw/share
MS 149 SFWSHAREMAN =    /usr/sfw/share/man
150 SFWSHAREMAN1 =    /usr/sfw/share/man/man1
3d7f8d 151 PROTOSFWBIN =    $(PROTO_DIR)/$(SFWBIN)
NJ 152 PROTOSFWLIB =    $(PROTO_DIR)/$(SFWLIB)
d92147 153 PROTOSFWLIB64 =    $(PROTO_DIR)/$(SFWLIB64)
1932c6 154 PROTOSFWSHARE =    $(PROTO_DIR)/$(SFWSHARE)
MS 155 PROTOSFWSHAREMAN =    $(PROTO_DIR)/$(SFWSHAREMAN)
156 PROTOSFWSHAREMAN1 =    $(PROTO_DIR)/$(SFWSHAREMAN1)
f685ac 157 PROTOSFWINCLUDE =    $(PROTO_DIR)/$(SFWINCLUDE)
1932c6 158
MS 159 GNUBIN =    /usr/gnu/bin
d1c159 160 GNULIB =    /usr/gnu/lib
RB 161 GNULIB64 =    /usr/gnu/lib/$(MACH64)
1932c6 162 GNUSHARE =    /usr/gnu/share
MS 163 GNUSHAREMAN =    /usr/gnu/share/man
164 GNUSHAREMAN1 =    /usr/gnu/share/man/man1
165 PROTOGNUBIN =    $(PROTO_DIR)/$(GNUBIN)
166 PROTOGNUSHARE =    $(PROTO_DIR)/$(GNUSHARE)
167 PROTOGNUSHAREMAN =    $(PROTO_DIR)/$(GNUSHAREMAN)
168 PROTOGNUSHAREMAN1 =    $(PROTO_DIR)/$(GNUSHAREMAN1)
3d7f8d 169
61c373 170 # work around _TIME, _DATE, embedded date chatter in component builds
NJ 171 # to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME)
172 # to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV
79b849 173 CONSTANT_TIME =        LD_PRELOAD_32=$(WS_TOOLS)/time-$(MACH32).so
NJ 174 CONSTANT_TIME +=    LD_PRELOAD_64=$(WS_TOOLS)/time-$(MACH64).so
61c373 175 CONSTANT_TIME +=    TIME_CONSTANT=$(TIME_CONSTANT)
80b1b4 176
5d461f 177 # set MACH from uname -p to either sparc or i386
NJ 178 MACH =        $(shell uname -p)
179
180 # set MACH32 from MACH to either sparcv7 or i86
181 MACH32_1 =    $(MACH:sparc=sparcv7)
182 MACH32 =    $(MACH32_1:i386=i86)
183
184 # set MACH64 from MACH to either sparcv9 or amd64
185 MACH64_1 =    $(MACH:sparc=sparcv9)
186 MACH64 =    $(MACH64_1:i386=amd64)
187
c2319a 188 CONFIGURE_32 =        $(BUILD_DIR_32)/.configured
BC 189 CONFIGURE_64 =        $(BUILD_DIR_64)/.configured
190
4f8cfa 191 BUILD_DIR_32 =        $(BUILD_DIR)/$(MACH32)
MS 192 BUILD_DIR_64 =        $(BUILD_DIR)/$(MACH64)
193
194 BUILD_32 =        $(BUILD_DIR_32)/.built
195 BUILD_64 =        $(BUILD_DIR_64)/.built
5d461f 196 BUILD_32_and_64 =    $(BUILD_32) $(BUILD_64)
4158c0 197 $(BUILD_DIR_32)/.built:        BITS=32
NJ 198 $(BUILD_DIR_64)/.built:        BITS=64
5d461f 199
4f8cfa 200 INSTALL_32 =        $(BUILD_DIR_32)/.installed
MS 201 INSTALL_64 =        $(BUILD_DIR_64)/.installed
5d461f 202 INSTALL_32_and_64 =    $(INSTALL_32) $(INSTALL_64)
a7cc57 203 $(BUILD_DIR_32)/.installed:       BITS=32
AC 204 $(BUILD_DIR_64)/.installed:       BITS=64
4158c0 205
NJ 206 # set the default target for installation of the component
207 COMPONENT_INSTALL_TARGETS =    install
9c75c0 208
35a012 209 TEST_32 =        $(BUILD_DIR_32)/.tested
NJ 210 TEST_64 =        $(BUILD_DIR_64)/.tested
211 TEST_32_and_64 =    $(TEST_32) $(TEST_64)
4158c0 212 $(BUILD_DIR_32)/.tested:       BITS=32
NJ 213 $(BUILD_DIR_64)/.tested:       BITS=64
214
215 # set the default target for test of the component
216 COMPONENT_TEST_TARGETS =    check
35a012 217
50cda8 218 # BUILD_TOOLS is the root of all tools not normally installed on the system.
44c8c7 219 BUILD_TOOLS ?=    /ws/on12-tools
50cda8 220
NJ 221 SPRO_ROOT =    $(BUILD_TOOLS)/SUNWspro
3d7f8d 222 SPRO_VROOT =    $(SPRO_ROOT)/sunstudio12.1
50cda8 223
0c2d4d 224 PARFAIT_ROOT =    $(BUILD_TOOLS)/parfait/parfait-tools-1.0.1/
7999b2 225 PARFAIT= $(PARFAIT_ROOT)/bin/parfait
MS 226 export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc
227 export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC
228 export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc
229 export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++
230
9aea33 231 GCC_ROOT =    /usr/sfw
9c75c0 232
35a012 233 CC.studio.32 =    $(SPRO_VROOT)/bin/cc
3cec7d 234 CXX.studio.32 =    $(SPRO_VROOT)/bin/CC
7999b2 235
9c75c0 236
35a012 237 CC.studio.64 =    $(SPRO_VROOT)/bin/cc
3cec7d 238 CXX.studio.64 =    $(SPRO_VROOT)/bin/CC
9c75c0 239
9dfd18 240 CC.gcc.32 =    $(GCC_ROOT)/bin/gcc
3cec7d 241 CXX.gcc.32 =    $(GCC_ROOT)/bin/g++
9c75c0 242
9dfd18 243 CC.gcc.64 =    $(GCC_ROOT)/bin/gcc
3cec7d 244 CXX.gcc.64 =    $(GCC_ROOT)/bin/g++
9c75c0 245
NJ 246
4f8cfa 247 lint.32 =    $(SPRO_VROOT)/bin/lint -m32
MS 248 lint.64 =    $(SPRO_VROOT)/bin/lint -m64
249
250 LINT =        $(lint.$(BITS))
251
61c373 252 LD =        /usr/bin/ld
9c75c0 253
fa74c0 254 PYTHON.2.6.VENDOR_PACKAGES.32 = /usr/lib/python2.6/vendor-packages
NJ 255 PYTHON.2.6.VENDOR_PACKAGES.64 = /usr/lib/python2.6/vendor-packages/64
256 PYTHON.2.6.VENDOR_PACKAGES = $(PYTHON.2.6.VENDOR_PACKAGES.$(BITS))
257
258 PYTHON.2.7.VENDOR_PACKAGES.32 = /usr/lib/python2.7/vendor-packages
259 PYTHON.2.7.VENDOR_PACKAGES.64 = /usr/lib/python2.7/vendor-packages/64
260 PYTHON.2.7.VENDOR_PACKAGES = $(PYTHON.2.7.VENDOR_PACKAGES.$(BITS))
7999b2 261
MS 262 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
263 CC.studio.32 =    $(WS_TOOLS)/parfait/cc
264 CXX.studio.32 =    $(WS_TOOLS)/parfait/CC
265 CC.studio.64 =    $(WS_TOOLS)/parfait/cc
266 CXX.studio.64 =    $(WS_TOOLS)/parfait/CC
267 CC.gcc.32 =    $(WS_TOOLS)/parfait/gcc
268 CXX.gcc.32 =    $(WS_TOOLS)/parfait/g++
269 CC.gcc.64 =    $(WS_TOOLS)/parfait/gcc
270 CXX.gcc.64 =    $(WS_TOOLS)/parfait/g++
271 LD =        $(WS_TOOLS)/parfait/ld
272 endif
273
274 CC =        $(CC.$(COMPILER).$(BITS))
275 CXX =        $(CXX.$(COMPILER).$(BITS))
276
fa74c0 277
a0613d 278 PYTHON_VENDOR_PACKAGES.32 = /usr/lib/python$(PYTHON_VERSION)/vendor-packages
NJ 279 PYTHON_VENDOR_PACKAGES.64 = /usr/lib/python$(PYTHON_VERSION)/vendor-packages/64
280 PYTHON_VENDOR_PACKAGES = $(PYTHON_VENDOR_PACKAGES.$(BITS))
281
9c75c0 282 PYTHON.2.6.32 =    /usr/bin/python2.6
ca4d33 283 PYTHON.2.6.64 =    /usr/bin/$(MACH64)/python2.6
fa74c0 284
NJ 285 PYTHON.2.7.32 =    /usr/bin/python2.7
286 PYTHON.2.7.64 =    /usr/bin/$(MACH64)/python2.7
9c75c0 287
4e6f9b 288 PYTHON.32 =    $(PYTHON.$(PYTHON_VERSION).32)
RB 289 PYTHON.64 =    $(PYTHON.$(PYTHON_VERSION).64)
a0613d 290 PYTHON =    $(PYTHON.$(PYTHON_VERSION).$(BITS))
9c75c0 291
5bdc52 292 # The default is site-packages, but that directory belongs to the end-user.
SS 293 # Modules which are shipped by the OS but not with the core Python distribution
294 # belong in vendor-packages.
295 PYTHON_LIB= /usr/lib/python$(PYTHON_VERSION)/vendor-packages
fa74c0 296 PYTHON_DATA= $(PYTHON_LIB)
5bdc52 297
61a323 298 JAVA_HOME =    /usr/jdk/instances/jdk1.6.0
PS 299
6bc9bf 300 # This is the default BUILD version of perl
CM 301 # Not necessarily the system's default version, i.e. /usr/bin/perl
720c9a 302 PERL_VERSION =  5.12
9aea33 303
6bc9bf 304 PERL_VERSIONS = 5.8.4 5.12
CM 305
306 PERL.5.8.4 =    /usr/perl5/5.8.4/bin/perl
307 PERL.5.12 =     /usr/perl5/5.12/bin/perl
308
309 PERL =          $(PERL.$(PERL_VERSION))
310
311 PERL_ARCH =     $(shell $(PERL) -e 'use Config; print $$Config{archname}')
312 # Optimally we should ask perl which C compiler was used but it doesn't
313 # result in a full path name.  Only "c" is being recorded
314 # inside perl builds while we actually need a full path to
315 # the studio compiler.
316 #PERL_CC =      $(shell $(PERL) -e 'use Config; print $$Config{cc}')
317 PERL_OPTIMIZE = $(shell $(PERL) -e 'use Config; print $$Config{optimize}')
318
319 PKG_MACROS +=   PERL_ARCH=$(PERL_ARCH)
320 PKG_MACROS +=   PERL_VERSION=$(PERL_VERSION)
321
322 CCSMAKE =    /usr/ccs/bin/make
9c75c0 323 GMAKE =        /usr/gnu/bin/make
NJ 324 GPATCH =    /usr/gnu/bin/patch
ff1c63 325 PATCH_LEVEL =    1
35a012 326 GPATCH_BACKUP =    --backup --version-control=numbered
NJ 327 GPATCH_FLAGS =    -p$(PATCH_LEVEL) $(GPATCH_BACKUP)
960e5b 328 GSED =        /usr/gnu/bin/sed
9c75c0 329
dd0336 330 PKGREPO =    /usr/bin/pkgrepo
9c75c0 331 PKGSEND =    /usr/bin/pkgsend
d08673 332 PKGLINT =    /usr/bin/pkglint
9c75c0 333
b06748 334 ACLOCAL =    /usr/bin/aclocal-1.10
VM 335 AUTOMAKE =    /usr/bin/automake-1.10
336 AUTORECONF =     /usr/bin/autoreconf
337
9b6169 338 KSH93 =         /usr/bin/ksh93
9c75c0 339 TOUCH =        /usr/bin/touch
NJ 340 MKDIR =        /bin/mkdir -p
341 RM =        /bin/rm -f
153732 342 CP =        /bin/cp -f
2515dc 343 MV =        /bin/mv -f
3d7f8d 344 LN =        /bin/ln
NJ 345 SYMLINK =    /bin/ln -s
61c373 346 ENV =        /usr/bin/env
3d7f8d 347 INSTALL =    /usr/bin/ginstall
81db49 348 CHMOD =        /usr/bin/chmod
e5e44e 349 NAWK =        /usr/bin/nawk
SM 350 TEE =        /usr/bin/tee
4f8cfa 351
MS 352 INS.dir=        $(INSTALL) -d $@
353 INS.file=       $(INSTALL) -m 444 $< $(@D)
3cec7d 354
NJ 355 PKG_CONFIG_PATH.32 = /usr/lib/pkgconfig
356 PKG_CONFIG_PATH.64 = /usr/lib/$(MACH64)/pkgconfig
4e6f9b 357 PKG_CONFIG_PATH = $(PKG_CONFIG_PATH.$(BITS))
3cec7d 358
4f8cfa 359
MS 360 #
35a012 361 # C preprocessor flag sets to ease feature selection.  Add the required
NJ 362 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
363 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
364 # similiar.
365 #
4f8cfa 366
35a012 367 # Enables visibility of some c99 math functions that aren't visible by default.
NJ 368 # What other side-effects are there?
369 CPP_C99_EXTENDED_MATH =    -D_STDC_99
e4bbaf 370
35a012 371 # Enables large file support for components that have no other means of doing
NJ 372 # so.  Use CPP_LARGEFILES and not the .32/.64 variety directly
373 CPP_LARGEFILES.32 =    $(shell getconf LFS_CFLAGS)
374 CPP_LARGEFILES.64 =    $(shell getconf LFS64_CFLAGS)
375 CPP_LARGEFILES =        $(CPP_LARGEFILES.$(BITS))
4f8cfa 376
35a012 377 # Enables some #pragma redefine_extname to POSIX-compliant Standard C Library
NJ 378 # functions. Also avoids the component's #define _POSIX_C_SOURCE to some value
379 # we currently do not support.
380 CPP_POSIX =    -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS
4f8cfa 381
MS 382 # XPG6 mode.  This option enables XPG6 conformance, plus extensions.
383 # Amongst other things, this option will cause system calls like
384 # popen (3C) and system (3C) to invoke the standards-conforming
35a012 385 # shell, /usr/xpg4/bin/sh, instead of /usr/bin/sh.  Add studio_XPG6MODE to
NJ 386 # CFLAGS instead of using this directly
387 CPP_XPG6MODE=    -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6
4f8cfa 388
0aeacd 389 # XPG5 mode. These options are specific for C++, where _XPG6,
ST 390 # _XOPEN_SOURCE=600 and C99 are illegal. -D__EXTENSIONS__=1 is legal in C++.
391 CPP_XPG5MODE=   -D_XOPEN_SOURCE=500 -D__EXTENSIONS__=1 -D_XPG5
35a012 392
NJ 393 #
394 # Studio C compiler flag sets to ease feature selection.  Add the required
395 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
396 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
397 #
398
399 # Generate 32/64 bit objects
400 CC_BITS =    -m$(BITS)
401
402 # Code generation instruction set and optimization 'hints'.  Use studio_XBITS
403 # and not the .arch.bits variety directly.
404 studio_XBITS.sparc.32 =    -xtarget=ultra2 -xarch=sparcvis -xchip=ultra2
65f457 405 studio_XBITS.sparc.64 =    
MS 406 ifneq   ($(strip $(PARFAIT_BUILD)),yes)
407 studio_XBITS.sparc.64 += -xtarget=ultra2
408 endif
409 studio_XBITS.sparc.64 += -xarch=sparcvis -xchip=ultra2
780aa6 410 studio_XBITS.i386.32 =    -xchip=pentium
63f346 411 studio_XBITS.i386.64 =    -xchip=generic -Ui386 -U__i386
780aa6 412 studio_XBITS = $(studio_XBITS.$(MACH).$(BITS))
35a012 413
NJ 414 # Turn on recognition of supported C99 language features and enable the 1999 C
415 # standard library semantics of routines that appear in    both the 1990 and
416 # 1999 C standard. To use set studio_C99MODE=$(studio_99_ENABLE) in your
417 # component Makefile.
418 studio_C99_ENABLE =        -xc99=all
419
420 # Turn off recognition of C99 language features, and do not enable the 1999 C
421 # standard library semantics of routines that appeared in both the 1990    and
422 # 1999 C standard.  To use set studio_C99MODE=$(studio_99_DISABLE) in your
423 # component Makefile.
424 studio_C99_DISABLE =    -xc99=none
425
426 # Use the compiler default 'xc99=all,no_lib'
427 studio_C99MODE =
0aeacd 428
ST 429 # For C++, compatibility with C99 (which is technically illegal) is
430 # enabled in a different way. So, we must use a different macro for it.
431 studio_cplusplus_C99_ENABLE =     -xlang=c99
432
433 # Turn it off.
434 studio_cplusplus_C99_DISABLE =
435
436 # And this is the macro you should actually use
437 studio_cplusplus_C99MODE = 
35a012 438
NJ 439 # Allow zero-sized struct/union declarations and void functions with return
440 # statements.
441 studio_FEATURES_EXTENSIONS =    -features=extensions
9b6169 442
35a012 443 # Control the Studio optimization level.
780aa6 444 studio_OPT.sparc.32 =    -xO4
NJ 445 studio_OPT.sparc.64 =    -xO4
446 studio_OPT.i386.32 =    -xO4
447 studio_OPT.i386.64 =    -xO4
448 studio_OPT =        $(studio_OPT.$(MACH).$(BITS))
35a012 449
NJ 450 # Studio PIC code generation.  Use CC_PIC instead to select PIC code generation.
451 studio_PIC =     -KPIC -DPIC
4f8cfa 452
MS 453 # The Sun Studio 11 compiler has changed the behaviour of integer
454 # wrap arounds and so a flag is needed to use the legacy behaviour
455 # (without this flag panics/hangs could be exposed within the source).
35a012 456 # This is used through studio_IROPTS, not the 'sparc' variety.
NJ 457 studio_IROPTS.sparc =    -W2,-xwrap_int
780aa6 458 studio_IROPTS =        $(studio_IROPTS.$(MACH))
35a012 459
NJ 460 # Control register usage for generated code.  SPARC ABI requires system
461 # libraries not to use application registers.  x86 requires 'no%frameptr' at
462 # x04 or higher.
15d3df 463
MS 464 # We should just use -xregs but we need to workaround 7030022. Note
465 # that we can't use the (documented) -Wc,-xregs workaround because
466 # libtool really hates -Wc and thinks it should be -Wl. Instead
467 # we use an (undocumented) option which actually happens to be what
468 # CC would use.
469 studio_XREGS.sparc =    -Qoption cg -xregs=no%appl
35a012 470 studio_XREGS.i386 =    -xregs=no%frameptr
780aa6 471 studio_XREGS =        $(studio_XREGS.$(MACH))
15d3df 472
MS 473 gcc_XREGS.sparc =    -mno-app-regs
474 gcc_XREGS.i386 =
475 gcc_XREGS =        $(gcc_XREGS.$(MACH))
35a012 476
24dc68 477 # Set data alignment on sparc to reasonable values, 8 byte alignment for 32 bit
NJ 478 # objects and 16 byte alignment for 64 bit objects.  This is added to CFLAGS by
479 # default.
480 studio_ALIGN.sparc.32 =    -xmemalign=8s
481 studio_ALIGN.sparc.64 =    -xmemalign=16s
482 studio_ALIGN =        $(studio_ALIGN.$(MACH).$(BITS))
483
484 # Studio shorthand for building multi-threaded code,  enables -D_REENTRANT and
485 # linking with threadin support.  This is added to CFLAGS by default, override
486 # studio_MT to turn this off.
487 studio_MT =        -mt
488
35a012 489 # See CPP_XPG6MODE comment above.
NJ 490 studio_XPG6MODE =    $(studio_C99MODE) $(CPP_XPG6MODE)
491 XPG6MODE =        $(studio_XPG6MODE)
492
0aeacd 493 # See CPP_XPG5MODE comment above. You can only use this in C++, not in C99.
ST 494 studio_XPG5MODE =    $(studio_cplusplus_C99MODE) $(CPP_XPG5MODE)
495 XPG5MODE =        $(studio_XPG5MODE)
496
35a012 497 # Default Studio C compiler flags.  Add the required feature to your Makefile
NJ 498 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
499 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.  In most cases, it
500 # should not be necessary to add CFLAGS to any environment other than the
501 # configure environment.
502 CFLAGS.studio +=    $(studio_OPT) $(studio_XBITS) $(studio_XREGS) \
24dc68 503             $(studio_IROPTS) $(studio_C99MODE) $(studio_ALIGN) \
NJ 504             $(studio_MT)
35a012 505
4f8cfa 506 #
35a012 507 # GNU C compiler flag sets to ease feature selection.  Add the required
NJ 508 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
509 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
510 #
4f8cfa 511
35a012 512 # GCC Compiler optimization flag
NJ 513 gcc_OPT =    -O3
4f8cfa 514
35a012 515 # GCC PIC code generation.  Use CC_PIC instead to select PIC code generation.
NJ 516 gcc_PIC =    -fPIC -DPIC
4f8cfa 517
35a012 518 # Generic macro for PIC code generation.  Use this macro instead of the
NJ 519 # compiler specific variant.
520 CC_PIC =    $($(COMPILER)_PIC)
4f8cfa 521
MS 522
35a012 523 # Default GNU C compiler flags.  Add the required feature to your Makefile
NJ 524 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
525 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.  In most cases, it
526 # should not be necessary to add CFLAGS to any environment other than the
527 # configure environment.
528 CFLAGS.gcc +=    $(gcc_OPT)
15d3df 529 CFLAGS.gcc +=    $(gcc_XREGS)
4f8cfa 530
35a012 531
NJ 532 # Build 32 or 64 bit objects.
533 CFLAGS +=    $(CC_BITS)
534
535 # Add compiler specific 'default' features
536 CFLAGS +=    $(CFLAGS.$(COMPILER))
537
538
3cec7d 539 # Studio C++ requires -norunpath to avoid adding its location into the RUNPATH
NJ 540 # to C++ applications.
541 studio_NORUNPATH =     -norunpath
542
543 # To link in standard mode (the default mode) without any C++ libraries
544 # (except libCrun), use studio_LIBRARY_NONE in your component Makefile.
545 studio_LIBRARY_NONE =     -library=%none
546
547 # Don't link C++ with any C++ Runtime or Standard C++ library
548 studio_CXXLIB_NONE =    -xnolib
549
550 # Link C++ with the Studio C++ Runtime and Standard C++ library.  This is the
551 # default for "standard" mode.
552 studio_CXXLIB_CSTD =    -library=Cstd,Crun
553
554 # link C++ with the Studio  C++ Runtime and Apache Standard C++ library
555 studio_CXXLIB_APACHE =    -library=stdcxx4,Crun
556
557 # Add the C++ ABI compatibility flags for older ABI compatibility.  The default
558 # is "standard mode" (-compat=5)
559 studio_COMPAT_VERSION_4 =    -compat=4
560
561 # Tell the compiler that we don't want the studio runpath added to the
562 # linker flags.  We never want the Studio location added to the RUNPATH.
563 CXXFLAGS +=    $($(COMPILER)_NORUNPATH)
564
614c6a 565 # Build 32 or 64 bit objects in C++ as well.
ST 566 CXXFLAGS +=    $(CC_BITS)
567
35a012 568 #
NJ 569 # Solaris linker flag sets to ease feature selection.  Add the required
570 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
571 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar.
572 #
3cec7d 573
NJ 574 # set the bittedness that we want to link
575 LD_BITS =    -$(BITS)
35a012 576
NJ 577 # Reduce the symbol table size, effectively conflicting with -g.  We should
578 # get linker guidance here.
579 LD_Z_REDLOCSYM =    -z redlocsym
580
581 # Cause the linker to rescan archive libraries and resolve remaining unresolved
582 # symbols recursively until all symbols are resolved.  Components should be
583 # linking in the libraries they need, in the required order.  This should
584 # only be required if the component's native build is horribly broken.
585 LD_Z_RESCAN_NOW =    -z rescan-now
586
587 LD_Z_TEXT =        -z direct
588
3a5b3f 589 # make sure that -lc is always present when building shared objects.
RB 590 LD_DEF_LIBS +=        -lc
591
35a012 592 # make sure all symbols are defined.
NJ 593 LD_Z_DEFS =        -z defs
594
17fc9e 595 # eliminate unreferenced dynamic dependencies
NJ 596 LD_Z_IGNORE =        -z ignore
597
35a012 598 # use direct binding
NJ 599 LD_B_DIRECT =        -Bdirect
600
601 #
602 # More Solaris linker flags that we want to be sure that everyone gets.  This
603 # is automatically added to the calling environment during the 'build' and
604 # 'install' phases of the component build.  Each individual feature can be
605 # turned off by adding FEATURE_MACRO= to the component Makefile.
606 #
607
608 # Create a non-executable stack when linking.
ad8773 609 LD_MAP_NOEXSTK.i386 =    -M /usr/lib/ld/map.noexstk
AB 610 LD_MAP_NOEXSTK.sparc =    -M /usr/lib/ld/map.noexstk
35a012 611
NJ 612 # Create a non-executable bss segment when linking.
613 LD_MAP_NOEXBSS =    -M /usr/lib/ld/map.noexbss
614
615 # Create a non-executable data segment when linking.  Due to PLT needs, the
616 # data segment must be executable on sparc, but the bss does not.
617 # see mapfile comments for more information
618 LD_MAP_NOEXDATA.i386 =    -M /usr/lib/ld/map.noexdata
619 LD_MAP_NOEXDATA.sparc =    $(LD_MAP_NOEXBSS)
620
621 # Page alignment
622 LD_MAP_PAGEALIGN =    -M /usr/lib/ld/map.pagealign
623
624 # Linker options to add when only building libraries
3a5b3f 625 LD_OPTIONS_SO +=    $(LD_Z_TEXT) $(LD_Z_DEFS) $(LD_DEF_LIBS)
35a012 626
NJ 627 # Default linker options that everyone should get.  Do not add additional
628 # libraries to this macro, as it will apply to everything linked during the
629 # component build.
ad8773 630 LD_OPTIONS +=    $(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \
17fc9e 631         $(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE)
1932c6 632
e83e52 633 # Environment variables and arguments passed into the build and install
1932c6 634 # environment(s).  These are the initial settings.
MS 635 COMPONENT_BUILD_ENV= \
ff1c63 636     LD_OPTIONS="$(LD_OPTIONS)"
1932c6 637 COMPONENT_INSTALL_ENV= \
ff1c63 638     LD_OPTIONS="$(LD_OPTIONS)"
1932c6 639
MS 640 # Add any bit-specific settings
e83e52 641 COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS))
NJ 642 COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS))
643 COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS))
644 COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
4158c0 645
3cec7d 646 # declare these phony so that we avoid filesystem conflicts.
7999b2 647 .PHONY:    prep build install publish test clean clobber parfait
3cec7d 648
4158c0 649 # If there are no tests to execute
NJ 650 NO_TESTS =    test-nothing
651 test-nothing:
652     @echo "There are no tests available at this time."