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