Makefile revision 5252
1c0f62e37b0e775df7cb6121bc6ae64d1d885d3bKay Sievers# CDDL HEADER START
baa30fbc2c04b23209d0b8fb3c86cd15ef9ea81aKay Sievers# The contents of this file are subject to the terms of the
b7ff1e47da4653d2ff1ec7b489e6067fed29d8c5Lennart Poettering# Common Development and Distribution License (the "License").
c904f64d84db8c4eebedf210ba10893f19ba05edLennart Poettering# You may not use this file except in compliance with the License.
05677bb78079c3fa0283101aac2c07581f4873f1Lennart Poettering# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
73090dc815390f4fca4e3ed8a7e1d3806605daaaLennart Poettering# or http://www.opensolaris.org/os/licensing.
71092d70af35567dd154d3de2ce04ce62e157a7cLennart Poettering# See the License for the specific language governing permissions
ddd88763921a1534081ed28e36f6712a85449005Lennart Poettering# and limitations under the License.
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers# When distributing Covered Code, include this CDDL HEADER in each
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers# If applicable, add the following below this CDDL HEADER, with the
9a36607584bbd1d78775353e022a51794b4e27b1Lennart Poettering# fields enclosed by brackets "[]" replaced with your own identifying
9a36607584bbd1d78775353e022a51794b4e27b1Lennart Poettering# information: Portions Copyright [yyyy] [name of copyright owner]
a40593a0d0d740efa387e35411e1e456a6c5aba7Lennart Poettering# CDDL HEADER END
b8217b7bd5fd171916a095b150fad4c3a37f5a41Kay Sievers# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
2d13da8821b8197e62f819b5b996750800e910abKay SieversCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
b8217b7bd5fd171916a095b150fad4c3a37f5a41Kay Sievers sha256:4de9e31f46b44d34871c22f54bfc54398ef124d6f7cafb1f4a5958fbcd3ba12d
b8217b7bd5fd171916a095b150fad4c3a37f5a41Kay SieversCOMPONENT_ARCHIVE_URL= ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
08f23fd29c9df9c8b4e874933eb39711f069754bLennart Poettering# W3C XML Conformance Test Suites
3cc588803dba3530cd39000d299353a31e4c068bLennart Poettering sha256:96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7
3cc588803dba3530cd39000d299353a31e4c068bLennart PoetteringCOMPONENT_ARCHIVE_URL_1= http://www.w3.org/XML/Test/$(COMPONENT_ARCHIVE_1)
231931ffba1bca9d8759bbd6f797e56f8c6971faLennart Poetteringinclude $(WS_MAKE_RULES)/lint-libraries.mk
6ba383fa49e01302dfeae1f5083bb942b055628bLennart PoetteringLDFLAGS += $(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
bd08f2422491169e92dc0899d5ba848fcae4c15cLennart Poettering# Once Python 2.6 goes away, the various POST_*_ACTIONs below can be simplified.
fb0864e7b9c6d26269ccea6ec5c0fd921c029781Lennart PoetteringCONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
fb0864e7b9c6d26269ccea6ec5c0fd921c029781Lennart PoetteringCONFIGURE_OPTIONS += --with-python-install-dir=$(PYTHON_VENDOR_PACKAGES)
fb0864e7b9c6d26269ccea6ec5c0fd921c029781Lennart Poettering# Cannot link to lzma since it's not in /lib.
fb0864e7b9c6d26269ccea6ec5c0fd921c029781Lennart PoetteringCOMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
18da49531e4c6b31bd2439b4d738dc1bb9660af1Lennart Poettering# After we have configured, make a copy of the python bits so we can build and
8af0fcdb909b87ef4dcef34d50df814656acec81Lennart Poettering# test separate python 2.7 and 3.4 support. Note for 3.4: .py files need to
8af0fcdb909b87ef4dcef34d50df814656acec81Lennart Poettering# go in .../vendor-packages (whether building 32-bit or 64-bit) whereas .so
9586cdfab6a2638078702b7fea7e16b3a71899e2Lennart Poettering# files need to go in .../vendor-packages for 32-bit but .../vendor-packages/64
9586cdfab6a2638078702b7fea7e16b3a71899e2Lennart Poettering# for 64-bit. For 2.6 and 2.7, Python is built 32- and 64-bit, so .py files
9586cdfab6a2638078702b7fea7e16b3a71899e2Lennart Poettering# end up in both places even though only the 32-bit location is needed, but the
9586cdfab6a2638078702b7fea7e16b3a71899e2Lennart Poettering# superfluous files in the proto area are harmless; meanwhile, the .so files
9586cdfab6a2638078702b7fea7e16b3a71899e2Lennart Poettering# end up in their proper 32- and 64-bit locations. But Python 3.4 is built
9586cdfab6a2638078702b7fea7e16b3a71899e2Lennart Poettering# 64-bit only, so we have an extra sed edit below to force the .py files into
6b80b9b8ee6d372e00ece51e6a11c6d31899aaecLennart Poettering# the 32-bit location and we manually specify the 32-bit path in the manifest
6b80b9b8ee6d372e00ece51e6a11c6d31899aaecLennart Poettering# to correct for the .so file being installed there instead of the 64-bit path
7f110ff9b8828b477e87de7b28c708cf69a3d008Lennart Poettering# where it belongs. Further, Python 3.4 needs an extra 'm' on the link and
7f110ff9b8828b477e87de7b28c708cf69a3d008Lennart Poettering# include paths, plus a tweak to the binary path; see PEP 3149 for details.
7d900eb6f58ca76a0f742c6e1823aa7317d4471fLennart Poettering $(GSED) -i -e 's/2[.]6/2.7/g' `find python2.7 -name Makefile` ; \
7d900eb6f58ca76a0f742c6e1823aa7317d4471fLennart Poettering $(GSED) -i -e 's|-lpython2[.]6|-lpython3.4m|' \
7d900eb6f58ca76a0f742c6e1823aa7317d4471fLennart Poettering -e 's|usr/bin/$(MACH64)/python2[.]6|usr/bin/python3.4m|' \
101f077676e9fbe1a66c8b2dc4864a8d7a94c372Lennart Poettering -e 's|usr/include/python2[.]6|usr/include/python3.4m|' \
101f077676e9fbe1a66c8b2dc4864a8d7a94c372Lennart Poettering -e 's/2[.]6/3.4/g' -e 's|vendor-packages/64|vendor-packages|' \
101f077676e9fbe1a66c8b2dc4864a8d7a94c372Lennart Poettering# After we have built/installed libxml2, build/install the python
f7f964eb3625e4cca7f16377fa12aa7a760243e7Lennart Poettering# support for python 2.7 and 3.4
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_INSTALL_ARGS) install ; \
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering [ $(BITS) -eq 64 ] && cd $(@D)/python3.4 ; \
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering $(GMAKE) $(COMPONENT_INSTALL_ARGS) install)
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering# It's nice to test also python 2.7 and 3.4 modules.
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_TEST_ARGS) test ; \
d0e5a33374cee92962af33dfc03873e470b014f6Lennart Poettering [ $(BITS) -eq 64 ] && cd $(@D)/python3.4 ; \
6edd7ca1624f89c9a36067b721a0280e748acb17Kay Sievers# We have patched our 64 bit python so it will search for modules only in
15e9fbd851c15ecaad4888932584f37dcd26111aLennart Poettering# '64/' directories. Now we need to provide one. Otherwise python will
15e9fbd851c15ecaad4888932584f37dcd26111aLennart Poettering# end up using libxml2mod.so installed on system.
53ed2eeb2e709a6c0d152d7bdf2d9a4b9f997a16Lennart Poettering$(BUILD_DIR)/$(MACH64)/.tested: COMPONENT_PRE_TEST_ACTION = ( \
680a1dbc354b2f437b4e06e27d4c43217977efdfLennart Poettering $(SYMLINK) ../libxml2mod.so $(@D)/python/.libs/64/libxml2mod.so; \
680a1dbc354b2f437b4e06e27d4c43217977efdfLennart Poettering $(SYMLINK) ../libxml2mod.so $(@D)/python2.7/.libs/64/libxml2mod.so; \
7e64c73a93cdcc7068280f3e3ba8adbd6c6f8f84Lennart Poettering $(SYMLINK) ../libxml2mod.so $(@D)/python3.4/.libs/64/libxml2mod.so);
7e64c73a93cdcc7068280f3e3ba8adbd6c6f8f84Lennart Poettering (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1));
36e43bddd0a4526e77cdae2c922bb29f67bd74adLennart Poettering# common targets
a558d00381291afd6a81f7df07269fe76eeae556Lennart Poettering $(PYTHON.2.6.32) -m compileall $(PROTO_DIR)/usr/lib/python2.6/vendor-packages
a558d00381291afd6a81f7df07269fe76eeae556Lennart Poettering $(PYTHON.2.7.32) -m compileall $(PROTO_DIR)/usr/lib/python2.7/vendor-packages