Makefile revision 618
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# CDDL HEADER START
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# The contents of this file are subject to the terms of the
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# Common Development and Distribution License (the "License").
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# You may not use this file except in compliance with the License.
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# or http://www.opensolaris.org/os/licensing.
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# See the License for the specific language governing permissions
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# and limitations under the License.
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# When distributing Covered Code, include this CDDL HEADER in each
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# If applicable, add the following below this CDDL HEADER, with the
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# fields enclosed by brackets "[]" replaced with your own identifying
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# information: Portions Copyright [yyyy] [name of copyright owner]
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# CDDL HEADER END
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus#
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusinclude ../../make-rules/shared-macros.mk
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_NAME= zlib
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_VERSION= 1.2.3
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_PROJECT_URL= http://www.zlib.net/
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_ARCHIVE_HASH= sha1:60faeaaf250642db5c0ea36cd6dcc9f99c8f3902
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_ARCHIVE_URL= http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusinclude ../../make-rules/prep.mk
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusinclude ../../make-rules/configure.mk
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusinclude ../../make-rules/ips.mk
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusinclude ../../make-rules/lint-libraries.mk
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# Zlib won't build without cloning. We need also to get rid of default
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# Makefile and get our own version of zlib.h to avoid interactions
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus# between 32 and 64 bit builds.
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikusCOMPONENT_PRE_CONFIGURE_ACTION = ( \
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus $(CLONEY) $(SOURCE_DIR) $(@D); \
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus $(RM) $(@D)/Makefile $(@D)/zconf.h; \
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus $(CP) $(SOURCE_DIR)/zconf.h $(@D) )
5a3bd0ef762b8a3238869ac9963194555e39e6a7jpikus
CFLAGS += $(CC_PIC)
# We need to reset configure options here because zlib is confused with
# CC and CFLAGS definitions as configure parameters.
CONFIGURE_OPTIONS = --shared
CONFIGURE_OPTIONS += --prefix=/usr
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
CONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64)
CONFIGURE_ENV += CC="$(CC)"
CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
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."
COMPONENT_TEST_TARGETS = test
build: $(BUILD_32_and_64)
install: $(INSTALL_32_and_64)
test: $(TEST_32_and_64)
BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
include ../../make-rules/depend.mk