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