Makefile revision 3056
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer#
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# CDDL HEADER START
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer#
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.
0fe15dc8ddddeb39a5cad1f4f4afa25fa074a5d1Evgeny Vereshchagin#
0d6e798a784ef0ba6b95512e4453067b2f84a91aHarald Hoyer# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0d6e798a784ef0ba6b95512e4453067b2f84a91aHarald Hoyer# or http://www.opensolaris.org/os/licensing.
898720b7e9cf3bdf7a93e435cbed5dd6942ecf9bHarald Hoyer# See the License for the specific language governing permissions
3486cb6cfa3d32a95c0daf02c7510fdf372507bfMartin Pitt# and limitations under the License.
3486cb6cfa3d32a95c0daf02c7510fdf372507bfMartin Pitt#
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]
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier#
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# CDDL HEADER END
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier#
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier#
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier#
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalierinclude ../../make-rules/shared-macros.mk
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_NAME= libxml2
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_VERSION= 2.9.1
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_PROJECT_URL= http://xmlsoft.org/
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE_HASH= \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier sha256:fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE_URL= ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_BUGDB= library/libxml
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier# W3C XML Conformance Test Suites
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE_1= xmlts20080827.tar.gz
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE_HASH_1= \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier sha256:96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_ARCHIVE_URL_1= http://www.w3.org/XML/Test/$(COMPONENT_ARCHIVE_1)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierTPNO= 17981
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald Hoyerinclude ../../make-rules/prep.mk
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald Hoyerinclude ../../make-rules/configure.mk
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald Hoyerinclude ../../make-rules/ips.mk
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald Hoyerinclude ../../make-rules/lint-libraries.mk
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald Hoyer
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald HoyerCFLAGS += $(CPP_LARGEFILES)
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald HoyerLDFLAGS += $(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
b6f0c419e38a960873fe68bf8f89bbb0268eed02Harald Hoyer
61fea35e14d84144e6e2122f5cd247f9c7e6245eEvgeny VereshchaginCONFIGURE_OPTIONS += --disable-static
61fea35e14d84144e6e2122f5cd247f9c7e6245eEvgeny VereshchaginCONFIGURE_OPTIONS += --with-pic
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCONFIGURE_OPTIONS += --with-threads
61fea35e14d84144e6e2122f5cd247f9c7e6245eEvgeny VereshchaginCONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
61fea35e14d84144e6e2122f5cd247f9c7e6245eEvgeny Vereshchagin# Cannot link to lzma since it's not in /lib.
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCONFIGURE_OPTIONS += --without-lzma
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCONFIGURE_OPTIONS += PYTHON_VENDOR_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny ChevalierCOMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier
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 ChevalierCOMPONENT_POST_CONFIGURE_ACTION = \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier (cd $(@D) ; cp -rp python python2.7 ; \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier $(GSED) -i -e 's/2[.]6/2.7/g' `find python2.7 -name Makefile` ; \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier cd $(@D) ; cp -rp python python3.4 ; \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier $(GSED) -i -e 's/2[.]6/3.4/g' -e 's|vendor-packages/64|vendor-packages|' \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier `find python3.4 -name Makefile` ; \
c6a77179a4097df355f0f04b8f3260c76b5e515cRonny Chevalier)
dbf43a42b8bb66d53c7cbab05f104c28097f811eDaniel Mack
dbf43a42b8bb66d53c7cbab05f104c28097f811eDaniel Mack# After we have built/installed libxml2, build/install the python
dbf43a42b8bb66d53c7cbab05f104c28097f811eDaniel Mack# support for python 2.7 and 3.4
dbf43a42b8bb66d53c7cbab05f104c28097f811eDaniel MackCOMPONENT_POST_INSTALL_ACTION = \
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 $(GMAKE) $(COMPONENT_INSTALL_ARGS) install)
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier# It's nice to test also python 2.7 and 3.4 modules.
8a8332f77e61d41f3bb28b8f929ed41e0ffaf721Zbigniew Jędrzejewski-SzmekCOMPONENT_POST_TEST_ACTION = \
24be78d72b931b0175f08cee12fd23d631c024bfEvgeny Vereshchagin (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_TEST_ARGS) test ; \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier [ $(BITS) -eq 64 ] && cd $(@D)/python3.4 ; \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(GMAKE) $(COMPONENT_TEST_ARGS) test)
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier
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 $(MKDIR) $(@D)/python/.libs/64 \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(@D)/python2.7/.libs/64 \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(@D)/python3.4/.libs/64; \
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
889a90422dd47284dffa32b9234a6e58991b000cRonny ChevalierCOMPONENT_PRE_TEST_ACTION += \
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1));
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier# common targets
9974ff63b182e67bf3d3d9262e2bfa84f0a1378bEvgeny Vereshchaginbuild: $(BUILD_32_and_64)
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalierinstall: $(INSTALL_32_and_64)
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
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier $(PYTHON.3.4.64) -m compileall $(PROTO_DIR)/usr/lib/python3.4/vendor-packages
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevaliertest: $(TEST_32_and_64)
889a90422dd47284dffa32b9234a6e58991b000cRonny Chevalier
a2fbff31c9c319da51528f85ae97d019f1e61a86Evgeny VereshchaginBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
a2fbff31c9c319da51528f85ae97d019f1e61a86Evgeny Vereshchagin
a2fbff31c9c319da51528f85ae97d019f1e61a86Evgeny Vereshchagininclude ../../make-rules/depend.mk
a2fbff31c9c319da51528f85ae97d019f1e61a86Evgeny Vereshchagin