Makefile revision 3056
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# CDDL HEADER START
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# The contents of this file are subject to the terms of the
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# Common Development and Distribution License (the "License").
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# You may not use this file except in compliance with the License.
0d6e798a784ef0ba6b95512e4453067b2f84a91aHarald Hoyer# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# See the License for the specific language governing permissions
3486cb6cfa3d32a95c0daf02c7510fdf372507bfMartin Pitt# and limitations under the License.
3486cb6cfa3d32a95c0daf02c7510fdf372507bfMartin Pitt# When distributing Covered Code, include this CDDL HEADER in each
3486cb6cfa3d32a95c0daf02c7510fdf372507bfMartin Pitt# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3486cb6cfa3d32a95c0daf02c7510fdf372507bfMartin Pitt# If applicable, add the following below this CDDL HEADER, with the
1c36b4a73b876258fbe01fbe9bc9b750b7dcc9ceEvgeny Vereshchagin# fields enclosed by brackets "[]" replaced with your own identifying
c50a4525aa8151b180d5a325e88c5f3812e66c36Martin Pitt# information: Portions Copyright [yyyy] [name of copyright owner]
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# CDDL HEADER END
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier sha256:fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE_URL= ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# W3C XML Conformance Test Suites
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier sha256:96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE_URL_1= http://www.w3.org/XML/Test/$(COMPONENT_ARCHIVE_1)
61fea35e14d84144e6e2122f5cd247f9c7e6245eEvgeny VereshchaginCONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
61fea35e14d84144e6e2122f5cd247f9c7e6245eEvgeny Vereshchagin# Cannot link to lzma since it's not in /lib.
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCONFIGURE_OPTIONS += PYTHON_VENDOR_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# After we have configured, make a copy of the python bits so we can build and
3486cb6cfa3d32a95c0daf02c7510fdf372507bfMartin Pitt# test separate python 2.7 and 3.4 support. Note for 3.4: .py files need to
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# go in .../vendor-packages (whether building 32-bit or 64-bit) whereas .so
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# files need to go in .../vendor-packages for 32-bit but .../vendor-packages/64
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# for 64-bit. For 2.6 and 2.7, Python is built 32- and 64-bit, so .py files
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# end up in both places even though only the 32-bit location is needed, but the
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# superfluous files in the proto area are harmless; meanwhile, the .so files
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# end up in their proper 32- and 64-bit locations. But Python 3.4 is built
dbf43a42b8bb66d53c7cbab05f104c28097f811eDaniel Mack# 64-bit only, so we have an extra sed edit below to force the .py files into
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# the 32-bit location and we manually specify the 32-bit path in the manifest
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# to correct for the .so file being installed there instead of the 64-bit path
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# where it belongs.
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier $(GSED) -i -e 's/2[.]6/2.7/g' `find python2.7 -name Makefile` ; \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier $(GSED) -i -e 's/2[.]6/3.4/g' -e 's|vendor-packages/64|vendor-packages|' \
dbf43a42b8bb66d53c7cbab05f104c28097f811eDaniel Mack# After we have built/installed libxml2, build/install the python
dbf43a42b8bb66d53c7cbab05f104c28097f811eDaniel Mack# support for python 2.7 and 3.4
8a8332f77e61d41f3bb28b8f929ed41e0ffaf721Zbigniew Jędrzejewski-Szmek (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_INSTALL_ARGS) install ; \
8a8332f77e61d41f3bb28b8f929ed41e0ffaf721Zbigniew Jędrzejewski-Szmek [ $(BITS) -eq 64 ] && cd $(@D)/python3.4 ; \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier# It's nice to test also python 2.7 and 3.4 modules.
24be78d72b931b0175f08cee12fd23d631c024bfEvgeny Vereshchagin (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_TEST_ARGS) test ; \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier [ $(BITS) -eq 64 ] && cd $(@D)/python3.4 ; \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier# We have patched our 64 bit python so it will search for modules only in
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier# '64/' directories. Now we need to provide one. Otherwise python will
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier# end up using libxml2mod.so installed on system.
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier$(BUILD_DIR)/$(MACH64)/.tested: COMPONENT_PRE_TEST_ACTION = ( \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(SYMLINK) ../libxml2mod.so $(@D)/python/.libs/64/libxml2mod.so; \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(SYMLINK) ../libxml2mod.so $(@D)/python2.7/.libs/64/libxml2mod.so; \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(SYMLINK) ../libxml2mod.so $(@D)/python3.4/.libs/64/libxml2mod.so);
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1));
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier# common targets
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(PYTHON.2.6.32) -m compileall $(PROTO_DIR)/usr/lib/python2.6/vendor-packages
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(PYTHON.2.7.32) -m compileall $(PROTO_DIR)/usr/lib/python2.7/vendor-packages