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-2010 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
SOURCE_URI="http://ftp.gnu.org/gnu/bison/bison-2.4.3.tar.gz"
CHECKSUM_SHA256="6b17be5e63ff6667c83f6ef0423befe0ba23d4bc554c4c33b02ce5bb65179b16"
REVISION="6"
ARCHITECTURES="x86_gcc2 x86 x86_64"

PATCHES="bison-2.4.3.patch"

PROVIDES="
	bison = $portVersion compat >= 2.4
	cmd:bison = $portVersion compat >= 2.4
	cmd:yacc
	devel:liby = $portVersion compat >= 2.4
	"
REQUIRES="
	haiku
	cmd:m4
	"
BUILD_REQUIRES="
	"
BUILD_PREREQUIRES="
	haiku_devel
	cmd:gcc
	cmd:ld
	cmd:m4
	cmd:make
	cmd:sed
	"


BUILD()
{
	# bison looks for m4 in an absolute path, but uses that only within
	# its own testsuite, so we let it be ...
	M4=$portPackageLinksDir/cmd~m4/bin/m4 runConfigure ./configure \
		--disable-rpath --with-gnu-ld
	make $jobArgs
}

INSTALL()
{
	make install

	# prepare develop/lib
	prepareInstalledDevelLibs liby

	rm $libDir/charset.alias
	rmdir $libDir
}

TEST()
{
	make check
}
