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"
SRC_URI="http://sourceforge.net/projects/flex/files/flex/flex-2.5.35/flex-2.5.35.tar.bz2/download"
CHECKSUM_MD5="10714e50cea54dc7a227e3eddcd44d57"
REVISION="6"
ARCHITECTURES="x86_gcc2 x86 x86_64"

PATCHES="flex-2.5.35.patch"

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 >= $haikuVersion
	cmd:m4
	"
BUILD_REQUIRES="
	"
BUILD_PREREQUIRES="
	haiku_devel >= $haikuVersion
	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
}
