#!/bin/sh

# create configure from the autotools and invoke
rm -rf autom4te.cache
aclocal
autoheader
autoconf
libtoolize -f
ln -s `which libtool` 2>/dev/null
automake -a --foreign 

ext="@EXTENSION_DIR@"
pld="@phplibdir@"
sh ./configure "$@" --with-extdir="$ext" --libdir="$pld" --datadir="$pld" --bindir="$pld" || (
echo "Back-end configuration failed."
echo "Please install the recommended autoconf, libtool and automake versions"
echo "or disable back-end configuration and use the pre-compiled J2EE back-end:"
echo 
echo "    ./configure --disable-backend --with-java=java"
echo
exit 1
)

