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