Makefile revision 814
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# CDDL HEADER START
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# The contents of this file are subject to the terms of the
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# Common Development and Distribution License (the "License").
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# You may not use this file except in compliance with the License.
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# or http://www.opensolaris.org/os/licensing.
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# See the License for the specific language governing permissions
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# and limitations under the License.
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# When distributing Covered Code, include this CDDL HEADER in each
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# If applicable, add the following below this CDDL HEADER, with the
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# CDDL HEADER END
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncinclude ../../../make-rules/shared-macros.mk
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncPATH=/usr/bin:/usr/gnu/bin:/usr/sbin
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_NAME= Python
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_VERSION= 2.6.4
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_PROJECT_URL= http://python.org/
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_ARCHIVE_HASH= sha1:bee572680d1966501247cb2b26e0e51f94d1cd13
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncinclude $(WS_TOP)/make-rules/prep.mk
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncinclude $(WS_TOP)/make-rules/configure.mk
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncinclude $(WS_TOP)/make-rules/ips.mk
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncinclude $(WS_TOP)/make-rules/lint-libraries.mk
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# We patch auto* files, so regenerate headers and configure
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_PREP_ACTION = \
a180a41bba1d50822df23fff0099e90b86638b89vboxsync (cd $(@D) ; autoheader ; autoconf)
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# This seems horribly wrong, but these defines break the ability to build c99
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# compliant modules or with gcc.
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_POST_CONFIGURE_ACTION = \
a180a41bba1d50822df23fff0099e90b86638b89vboxsync (cd $(@D) ; \
a180a41bba1d50822df23fff0099e90b86638b89vboxsync perl -pi -e 's/(^\#define _POSIX_C_SOURCE.*)/\/* $$1 *\//' pyconfig.h ; \
a180a41bba1d50822df23fff0099e90b86638b89vboxsync perl -pi -e 's/^(\#define _XOPEN_SOURCE.*)/\/* $$1 *\//' pyconfig.h ; \
a180a41bba1d50822df23fff0099e90b86638b89vboxsync perl -pi -e 's/^(\#define _XOPEN_SOURCE_EXTENDED.*)/\/* $$1 *\//' \
a180a41bba1d50822df23fff0099e90b86638b89vboxsync pyconfig.h)
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# The python build is profile-guided for studio; to see the benefits of that,
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# Python must be compiled with -xO5 and a different build target must be used.
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# Use of xprofile requires that the same options be used during compilation and
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# linking. The targets chosen are based on Solaris 11 minimum supported system
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# requirements.
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_BUILD_TARGETS = profile-opt
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncXPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# the non-clang compiler we need to use for now doesn't like
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# this flag
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#ifneq ($(strip $(PARFAIT_BUILD)),yes)
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncPYFLAGS.i386 = -xtarget=opteron
a180a41bba1d50822df23fff0099e90b86638b89vboxsync#endif
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncPYFLAGS.i386 += -xarch=sse2 -xcache=generic
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncPYFLAGS.sparc =
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCFLAGS += -xO5 $(PYFLAGS.$(MACH))
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncLDFLAGS += -xO5 $(PYFLAGS.$(MACH))
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# python-config
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCC += $(CFLAGS)
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncC99MODE=
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCPPFLAGS += -IPython
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# so we find the ncurses headers
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCPPFLAGS += -I/usr/include/ncurses
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# enable large files how they did in JDS
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCPPFLAGS += -D_LARGEFILE64_SOURCE
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# libffi for _ctypes
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCPPFLAGS += $(shell pkg-config --cflags-only-I libffi)
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsync# Python puts its header files in a special place.
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncLINT_FLAGS += -I$(SOURCE_DIR)/Include
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += --enable-shared
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += --with-system-ffi
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += --without-gcc
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += ac_cv_opt_olimit_ok=no
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += ac_cv_olimit_ok=no
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += CCSHARED="$(CC_PIC)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += CXX="$(CXX)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += DFLAGS="-$(BITS)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCONFIGURE_OPTIONS += XPROFILE_DIR="$(XPROFILE_DIR)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_BUILD_ENV += DFLAGS="-$(BITS)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsyncCOMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)"
a180a41bba1d50822df23fff0099e90b86638b89vboxsync
COMPONENT_TEST_TARGETS = test
# 64 bit shared objects need to go in a 64-bit directory
COMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python2.6/lib-dynload
# common targets
build: $(BUILD_32_and_64)
$(INSTALL_32): $(INSTALL_64)
install: $(INSTALL_32_and_64)
test: $(TEST_32_and_64)
BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
include $(WS_TOP)/make-rules/depend.mk