184N/A#
184N/A# CDDL HEADER START
184N/A#
184N/A# The contents of this file are subject to the terms of the
184N/A# Common Development and Distribution License (the "License").
184N/A# You may not use this file except in compliance with the License.
184N/A#
184N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
184N/A# or http://www.opensolaris.org/os/licensing.
184N/A# See the License for the specific language governing permissions
184N/A# and limitations under the License.
184N/A#
184N/A# When distributing Covered Code, include this CDDL HEADER in each
184N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
184N/A# If applicable, add the following below this CDDL HEADER, with the
184N/A# fields enclosed by brackets "[]" replaced with your own identifying
184N/A# information: Portions Copyright [yyyy] [name of copyright owner]
184N/A#
184N/A# CDDL HEADER END
184N/A#
184N/A
184N/A#
3670N/A# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
184N/A#
184N/A
184N/Ainclude ../../make-rules/shared-macros.mk
184N/A
184N/ACOMPONENT_NAME= zlib
3670N/ACOMPONENT_VERSION= 1.2.8
618N/ACOMPONENT_PROJECT_URL= http://www.zlib.net/
184N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
184N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
844N/ACOMPONENT_ARCHIVE_HASH= \
3670N/A sha256:36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
184N/ACOMPONENT_ARCHIVE_URL= http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
1273N/ACOMPONENT_BUGDB= library/libz
184N/A
3670N/ATPNO= 17611
3661N/A
3996N/Ainclude $(WS_MAKE_RULES)/prep.mk
3996N/Ainclude $(WS_MAKE_RULES)/configure.mk
3996N/Ainclude $(WS_MAKE_RULES)/ips.mk
3996N/Ainclude $(WS_MAKE_RULES)/lint-libraries.mk
184N/A
881N/A#
881N/A# We want to build hardware specific versions of the longest_match()
881N/A# function into our shared library that has been hand optimised to use
881N/A# some machine architecture specific instructions. Currently, we are doing
881N/A# it for the T4 architecture, but later other architectures may be added.
881N/A# This is done by taking advantage of the Solaris 11 linker-editor
881N/A# "Symbol Capabilities" feature. Refer to the section "Creating a Family
881N/A# of Symbol Capabilities Functions", under "Identifying Capability
881N/A# Requirements" in the "Linker and Libraries Guide"
881N/A# (http://docs.oracle.com/cd/E19963-01/html/819-0690/chapter2-13.html#giskh).
881N/ACAP_OBJS_sparcv7 += ../../capabilities/sun4v/sparcv7/symcap.o
881N/ACAP_OBJS_sparcv9 += ../../capabilities/sun4v/sparcv9/symcap.o
881N/A$(BUILD_DIR)/%/.built: CAP_OBJS=$(CAP_OBJS_$*)
881N/A
184N/A# Zlib won't build without cloning. We need also to get rid of default
881N/A# Makefile and get our own version of zconf.h to avoid interactions
184N/A# between 32 and 64 bit builds.
881N/A# Also, the x86 architecture does not require alignment for multi-byte
881N/A# loads, so we can define UNALIGNED_OK for x86
881N/Aifeq ($(MACH), i386)
184N/ACOMPONENT_PRE_CONFIGURE_ACTION = ( \
184N/A $(CLONEY) $(SOURCE_DIR) $(@D); \
184N/A $(RM) $(@D)/Makefile $(@D)/zconf.h; \
184N/A $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
881N/ACFLAGS_EXTRA = -DUNALIGNED_OK -DORIG_LONGEST_MATCH_GLOBAL
3670N/APIC_OBJA=
881N/Aelse
881N/ACOMPONENT_PRE_CONFIGURE_ACTION = ( \
881N/A $(CLONEY) $(SOURCE_DIR) $(@D); \
881N/A $(RM) $(@D)/Makefile $(@D)/zconf.h; \
881N/A $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
881N/ACFLAGS_EXTRA = -DORIG_LONGEST_MATCH_GLOBAL -xinline=%auto,no%longest_match
3670N/APIC_OBJA=$(CAP_OBJS)
881N/Aendif
184N/A
3670N/A# Avoid *.lo.bc from Parfait analyze (see also parfait.patch).
3670N/APARFAIT += -X *.lo.bc
3670N/A
881N/ACFLAGS += $(CC_PIC)
881N/A
881N/ACFLAGS += $(CFLAGS_EXTRA)
184N/A
184N/A# We need to reset configure options here because zlib is confused with
184N/A# CC and CFLAGS definitions as configure parameters.
184N/ACONFIGURE_OPTIONS = --shared
184N/ACONFIGURE_OPTIONS += --prefix=/usr
184N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
184N/ACONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64)
184N/A
184N/ACONFIGURE_ENV += CC="$(CC)"
881N/ACONFIGURE_ENV += CFLAGS="$(CFLAGS) -xalias_level=basic -xdepend"
184N/ACONFIGURE_ENV += LDSHARED="$(CC) $(CFLAGS) -G"
184N/A
184N/A# This LDSHARED definitions is forced to get all required options plus
184N/A# mapfile for result linking. While the one used with configure is just
184N/A# to allow Zlib detect capability of creating shared libraries.
3670N/ACOMPONENT_BUILD_ARGS = LDSHARED="$(CC) $(CFLAGS) -G -h libz.so.1 $(LD_OPTIONS_SO) -M ../../mapfile -L." PIC_OBJA=$(PIC_OBJA)
881N/A
881N/A$(BUILD_DIR)/sparc%/.built: COMPONENT_PRE_BUILD_ACTION = ( \
881N/A cd capabilities; \
881N/A $(ENV) SUBDIRS="sun4v" BUILD_ARCH=$* $(GMAKE) build )
184N/A
184N/ACOMPONENT_TEST_TARGETS = test
184N/A
184N/Abuild: $(BUILD_32_and_64)
184N/A
184N/Ainstall: $(INSTALL_32_and_64)
184N/A
184N/Atest: $(TEST_32_and_64)
184N/A
881N/Aclean::
881N/A $(RM) -r $(BUILD_DIR) $(PROTO_DIR) capabilities/*/*/*.o
881N/A
184N/A
3996N/AREQUIRED_PACKAGES += system/library