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"
SOURCE_URI="http://sourceforge.net/projects/flex/files/flex-$portVersion.tar.bz2"
CHECKSUM_SHA256="add2b55f3bc38cb512b48fad7d72f43b11ef244487ff25fc00aabec1e32b617f"
REVISION="2"
ARCHITECTURES="x86_gcc2 x86 x86_64 arm"

PATCHES="flex-2.5.39.patchset"

PROVIDES="
	flex = $portVersion compat >= 2.5
	cmd:flex = $portVersion compat >= 2.5
	cmd:flex++ = $portVersion compat >= 2.5
	lib:libfl = 2.0.0 compat >= 2
	lib:libfl_pic = 2.0.0 compat >= 2
	devel:libfl = 2.0.0 compat >= 2
	devel:libfl_pic = 2.0.0 compat >= 2
	"
REQUIRES="
	haiku
	cmd:m4
	"
BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc
	cmd:gettext
	cmd:ld
	cmd:libtoolize
	cmd:make
	cmd:makeinfo
	cmd:find
	"

BUILD()
{
	rm -f aclocal.m4
	autoreconf -fi
	runConfigure ./configure \
		--disable-rpath --with-gnu-ld --disable-shared \
		--disable-dependency-tracking --disable-nls
	make $jobArgs
}

INSTALL()
{
	make install

	# prepare develop/lib
	prepareInstalledDevelLibs libfl libfl_pic
}
