SUMMARY="A yacc-compatible parser generator"
DESCRIPTION="
Bison is a general-purpose parser generator that converts an annotated \
context-free grammar into an LALR(1) or GLR parser for that grammar. Once you \
are proficient with Bison, you can use it to develop a wide range of language \
parsers, from those used in simple desk calculators to complex programming \
languages.
Bison is upward compatible with Yacc: all properly-written Yacc grammars ought \
to work with Bison with no change. Anyone familiar with Yacc should be able to \
use Bison with little trouble. You need to be fluent in C or C++ programming \
in order to use Bison.
"
HOMEPAGE="http://www.gnu.org/software/bison/bison.html" 
COPYRIGHT="1992-2011 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
SRC_URI="http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz"
CHECKSUM_SHA256="722def46e4a19a5b7a579ef30db1965f86c37c1a20a5f0113743a2e4399f7c99"
REVISION="1"

ARCHITECTURES="?x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PATCHES="bison-${portVersion}.patch"

PROVIDES="
	bison$secondaryArchSuffix = $portVersion compat >= 2.5
	cmd:bison$secondaryArchSuffix = $portVersion compat >= 2.5
	cmd:yacc$secondaryArchSuffix
	devel:liby$secondaryArchSuffix = $portVersion compat >= 2.5
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	cmd:m4
	"

BUILD_REQUIRES="
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:awk
	cmd:m4
	cmd:make
	cmd:sed
	"

BUILD()
{
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs liby

	rm $libDir/charset.alias
	rmdir $libDir
}

TEST()
{
	make check
}
