Makefile revision 3670
8495845a800cf09321436aed996188c9a92cd647bnicholes#
8495845a800cf09321436aed996188c9a92cd647bnicholes# CDDL HEADER START
8495845a800cf09321436aed996188c9a92cd647bnicholes#
8495845a800cf09321436aed996188c9a92cd647bnicholes# The contents of this file are subject to the terms of the
8495845a800cf09321436aed996188c9a92cd647bnicholes# Common Development and Distribution License (the "License").
8495845a800cf09321436aed996188c9a92cd647bnicholes# You may not use this file except in compliance with the License.
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg#
8495845a800cf09321436aed996188c9a92cd647bnicholes# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8495845a800cf09321436aed996188c9a92cd647bnicholes# or http://www.opensolaris.org/os/licensing.
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# See the License for the specific language governing permissions
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# and limitations under the License.
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg#
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# When distributing Covered Code, include this CDDL HEADER in each
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# If applicable, add the following below this CDDL HEADER, with the
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg# fields enclosed by brackets "[]" replaced with your own identifying
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg# information: Portions Copyright [yyyy] [name of copyright owner]
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg#
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg# CDDL HEADER END
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg#
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg#
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg#
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg
f43432d112920ab9af58aecc78d9fd5bacefc216fuankginclude ../../make-rules/shared-macros.mk
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgCOMPONENT_NAME= zlib
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgCOMPONENT_VERSION= 1.2.8
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgCOMPONENT_PROJECT_URL= http://www.zlib.net/
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgCOMPONENT_ARCHIVE_HASH= \
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg sha256:36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgCOMPONENT_ARCHIVE_URL= http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
5594e2aca1550d202df69bf273a876de2ccf01d4fuankgCOMPONENT_BUGDB= library/libz
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgTPNO= 17611
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg
5594e2aca1550d202df69bf273a876de2ccf01d4fuankginclude ../../make-rules/prep.mk
8495845a800cf09321436aed996188c9a92cd647bnicholesinclude ../../make-rules/configure.mk
8495845a800cf09321436aed996188c9a92cd647bnicholesinclude ../../make-rules/ips.mk
8495845a800cf09321436aed996188c9a92cd647bnicholesinclude ../../make-rules/lint-libraries.mk
8495845a800cf09321436aed996188c9a92cd647bnicholes
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg#
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# We want to build hardware specific versions of the longest_match()
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg# function into our shared library that has been hand optimised to use
f43432d112920ab9af58aecc78d9fd5bacefc216fuankg# some machine architecture specific instructions. Currently, we are doing
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# it for the T4 architecture, but later other architectures may be added.
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# This is done by taking advantage of the Solaris 11 linker-editor
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# "Symbol Capabilities" feature. Refer to the section "Creating a Family
8495845a800cf09321436aed996188c9a92cd647bnicholes# of Symbol Capabilities Functions", under "Identifying Capability
8495845a800cf09321436aed996188c9a92cd647bnicholes# Requirements" in the "Linker and Libraries Guide"
8495845a800cf09321436aed996188c9a92cd647bnicholes# (http://docs.oracle.com/cd/E19963-01/html/819-0690/chapter2-13.html#giskh).
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholesCAP_OBJS_sparcv7 += ../../capabilities/sun4v/sparcv7/symcap.o
c5ef27ed1cf15c6b6345335c51416d2ea36198bfbnicholesCAP_OBJS_sparcv9 += ../../capabilities/sun4v/sparcv9/symcap.o
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes$(BUILD_DIR)/%/.built: CAP_OBJS=$(CAP_OBJS_$*)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholes# Zlib won't build without cloning. We need also to get rid of default
8495845a800cf09321436aed996188c9a92cd647bnicholes# Makefile and get our own version of zconf.h to avoid interactions
8495845a800cf09321436aed996188c9a92cd647bnicholes# between 32 and 64 bit builds.
8495845a800cf09321436aed996188c9a92cd647bnicholes# Also, the x86 architecture does not require alignment for multi-byte
8495845a800cf09321436aed996188c9a92cd647bnicholes# loads, so we can define UNALIGNED_OK for x86
8495845a800cf09321436aed996188c9a92cd647bnicholesifeq ($(MACH), i386)
8495845a800cf09321436aed996188c9a92cd647bnicholesCOMPONENT_PRE_CONFIGURE_ACTION = ( \
8495845a800cf09321436aed996188c9a92cd647bnicholes $(CLONEY) $(SOURCE_DIR) $(@D); \
8495845a800cf09321436aed996188c9a92cd647bnicholes $(RM) $(@D)/Makefile $(@D)/zconf.h; \
8495845a800cf09321436aed996188c9a92cd647bnicholes $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
5594e2aca1550d202df69bf273a876de2ccf01d4fuankgCFLAGS_EXTRA = -DUNALIGNED_OK -DORIG_LONGEST_MATCH_GLOBAL
8495845a800cf09321436aed996188c9a92cd647bnicholesPIC_OBJA=
5594e2aca1550d202df69bf273a876de2ccf01d4fuankgelse
8495845a800cf09321436aed996188c9a92cd647bnicholesCOMPONENT_PRE_CONFIGURE_ACTION = ( \
8495845a800cf09321436aed996188c9a92cd647bnicholes $(CLONEY) $(SOURCE_DIR) $(@D); \
8495845a800cf09321436aed996188c9a92cd647bnicholes $(RM) $(@D)/Makefile $(@D)/zconf.h; \
8495845a800cf09321436aed996188c9a92cd647bnicholes $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
8495845a800cf09321436aed996188c9a92cd647bnicholesCFLAGS_EXTRA = -DORIG_LONGEST_MATCH_GLOBAL -xinline=%auto,no%longest_match
8495845a800cf09321436aed996188c9a92cd647bnicholesPIC_OBJA=$(CAP_OBJS)
f43432d112920ab9af58aecc78d9fd5bacefc216fuankgendif
8495845a800cf09321436aed996188c9a92cd647bnicholes
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg# Avoid *.lo.bc from Parfait analyze (see also parfait.patch).
8495845a800cf09321436aed996188c9a92cd647bnicholesPARFAIT += -X *.lo.bc
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesCFLAGS += $(CC_PIC)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesCFLAGS += $(CFLAGS_EXTRA)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholes# We need to reset configure options here because zlib is confused with
8495845a800cf09321436aed996188c9a92cd647bnicholes# CC and CFLAGS definitions as configure parameters.
8495845a800cf09321436aed996188c9a92cd647bnicholesCONFIGURE_OPTIONS = --shared
8495845a800cf09321436aed996188c9a92cd647bnicholesCONFIGURE_OPTIONS += --prefix=/usr
8495845a800cf09321436aed996188c9a92cd647bnicholesCONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
8495845a800cf09321436aed996188c9a92cd647bnicholesCONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesCONFIGURE_ENV += CC="$(CC)"
8495845a800cf09321436aed996188c9a92cd647bnicholesCONFIGURE_ENV += CFLAGS="$(CFLAGS) -xalias_level=basic -xdepend"
8495845a800cf09321436aed996188c9a92cd647bnicholesCONFIGURE_ENV += LDSHARED="$(CC) $(CFLAGS) -G"
5594e2aca1550d202df69bf273a876de2ccf01d4fuankg
8495845a800cf09321436aed996188c9a92cd647bnicholes# This LDSHARED definitions is forced to get all required options plus
8495845a800cf09321436aed996188c9a92cd647bnicholes# mapfile for result linking. While the one used with configure is just
8495845a800cf09321436aed996188c9a92cd647bnicholes# to allow Zlib detect capability of creating shared libraries.
8495845a800cf09321436aed996188c9a92cd647bnicholesCOMPONENT_BUILD_ARGS = LDSHARED="$(CC) $(CFLAGS) -G -h libz.so.1 $(LD_OPTIONS_SO) -M ../../mapfile -L." PIC_OBJA=$(PIC_OBJA)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholes$(BUILD_DIR)/sparc%/.built: COMPONENT_PRE_BUILD_ACTION = ( \
8495845a800cf09321436aed996188c9a92cd647bnicholes cd capabilities; \
8495845a800cf09321436aed996188c9a92cd647bnicholes $(ENV) SUBDIRS="sun4v" BUILD_ARCH=$* $(GMAKE) build )
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesCOMPONENT_TEST_TARGETS = test
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesbuild: $(BUILD_32_and_64)
8495845a800cf09321436aed996188c9a92cd647bnicholes
5594e2aca1550d202df69bf273a876de2ccf01d4fuankginstall: $(INSTALL_32_and_64)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholestest: $(TEST_32_and_64)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesclean::
8495845a800cf09321436aed996188c9a92cd647bnicholes $(RM) -r $(BUILD_DIR) $(PROTO_DIR) capabilities/*/*/*.o
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
8495845a800cf09321436aed996188c9a92cd647bnicholes
8495845a800cf09321436aed996188c9a92cd647bnicholesinclude ../../make-rules/depend.mk
8495845a800cf09321436aed996188c9a92cd647bnicholes