components/zlib/Makefile
author Rich Burridge <rich.burridge@oracle.com>
Tue, 20 Nov 2012 15:20:49 -0800
changeset 1058 34d7aaa03423
parent 825 78809aba88fe
child 1945 3dc1935a2189
child 3661 47545fb8aed4
permissions -rw-r--r--
15886624 Auto-generation of Userland gate list - Phase 3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     1
#
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     2
# CDDL HEADER START
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     3
#
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     7
#
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    11
# and limitations under the License.
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    12
#
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    18
#
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    19
# CDDL HEADER END
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    20
#
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    21
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    22
#
800
2ad056ed89ec 7163771 sha1 should not be used in userland-fetch and userland component/*/Makefile
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 609
diff changeset
    23
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    24
#
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    25
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    26
include ../../make-rules/shared-macros.mk
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    27
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    28
COMPONENT_NAME=		zlib
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    29
COMPONENT_VERSION=	1.2.3
609
775168282b2f 7037821 Userland migration of data from Makefile to manifest may have been a little overzealous
Rich Burridge <rich.burridge@oracle.com>
parents: 184
diff changeset
    30
COMPONENT_PROJECT_URL=	http://www.zlib.net/
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    31
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    32
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
800
2ad056ed89ec 7163771 sha1 should not be used in userland-fetch and userland component/*/Makefile
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 609
diff changeset
    33
COMPONENT_ARCHIVE_HASH=	\
2ad056ed89ec 7163771 sha1 should not be used in userland-fetch and userland component/*/Makefile
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 609
diff changeset
    34
    sha256:1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    35
COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
1058
34d7aaa03423 15886624 Auto-generation of Userland gate list - Phase 3
Rich Burridge <rich.burridge@oracle.com>
parents: 825
diff changeset
    36
COMPONENT_BUGDB=	library/libz
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    37
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    38
include ../../make-rules/prep.mk
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    39
include ../../make-rules/configure.mk
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    40
include ../../make-rules/ips.mk
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    41
include ../../make-rules/lint-libraries.mk
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    42
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    43
#
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    44
# We want to build hardware specific versions of the longest_match()
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    45
# function into our shared library that has been hand optimised to use
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    46
# some machine architecture specific instructions. Currently, we are doing
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    47
# it for the T4 architecture, but later other architectures may be added.
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    48
# This is done by taking advantage of the Solaris 11 linker-editor
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    49
# "Symbol Capabilities" feature.  Refer to the section "Creating a Family
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    50
# of Symbol Capabilities Functions", under "Identifying Capability
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    51
# Requirements" in the "Linker and Libraries Guide"
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    52
# (http://docs.oracle.com/cd/E19963-01/html/819-0690/chapter2-13.html#giskh).
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    53
CAP_OBJS_sparcv7 += ../../capabilities/sun4v/sparcv7/symcap.o 
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    54
CAP_OBJS_sparcv9 += ../../capabilities/sun4v/sparcv9/symcap.o 
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    55
$(BUILD_DIR)/%/.built: CAP_OBJS=$(CAP_OBJS_$*)
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    56
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    57
# Zlib won't build without cloning. We need also to get rid of default
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    58
# Makefile and get our own version of zconf.h to avoid interactions
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    59
# between 32 and 64 bit builds.
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    60
# Also, the x86 architecture does not require alignment for multi-byte
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    61
# loads, so we can define UNALIGNED_OK for x86
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    62
ifeq ($(MACH), i386)
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    63
COMPONENT_PRE_CONFIGURE_ACTION = ( \
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    64
	$(CLONEY) $(SOURCE_DIR) $(@D); \
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    65
	$(RM) $(@D)/Makefile $(@D)/zconf.h; \
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    66
	$(CP) $(SOURCE_DIR)/zconf.h $(@D) )
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    67
CFLAGS_EXTRA = -DUNALIGNED_OK -DORIG_LONGEST_MATCH_GLOBAL
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    68
PIC_OBJS =
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    69
else
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    70
COMPONENT_PRE_CONFIGURE_ACTION = ( \
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    71
	$(CLONEY) $(SOURCE_DIR) $(@D); \
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    72
	$(RM) $(@D)/Makefile $(@D)/zconf.h; \
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    73
	$(CP) $(SOURCE_DIR)/zconf.h $(@D) )
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    74
CFLAGS_EXTRA = -DORIG_LONGEST_MATCH_GLOBAL -xinline=%auto,no%longest_match
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    75
PIC_OBJS=$(CAP_OBJS)
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    76
endif
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    77
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    78
CFLAGS += $(CC_PIC)
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    79
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    80
CFLAGS += $(CFLAGS_EXTRA)
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    81
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    82
# We need to reset configure options here because zlib is confused with
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    83
# CC and CFLAGS definitions as configure parameters.
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    84
CONFIGURE_OPTIONS	=  --shared
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    85
CONFIGURE_OPTIONS	+= --prefix=/usr
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    86
CONFIGURE_OPTIONS	+= $(CONFIGURE_OPTIONS.$(BITS))
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    87
CONFIGURE_OPTIONS.64	+= --libdir=/usr/lib/$(MACH64)
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    88
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    89
CONFIGURE_ENV += CC="$(CC)"
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    90
CONFIGURE_ENV += CFLAGS="$(CFLAGS) -xalias_level=basic -xdepend"
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    91
CONFIGURE_ENV += LDSHARED="$(CC) $(CFLAGS) -G"
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    92
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    93
# This LDSHARED definitions is forced to get all required options plus
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    94
# mapfile for result linking. While the one used with configure is just
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    95
# to allow Zlib detect capability of creating shared libraries.
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    96
COMPONENT_BUILD_ARGS = LDSHARED="$(CC) $(CFLAGS) -G -h libz.so.1 $(LD_OPTIONS_SO) -M ../../mapfile -L." PIC_OBJS=$(PIC_OBJS)
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    97
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    98
$(BUILD_DIR)/sparc%/.built: COMPONENT_PRE_BUILD_ACTION = ( \
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
    99
	cd capabilities; \
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
   100
	$(ENV) SUBDIRS="sun4v" BUILD_ARCH=$* $(GMAKE) build )
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   101
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   102
COMPONENT_TEST_TARGETS = test
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   103
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   104
build:		$(BUILD_32_and_64)
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   105
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   106
install:	$(INSTALL_32_and_64)
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   107
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   108
test:		$(TEST_32_and_64)
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   109
825
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
   110
clean::
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
   111
	$(RM) -r $(BUILD_DIR) $(PROTO_DIR) capabilities/*/*/*.o
78809aba88fe 7102535 libz.so performance on Solaris needs significant improvement
Ferenc Rakoczi <Ferenc.Rakoczi@Sun.COM>
parents: 800
diff changeset
   112
184
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   113
BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   114
037c654f48d9 7036217 move zlib to userland
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
   115
include ../../make-rules/depend.mk