SUMMARY="A portable, high level programming interface."
DESCRIPTION="
A portable, high level programming interface to various calling conventions.
"
HOMEPAGE="http://sourceware.org/libffi" 
SRC_URI="ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz"
CHECKSUM_MD5="45f3b6dbc9ee7c7dfbbbc5feba571529"
COPYRIGHT="1996-2013 Anthony Green, Red Hat, Inc and others."
LICENSE="MIT"
REVISION="1"

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86 x86_64"

PROVIDES="
	libffi$secondaryArchSuffix = $portVersion compat >= 3
	lib:libffi$secondaryArchSuffix = 6.0.1 compat >= 6
	"

REQUIRES="
	haiku >= $haikuVersion
	"

BUILD_REQUIRES="
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

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

INSTALL()
{
	make install

	mkdir -p $includeDir
	mv -f $libDir/$portVersionedName/include/*.h* $includeDir
	rm -rf $libDir/$portVersionedName
	
	prepareInstalledDevelLibs libffi
	fixPkgconfig
	
	# devel package
	packageEntries devel \
		$developDir \
		$documentationDir
}

PROVIDES_devel="
	libffi${secondaryArchSuffix}_devel = $portVersion
	devel:libffi$secondaryArchSuffix = 6.0.1 compat >= 6
	"

REQUIRES_devel="
	libffi$secondaryArchSuffix == $portVersion base
	"
