Makefile revision 1273
330c042543440d0987244c94c65d14eeb7af0868rbb#
962f339c5f0f61adde79936f610fb05ce0854d6echuck# CDDL HEADER START
962f339c5f0f61adde79936f610fb05ce0854d6echuck#
962f339c5f0f61adde79936f610fb05ce0854d6echuck# The contents of this file are subject to the terms of the
962f339c5f0f61adde79936f610fb05ce0854d6echuck# Common Development and Distribution License (the "License").
157e6980a24a44e4719173b1c555133caecbc172stoddard# You may not use this file except in compliance with the License.
157e6980a24a44e4719173b1c555133caecbc172stoddard#
157e6980a24a44e4719173b1c555133caecbc172stoddard# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
157e6980a24a44e4719173b1c555133caecbc172stoddard# or http://www.opensolaris.org/os/licensing.
faa6e5d8b210456ae4dad0398dfa40a19fd89d59coar# See the License for the specific language governing permissions
171f8c636ff1374e3a3dfff333211becda355b98trawick# and limitations under the License.
171f8c636ff1374e3a3dfff333211becda355b98trawick#
171f8c636ff1374e3a3dfff333211becda355b98trawick# When distributing Covered Code, include this CDDL HEADER in each
171f8c636ff1374e3a3dfff333211becda355b98trawick# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
171f8c636ff1374e3a3dfff333211becda355b98trawick# If applicable, add the following below this CDDL HEADER, with the
171f8c636ff1374e3a3dfff333211becda355b98trawick# fields enclosed by brackets "[]" replaced with your own identifying
faa6e5d8b210456ae4dad0398dfa40a19fd89d59coar# information: Portions Copyright [yyyy] [name of copyright owner]
faa6e5d8b210456ae4dad0398dfa40a19fd89d59coar#
faa6e5d8b210456ae4dad0398dfa40a19fd89d59coar# CDDL HEADER END
faa6e5d8b210456ae4dad0398dfa40a19fd89d59coar#
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddard
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddard#
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddard# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddard#
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddard
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddardinclude ../../make-rules/shared-macros.mk
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddard
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddardCOMPONENT_NAME= zlib
ed105ee460bbaf479f0aa0f59d3951da85066e27stoddardCOMPONENT_VERSION= 1.2.3
21b8c3cb46cea2b31a585a95ce9f93f4f6abc35brbbCOMPONENT_PROJECT_URL= http://www.zlib.net/
bae64a3e5bf7b96d8379e24f13273f26b3b29e16coarCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
bae64a3e5bf7b96d8379e24f13273f26b3b29e16coarCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
bae64a3e5bf7b96d8379e24f13273f26b3b29e16coarCOMPONENT_ARCHIVE_HASH= \
c7fe488773cf6f50a1b2d9211c2f30a2ace8b67ccoar sha256:1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e
c7fe488773cf6f50a1b2d9211c2f30a2ace8b67ccoarCOMPONENT_ARCHIVE_URL= http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
c7fe488773cf6f50a1b2d9211c2f30a2ace8b67ccoarCOMPONENT_BUGDB= library/libz
c7fe488773cf6f50a1b2d9211c2f30a2ace8b67ccoar
27338fc39af80f2f0e4a8dbdc90c8a8179a5b2e4rbbinclude ../../make-rules/prep.mk
27338fc39af80f2f0e4a8dbdc90c8a8179a5b2e4rbbinclude ../../make-rules/configure.mk
27338fc39af80f2f0e4a8dbdc90c8a8179a5b2e4rbbinclude ../../make-rules/ips.mk
27338fc39af80f2f0e4a8dbdc90c8a8179a5b2e4rbbinclude ../../make-rules/lint-libraries.mk
27338fc39af80f2f0e4a8dbdc90c8a8179a5b2e4rbb
27338fc39af80f2f0e4a8dbdc90c8a8179a5b2e4rbb#
853a0c44563b056e40e9cffe911190f554e63ec3chuck# We want to build hardware specific versions of the longest_match()
853a0c44563b056e40e9cffe911190f554e63ec3chuck# function into our shared library that has been hand optimised to use
853a0c44563b056e40e9cffe911190f554e63ec3chuck# some machine architecture specific instructions. Currently, we are doing
853a0c44563b056e40e9cffe911190f554e63ec3chuck# it for the T4 architecture, but later other architectures may be added.
330c042543440d0987244c94c65d14eeb7af0868rbb# This is done by taking advantage of the Solaris 11 linker-editor
330c042543440d0987244c94c65d14eeb7af0868rbb# "Symbol Capabilities" feature. Refer to the section "Creating a Family
f1fa5e69040a3a72054d185f6087a7d1592b83e8rbb# of Symbol Capabilities Functions", under "Identifying Capability
f1fa5e69040a3a72054d185f6087a7d1592b83e8rbb# Requirements" in the "Linker and Libraries Guide"
f1fa5e69040a3a72054d185f6087a7d1592b83e8rbb# (http://docs.oracle.com/cd/E19963-01/html/819-0690/chapter2-13.html#giskh).
f1fa5e69040a3a72054d185f6087a7d1592b83e8rbbCAP_OBJS_sparcv7 += ../../capabilities/sun4v/sparcv7/symcap.o
30e3e9b782c701f885583b7d13d8e46c37d7e1ddtrawickCAP_OBJS_sparcv9 += ../../capabilities/sun4v/sparcv9/symcap.o
30e3e9b782c701f885583b7d13d8e46c37d7e1ddtrawick$(BUILD_DIR)/%/.built: CAP_OBJS=$(CAP_OBJS_$*)
30e3e9b782c701f885583b7d13d8e46c37d7e1ddtrawick
30e3e9b782c701f885583b7d13d8e46c37d7e1ddtrawick# Zlib won't build without cloning. We need also to get rid of default
30e3e9b782c701f885583b7d13d8e46c37d7e1ddtrawick# Makefile and get our own version of zconf.h to avoid interactions
27faa3af8a50c1dc2dc6cb3049722378f85e5517rbb# between 32 and 64 bit builds.
27faa3af8a50c1dc2dc6cb3049722378f85e5517rbb# Also, the x86 architecture does not require alignment for multi-byte
27faa3af8a50c1dc2dc6cb3049722378f85e5517rbb# loads, so we can define UNALIGNED_OK for x86
141b1a93f508248cbc0e9a124cc38041eb3e2562rbbifeq ($(MACH), i386)
141b1a93f508248cbc0e9a124cc38041eb3e2562rbbCOMPONENT_PRE_CONFIGURE_ACTION = ( \
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb $(CLONEY) $(SOURCE_DIR) $(@D); \
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb $(RM) $(@D)/Makefile $(@D)/zconf.h; \
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
141b1a93f508248cbc0e9a124cc38041eb3e2562rbbCFLAGS_EXTRA = -DUNALIGNED_OK -DORIG_LONGEST_MATCH_GLOBAL
141b1a93f508248cbc0e9a124cc38041eb3e2562rbbPIC_OBJS =
865980dc9aeb61741e586502440f0c0fea4835c6trawickelse
865980dc9aeb61741e586502440f0c0fea4835c6trawickCOMPONENT_PRE_CONFIGURE_ACTION = ( \
865980dc9aeb61741e586502440f0c0fea4835c6trawick $(CLONEY) $(SOURCE_DIR) $(@D); \
865980dc9aeb61741e586502440f0c0fea4835c6trawick $(RM) $(@D)/Makefile $(@D)/zconf.h; \
865980dc9aeb61741e586502440f0c0fea4835c6trawick $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
865980dc9aeb61741e586502440f0c0fea4835c6trawickCFLAGS_EXTRA = -DORIG_LONGEST_MATCH_GLOBAL -xinline=%auto,no%longest_match
865980dc9aeb61741e586502440f0c0fea4835c6trawickPIC_OBJS=$(CAP_OBJS)
865980dc9aeb61741e586502440f0c0fea4835c6trawickendif
9a0d076511763b559a755133f6a182e6c24ef643rbb
9a0d076511763b559a755133f6a182e6c24ef643rbbCFLAGS += $(CC_PIC)
9a0d076511763b559a755133f6a182e6c24ef643rbb
9a0d076511763b559a755133f6a182e6c24ef643rbbCFLAGS += $(CFLAGS_EXTRA)
9a0d076511763b559a755133f6a182e6c24ef643rbb
b42a7e46e4f80282bd27e96d43c9510b14ccb9aarbb# We need to reset configure options here because zlib is confused with
b42a7e46e4f80282bd27e96d43c9510b14ccb9aarbb# CC and CFLAGS definitions as configure parameters.
b42a7e46e4f80282bd27e96d43c9510b14ccb9aarbbCONFIGURE_OPTIONS = --shared
b42a7e46e4f80282bd27e96d43c9510b14ccb9aarbbCONFIGURE_OPTIONS += --prefix=/usr
b42a7e46e4f80282bd27e96d43c9510b14ccb9aarbbCONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
6501b757f710f75d47c950300d8110aca67dc0b0rbbCONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64)
6501b757f710f75d47c950300d8110aca67dc0b0rbb
6501b757f710f75d47c950300d8110aca67dc0b0rbbCONFIGURE_ENV += CC="$(CC)"
6501b757f710f75d47c950300d8110aca67dc0b0rbbCONFIGURE_ENV += CFLAGS="$(CFLAGS) -xalias_level=basic -xdepend"
dfd4950edac888e671b96f62ff5382b7cb350d48rbbCONFIGURE_ENV += LDSHARED="$(CC) $(CFLAGS) -G"
dfd4950edac888e671b96f62ff5382b7cb350d48rbb
dfd4950edac888e671b96f62ff5382b7cb350d48rbb# This LDSHARED definitions is forced to get all required options plus
dfd4950edac888e671b96f62ff5382b7cb350d48rbb# mapfile for result linking. While the one used with configure is just
a6d4b3f8d54aaf14d8ee5dda3a09bf8b6370dfa4wrowe# to allow Zlib detect capability of creating shared libraries.
a6d4b3f8d54aaf14d8ee5dda3a09bf8b6370dfa4wroweCOMPONENT_BUILD_ARGS = LDSHARED="$(CC) $(CFLAGS) -G -h libz.so.1 $(LD_OPTIONS_SO) -M ../../mapfile -L." PIC_OBJS=$(PIC_OBJS)
c9a95767fbf0f5fb0976a06b97a256033925e433rbb
c9a95767fbf0f5fb0976a06b97a256033925e433rbb$(BUILD_DIR)/sparc%/.built: COMPONENT_PRE_BUILD_ACTION = ( \
c9a95767fbf0f5fb0976a06b97a256033925e433rbb cd capabilities; \
c9a95767fbf0f5fb0976a06b97a256033925e433rbb $(ENV) SUBDIRS="sun4v" BUILD_ARCH=$* $(GMAKE) build )
21b8c3cb46cea2b31a585a95ce9f93f4f6abc35brbb
d8d839738b1e80b0f9c54e83677b3f2c46c22705rbbCOMPONENT_TEST_TARGETS = test
d8d839738b1e80b0f9c54e83677b3f2c46c22705rbb
d8d839738b1e80b0f9c54e83677b3f2c46c22705rbbbuild: $(BUILD_32_and_64)
d8d839738b1e80b0f9c54e83677b3f2c46c22705rbb
adaea88da2d103e4302e361c932b98cee86fb1c5rbbinstall: $(INSTALL_32_and_64)
9635d7ffbd8ca441f85051f9a3adba17142d0b20rbb
9635d7ffbd8ca441f85051f9a3adba17142d0b20rbbtest: $(TEST_32_and_64)
9635d7ffbd8ca441f85051f9a3adba17142d0b20rbb
9635d7ffbd8ca441f85051f9a3adba17142d0b20rbbclean::
d8d839738b1e80b0f9c54e83677b3f2c46c22705rbb $(RM) -r $(BUILD_DIR) $(PROTO_DIR) capabilities/*/*/*.o
d8d839738b1e80b0f9c54e83677b3f2c46c22705rbb
0415e5e1b9b6eba6899a2e5ef18f8facb8db0cfbstoddardBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
0415e5e1b9b6eba6899a2e5ef18f8facb8db0cfbstoddard
0415e5e1b9b6eba6899a2e5ef18f8facb8db0cfbstoddardinclude ../../make-rules/depend.mk
0415e5e1b9b6eba6899a2e5ef18f8facb8db0cfbstoddard