Makefile revision 4793
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# CDDL HEADER START
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater# The contents of this file are subject to the terms of the
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# Common Development and Distribution License (the "License").
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# You may not use this file except in compliance with the License.
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
cd0aa2d941d1438fabb5337f1f38c49478edf71dAutomatic Updater# or http://www.opensolaris.org/os/licensing.
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater# See the License for the specific language governing permissions
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# and limitations under the License.
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# When distributing Covered Code, include this CDDL HEADER in each
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# If applicable, add the following below this CDDL HEADER, with the
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# fields enclosed by brackets "[]" replaced with your own identifying
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark AndrewsCOMPONENT_PROJECT_URL= http://gnu.org/software/grep/
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson sha256:f0af452bc0d09464b6d089b6d56a0a3c16672e9ed9118fbe37b0b6aeaf069a65
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/grep/$(COMPONENT_ARCHIVE)
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# We need to be able to return from void functions
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# Enable aslr for this component
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater# Needed for "gmake test" to work.
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater# SHELLOPTS is exported via make-rules/shared-macros.mk,
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# causing the braceexpand option to be set.
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# This option causes "$1: unbound variable" errors during the check-TESTS,
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# and the gnulib-tests don't even run at all.
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# Note that the below unexports SHELLOPTS, even for targets
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews# other than "test."
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Test transforms retain only relevant results output.
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater '-e "/TOTAL/p" ' \
8e9f3b69914ee02a80b87c97b1f8093edb3e9ae0Automatic Updater '-e "/SKIP/p" ' \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews '-e "/PASS/p" ' \
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater '-e "/FAIL/p" ' \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews '-e "/ERROR/p" '
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater# Putting GNU on path first prevents some tests from being skipped,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# which also keeps the test and system-test results consistent.
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# With the test target, the path to the just-built commands is
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# prepended to PATH. With the system-test target, we patch
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater# to prevent the PATH from being prepended.
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic UpdaterCOMPONENT_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_SYSTEM_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# Patch to change test path so it tests grep commands from /usr/gnu/bin
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# installed on the test system. If we patch, we must re-configure the
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews$(SOURCE_DIR)/.system-test-patched: $(SOURCE_DIR)/.prep
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater $(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $(COMPONENT_DIR)/system-test-patches/systest.patch
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# if we previously patched the source for the system-test target,
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# ensure we rebuild without that patch
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater if [ -e $(SOURCE_DIR)/.system-test-patched ]; then \
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews# common targets