### this file is sourced not run
PKGVER=0.18.2
PKGBUILD=1
PKGARCH=i686

TARBALL=cloog-$PKGVER.tar.gz
MD5SUM=69116aa6cd5e73f6b688d871875e1292
SRC_URL=http://distro.ibiblio.org/fatdog/source/710/clfs-packages-3.0.0.tar
BUNDLE=clfs-packages-3.0.0.tar

SLACKREQ=
SLACKDESC="libcloog32: libcloog32 $PKGVER (Z-polyhedra library)  
libcloog32:  
libcloog32: CLooG is a library to generate code for scanning Z-polyhedra. In 
libcloog32: other words, it finds code that reaches each integral point of one 
libcloog32: or more parameterized polyhedra. GCC links with this library in 
libcloog32: order to enable the new loop generation code known as Graphite.  
libcloog32: 
libcloog32: This is the 32-bit version of the library
libcloog32: 
libcloog32: 
libcloog32: 
"


### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### default pkg_prepare

### package - only collect the libraries
pkg_package() {
	rm -rf usr/include usr/share
}

### build
pkg_build() {
	cd /tmp/cloog*

	CC="gcc -isystem /usr/include ${BUILD32}" \
	LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib ${BUILD32}" \
	  ./configure --prefix=/usr --host=${CLFS_TARGET32} --with-isl=system &&
	  
	sed -i '/cmake/d' Makefile &&
	make $MAKEFLAGS &&
	make install &&
	
	pkg_build_slackdesc &&
		
	# multi-lib
	mv -v /usr/bin/cloog{,-32}	
	
}
