1725N/A#
1725N/A# CDDL HEADER START
1725N/A#
1725N/A# The contents of this file are subject to the terms of the
1725N/A# Common Development and Distribution License (the "License").
1725N/A# You may not use this file except in compliance with the License.
1725N/A#
1725N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1725N/A# or http://www.opensolaris.org/os/licensing.
1725N/A# See the License for the specific language governing permissions
1725N/A# and limitations under the License.
1725N/A#
1725N/A# When distributing Covered Code, include this CDDL HEADER in each
1725N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1725N/A# If applicable, add the following below this CDDL HEADER, with the
1725N/A# fields enclosed by brackets "[]" replaced with your own identifying
1725N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1725N/A#
1725N/A# CDDL HEADER END
1725N/A#
5680N/A
5680N/A#
5347N/A# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
1725N/A#
5680N/ABUILD_BITS= 64_and_32
1725N/Ainclude ../../make-rules/shared-macros.mk
1725N/A
1725N/ACOMPONENT_NAME= libarchive
6345N/ACOMPONENT_VERSION= 3.2.1
4995N/ACOMPONENT_PROJECT_URL= http://www.libarchive.org/
1725N/ACOMPONENT_ARCHIVE_HASH= \
6345N/A sha256:72ee1a4e3fd534525f13a0ba1aa7b05b203d186e0c6072a8a4738649d0b3cfd2
1725N/ACOMPONENT_ARCHIVE_URL= \
4995N/A $(COMPONENT_PROJECT_URL)downloads/$(COMPONENT_ARCHIVE)
1725N/ACOMPONENT_BUGDB= library/libarchive
1725N/A
6345N/ATPNO= 29683
2899N/A
6259N/ATEST_TARGET= install $(TEST_32_and_64)
7424N/ASYSTEM_TEST_TARGET= build $(SYSTEM_TEST_32_and_64)
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
1725N/A
1725N/A# Userland default includes -mt which links with libthread which we don't need.
1725N/Astudio_MT =
1725N/A
4995N/ACONFIGURE_OPTIONS += --disable-static
4995N/ACONFIGURE_OPTIONS += --enable-shared
4995N/ACONFIGURE_OPTIONS += --enable-largefile
4995N/A# We prefer openssl over nettle.
4995N/ACONFIGURE_OPTIONS += --without-nettle
4995N/ACONFIGURE_OPTIONS += --with-openssl
4995N/ACONFIGURE_OPTIONS += --with-pic
4995N/ACONFIGURE_OPTIONS += --with-xml2
4995N/ACONFIGURE_OPTIONS += --with-zlib
4682N/A
1725N/A# libarchive's Makefile hard-codes some gcc-only flags in COMMON_CFLAGS, then
1725N/A# appends CFLAGS to that. Reset the former here so we can build with Studio.
1725N/ACOMPONENT_BUILD_ARGS += COMMON_CFLAGS=''
1725N/ACOMPONENT_BUILD_ARGS += CFLAGS="$(CFLAGS)"
1725N/ACOMPONENT_TEST_ARGS += COMMON_CFLAGS=''
1725N/ACOMPONENT_TEST_ARGS += CFLAGS="$(CFLAGS)"
5347N/ACOMPONENT_TEST_ENV += TMPDIR="$(COMPONENT_TEST_BUILD_DIR)"
1725N/A
6259N/A# Get correct libarchive.so from the proto area.
6259N/ATEST_LIBPATH.32 = $(PROTOUSRLIBDIR)
6259N/ATEST_LIBPATH.64 = $(PROTOUSRLIBDIR64)
6259N/ACOMPONENT_TEST_ENV += LD_LIBRARY_PATH=$(TEST_LIBPATH.$(BITS))
6259N/A
1725N/A# We need GNU awk for the following to work; hence the PATH tweak.
4995N/A# We then convert BSD-style section numbers in the libarchive man pages to
4995N/A# Solaris-style section numbers.
1725N/ACOMPONENT_PREP_ACTION = \
5680N/A cd $(@D)/doc/man ; rm *.[135] ; env PATH=$(GNUBIN):$$PATH gmake all ; \
4995N/A cd $(@D)/libarchive ; \
5680N/A find . -name "*\.[35]" | xargs $(GSED) -i 's/\(Xr.*\|Dt.*\)3/\13ARCHIVE/' ; \
5680N/A find . -name "*\.[35]" | xargs $(GSED) -i \
4995N/A -e 's/Xr \(malloc\|getpwuid\|getgrgud\|strerror\|printf\|getpwnam\|getgrnam\) 3ARCHIVE/Xr \13C/' \
4995N/A -e 's/\(Dt.*LIBARCHIVE.*\)3ARCHIVE/\13LIB/' \
4995N/A -e 's/Xr \(libarchive\|archive\) 3ARCHIVE/Xr libarchive 3LIB/';
4995N/A
1725N/APKG_PROTO_DIRS += $(COMPONENT_SRC)/doc/man
1725N/A
6259N/A# Needed for "gmake test" to work successfully.
6259N/A# If SHELLOPTS is exported (as it is by the userland makefiles),
6259N/A# then all shell options get exported to child invocations of bash,
6259N/A# which results in test failures due to nounset and xtrace being
6259N/A# set unexpectedly, and errors such as "$1: unbound variable" and
6259N/A# diffs failing due to script tracing in output files.
6259N/Aunexport SHELLOPTS
6259N/A
3845N/ACOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
3845N/ACOMPONENT_TEST_TRANSFORMS += \
6259N/A '-n ' \
6259N/A '-e "/ ok/p" ' \
6259N/A '-e "/ FAIL/p" ' \
6259N/A '-e "/Totals:/p" ' \
6259N/A '-e "/Tests run:/p" ' \
6259N/A '-e "/Tests failed:/p" ' \
6259N/A '-e "/Assertions failed:/p" ' \
6259N/A '-e "/Skips reported:/p" ' \
6259N/A '-e "/Failing tests:/p" ' \
6259N/A '-e "/ failure/p" ' \
6259N/A '-e "/TOTAL/p" ' \
6259N/A '-e "/SKIP/p" ' \
6259N/A '-e "/PASS/p" ' \
6259N/A '-e "/FAIL/p" ' \
6259N/A '-e "/ERROR/p" ' \
6259N/A '-e "/=========/p" ' \
1725N/A
3817N/AREQUIRED_PACKAGES += compress/bzip2
3817N/AREQUIRED_PACKAGES += compress/xz
3817N/AREQUIRED_PACKAGES += library/libxml2
3817N/AREQUIRED_PACKAGES += library/security/openssl
3817N/AREQUIRED_PACKAGES += library/zlib