5f5870385cff47efd2f58e7892f251cf13761528Timo Sirainen#
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# CDDL HEADER START
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen#
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# The contents of this file are subject to the terms of the
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# Common Development and Distribution License (the "License").
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# You may not use this file except in compliance with the License.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen#
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# or http://www.opensolaris.org/os/licensing.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# See the License for the specific language governing permissions
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# and limitations under the License.
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen#
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen#
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo Sirainen# CDDL HEADER END
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen#
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen#
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen#
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Siraineninclude ../../make-rules/shared-macros.mk
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo SirainenCOMPONENT_NAME= libxml2
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_VERSION= 2.9.4
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCOMPONENT_PROJECT_URL= http://xmlsoft.org/
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo SirainenCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_ARCHIVE_HASH= \
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen sha256:ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_ARCHIVE_URL= ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_BUGDB= library/libxml
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# W3C XML Conformance Test Suites
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_ARCHIVE_1= xmlts20080827.tar.gz
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_ARCHIVE_HASH_1= \
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen sha256:96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo SirainenCOMPONENT_ARCHIVE_URL_1= http://www.w3.org/XML/Test/$(COMPONENT_ARCHIVE_1)
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Sirainen
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo SirainenTPNO= 29079
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Siraineninclude $(WS_MAKE_RULES)/prep.mk
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Siraineninclude $(WS_MAKE_RULES)/configure.mk
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Siraineninclude $(WS_MAKE_RULES)/ips.mk
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Siraineninclude $(WS_MAKE_RULES)/lint-libraries.mk
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen
b66d803de86bfb411165b3465b0d9ef64ecfe2a1Timo SirainenASLR_MODE = $(ASLR_ENABLE)
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCFLAGS += $(CPP_LARGEFILES)
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo SirainenLDFLAGS += $(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Sirainen
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Sirainen# Once Python 2.6 goes away, the various POST_*_ACTIONs below can be simplified.
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo SirainenPYTHON_VERSION=2.6
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Sirainen
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo SirainenCONFIGURE_OPTIONS += --disable-static
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCONFIGURE_OPTIONS += --with-pic
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCONFIGURE_OPTIONS += --with-threads
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo SirainenCONFIGURE_OPTIONS += --with-python-install-dir=$(PYTHON_VENDOR_PACKAGES)
12224fcf2de6724c89f63c0f9ee857f28a270df5Timo Sirainen# Cannot link to lzma since it's not in /lib.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCONFIGURE_OPTIONS += --without-lzma
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# After we have configured, make a copy of the python bits so we can build and
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# test separate python 2.7 and 3.4 support. Note for 3.4: .py files need to
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# go in .../vendor-packages (whether building 32-bit or 64-bit) whereas .so
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# files need to go in .../vendor-packages for 32-bit but .../vendor-packages/64
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# for 64-bit. For 2.6 and 2.7, Python is built 32- and 64-bit, so .py files
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# end up in both places even though only the 32-bit location is needed, but the
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# superfluous files in the proto area are harmless; meanwhile, the .so files
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# end up in their proper 32- and 64-bit locations. But Python 3.4 is built
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# 64-bit only, so we have an extra sed edit below to force the .py files into
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# the 32-bit location and we manually specify the 32-bit path in the manifest
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# to correct for the .so file being installed there instead of the 64-bit path
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# where it belongs. Further, Python 3.4 needs an extra 'm' on the link and
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# include paths, plus a tweak to the binary path; see PEP 3149 for details.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_POST_CONFIGURE_ACTION = \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen (cd $(@D) ; cp -rp python python2.7 ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(GSED) -i -e 's/2[.]6/2.7/g' `find python2.7 -name Makefile` ; \
f77da594de6318312a7f31589c9e4c38e2b74c73Timo Sirainen cd $(@D) ; cp -rp python python3.4 ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(GSED) -i -e 's|-lpython2[.]6|-lpython3.4m|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen -e 's|usr/bin/$(MACH64)/python2[.]6|usr/bin/python3.4m|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen -e 's|usr/include/python2[.]6|usr/include/python3.4m|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen -e 's/2[.]6/3.4/g' -e 's|vendor-packages/64|vendor-packages|' \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen `find python3.4 -name Makefile` ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# After we have built/installed libxml2, build/install the python
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# support for python 2.7 and 3.4
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_POST_INSTALL_ACTION = \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_INSTALL_ARGS) install ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen [ $(BITS) -eq 64 ] && cd $(@D)/python3.4 ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(GMAKE) $(COMPONENT_INSTALL_ARGS) install)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# It's nice to test also python 2.7 and 3.4 modules.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_POST_TEST_ACTION = \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen (cd $(@D)/python2.7 ; $(GMAKE) $(COMPONENT_TEST_ARGS) test ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen [ $(BITS) -eq 64 ] && cd $(@D)/python3.4 ; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(GMAKE) $(COMPONENT_TEST_ARGS) test)
f77da594de6318312a7f31589c9e4c38e2b74c73Timo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# We have patched our 64 bit python so it will search for modules only in
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# '64/' directories. Now we need to provide one. Otherwise python will
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# end up using libxml2mod.so installed on system.
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen$(BUILD_DIR)/$(MACH64)/.tested: COMPONENT_PRE_TEST_ACTION = ( \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(MKDIR) $(@D)/python/.libs/64 \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(@D)/python2.7/.libs/64 \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(@D)/python3.4/.libs/64; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(SYMLINK) ../libxml2mod.so $(@D)/python/.libs/64/libxml2mod.so; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(SYMLINK) ../libxml2mod.so $(@D)/python2.7/.libs/64/libxml2mod.so; \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(SYMLINK) ../libxml2mod.so $(@D)/python3.4/.libs/64/libxml2mod.so);
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenCOMPONENT_PRE_TEST_ACTION += \
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen (cd $(@D) ; gtar xf $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_1));
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen# common targets
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainenconfigure: $(CONFIGURE_32_and_64)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainenbuild: $(BUILD_32_and_64)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Siraineninstall: $(INSTALL_32_and_64)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(PYTHON.2.6.32) -m compileall $(PROTO_DIR)/usr/lib/python2.6/vendor-packages
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(PYTHON.2.7.32) -m compileall $(PROTO_DIR)/usr/lib/python2.7/vendor-packages
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen $(PYTHON.3.4.64) -m compileall $(PROTO_DIR)/usr/lib/python3.4/vendor-packages
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainentest: $(TEST_32_and_64)
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += library/libxml2
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += library/zlib
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += runtime/python-26
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += runtime/python-27
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += runtime/python-34
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += shell/ksh93
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += system/library
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += system/library/math
4eecd3e2aadb20768a60f701e329b4345d04430cTimo SirainenREQUIRED_PACKAGES += system/linker
4eecd3e2aadb20768a60f701e329b4345d04430cTimo Sirainen