#!/bin/bash

# Tesseract needs glibtool or libtool (only for conguring).
# We're getting gnu libtool. Not sure if this is glibtool.

package=libtool
version=-2.4.6

progname=$0

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

prefix=$GEXT_TESSERACT_INSTALLED

# See imagemagick ext
if [ "x$CROSSCONFIGURE_ARGS" != "x" ] ; then
    echo "WARNING: Crossconfiguring not supported yet"
fi

# libtool is not dependent on the other packages at least
# export CFLAGS="$CFLAGS -I$GEXT_TESSERACT_INSTALLED/include"
# export CPPFLAGS="$CPPFLAGS -I$GEXT_TESSERACT_INSTALLED/include"
# export CXXFLAGS="$CXXFLAGS -I$GEXT_TESSERACT_INSTALLED/include"
# export LDFLAGS="$LDFLAGS -L$GEXT_TESSERACT_INSTALLED/lib"
# export LD_LIBRARY_PATH="$GEXT_TESSERACT_INSTALLED/lib"

opt_run_untar $force_untar $auto_untar $package $version

opt_run_configure $force_config $auto_config $package $version $prefix \
  --disable-shared --enable-static

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
