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#
5680N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
184N/A#
184N/A
5680N/ABUILD_BITS= 64_and_32
184N/Ainclude ../../make-rules/shared-macros.mk
184N/A
184N/ACOMPONENT_NAME= zlib
2893N/ACOMPONENT_VERSION= 1.2.8
618N/ACOMPONENT_PROJECT_URL= http://www.zlib.net/
844N/ACOMPONENT_ARCHIVE_HASH= \
2893N/A sha256:36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
184N/ACOMPONENT_ARCHIVE_URL= http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
1258N/ACOMPONENT_BUGDB= library/libz
184N/A
2899N/ATPNO= 17611
2899N/A
5123N/A# Omit directory options that cause zlib's CMake-based build to fail.
5123N/ACONFIGURE_DEFAULT_DIRS=no
5680N/Ainclude $(WS_MAKE_RULES)/common.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
2893N/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
2893N/APIC_OBJA=$(CAP_OBJS)
881N/Aendif
184N/A
2893N/A# Avoid *.lo.bc from Parfait analyze (see also parfait.patch).
2893N/APARFAIT += -X *.lo.bc
2893N/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.
5680N/ACONFIGURE_OPTIONS += --shared
5680N/ACONFIGURE_OPTIONS.64 += --libdir=$(USRLIBDIR64)
184N/A
5680N/ACFLAGS.studio += -xalias_level=basic -xdepend
5680N/A
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.
2893N/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; \
2893N/A $(ENV) SUBDIRS="sun4v" BUILD_ARCH=$* CC=$(CC) $(GMAKE) build )
184N/A
184N/ACOMPONENT_TEST_TARGETS = test
184N/A
5058N/ACOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
5058N/A
5058N/ACOMPONENT_TEST_TRANSFORMS += '-e "/^zlib version/s/0x..$$/0xXX/" '
5058N/A
5058N/ACOMPONENT_SYSTEM_TEST_TARGETS= test SYSTEM_TEST=1
5058N/A
5680N/ACLEAN_PATHS += $(PROTO_DIR) capabilities/*/*/*.o capabilities/*/$(MACH32)/*.s
184N/A
5680N/Asystem-test: build $(SYSTEM_TEST_32_and_64)
4337N/A