components/ggrep/Makefile
author April Chin <april.chin@oracle.com>
Tue, 02 Feb 2016 13:47:41 -0800
changeset 5391 5aa4a8c4577f
parent 5125 34cc580c62c2
child 5682 94c0ca64c022
permissions -rw-r--r--
22536285 update ggrep to 2.22 22506630 problem in UTILITY/GGREP

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
#
BITS=64
include ../../make-rules/shared-macros.mk

COMPONENT_NAME=		grep
COMPONENT_VERSION=	2.22
COMPONENT_PROJECT_URL=	http://gnu.org/software/grep/
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.xz

COMPONENT_ARCHIVE_HASH=	\
    sha256:ca91d22f017bfcb503d4bc3b44295491c89a33a3df0c3d8b8614f2d3831836eb
COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/grep/$(COMPONENT_ARCHIVE)

COMPONENT_BUGDB=	utility/ggrep

TPNO=			26437

include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk

# We need to be able to return from void functions
CFLAGS	+=			$(studio_FEATURES_EXTENSIONS)

# 64-bit only components are delivered to the "32-bit" locations since we don't
# need both versions.
CONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/gnu/bin

CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"

# Enable aslr for this component
ASLR_MODE = $(ASLR_ENABLE)

# Needed for "gmake test" to work.
# SHELLOPTS is exported via make-rules/shared-macros.mk,
# causing the braceexpand option to be set.
# This option causes "$1: unbound variable" errors during the check-TESTS,
# and the gnulib-tests don't even run at all.
# Note that the below unexports SHELLOPTS, even for targets
# other than "test." 
unexport SHELLOPTS

# Test transforms retain only relevant results output.
COMPONENT_TEST_TRANSFORMS += \
        '-n ' \
        '-e "/TOTAL/p" ' \
        '-e "/SKIP/p" ' \
        '-e "/PASS/p" ' \
        '-e "/FAIL/p" ' \
        '-e "/ERROR/p" '

# Putting GNU on path first prevents some tests from being skipped,
# which also  keeps the test and system-test results consistent.
# With the test target, the path to the just-built commands is
# prepended to PATH.  With the system-test target, we patch
# to prevent the PATH from being prepended.
COMPONENT_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
COMPONENT_SYSTEM_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"

# Patch to change test path so it tests grep commands from /usr/gnu/bin
# installed on the test system. If we patch, we must re-configure the
# tests.
$(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
test-check:
	if [ -e $(SOURCE_DIR)/.system-test-patched ]; then \
	   cd $(COMPONENT_DIR); \
	   $(GMAKE) clean build; \
	fi

# common targets
configure:	$(CONFIGURE_64)

build:		$(BUILD_64)

install:	$(INSTALL_64)

test:		test-check $(TEST_64)

system-test:    $(SOURCE_DIR)/.system-test-patched configure $(SYSTEM_TEST_64)


REQUIRED_PACKAGES += library/pcre
REQUIRED_PACKAGES += shell/bash
REQUIRED_PACKAGES += system/library