Makefile revision 6444
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# CDDL HEADER START
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The contents of this file are subject to the terms of the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Common Development and Distribution License (the "License").
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# You may not use this file except in compliance with the License.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# See the License for the specific language governing permissions
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# and limitations under the License.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# When distributing Covered Code, include this CDDL HEADER in each
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# If applicable, add the following below this CDDL HEADER, with the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# CDDL HEADER END
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync sha256:ee64b1c8a47461009abf25252332d29a4e587cb4f0c1c96aa793a3732e9d898a
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Need to preserve timestamp for Grammar files. If the pickle files are older,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Python will try to rebuild them.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# We patch auto* files, so regenerate headers and configure
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_PREP_ACTION = (cd $(@D) ; autoheader ; autoconf -f)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The DTrace patch needs this file to be mode 0755.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# python-config
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# to find the ncurses headers
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# enable large files how they did in JDS
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# libffi for _ctypes
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCPPFLAGS += $(shell pkg-config --cflags-only-I libffi)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# because python links with $(CC) ... $(LDFLAGS) ...
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Use the Studio VIS SDK in order to explicitly generate nonfaulting loads
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# that allow Python to work with ADI-aware memory allocators.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# 16-byte memory alignment + interpretation of non-alignment prevents SIGBUS.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The python build is profile-guided for studio; to see the benefits of that,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Python must be compiled with -xO5 and a different build target must be used.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Use of xprofile requires that the same options be used during compilation and
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# linking. The targets chosen are based on Solaris 11 minimum supported system
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# requirements.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPYFLAGS.i386 = -xtarget=opteron -xarch=sse2 -xcache=generic
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Python puts its header files in a special place.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# PYTHONPATH in the environment can be harmful, but setting it to empty via
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# _INSTALL_ENV causes problems too, so just ignore the entire environment.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Because of this, we need to specify PATH in multiple places below.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Some tests have non-ASCII characters encoded for international domain names;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# the publish step will fail in 'pkgdepend generate' without this:
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# 64 bit shared objects need to go in a 64-bit directory
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python3.4/lib-dynload
989d2489ff3cb4750510f8c9ea4ab95986d472a3vboxsync# Simplify the definitions of CC, CXX, CFLAGS and LDFLAGS so they hard-code
989d2489ff3cb4750510f8c9ea4ab95986d472a3vboxsync# neither paths from our build systems nor Studio-specific options.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(GSED) -i -e 's/^CC=.*/CC=\t\tcc/' -e 's/^CXX=.*/CXX=\t\tCC/' \
989d2489ff3cb4750510f8c9ea4ab95986d472a3vboxsync -e 's/^CFLAGS=.*/CFLAGS=\t\t\$$\(BASECFLAGS) \$$\(OPT) \$$\(EXTRA_CFLAGS)/' \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Because we stripped the Makefile above, we need to pass several things in the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# environment, and use -e to tell gmake to pay attention to the environment.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Strip build machine paths from _sysconfigdata.py & config/Makefile,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# then (re)compile _sysconfigdata.py since we just updated it.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(GSED) -i -e 's|$(SOURCE_DIR)|.|g' -e 's|$(COMPONENT_DIR)|..|g' \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync -e 's|$(SPRO_VROOT)/bin/||g' lib-dynload/64/_sysconfigdata.py \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(PYTHON.3.4) -m py_compile lib-dynload/64/_sysconfigdata.py)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# common targets
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Using "-uall,-network" ensures all tests are run except the network tests.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The network tests contain many expected failures when run behind a firewall.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The "-v" ensures verbose mode. You can set TESTOPTS_PYTHON_TEST to a
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# particular test if you want to run just one test. For example,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# $ TESTOPTS_PYTHON_TEST=test_sys gmake -k test
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Note that when a test succeeds, the builds/*/.tested file gets created. You
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# may need to remove these files, or run "gmake clobber" or "gmake clean"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# between tests.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The distutils tests need $CC in $PATH.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_TEST_ENV += PATH="$(SPRO_VROOT)/bin:$(PATH)"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Prevent the tests from getting stuck waiting for input.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Some different values for system testing.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_SYSTEM_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_SYSTEM_TEST_ARGS= /usr/lib/python3.4/test/regrtest.py -v -uall,-network
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The test output contains details from each test, in whatever order they
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# complete. The default _TRANSFORMER is not powerful enough to deal with
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# this; we need heavier artillery. Extract just the sections that start
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# with "tests OK." and end with "Re-running failed tests..." for comparison.
COMPONENT_TEST_TRANSFORMS = "'/tests OK./ {results = 1}; /Re-running failed tests in verbose mode/ {results = 0} {if (results) print $0 } '"
test: $(TEST_64)