components/bison/Makefile
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Thu, 14 Jan 2016 10:17:27 -0800
changeset 5272 28045eab1400
parent 4341 10335b2a1e5d
child 5682 94c0ca64c022
permissions -rw-r--r--
PSARC/2015/549 bison version 3.0.4 15623772 SUNBT6927713 upgrade bison to 3.0.4 18111679 perl 5.12 and newer bisons don't get along 21468061 libpcap doesn't like bison3

#
# 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.
#

# for the tests
COMPILER=gcc

include ../../make-rules/shared-macros.mk

COMPONENT_NAME=		bison
COMPONENT_VERSION=	3.0.4
COMPONENT_PROJECT_URL=	http://www.gnu.org/software/bison/
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.xz
COMPONENT_ARCHIVE_HASH=	\
    sha256:a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1
COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/pub/gnu/bison/$(COMPONENT_ARCHIVE)
COMPONENT_BUGDB=	utility/bison

TPNO=			24440

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

CONFIGURE_LIBDIR.32 =   $(GNULIB)
CONFIGURE_LIBDIR.64 =   $(GNULIB)/$(MACH64)

COMPONENT_PRE_CONFIGURE_ACTION = \
	($(CLONEY) $(SOURCE_DIR) $(@D))

CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
CONFIGURE_OPTIONS  +=		M4="/usr/gnu/bin/m4"
CONFIGURE_OPTIONS  += 		--disable-silent-rules

# the shared library we create needs to be built pic
COMPONENT_BUILD_ARGS += CC_PIC="$(CC_PIC)"

# this is cheesy but the tests don't seem to
# get compiled with the CFLAGS we built bison
# with, so they are 32-bit otherwise.
CONFIGURE_OPTIONS  +=		WARN_CXXFLAGS_TEST="$(CFLAGS)"

COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master

# the test suite actually generates a script
# that runs the just-built bison against the
# just-built files. to make it run the system
# one, we can just replace that script with
# a simpler one
COMPONENT_PRE_SYSTEM_TEST_ACTION= \
    (cd $(@D)/tests; mv bison bison.orig; \
        echo "\#!/bin/bash" > bison; \
        echo "IFS=" >> bison; \
        echo "exec /usr/bin/bison \$$@" >> bison; \
        chmod +x bison; \
    )

COMPONENT_POST_SYSTEM_TEST_ACTION= \
    (cd $(@D)/tests; rm -f bison; mv bison.orig bison)

# Strip compilation lines from test output
# and strange backslash lines. and random output,
# including rm complaints over nfs
COMPONENT_TEST_TRANSFORMS += \
    '-e "s|^.*$(CC).*$$|XXX_CC_XXX|g" ' \
    '-e "s|^.*$(CXX).*$$|XXX_CC_XXX|g" ' \
    '-e "s|^.*source=.*libtool=no.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^.*DEPDIR=.deps.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^config.status: .*$$|XXX_CC_XXX|g" ' \
    '-e "s|^make.*: Leaving directory.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^make.*: Entering directory.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^make.*: Nothing to be done for.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^make.*: .*is up to date.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^mv -f.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^.$$|XXX_CC_XXX|g" ' \
    '-e "s|^updating examples.*$$|XXX_CC_XXX|g" ' \
    '-e "s|.*build-aux/ylwrap.*$$|XXX_CC_XXX|g" ' \
    '-e "s|.*examples/calc++/calc++-parser.stamp.*$$|XXX_CC_XXX|g" ' \
    '-e "s|.*tests/bison -o y.tab.c.*$$|XXX_CC_XXX|g" ' \
    '-e "s|^rm:.*directory renamed.*$$|XXX_CC_XXX|g" ' \
    '-e "/^XXX_CC_XXX$$/d" '

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

$(INSTALL_32):	$(INSTALL_64)

# common targets
configure:	$(CONFIGURE_32_and_64)

build:		$(BUILD_32_and_64)

install:	$(INSTALL_32_and_64)

test:		$(TEST_64)

# we need to first generate the test suite,
system-test:    build $(SYSTEM_TEST_64)


REQUIRED_PACKAGES += developer/macro/gnu-m4
REQUIRED_PACKAGES += system/library