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