components/zlib/Makefile
changeset 184 037c654f48d9
child 609 775168282b2f
equal deleted inserted replaced
183:587c9cdd9ea2 184:037c654f48d9
       
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     4 # The contents of this file are subject to the terms of the
       
     5 # Common Development and Distribution License (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 
       
    22 #
       
    23 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 
       
    26 include ../../make-rules/shared-macros.mk
       
    27 
       
    28 COMPONENT_NAME=		zlib
       
    29 COMPONENT_VERSION=	1.2.3
       
    30 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
       
    31 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
       
    32 COMPONENT_ARCHIVE_HASH=	sha1:60faeaaf250642db5c0ea36cd6dcc9f99c8f3902
       
    33 COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
       
    34 
       
    35 include ../../make-rules/prep.mk
       
    36 include ../../make-rules/configure.mk
       
    37 include ../../make-rules/ips.mk
       
    38 include ../../make-rules/lint-libraries.mk
       
    39 
       
    40 # Zlib won't build without cloning. We need also to get rid of default
       
    41 # Makefile and get our own version of zlib.h to avoid interactions
       
    42 # between 32 and 64 bit builds.
       
    43 COMPONENT_PRE_CONFIGURE_ACTION = ( \
       
    44 	$(CLONEY) $(SOURCE_DIR) $(@D); \
       
    45 	$(RM) $(@D)/Makefile $(@D)/zconf.h; \
       
    46 	$(CP) $(SOURCE_DIR)/zconf.h $(@D) )
       
    47 
       
    48 CFLAGS += $(CC_PIC) 
       
    49 
       
    50 # We need to reset configure options here because zlib is confused with
       
    51 # CC and CFLAGS definitions as configure parameters.
       
    52 CONFIGURE_OPTIONS	=  --shared
       
    53 CONFIGURE_OPTIONS	+= --prefix=/usr
       
    54 CONFIGURE_OPTIONS	+= $(CONFIGURE_OPTIONS.$(BITS))
       
    55 CONFIGURE_OPTIONS.64	+= --libdir=/usr/lib/$(MACH64)
       
    56 
       
    57 CONFIGURE_ENV += CC="$(CC)"
       
    58 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
       
    59 CONFIGURE_ENV += LDSHARED="$(CC) $(CFLAGS) -G"
       
    60 
       
    61 # This LDSHARED definitions is forced to get all required options plus
       
    62 # mapfile for result linking. While the one used with configure is just
       
    63 # to allow Zlib detect capability of creating shared libraries.
       
    64 COMPONENT_BUILD_ARGS = LDSHARED="$(CC) $(CFLAGS) -G -h libz.so.1 $(LD_OPTIONS_SO) -M ../../mapfile -L."
       
    65 
       
    66 COMPONENT_TEST_TARGETS = test
       
    67 
       
    68 build:		$(BUILD_32_and_64)
       
    69 
       
    70 install:	$(INSTALL_32_and_64)
       
    71 
       
    72 test:		$(TEST_32_and_64)
       
    73 
       
    74 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
       
    75 
       
    76 include ../../make-rules/depend.mk