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