Makefile revision 3996
127N/A#
127N/A# CDDL HEADER START
127N/A#
127N/A# The contents of this file are subject to the terms of the
127N/A# Common Development and Distribution License (the "License").
127N/A# You may not use this file except in compliance with the License.
127N/A#
127N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
127N/A# or http://www.opensolaris.org/os/licensing.
127N/A# See the License for the specific language governing permissions
127N/A# and limitations under the License.
127N/A#
127N/A# When distributing Covered Code, include this CDDL HEADER in each
127N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
127N/A# If applicable, add the following below this CDDL HEADER, with the
127N/A# fields enclosed by brackets "[]" replaced with your own identifying
127N/A# information: Portions Copyright [yyyy] [name of copyright owner]
127N/A#
127N/A# CDDL HEADER END
127N/A#
127N/A
127N/A#
3996N/A# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
127N/A#
127N/A
127N/Ainclude ../../make-rules/shared-macros.mk
127N/A
127N/ACOMPONENT_NAME= zlib
729N/ACOMPONENT_VERSION= 1.2.8
618N/ACOMPONENT_PROJECT_URL= http://www.zlib.net/
127N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
127N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
844N/ACOMPONENT_ARCHIVE_HASH= \
844N/A sha256:36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d
127N/ACOMPONENT_ARCHIVE_URL= http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
1273N/ACOMPONENT_BUGDB= library/libz
127N/A
3661N/ATPNO= 17611
3661N/A
729N/Ainclude $(WS_MAKE_RULES)/prep.mk
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#
844N/A# We want to build hardware specific versions of the longest_match()
844N/A# function into our shared library that has been hand optimised to use
729N/A# some machine architecture specific instructions. Currently, we are doing
729N/A# it for the T4 architecture, but later other architectures may be added.
729N/A# This is done by taking advantage of the Solaris 11 linker-editor
3996N/A# "Symbol Capabilities" feature. Refer to the section "Creating a Family
3996N/A# of Symbol Capabilities Functions", under "Identifying Capability
3996N/A# Requirements" in the "Linker and Libraries Guide"
127N/A# (http://docs.oracle.com/cd/E19963-01/html/819-0690/chapter2-13.html#giskh).
127N/ACAP_OBJS_sparcv7 += ../../capabilities/sun4v/sparcv7/symcap.o
127N/ACAP_OBJS_sparcv9 += ../../capabilities/sun4v/sparcv9/symcap.o
127N/A$(BUILD_DIR)/%/.built: CAP_OBJS=$(CAP_OBJS_$*)
127N/A
127N/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.
751N/A# Also, the x86 architecture does not require alignment for multi-byte
751N/A# loads, so we can define UNALIGNED_OK for x86
751N/Aifeq ($(MACH), i386)
751N/ACOMPONENT_PRE_CONFIGURE_ACTION = ( \
751N/A $(CLONEY) $(SOURCE_DIR) $(@D); \
751N/A $(RM) $(@D)/Makefile $(@D)/zconf.h; \
751N/A $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
751N/ACFLAGS_EXTRA = -DUNALIGNED_OK -DORIG_LONGEST_MATCH_GLOBAL
751N/APIC_OBJA=
751N/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 += --prefix=/usr
729N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
729N/ACONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64)
729N/A
729N/ACONFIGURE_ENV += CC="$(CC)"
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; \
913N/A $(ENV) SUBDIRS="sun4v" BUILD_ARCH=$* $(GMAKE) build )
729N/A
127N/ACOMPONENT_TEST_TARGETS = test
127N/A
127N/Abuild: $(BUILD_32_and_64)
127N/A
127N/Ainstall: $(INSTALL_32_and_64)
181N/A
181N/Atest: $(TEST_32_and_64)
127N/A
3996N/Aclean::
3996N/A $(RM) -r $(BUILD_DIR) $(PROTO_DIR) capabilities/*/*/*.o
3996N/A
3996N/A
3996N/AREQUIRED_PACKAGES += system/library
3996N/A