Makefile revision 5680
98N/A#
98N/A# CDDL HEADER START
606N/A#
98N/A# The contents of this file are subject to the terms of the
1630N/A# Common Development and Distribution License (the "License").
98N/A# You may not use this file except in compliance with the License.
98N/A#
919N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
919N/A# or http://www.opensolaris.org/os/licensing.
919N/A# See the License for the specific language governing permissions
919N/A# and limitations under the License.
919N/A#
919N/A# When distributing Covered Code, include this CDDL HEADER in each
919N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
919N/A# If applicable, add the following below this CDDL HEADER, with the
919N/A# fields enclosed by brackets "[]" replaced with your own identifying
919N/A# information: Portions Copyright [yyyy] [name of copyright owner]
919N/A#
919N/A# CDDL HEADER END
919N/A#
919N/A
919N/A#
919N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
919N/A#
98N/ABUILD_BITS= 64
98N/Ainclude ../../make-rules/shared-macros.mk
98N/A
98N/ACOMPONENT_NAME= grep
493N/ACOMPONENT_VERSION= 2.22
98N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
98N/ACOMPONENT_ARCHIVE_HASH= \
1634N/A sha256:ca91d22f017bfcb503d4bc3b44295491c89a33a3df0c3d8b8614f2d3831836eb
98N/ACOMPONENT_BUGDB= utility/ggrep
911N/A
1634N/ATPNO= 26437
1634N/A
1634N/ASYSTEM_TEST_TARGET= $(SOURCE_DIR)/.system-test-patched configure $(SYSTEM_TEST_64)
911N/Ainclude $(WS_MAKE_RULES)/gnu-component.mk
98N/A
1549N/A# We need to be able to return from void functions
606N/ACFLAGS += $(studio_FEATURES_EXTENSIONS)
1119N/A
606N/ACONFIGURE_PREFIX = $(USRGNUDIR)
98N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
98N/ACONFIGURE_OPTIONS += --localedir=$(USRSHARELOCALEDIR)
98N/A
493N/A# Needed for "gmake test" to work.
98N/A# SHELLOPTS is exported via make-rules/shared-macros.mk,
705N/A# causing the braceexpand option to be set.
705N/A# This option causes "$1: unbound variable" errors during the check-TESTS,
705N/A# and the gnulib-tests don't even run at all.
705N/A# Note that the below unexports SHELLOPTS, even for targets
1630N/A# other than "test."
1630N/Aunexport SHELLOPTS
1630N/A
98N/A# Test transforms retain only relevant results output.
1549N/ACOMPONENT_TEST_TRANSFORMS += \
606N/A '-n ' \
1425N/A '-e "/TOTAL/p" ' \
1425N/A '-e "/SKIP/p" ' \
1097N/A '-e "/PASS/p" ' \
1097N/A '-e "/FAIL/p" ' \
98N/A '-e "/ERROR/p" '
1425N/A
1425N/A# Putting GNU on path first prevents some tests from being skipped,
1425N/A# which also keeps the test and system-test results consistent.
1425N/A# With the test target, the path to the just-built commands is
1425N/A# prepended to PATH. With the system-test target, we patch
1549N/A# to prevent the PATH from being prepended.
1549N/ACOMPONENT_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
1549N/ACOMPONENT_SYSTEM_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
1549N/A
1549N/A# Patch to change test path so it tests grep commands from /usr/gnu/bin
1549N/A# installed on the test system. If we patch, we must re-configure the
98N/A# tests.
493N/A$(SOURCE_DIR)/.system-test-patched: $(SOURCE_DIR)/.prep
$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $(COMPONENT_DIR)/system-test-patches/systest.patch
$(TOUCH) $(@)
# if we previously patched the source for the system-test target,
# ensure we rebuild without that patch
COMPONENT_PRE_TEST_ACTION += \
if [ -e $(SOURCE_DIR)/.system-test-patched ]; then \
cd $(COMPONENT_DIR); \
$(GMAKE) clean build; \
fi
REQUIRED_PACKAGES += library/pcre
REQUIRED_PACKAGES += shell/bash