author | John Beck <John.Beck@Oracle.COM> |
Wed, 27 Aug 2014 09:04:47 -0700 | |
changeset 2060 | a9ad5cd0ec29 |
parent 1953 | 5c1face45dc8 |
child 2124 | c9bbad49190b |
permissions | -rw-r--r-- |
1907 | 1 |
# |
2 |
# CDDL HEADER START |
|
3 |
# |
|
4 |
# The contents of this file are subject to the terms of the |
|
5 |
# Common Development and Distribution License (the "License"). |
|
6 |
# You may not use this file except in compliance with the License. |
|
7 |
# |
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
# or http://www.opensolaris.org/os/licensing. |
|
10 |
# See the License for the specific language governing permissions |
|
11 |
# and limitations under the License. |
|
12 |
# |
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
# |
|
19 |
# CDDL HEADER END |
|
20 |
# |
|
21 |
||
22 |
# |
|
23 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
|
24 |
# |
|
25 |
||
26 |
include ../../../make-rules/shared-macros.mk |
|
27 |
||
28 |
COMPONENT_NAME= Python |
|
1953
5c1face45dc8
19004593 update Python to 3.4.1
John Beck <John.Beck@Oracle.COM>
parents:
1948
diff
changeset
|
29 |
COMPONENT_VERSION= 3.4.1 |
1907 | 30 |
COMPONENT_PROJECT_URL= http://python.org/ |
31 |
COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
32 |
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz |
|
33 |
COMPONENT_ARCHIVE_HASH= \ |
|
1953
5c1face45dc8
19004593 update Python to 3.4.1
John Beck <John.Beck@Oracle.COM>
parents:
1948
diff
changeset
|
34 |
sha256:c595a163104399041fcbe1c5c04db4c1da94f917b82ce89e8944c8edff7aedc4 |
1907 | 35 |
COMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE) |
36 |
COMPONENT_BUGDB= utility/python |
|
37 |
||
1953
5c1face45dc8
19004593 update Python to 3.4.1
John Beck <John.Beck@Oracle.COM>
parents:
1948
diff
changeset
|
38 |
TPNO= 18022 |
1948
2d1537e7942d
18978320 Userland components should specify TPNOs in Makefiles instead of pkg manifests
John Beck <John.Beck@Oracle.COM>
parents:
1907
diff
changeset
|
39 |
|
1907 | 40 |
include $(WS_TOP)/make-rules/prep.mk |
41 |
include $(WS_TOP)/make-rules/configure.mk |
|
42 |
include $(WS_TOP)/make-rules/ips.mk |
|
43 |
include $(WS_TOP)/make-rules/lint-libraries.mk |
|
44 |
||
45 |
# Need to preserve timestamp for Grammar files. If the pickle files are older, |
|
46 |
# Python will try to rebuild them. |
|
47 |
PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.txt |
|
48 |
PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.pickle |
|
49 |
||
50 |
# We patch auto* files, so regenerate headers and configure |
|
51 |
COMPONENT_PREP_ACTION = \ |
|
52 |
(cd $(@D) ; autoheader ; autoconf) |
|
53 |
||
54 |
# The DTrace patch needs this file to be mode 0755. |
|
55 |
COMPONENT_PRE_BUILD_ACTION=($(CHMOD) +x \ |
|
56 |
$(SOURCE_DIR)/Include/pydtrace_offsets.sh) |
|
57 |
||
58 |
# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with |
|
59 |
# python-config |
|
60 |
CC += $(CFLAGS) |
|
61 |
||
62 |
C99MODE= |
|
63 |
CPPFLAGS += -IPython |
|
64 |
||
65 |
# to find the ncurses headers |
|
66 |
CPPFLAGS += -I/usr/include/ncurses |
|
67 |
# enable large files how they did in JDS |
|
68 |
CPPFLAGS += -D_LARGEFILE64_SOURCE |
|
69 |
||
70 |
# libffi for _ctypes |
|
71 |
CPPFLAGS += $(shell pkg-config --cflags-only-I libffi) |
|
72 |
||
73 |
# because python links with $(CC) ... $(LDFLAGS) ... |
|
74 |
LDFLAGS = $(CC_BITS) $(CC_PIC) |
|
75 |
||
76 |
# build pic |
|
77 |
CFLAGS += $(CC_PIC) |
|
78 |
||
79 |
# The python build is profile-guided for studio; to see the benefits of that, |
|
80 |
# Python must be compiled with -xO5 and a different build target must be used. |
|
81 |
# Use of xprofile requires that the same options be used during compilation and |
|
82 |
# linking. The targets chosen are based on Solaris 11 minimum supported system |
|
83 |
# requirements. |
|
84 |
COMPONENT_BUILD_TARGETS = profile-opt |
|
85 |
XPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile |
|
86 |
PYFLAGS.i386 = -xtarget=opteron -xarch=sse2 -xcache=generic |
|
87 |
PYFLAGS.sparc = |
|
88 |
CFLAGS += -xO5 $(PYFLAGS.$(MACH)) |
|
89 |
LDFLAGS += -xO5 $(PYFLAGS.$(MACH)) |
|
90 |
||
91 |
# add /usr/gnu/lib to the library search/run path |
|
92 |
LDFLAGS.64 = -R/usr/gnu/lib/$(MACH64) -L/usr/gnu/lib/$(MACH64) |
|
93 |
LDFLAGS += $(LDFLAGS.$(BITS)) |
|
94 |
||
95 |
# Python puts its header files in a special place. |
|
96 |
LINT_FLAGS += -I$(SOURCE_DIR)/Include |
|
97 |
||
98 |
CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR) |
|
99 |
CONFIGURE_OPTIONS += --enable-shared |
|
100 |
CONFIGURE_OPTIONS += --with-dtrace |
|
101 |
CONFIGURE_OPTIONS += --with-system-expat |
|
102 |
CONFIGURE_OPTIONS += --with-system-ffi |
|
103 |
CONFIGURE_OPTIONS += --without-gcc |
|
104 |
CONFIGURE_OPTIONS += --without-ensurepip |
|
105 |
CONFIGURE_OPTIONS += --enable-ipv6 |
|
106 |
CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" |
|
107 |
CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" |
|
108 |
CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" |
|
109 |
CONFIGURE_OPTIONS += DFLAGS="-$(BITS)" |
|
110 |
CONFIGURE_OPTIONS += XPROFILE_DIR="$(XPROFILE_DIR)" |
|
111 |
||
112 |
COMPONENT_BUILD_ENV += DFLAGS="-$(BITS)" |
|
113 |
COMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)" |
|
114 |
||
115 |
# Some tests have non-ASCII characters encoded for international domain names; |
|
116 |
# the publish step will fail in 'pkgdepend generate' without this: |
|
117 |
COMPONENT_PUBLISH_ENV += LC_ALL=en_US.UTF-8 |
|
118 |
||
119 |
# 64 bit shared objects need to go in a 64-bit directory |
|
120 |
COMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python3.4/lib-dynload |
|
121 |
||
122 |
ASLR_MODE = $(ASLR_ENABLE) |
|
123 |
||
124 |
# common targets |
|
125 |
build: $(BUILD_64) |
|
126 |
install: $(INSTALL_64) |
|
127 |
||
128 |
# Using "-uall,-network" ensures all tests are run except the network tests. |
|
129 |
# The network tests contain many expected failures when run behind a firewall. |
|
130 |
# The "-v" ensures verbose mode. You can set TESTOPTS_PYTHON_TEST to a |
|
131 |
# particular test if you want to run just one test. For example, |
|
132 |
# $ TESTOPTS_PYTHON_TEST=test_sys gmake -k test |
|
133 |
# Note that when a test succeeds, the builds/*/.tested file gets created. You |
|
134 |
# may need to remove these files, or run "gmake clobber" or "gmake clean" |
|
135 |
# between tests. |
|
136 |
# |
|
137 |
COMPONENT_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)" |
|
138 |
# Prevent the tests from getting stuck waiting for input. |
|
139 |
COMPONENT_TEST_TARGETS = test < /dev/null |
|
140 |
||
141 |
test: $(TEST_64) |
|
142 |
||
143 |
BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) |
|
144 |
||
145 |
include $(WS_TOP)/make-rules/depend.mk |