Makefile revision 3869
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# CDDL HEADER START
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# The contents of this file are subject to the terms of the
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Common Development and Distribution License (the "License").
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync# You may not use this file except in compliance with the License.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# or http://www.opensolaris.org/os/licensing.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# See the License for the specific language governing permissions
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# and limitations under the License.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# When distributing Covered Code, include this CDDL HEADER in each
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# If applicable, add the following below this CDDL HEADER, with the
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# fields enclosed by brackets "[]" replaced with your own identifying
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# CDDL HEADER END
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync#
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncinclude ../../../make-rules/shared-macros.mk
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_NAME= Python
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_VERSION= 3.4.3
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_PROJECT_URL= http://python.org/
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_ARCHIVE_HASH= \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync sha256:b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).asc
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_BUGDB= utility/python
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncTPNO= 21686
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncinclude $(WS_MAKE_RULES)/prep.mk
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinclude $(WS_MAKE_RULES)/configure.mk
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncinclude $(WS_MAKE_RULES)/ips.mk
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncinclude $(WS_MAKE_RULES)/lint-libraries.mk
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Need to preserve timestamp for Grammar files. If the pickle files are older,
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Python will try to rebuild them.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncPKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.txt
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncPKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.pickle
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# We patch auto* files, so regenerate headers and configure
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_PREP_ACTION = \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync (cd $(@D) ; autoheader ; autoconf)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# The DTrace patch needs this file to be mode 0755.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_PRE_BUILD_ACTION=($(CHMOD) +x \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync $(SOURCE_DIR)/Include/pydtrace_offsets.sh)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# python-config
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCC += $(CFLAGS)
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncC99MODE=
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCPPFLAGS += -IPython
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# to find the ncurses headers
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCPPFLAGS += -I/usr/include/ncurses
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# enable large files how they did in JDS
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCPPFLAGS += -D_LARGEFILE64_SOURCE
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# libffi for _ctypes
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCPPFLAGS += $(shell pkg-config --cflags-only-I libffi)
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# because python links with $(CC) ... $(LDFLAGS) ...
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncLDFLAGS = $(CC_BITS) $(CC_PIC)
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync# build pic
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCFLAGS += $(CC_PIC)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# 16-byte memory alignment + interpretation of non-alignment prevents SIGBUS.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncstudio_ALIGN.sparc.64 = -xmemalign=16i
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# The python build is profile-guided for studio; to see the benefits of that,
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Python must be compiled with -xO5 and a different build target must be used.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Use of xprofile requires that the same options be used during compilation and
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# linking. The targets chosen are based on Solaris 11 minimum supported system
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# requirements.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCOMPONENT_BUILD_TARGETS = profile-opt
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncXPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncPYFLAGS.i386 = -xtarget=opteron -xarch=sse2 -xcache=generic
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncPYFLAGS.sparc =
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCFLAGS += -xO5 $(PYFLAGS.$(MACH))
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncLDFLAGS += -xO5 $(PYFLAGS.$(MACH))
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Python puts its header files in a special place.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncLINT_FLAGS += -I$(SOURCE_DIR)/Include
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# PYTHONPATH in the environment can be harmful, but setting it to empty via
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# _INSTALL_ENV causes problems too, so just ignore the entire environment.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Because of this, we need to specify PATH in multiple places below.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncENV += -i
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCONFIGURE_ENV += PATH="$(PATH)"
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --enable-shared
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --with-dtrace
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --with-system-expat
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --with-system-ffi
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --without-gcc
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --without-ensurepip
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --enable-ipv6
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += --bindir=/usr/bin
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCONFIGURE_OPTIONS += DFLAGS="-$(BITS)"
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncCONFIGURE_OPTIONS += XPROFILE_DIR="$(XPROFILE_DIR)"
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncCOMPONENT_BUILD_ENV += DFLAGS="-$(BITS)"
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncCOMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)"
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncCOMPONENT_BUILD_ENV += PATH="$(PATH)"
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync# Some tests have non-ASCII characters encoded for international domain names;
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync# the publish step will fail in 'pkgdepend generate' without this:
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncCOMPONENT_PUBLISH_ENV += LC_ALL=en_US.UTF-8
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync# 64 bit shared objects need to go in a 64-bit directory
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncCOMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python3.4/lib-dynload
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
73e8df2e481cb3697372a3cf4acffd068a7f1296vboxsyncASLR_MODE = $(ASLR_ENABLE)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Simplify the definitions of CC, CXX, CFLAGS and LDFLAGS so they hard-code
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# neither paths from our build systems nor Studio-specific options.
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncCOMPONENT_PRE_INSTALL_ACTION= \
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync (cd $(@D) ; \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync $(GSED) -i -e 's/^CC=.*/CC=\t\tcc/' -e 's/^CXX=.*/CXX=\t\tCC/' \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync -e 's/^CFLAGS=.*/CFLAGS=\t\t\$$\(BASECFLAGS) \$$\(OPT) \$$\(EXTRA_CFLAGS)/' \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync -e 's|^LDFLAGS=.*|LDFLAGS=|' Makefile)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Because we stripped the Makefile above, we need to pass several things in the
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# environment, and use -e to tell gmake to pay attention to the environment.
COMPONENT_INSTALL_ENV += CC="$(CC)"
COMPONENT_INSTALL_ENV += CXX="$(CXX)"
COMPONENT_INSTALL_ENV += CFLAGS="$(CFLAGS)"
COMPONENT_INSTALL_ENV += LDFLAGS="$(LDFLAGS)"
COMPONENT_INSTALL_ENV += PATH="$(PATH)"
COMPONENT_INSTALL_ARGS += -e
# Strip build machine paths from _sysconfigdata.py & config/Makefile.
COMPONENT_POST_INSTALL_ACTION= \
(cd $(PROTOUSRLIBDIR)/python3.4 ; \
$(GSED) -i -e 's|$(SOURCE_DIR)|.|g' -e 's|$(COMPONENT_DIR)|..|g' \
-e 's|$(SPRO_VROOT)/bin/||g' lib-dynload/64/_sysconfigdata.py \
config-3.4m/Makefile)
# common targets
configure: $(CONFIGURE_64)
build: $(BUILD_64)
install: $(INSTALL_64)
# Using "-uall,-network" ensures all tests are run except the network tests.
# The network tests contain many expected failures when run behind a firewall.
# The "-v" ensures verbose mode. You can set TESTOPTS_PYTHON_TEST to a
# particular test if you want to run just one test. For example,
# $ TESTOPTS_PYTHON_TEST=test_sys gmake -k test
# Note that when a test succeeds, the builds/*/.tested file gets created. You
# may need to remove these files, or run "gmake clobber" or "gmake clean"
# between tests.
#
COMPONENT_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)"
# The distutils tests need $CC in $PATH.
COMPONENT_TEST_ENV += PATH="$(SPRO_VROOT)/bin:$(PATH)"
# Prevent the tests from getting stuck waiting for input.
COMPONENT_TEST_TARGETS = test < /dev/null
# The test output contains details from each test, in whatever order they
# complete. The default _TRANSFORMER is not powerful enough to deal with
# this; we need heavier artillery. Extract just the sections that start
# with "tests OK." and end with "Re-running failed tests..." for comparison.
COMPONENT_TEST_TRANSFORMER = $(NAWK)
COMPONENT_TEST_TRANSFORMS = "'/tests OK./ {results = 1}; /Re-running failed tests in verbose mode/ {results = 0} {if (results) print $0 } '"
test: $(TEST_64)
REQUIRED_PACKAGES += compress/bzip2
REQUIRED_PACKAGES += compress/xz
REQUIRED_PACKAGES += database/sqlite-3
REQUIRED_PACKAGES += library/database/gdbm
REQUIRED_PACKAGES += library/expat
REQUIRED_PACKAGES += library/libffi
REQUIRED_PACKAGES += library/ncurses
REQUIRED_PACKAGES += library/readline
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += runtime/tcl-8
REQUIRED_PACKAGES += runtime/tk-8
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += system/linker
REQUIRED_PACKAGES += x11/library/libx11