author | John Beck <John.Beck@Oracle.COM> |
Mon, 06 Feb 2017 13:54:36 -0800 | |
changeset 7648 | 20e09cf3cfaa |
parent 6903 | 9681a8af4330 |
child 7687 | 1093e2a9adbd |
permissions | -rw-r--r-- |
4912 | 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 |
# |
|
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6903
diff
changeset
|
23 |
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. |
4912 | 24 |
# |
25 |
include ../../../make-rules/shared-macros.mk |
|
26 |
||
27 |
COMPONENT_NAME= Python |
|
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6903
diff
changeset
|
28 |
COMPONENT_VERSION= 3.5.3 |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6903
diff
changeset
|
29 |
COMPONENT_PROJECT_URL= https://python.org/ |
4912 | 30 |
COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
31 |
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz |
|
32 |
COMPONENT_ARCHIVE_HASH= \ |
|
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6903
diff
changeset
|
33 |
sha256:eefe2ad6575855423ab630f5b51a8ef6e5556f774584c06beab4926f930ddbb0 |
5184
6c2a9525f3a4
22332010 upgrade Python to 3.5.1
John Beck <John.Beck@Oracle.COM>
parents:
5066
diff
changeset
|
34 |
COMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/python/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE) |
4912 | 35 |
COMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).asc |
36 |
COMPONENT_BUGDB= utility/python |
|
37 |
||
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6903
diff
changeset
|
38 |
TPNO= 33493 |
4912 | 39 |
|
40 |
include $(WS_MAKE_RULES)/prep.mk |
|
41 |
include $(WS_MAKE_RULES)/configure.mk |
|
42 |
include $(WS_MAKE_RULES)/ips.mk |
|
43 |
include $(WS_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 |
|
4978
055c17ca3402
22065993 python Makefiles should use autoconf -f
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
51 |
COMPONENT_PREP_ACTION = (cd $(@D) ; autoheader ; autoconf -f) |
4912 | 52 |
|
53 |
# The DTrace patch needs this file to be mode 0755. |
|
54 |
COMPONENT_PRE_BUILD_ACTION=($(CHMOD) +x \ |
|
55 |
$(SOURCE_DIR)/Include/pydtrace_offsets.sh) |
|
56 |
||
57 |
# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with |
|
58 |
# python-config |
|
59 |
CC += $(CFLAGS) |
|
60 |
||
6903
9681a8af4330
24589114 build python in C99 mode to prepare for move to Studio 12.5
John Beck <John.Beck@Oracle.COM>
parents:
6552
diff
changeset
|
61 |
studio_C99MODE= $(studio_C99_ENABLE) |
9681a8af4330
24589114 build python in C99 mode to prepare for move to Studio 12.5
John Beck <John.Beck@Oracle.COM>
parents:
6552
diff
changeset
|
62 |
CFLAGS += $(XPG6MODE) |
9681a8af4330
24589114 build python in C99 mode to prepare for move to Studio 12.5
John Beck <John.Beck@Oracle.COM>
parents:
6552
diff
changeset
|
63 |
|
4912 | 64 |
CPPFLAGS += -IPython |
65 |
||
66 |
# to find the ncurses headers |
|
67 |
CPPFLAGS += -I/usr/include/ncurses |
|
68 |
# enable large files how they did in JDS |
|
69 |
CPPFLAGS += -D_LARGEFILE64_SOURCE |
|
70 |
||
71 |
# libffi for _ctypes |
|
72 |
CPPFLAGS += $(shell pkg-config --cflags-only-I libffi) |
|
73 |
||
74 |
# because python links with $(CC) ... $(LDFLAGS) ... |
|
75 |
LDFLAGS = $(CC_BITS) $(CC_PIC) |
|
76 |
||
77 |
# build pic |
|
78 |
CFLAGS += $(CC_PIC) |
|
79 |
||
80 |
# for DWARF |
|
81 |
CFLAGS.i386 = -preserve_argvalues=complete |
|
5936
56a9d82c570e
21658934 Python is not ADI-safe
Enrico Perla <enrico.perla@oracle.com>
parents:
5846
diff
changeset
|
82 |
# Use the Studio VIS SDK in order to explicitly generate nonfaulting loads |
56a9d82c570e
21658934 Python is not ADI-safe
Enrico Perla <enrico.perla@oracle.com>
parents:
5846
diff
changeset
|
83 |
# that allow Python to work with ADI-aware memory allocators. |
56a9d82c570e
21658934 Python is not ADI-safe
Enrico Perla <enrico.perla@oracle.com>
parents:
5846
diff
changeset
|
84 |
CFLAGS.studio.sparc.64 = -xvis |
56a9d82c570e
21658934 Python is not ADI-safe
Enrico Perla <enrico.perla@oracle.com>
parents:
5846
diff
changeset
|
85 |
|
4912 | 86 |
CFLAGS += $(CFLAGS.$(MACH)) |
87 |
||
88 |
# 16-byte memory alignment + interpretation of non-alignment prevents SIGBUS. |
|
89 |
studio_ALIGN.sparc.64 = -xmemalign=16i |
|
90 |
||
91 |
# The python build is profile-guided for studio; to see the benefits of that, |
|
92 |
# Python must be compiled with -xO5 and a different build target must be used. |
|
93 |
# Use of xprofile requires that the same options be used during compilation and |
|
94 |
# linking. The targets chosen are based on Solaris 11 minimum supported system |
|
95 |
# requirements. |
|
96 |
COMPONENT_BUILD_TARGETS = profile-opt |
|
97 |
XPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile |
|
98 |
PYFLAGS.i386 = -xtarget=opteron -xarch=sse2 -xcache=generic |
|
99 |
PYFLAGS.sparc = |
|
100 |
CFLAGS += -xO5 $(PYFLAGS.$(MACH)) |
|
101 |
LDFLAGS += -xO5 $(PYFLAGS.$(MACH)) |
|
102 |
||
103 |
# Python puts its header files in a special place. |
|
104 |
LINT_FLAGS += -I$(SOURCE_DIR)/Include |
|
105 |
||
106 |
# PYTHONPATH in the environment can be harmful, but setting it to empty via |
|
107 |
# _INSTALL_ENV causes problems too, so just ignore the entire environment. |
|
108 |
# Because of this, we need to specify PATH in multiple places below. |
|
109 |
ENV += -i |
|
110 |
||
111 |
CONFIGURE_ENV += PATH="$(PATH)" |
|
112 |
||
113 |
CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR) |
|
114 |
CONFIGURE_OPTIONS += --enable-shared |
|
115 |
CONFIGURE_OPTIONS += --with-dtrace |
|
116 |
CONFIGURE_OPTIONS += --with-system-expat |
|
117 |
CONFIGURE_OPTIONS += --with-system-ffi |
|
118 |
CONFIGURE_OPTIONS += --without-gcc |
|
119 |
CONFIGURE_OPTIONS += --without-ensurepip |
|
120 |
CONFIGURE_OPTIONS += --enable-ipv6 |
|
121 |
CONFIGURE_OPTIONS += --bindir=/usr/bin |
|
122 |
CONFIGURE_OPTIONS += "ac_cv_func_getentropy=no" |
|
123 |
CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" |
|
124 |
CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" |
|
125 |
CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" |
|
126 |
CONFIGURE_OPTIONS += DFLAGS="-$(BITS)" |
|
127 |
CONFIGURE_OPTIONS += XPROFILE_DIR="$(XPROFILE_DIR)" |
|
128 |
||
129 |
COMPONENT_BUILD_ENV += DFLAGS="-$(BITS)" |
|
130 |
COMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)" |
|
131 |
COMPONENT_BUILD_ENV += PATH="$(PATH)" |
|
132 |
||
133 |
# Some tests have non-ASCII characters encoded for international domain names; |
|
134 |
# the publish step will fail in 'pkgdepend generate' without this: |
|
135 |
COMPONENT_PUBLISH_ENV += LC_ALL=en_US.UTF-8 |
|
136 |
||
137 |
# 64 bit shared objects need to go in a 64-bit directory |
|
138 |
COMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python3.5/lib-dynload |
|
139 |
||
140 |
# Simplify the definitions of CC, CXX, CFLAGS and LDFLAGS so they hard-code |
|
141 |
# neither paths from our build systems nor Studio-specific options. |
|
142 |
COMPONENT_PRE_INSTALL_ACTION= \ |
|
143 |
(cd $(@D) ; \ |
|
144 |
$(GSED) -i -e 's/^CC=.*/CC=\t\tcc/' -e 's/^CXX=.*/CXX=\t\tCC/' \ |
|
145 |
-e 's/^CFLAGS=.*/CFLAGS=\t\t\$$\(BASECFLAGS) \$$\(OPT) \$$\(EXTRA_CFLAGS)/' \ |
|
146 |
-e 's|^LDFLAGS=.*|LDFLAGS=|' Makefile) |
|
147 |
||
148 |
# Because we stripped the Makefile above, we need to pass several things in the |
|
149 |
# environment, and use -e to tell gmake to pay attention to the environment. |
|
150 |
COMPONENT_INSTALL_ENV += CC="$(CC)" |
|
151 |
COMPONENT_INSTALL_ENV += CXX="$(CXX)" |
|
152 |
COMPONENT_INSTALL_ENV += CFLAGS="$(CFLAGS)" |
|
153 |
COMPONENT_INSTALL_ENV += LDFLAGS="$(LDFLAGS)" |
|
154 |
COMPONENT_INSTALL_ENV += PATH="$(PATH)" |
|
155 |
COMPONENT_INSTALL_ARGS += -e |
|
156 |
||
157 |
# Strip build machine paths from _sysconfigdata.py & config/Makefile, |
|
158 |
# then (re)compile _sysconfigdata.py since we just updated it. |
|
159 |
# Note that once Python 3.5 has been integrated and propagated to build |
|
160 |
# machines, then the LD_LIBRARY_PATH setting and PROTO_DIR prefix below |
|
161 |
# can both be removed. |
|
162 |
COMPONENT_POST_INSTALL_ACTION= \ |
|
163 |
(cd $(PROTOUSRLIBDIR)/python3.5 ; \ |
|
164 |
$(GSED) -i -e 's|$(SOURCE_DIR)|.|g' -e 's|$(COMPONENT_DIR)|..|g' \ |
|
165 |
-e 's|$(SPRO_VROOT)/bin/||g' _sysconfigdata.py config-3.5m/Makefile; \ |
|
166 |
LD_LIBRARY_PATH=$(PROTOUSRLIBDIR64) $(PROTO_DIR)$(PYTHON.3.5) -m py_compile _sysconfigdata.py) |
|
167 |
||
168 |
# common targets |
|
169 |
configure: $(CONFIGURE_64) |
|
170 |
build: $(BUILD_64) |
|
171 |
install: $(INSTALL_64) |
|
172 |
||
173 |
# Using "-uall,-network" ensures all tests are run except the network tests. |
|
174 |
# The network tests contain many expected failures when run behind a firewall. |
|
175 |
# The "-v" ensures verbose mode. You can set TESTOPTS_PYTHON_TEST to a |
|
176 |
# particular test if you want to run just one test. For example, |
|
177 |
# $ TESTOPTS_PYTHON_TEST=test_sys gmake -k test |
|
178 |
# Note that when a test succeeds, the builds/*/.tested file gets created. You |
|
179 |
# may need to remove these files, or run "gmake clobber" or "gmake clean" |
|
180 |
# between tests. |
|
181 |
# |
|
182 |
COMPONENT_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)" |
|
183 |
# The distutils tests need $CC in $PATH. |
|
184 |
COMPONENT_TEST_ENV += PATH="$(SPRO_VROOT)/bin:$(PATH)" |
|
185 |
# Prevent the tests from getting stuck waiting for input. |
|
186 |
COMPONENT_TEST_TARGETS = test < /dev/null |
|
187 |
# Some different values for system testing. |
|
188 |
COMPONENT_SYSTEM_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)" |
|
189 |
COMPONENT_SYSTEM_TEST_TARGETS = |
|
190 |
COMPONENT_SYSTEM_TEST_CMD= $(PYTHON.3.5) |
|
191 |
COMPONENT_SYSTEM_TEST_ARGS= /usr/lib/python3.5/test/regrtest.py -v -uall,-network |
|
192 |
||
193 |
# The test output contains details from each test, in whatever order they |
|
194 |
# complete. The default _TRANSFORMER is not powerful enough to deal with |
|
195 |
# this; we need heavier artillery. Extract just the sections that start |
|
196 |
# with "tests OK." and end with "Re-running failed tests..." for comparison. |
|
197 |
COMPONENT_TEST_TRANSFORMER = $(NAWK) |
|
198 |
COMPONENT_TEST_TRANSFORMS = "'/tests OK./ {results = 1}; /Re-running failed tests in verbose mode/ {results = 0} {if (results) print $0 } '" |
|
199 |
||
200 |
test: $(TEST_64) |
|
201 |
system-test: $(SYSTEM_TEST_64) |
|
202 |
||
203 |
REQUIRED_PACKAGES += compress/bzip2 |
|
204 |
REQUIRED_PACKAGES += compress/xz |
|
205 |
REQUIRED_PACKAGES += database/sqlite-3 |
|
206 |
REQUIRED_PACKAGES += library/database/gdbm |
|
207 |
REQUIRED_PACKAGES += library/expat |
|
208 |
REQUIRED_PACKAGES += library/libffi |
|
209 |
REQUIRED_PACKAGES += library/ncurses |
|
210 |
REQUIRED_PACKAGES += library/readline |
|
211 |
REQUIRED_PACKAGES += library/security/openssl |
|
212 |
REQUIRED_PACKAGES += library/zlib |
|
213 |
REQUIRED_PACKAGES += runtime/tcl-8 |
|
214 |
REQUIRED_PACKAGES += runtime/tk-8 |
|
215 |
REQUIRED_PACKAGES += system/library/math |
|
216 |
REQUIRED_PACKAGES += x11/library/libx11 |