#!/bin/bash

package=ilmbase
version=-git-jan2013

progname=$0

source ../cascade-make/lib/cascade-lib.bash GEXT_HUGIN ../.. $*

prefix=$GEXTHUGIN_INSTALLED

needs_patch=0
if [ $force_untar = "1" ] ; then
  needs_patch=1;
fi

if [ $auto_config = "1" ] ; then
  if [ ! -d $package$version ] ; then
    needs_patch=1;
  fi
fi


opt_run_untar $force_untar $auto_untar $package $version

if [ $needs_patch = "1" ] ; then
  patch -p0 < patches/ilmbase-git-jan2013.patch
fi

if [ $auto_config = "1" ] ; then
	cd $package$version;
	ACLOCAL_INCLUDE="$ACLOCAL_INLCUDE -I$prefix/share/aclocal" ./bootstrap
	cd ..;
fi

opt_run_configure $force_config $auto_config $package $version $prefix

opt_run_make $compile $package $version
opt_run_make $install $package $version "install"
opt_run_make $clean $package $version "clean"
opt_run_make $distclean $package $version "distclean"

opt_run_tarclean $tarclean $package $version

