#!/bin/bash

package=boost
version=_1_52_0

progname=$0

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

prefix=$GEXTHUGIN_INSTALLED

opt_run_untar $force_untar $auto_untar $package $version

if [ $auto_config = "1" ] ; then
  if [ ! -e $package$version/bjam ]; then
  force_config=1
  fi
fi

if [ $force_config = "1" ] ; then
  echo "[pushd $package$version]"
  ( cd $package$version ; \
   ./bootstrap.sh --prefix=$prefix; \
   BZIP2_INCLUDE=$prefix/include/ \
   BZIP2_LIBPATH=$prefix/lib/ \
   ./b2 --without-python install; \
   cd ..; )
  if [ $? != 0 ] ; then
      echo "      Error encountered running *configure* stage of $progname"
      exit 1
  fi
  echo "[popd]"
else
  if [ $auto_config = "1" ] ; then
    echo "Found Boostrap output for ${progname%.*} => no need to Bootstrap or Compile"
  fi
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

