Makefile revision 969
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# The contents of this file are subject to the terms of the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# Common Development and Distribution License (the "License").
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# You may not use this file except in compliance with the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# or http://www.opensolaris.org/os/licensing.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# and limitations under the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# When distributing Covered Code, include this CDDL HEADER in each
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# If applicable, add the following below this CDDL HEADER, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# fields enclosed by brackets "[]" replaced with your own identifying
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# information: Portions Copyright [yyyy] [name of copyright owner]
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# CDDL HEADER END
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiinclude ../../../make-rules/shared-macros.mk
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiPATH=/usr/bin:/usr/gnu/bin:/usr/sbin
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_NAME= Python
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_VERSION= 2.7.3
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_PROJECT_URL= http://python.org/
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_ARCHIVE_HASH= \
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi sha256:726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiinclude $(WS_TOP)/make-rules/prep.mk
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiinclude $(WS_TOP)/make-rules/configure.mk
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiinclude $(WS_TOP)/make-rules/ips.mk
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiinclude $(WS_TOP)/make-rules/lint-libraries.mk
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# We patch auto* files, so regenerate headers and configure
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_PREP_ACTION = \
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi (cd $(@D) ; autoheader ; autoconf)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# python-config
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCC += $(CFLAGS)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiC99MODE=
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCPPFLAGS += -IPython
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# to find the ncurses headers
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCPPFLAGS += -I/usr/include/ncurses
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# enable large files how they did in JDS
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCPPFLAGS += -D_LARGEFILE64_SOURCE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# libffi for _ctypes
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCPPFLAGS += $(shell pkg-config --cflags-only-I libffi)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# because python links with $(CC) ... $(LDFLAGS) ...
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiLDFLAGS = $(CC_BITS) $(CC_PIC)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# build pic
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCFLAGS += $(CC_PIC)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# The python build is profile-guided for studio; to see the benefits of that,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# Python must be compiled with -xO5 and a different build target must be used.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# Use of xprofile requires that the same options be used during compilation and
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# linking. The targets chosen are based on Solaris 11 minimum supported system
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# requirements.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_BUILD_TARGETS = profile-opt
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiXPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# the non-clang compiler we need to use for now doesn't like
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# this flag
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifneq ($(strip $(PARFAIT_BUILD)),yes)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiPYFLAGS.i386 = -xtarget=opteron
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiPYFLAGS.i386 += -xarch=sse2 -xcache=generic
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiPYFLAGS.sparc =
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCFLAGS += -xO5 $(PYFLAGS.$(MACH))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiLDFLAGS += -xO5 $(PYFLAGS.$(MACH))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# add /usr/gnu/lib to the library search/run path
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiLDFLAGS.32 = -R/usr/gnu/lib -L/usr/gnu/lib
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiLDFLAGS.64 = -R/usr/gnu/lib/$(MACH64) -L/usr/gnu/lib/$(MACH64)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiLDFLAGS += $(LDFLAGS.$(BITS))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# Python puts its header files in a special place.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiLINT_FLAGS += -I$(SOURCE_DIR)/Include
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += --enable-shared
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += --with-system-expat
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += --with-system-ffi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += --without-gcc
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += --enable-ipv6
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += ac_cv_opt_olimit_ok=no
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += ac_cv_olimit_ok=no
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += DFLAGS="-$(BITS)"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS += XPROFILE_DIR="$(XPROFILE_DIR)"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_BUILD_ENV += DFLAGS="-$(BITS)"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# patches/00-bits.patch removes some AC_CHECK_SIZEOF tests in order to
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# generate a pyconfig.h that is both 32 and 64 bit compatible. We add this
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# back to the environment so that configure can still work. configure.in and
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# pyconfig.h.in should probably be rewhacked to do this more cleanly in the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# future.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS.32 += ac_cv_sizeof_long=4
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCONFIGURE_OPTIONS.64 += ac_cv_sizeof_long=8
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# 64 bit shared objects need to go in a 64-bit directory
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python2.7/lib-dynload
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi# common targets
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindibuild: $(BUILD_32_and_64)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi$(INSTALL_32): $(INSTALL_64)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiinstall: $(INSTALL_32_and_64)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiCOMPONENT_TEST_TARGETS = test
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditest: $(TEST_32_and_64)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindiinclude $(WS_TOP)/make-rules/depend.mk
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi