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.
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.
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]
23 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2013 Erol Zavidic. All rights reserved.
25 # Copyright (c) 2022 Tim Mooney. All rights reserved.
29 USE_COMMON_TEST_MASTER
= no
30 include ..
/..
/..
/make-rules
/shared-macros.mk
33 COMPONENT_VERSION
= 1.3.1
34 COMPONENT_SUMMARY
= The Zip compression library
35 COMPONENT_PROJECT_URL
= https
://zlib.net
/
36 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
37 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
38 COMPONENT_ARCHIVE_URL
= https
://zlib.net
/$(COMPONENT_ARCHIVE
)
39 COMPONENT_SIG_URL
= $(COMPONENT_ARCHIVE_URL
).asc
40 COMPONENT_ARCHIVE_HASH
= sha256
:9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
41 COMPONENT_FMRI
= library
/zlib
42 COMPONENT_CLASSIFICATION
=System
/Libraries
43 COMPONENT_LICENSE
= zlib license
44 COMPONENT_LICENSE_FILE
= LICENSE
46 include $(WS_MAKE_RULES
)/common.mk
49 # Zlib won't build without cloning. We need also to get rid of default
50 # Makefile and get our own version of zconf.h to avoid interactions
51 # between 32 and 64 bit builds.
52 COMPONENT_PRE_CONFIGURE_ACTION
= ( \
53 $(CLONEY
) $(SOURCE_DIR
) $(@D
); \
54 $(RM
) $(@D
)/Makefile
$(@D
)/zconf.h
; \
55 $(CP
) $(SOURCE_DIR
)/zconf.h
$(@D
) )
57 # Also, the x86 architecture does not require alignment for multi-byte
58 # loads, so we can define UNALIGNED_OK for x86
59 CFLAGS.i386.32
+= -DUNALIGNED_OK
62 CFLAGS
+= $(CFLAGS.
$(MACH
).
$(BITS
))
64 # We need to reset configure options here because zlib is confused with
65 # CC and CFLAGS definitions as configure parameters.
66 # Note that this is NOT an autoconf-generated standard configure script.
67 CONFIGURE_OPTIONS
= --shared
68 CONFIGURE_OPTIONS
+= --prefix=/usr
69 CONFIGURE_OPTIONS
.32 =
70 CONFIGURE_OPTIONS
.64 = --64
71 CONFIGURE_OPTIONS
.64 += --libdir=/usr
/lib
/$(MACH64
)
72 CONFIGURE_OPTIONS
+= $(CONFIGURE_OPTIONS.
$(BITS
))
74 CONFIGURE_ENV
+= LDSHARED
="$(CC) $(CFLAGS) -G"
76 # This LDSHARED definitions is forced to get all required options plus
77 # mapfile for result linking. While the one used with configure is just
78 # to allow Zlib detect capability of creating shared libraries.
79 COMPONENT_BUILD_ARGS
= LDSHARED
="$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-z -Wl,text -Wl,-h -Wl,libz.so.1 $(LD_OPTIONS_SO) -Wl,-M -Wl,../../mapfile -L."
81 # Auto-generated dependencies
82 REQUIRED_PACKAGES
+= system
/library