SUMMARY="A loop generator for scanning Z-polyhedra"
DESCRIPTION="
CLooG is a software which generates loops for scanning Z-polyhedra. That is,
CLooG finds the code or pseudo-code where each integral point of one or more
parametrized polyhedron or parametrized polyhedra union is reached. CLooG is
designed to avoid control overhead and to produce a very efficient code.
"
HOMEPAGE="http://www.bastoul.net/cloog/index.php"
COPYRIGHT="
	2001-2005 Cedric Bastoul
	2008 University Paris-Sud 11 and INRIA
	"
LICENSE="GNU LGPL v2.1"
SOURCE_URI="http://www.bastoul.net/cloog/pages/download/cloog-$portVersion.tar.gz"
CHECKSUM_SHA256="460c6c740acb8cdfbfbb387156b627cf731b3837605f2ec0001d079d89c69734"
REVISION="1"
ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
    # x86_gcc2 is fine as primary target architecture as long as we're building
    # for a different secondary architecture.
    ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PATCHES="cloog-$portVersion.patchset"

PROVIDES="
	cloog$secondaryArchSuffix = $portVersion compat >= 0.18
	cmd:cloog$secondaryArchSuffix
	lib:libcloog_isl$secondaryArchSuffix = 4.0.0 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgmp$secondaryArchSuffix
	lib:libisl$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgmp$secondaryArchSuffix
	devel:libisl$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure --with-gmp=system \
		--with-isl=system
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libcloog-isl
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

TEST()
{
	make check	
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	cloog${secondaryArchSuffix}_devel = $portVersion compat >= 0.18
	devel:libcloog_isl$secondaryArchSuffix = 4.0.0 compat >= 4
	"
REQUIRES_devel="
	cloog$secondaryArchSuffix == $portVersion base
	"
