SUMMARY="A tool for generating scanners"
DESCRIPTION="Flex is a fast lexical analyser generator. It is a tool for \
generating programs that perform pattern-matching on text."
HOMEPAGE="http://flex.sourceforge.net/"
COPYRIGHT="2001-2007 The Flex Project
	1990, 1997 The Regents of the University of California"
LICENSE="Flex"
REVISION="6"
SOURCE_URI="http://sourceforge.net/projects/flex/files/flex/flex-2.5.35/flex-2.5.35.tar.bz2/download"
CHECKSUM_SHA256="0becbd4b2b36b99c67f8c22ab98f7f80c9860aec70f0350a0018f29a88704e7b"
PATCHES="flex-2.5.35.patch"

ARCHITECTURES="all"

PROVIDES="
	flex = $portVersion compat >= 2.5
	cmd:flex = $portVersion compat >= 2.5
	devel:libfl = $portVersion compat >= 2.5
	devel:libfl_pic = $portVersion compat >= 2.5
	"
REQUIRES="
	haiku
	cmd:m4
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc
	cmd:ld
	cmd:libtoolize
	cmd:make
	cmd:makeinfo
	"

BUILD()
{
	rm aclocal.m4
	libtoolize --force --copy --install
	aclocal -I m4
	autoconf
	automake --add-missing --force-missing
	runConfigure ./configure \
		--disable-rpath --with-gnu-ld
	make $jobArgs
}

INSTALL()
{
	make install

	# prepare develop/lib
	prepareInstalledDevelLibs libfl libfl_pic
	rmdir $libDir
}
