#!/bin/sh
usage() {
	echo "$0 - use this program instead of calling ./configure for"
	echo "compiling KDE 1.x applications."
	echo
	echo "Usage: konfigure --whatever-parameters-you'd-like-to-pass-to-./confugure"
}

if [ "x$1" = "x--help" -o "x$1" = "x-h" ]; then
	usage
	exit 0
fi
[ ! -x ./configure -a -e ./Makefile.cvs ] && make -f Makefile.cvs
[ ! -x ./configure -a -e ./autogen.sh ] && ./autogen.sh
[ ! -x ./configure -a -e ./configure.in ] && ( aclocal; autoheader; automake; perl admin/am_edit; autoconf )
if [ ! -x ./configure ]; then
	usage
	echo
	echo "$0 must be called from the directory that holds configure."
	exit 1
fi
QTDIR=/usr/lib/qt-1.45
KDEDIR=/usr
if [ "`uname -m`" != "ia64" ]; then
  CXX="egcs++ -L/usr/lib -L/usr/lib/qt-1.45/lib -I/usr/include/kde"
  CC="egcs -L/usr/lib -L/usr/lib/qt-1.45/lib -I/usr/include/kde"
  LDFLAGS="-L/usr/lib -L/usr/lib/qt-1.45/lib"
else
  CXX="g++ -I/usr/include/kde"
  CC="gcc -I/usr/include/kde"
fi
MOC=/usr/lib/qt-1.45/bin/moc
export QTDIR KDEDIR CXX CC LDFLAGS MOC
exec ./configure --prefix=${KDEDIR} --with-qt-dir=${QTDIR} $@
