363N/A# The contents of this file are subject to the terms of the
363N/A# Common Development and Distribution License (the "License").
363N/A# You may not use this file except in compliance with the License.
363N/A# See the License for the specific language governing permissions
363N/A# and limitations under the License.
363N/A# When distributing Covered Code, include this CDDL HEADER in each
363N/A# If applicable, add the following below this CDDL HEADER, with the
363N/A# fields enclosed by brackets "[]" replaced with your own identifying
363N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2887N/A# Copyright (c) 2010, 2011, Oracle
and/or its affiliates. All rights reserved.
2369N/A# Default to looking for source archives on the internal mirror before we
363N/A# hammer on the external repositories.
363N/A# The workspace starts at the mercurial root
363N/Aexport WS_TOP ?= $(shell hg root)
363N/APUBLISHER ?= $(CONSOLIDATION)
363N/A# get the most recent build number from the last mercurial tag
363N/ALAST_HG_TAG = $(shell hg tags -q | grep build- | head -1)
695N/ALAST_BUILD_NUM = $(LAST_HG_TAG:build-%=%)
363N/AOS_VERSION = $(shell uname -r)
363N/ASOLARIS_VERSION = $(OS_VERSION:5.%=2.%)
363N/ABUILD_NUM = 0.$(shell expr $(LAST_BUILD_NUM) + 1)
363N/ABUILD_VERSION = $(OS_VERSION)-$(BUILD_NUM)
363N/AWS_LOGS = $(WS_TOP)/$(MACH)/logs
363N/AWS_REPO = $(WS_TOP)/$(MACH)/repo
814N/AWS_TOOLS = $(WS_TOP)/tools
814N/AWS_MAKE_RULES = $(WS_TOP)/make-rules
363N/AWS_COMPONENTS = $(WS_TOP)/components
2369N/AWS_INCORPORATIONS = $(WS_TOP)/incorporations
791N/AWS_LINT_CACHE = $(WS_TOP)/$(MACH)/pkglint-cache
791N/ABASS_O_MATIC = $(WS_TOOLS)/bass-o-matic
363N/ACLONEY = $(WS_TOOLS)/cloney
3091N/A# Set a default reference repository against which pkglint is run, in case it
363N/A# hasn't been set in the environment.
363N/ACOMPONENT_DIR = $(shell pwd)
363N/ASOURCE_DIR = $(COMPONENT_DIR)/$(COMPONENT_SRC)
363N/ABUILD_DIR = $(COMPONENT_DIR)/build
363N/APROTO_DIR = $(BUILD_DIR)/prototype/$(MACH)
2369N/AUSRSHAREDIR = $(USRDIR)/share
2369N/AUSRSHAREMANDIR = $(USRSHAREDIR)/man
2369N/AUSRSHAREDOCDIR = $(USRSHAREDIR)/doc
363N/AUSRSHAREMAN1DIR = $(USRSHAREMANDIR)/man1
2369N/AUSRSHAREMAN1MDIR = $(USRSHAREMANDIR)/man1m
2369N/AUSRSHAREMAN3DIR = $(USRSHAREMANDIR)/man3
363N/AUSRSHAREMAN4DIR = $(USRSHAREMANDIR)/man4
2369N/AUSRSHAREMAN5DIR = $(USRSHAREMANDIR)/man5
363N/AUSRLIBDIR64 = $(USRDIR)/lib/$(MACH64)
363N/APROTOETCDIR = $(PROTO_DIR)/$(ETCDIR)
363N/APROTOETCSECDIR = $(PROTO_DIR)/$(ETCDIR)/security
363N/APROTOUSRDIR = $(PROTO_DIR)/$(USRDIR)
363N/APROTOLIBDIR = $(PROTO_DIR)/$(LIBDIR)
695N/APROTOUSRBINDIR = $(PROTO_DIR)/$(USRBINDIR)
695N/APROTOUSRSBINDIR = $(PROTO_DIR)/$(USRSBINDIR)
363N/APROTOUSRLIBDIR = $(PROTO_DIR)/$(USRLIBDIR)
363N/APROTOUSRLIBDIR64 = $(PROTO_DIR)/$(USRLIBDIR64)
363N/APROTOUSRSHAREDIR = $(PROTO_DIR)/$(USRSHAREDIR)
363N/APROTOUSRSHAREMANDIR = $(PROTO_DIR)/$(USRSHAREMANDIR)
363N/APROTOUSRSHAREDOCDIR = $(PROTO_DIR)/$(USRSHAREDOCDIR)
363N/APROTOUSRSHAREMAN1DIR = $(PROTO_DIR)/$(USRSHAREMAN1DIR)
363N/APROTOUSRSHAREMAN1MDIR = $(PROTO_DIR)/$(USRSHAREMAN1MDIR)
363N/APROTOUSRSHAREMAN3DIR = $(PROTO_DIR)/$(USRSHAREMAN3DIR)
363N/APROTOUSRSHAREMAN4DIR = $(PROTO_DIR)/$(USRSHAREMAN4DIR)
363N/APROTOUSRSHAREMAN5DIR = $(PROTO_DIR)/$(USRSHAREMAN5DIR)
2887N/APROTOSFWBIN = $(PROTO_DIR)/$(SFWBIN)
363N/APROTOSFWLIB = $(PROTO_DIR)/$(SFWLIB)
363N/APROTOSFWLIB64 = $(PROTO_DIR)/$(SFWLIB64)
363N/APROTOSFWSHARE = $(PROTO_DIR)/$(SFWSHARE)
363N/APROTOSFWSHAREMAN = $(PROTO_DIR)/$(SFWSHAREMAN)
363N/APROTOSFWSHAREMAN1 = $(PROTO_DIR)/$(SFWSHAREMAN1)
PROTOGNUBIN = $(PROTO_DIR)/$(GNUBIN)
PROTOGNUSHARE = $(PROTO_DIR)/$(GNUSHARE)
PROTOGNUSHAREMAN = $(PROTO_DIR)/$(GNUSHAREMAN)
PROTOGNUSHAREMAN1 = $(PROTO_DIR)/$(GNUSHAREMAN1)
# work around _TIME, _DATE, embedded date chatter in component builds
# to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME)
# to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV
CONSTANT_TIME = LD_PRELOAD_32=$(WS_TOOLS)/time-$(MACH32).so
CONSTANT_TIME += LD_PRELOAD_64=$(WS_TOOLS)/time-$(MACH64).so
CONSTANT_TIME += TIME_CONSTANT=$(TIME_CONSTANT)
# set MACH from uname -p to either sparc or i386
# set MACH32 from MACH to either sparcv7 or i86
MACH32_1 = $(MACH:sparc=sparcv7)
MACH32 = $(MACH32_1:i386=i86)
# set MACH64 from MACH to either sparcv9 or amd64
MACH64_1 = $(MACH:sparc=sparcv9)
MACH64 = $(MACH64_1:i386=amd64)
BUILD_DIR_32 = $(BUILD_DIR)/$(MACH32)
BUILD_DIR_64 = $(BUILD_DIR)/$(MACH64)
BUILD_32 = $(BUILD_DIR_32)/.built
BUILD_64 = $(BUILD_DIR_64)/.built
BUILD_32_and_64 = $(BUILD_32) $(BUILD_64)
$(BUILD_DIR_32)/.built: BITS=32
$(BUILD_DIR_64)/.built: BITS=64
INSTALL_32 = $(BUILD_DIR_32)/.installed
INSTALL_64 = $(BUILD_DIR_64)/.installed
INSTALL_32_and_64 = $(INSTALL_32) $(INSTALL_64)
$(BUILD_DIR_32)/.install: BITS=32
$(BUILD_DIR_64)/.install: BITS=64
# set the default target for installation of the component
COMPONENT_INSTALL_TARGETS = install
TEST_32 = $(BUILD_DIR_32)/.tested
TEST_64 = $(BUILD_DIR_64)/.tested
TEST_32_and_64 = $(TEST_32) $(TEST_64)
$(BUILD_DIR_32)/.tested: BITS=32
$(BUILD_DIR_64)/.tested: BITS=64
# set the default target for test of the component
COMPONENT_TEST_TARGETS = check
# BUILD_TOOLS is the root of all tools not normally installed on the system.
SPRO_ROOT = $(BUILD_TOOLS)/SUNWspro
SPRO_VROOT = $(SPRO_ROOT)/sunstudio12.1
CC = $(CC.$(COMPILER).$(BITS))
CXX = $(CXX.$(COMPILER).$(BITS))
PYTHON_VENDOR_PACKAGES.32 =
/usr/lib/python$(PYTHON_VERSION)/vendor-packages
PYTHON_VENDOR_PACKAGES.64 =
/usr/lib/python$(PYTHON_VERSION)/vendor-packages/64
PYTHON_VENDOR_PACKAGES = $(PYTHON_VENDOR_PACKAGES.$(BITS))
PYTHON.2.6.64 =
/usr/bin/$(MACH64)/python2.6
PYTHON.32 = $(PYTHON.$(PYTHON_VERSION).$(BITS))
PYTHON.64 = $(PYTHON.$(PYTHON_VERSION).$(BITS))
PYTHON = $(PYTHON.$(PYTHON_VERSION).$(BITS))
# The default is site-packages, but that directory belongs to the end-user.
# Modules which are shipped by the OS but not with the core Python distribution
# belong in vendor-packages.
GPATCH_BACKUP = --backup --version-control=numbered
GPATCH_FLAGS = -p$(PATCH_LEVEL) $(GPATCH_BACKUP)
PKG_CONFIG_PATH.64 =
/usr/lib/$(MACH64)/pkgconfig
PKG_CONFIG_PATH = PKG_CONFIG_PATH.$(BITS)
# C preprocessor flag sets to ease feature selection. Add the required
# feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
# the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
# Enables visibility of some c99 math functions that aren't visible by default.
# What other side-effects are there?
CPP_C99_EXTENDED_MATH = -D_STDC_99
# Enables large file support for components that have no other means of doing
# so. Use CPP_LARGEFILES and not the .32/.64 variety directly
CPP_LARGEFILES.32 = $(shell getconf LFS_CFLAGS)
CPP_LARGEFILES.64 = $(shell getconf LFS64_CFLAGS)
CPP_LARGEFILES = $(CPP_LARGEFILES.$(BITS))
# Enables some #pragma redefine_extname to POSIX-compliant Standard C Library
# functions. Also avoids the component's #define _POSIX_C_SOURCE to some value
# we currently do not support.
CPP_POSIX = -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS
# XPG6 mode. This option enables XPG6 conformance, plus extensions.
# Amongst other things, this option will cause system calls like
# popen (3C) and system (3C) to invoke the standards-conforming
# CFLAGS instead of using this directly
CPP_XPG6MODE= -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6
# XPG5 mode. These options are specific for C++, where _XPG6,
# _XOPEN_SOURCE=600 and C99 are illegal. -D__EXTENSIONS__=1 is legal in C++.
CPP_XPG5MODE= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__=1 -D_XPG5
# Studio C compiler flag sets to ease feature selection. Add the required
# feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
# component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
# Generate 32/64 bit objects
# Code generation instruction set and optimization 'hints'. Use studio_XBITS
studio_XBITS = $(studio_XBITS.$(MACH).$(BITS))
# Turn on recognition of supported C99 language features and enable the 1999 C
# standard library semantics of routines that appear in both the 1990 and
# 1999 C standard. To use set studio_C99MODE=$(studio_99_ENABLE) in your
studio_C99_ENABLE = -xc99=all
# Turn off recognition of C99 language features, and do not enable the 1999 C
# standard library semantics of routines that appeared in both the 1990 and
# 1999 C standard. To use set studio_C99MODE=$(studio_99_DISABLE) in your
studio_C99_DISABLE = -xc99=none
# Use the compiler default 'xc99=all,no_lib'
# For C++, compatibility with C99 (which is technically illegal) is
# enabled in a different way. So, we must use a different macro for it.
studio_cplusplus_C99_ENABLE = -xlang=c99
studio_cplusplus_C99_DISABLE =
# And this is the macro you should actually use
studio_cplusplus_C99MODE =
# Allow zero-sized
struct/union declarations and void functions with return
studio_FEATURES_EXTENSIONS = -features=extensions
# Control the Studio optimization level.
studio_OPT = $(studio_OPT.$(MACH).$(BITS))
# Studio PIC code generation. Use CC_PIC instead to select PIC code generation.
# The Sun Studio 11 compiler has changed the behaviour of integer
# wrap arounds and so a flag is needed to use the legacy behaviour
# (without this flag
panics/hangs could be exposed within the source).
# This is used through studio_IROPTS, not the 'sparc' variety.
studio_IROPTS = $(studio_IROPTS.$(MACH))
# Control register usage for generated code. SPARC ABI requires system
# libraries not to use application registers. x86 requires 'no%frameptr' at
studio_XREGS = $(studio_XREGS.$(MACH))
# Set data alignment on sparc to reasonable values, 8 byte alignment for 32 bit
# objects and 16 byte alignment for 64 bit objects. This is added to CFLAGS by
studio_ALIGN = $(studio_ALIGN.$(MACH).$(BITS))
# Studio shorthand for building multi-threaded code, enables -D_REENTRANT and
# linking with threadin support. This is added to CFLAGS by default, override
# studio_MT to turn this off.
# See CPP_XPG6MODE comment above.
studio_XPG6MODE = $(studio_C99MODE) $(CPP_XPG6MODE)
XPG6MODE = $(studio_XPG6MODE)
# See CPP_XPG5MODE comment above. You can only use this in C++, not in C99.
studio_XPG5MODE = $(studio_cplusplus_C99MODE) $(CPP_XPG5MODE)
XPG5MODE = $(studio_XPG5MODE)
# Default Studio C compiler flags. Add the required feature to your Makefile
# with CFLAGS += $(FEATURE_MACRO) and add to the component build with
# CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it
# should not be necessary to add CFLAGS to any environment other than the
$(studio_IROPTS) $(studio_C99MODE) $(studio_ALIGN) \
# GNU C compiler flag sets to ease feature selection. Add the required
# feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
# component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
# GCC Compiler optimization flag
# GCC PIC code generation. Use CC_PIC instead to select PIC code generation.
# Generic macro for PIC code generation. Use this macro instead of the
# compiler specific variant.
CC_PIC = $($(COMPILER)_PIC)
# Default GNU C compiler flags. Add the required feature to your Makefile
# with CFLAGS += $(FEATURE_MACRO) and add to the component build with
# CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar. In most cases, it
# should not be necessary to add CFLAGS to any environment other than the
# Build 32 or 64 bit objects.
# Add compiler specific 'default' features
CFLAGS += $(CFLAGS.$(COMPILER))
# C++ compiler usually wants all of the C compiler options too
# Studio C++ requires -norunpath to avoid adding its location into the RUNPATH
studio_NORUNPATH = -norunpath
# To link in standard mode (the default mode) without any C++ libraries
# (except libCrun), use studio_LIBRARY_NONE in your component Makefile.
studio_LIBRARY_NONE = -library=%none
# Don't link C++ with any C++ Runtime or Standard C++ library
studio_CXXLIB_NONE = -xnolib
# Link C++ with the Studio C++ Runtime and Standard C++ library. This is the
# default for "standard" mode.
studio_CXXLIB_CSTD = -library=Cstd,Crun
# link C++ with the Studio C++ Runtime and Apache Standard C++ library
studio_CXXLIB_APACHE = -library=stdcxx4,Crun
# Add the C++ ABI compatibility flags for older ABI compatibility. The default
# is "standard mode" (-compat=5)
studio_COMPAT_VERSION_4 = -compat=4
# Tell the compiler that we don't want the studio runpath added to the
# linker flags. We never want the Studio location added to the RUNPATH.
CXXFLAGS += $($(COMPILER)_NORUNPATH)
# Solaris linker flag sets to ease feature selection. Add the required
# feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
# component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar.
# set the bittedness that we want to link
# Reduce the symbol table size, effectively conflicting with -g. We should
# get linker guidance here.
LD_Z_REDLOCSYM = -z redlocsym
# Cause the linker to rescan archive libraries and resolve remaining unresolved
# symbols recursively until all symbols are resolved. Components should be
# linking in the libraries they need, in the required order. This should
# only be required if the component's native build is horribly broken.
LD_Z_RESCAN_NOW = -z rescan-now
# make sure all symbols are defined.
# eliminate unreferenced dynamic dependencies
# More Solaris linker flags that we want to be sure that everyone gets. This
# is automatically added to the calling environment during the 'build' and
# 'install' phases of the component build. Each individual feature can be
# turned off by adding FEATURE_MACRO= to the component Makefile.
# Create a non-executable stack when linking.
# Create a non-executable bss segment when linking.
# Create a non-executable data segment when linking. Due to PLT needs, the
# data segment must be executable on sparc, but the bss does not.
# see mapfile comments for more information
# Linker options to add when only building libraries
LD_OPTIONS_SO += $(LD_Z_TEXT) $(LD_Z_DEFS)
# Default linker options that everyone should get. Do not add additional
# libraries to this macro, as it will apply to everything linked during the
LD_OPTIONS += $(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \
$(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE)
# We want to add bittedness to the default linker flags
# Environment variables and arguments passed into the build and install
# environment(s). These are the initial settings.
LD_OPTIONS="$(LD_OPTIONS)"
LD_OPTIONS="$(LD_OPTIONS)"
# Add any bit-specific settings
COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS))
COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS))
COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS))
COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
# declare these phony so that we avoid filesystem conflicts.
.PHONY: download prep build install publish test clean clobber
# If there are no tests to execute
@echo "There are no tests available at this time."