# $Id$
AC_INIT([README])
PACKAGENAME=proxyface
MAJOR=1
MINOR=2
LEAST="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout"
for path in . .. ../..; do
if svn info $path 2>&1 > /dev/null; then
LEAST=$(LANG= svn info $path | sed -n 's/Revision: //p')
break;
fi
done
AM_INIT_AUTOMAKE($PACKAGENAME, $MAJOR.$MINOR.$LEAST, [marc@waeckerlin.org])
AC_CONFIG_FILES([makefile proxyface/makefile proxyface/version.cxx
proxyface/libproxyface.pc debian/changelog
examples/makefile Doxyfile])
# programs
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
# libtool versioning
LIB_MAJOR=$(($MAJOR+$MINOR))
LIB_MINOR=$LEAST
LIB_LEAST=$MINOR
LIB_VERSION="${LIB_MAJOR}:${LIB_MINOR}:${LIB_LEAST}"
AC_SUBST(LIB_VERSION)
AC_SUBST(PACKAGENAME)
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(LEAST)
# Qt Environment
AC_MSG_CHECKING(QT4 directory)
QTDIR="no"
AC_ARG_WITH([qt-dir],
AC_HELP_STRING([--with-qt-dir=/path/to/Qt4],
[to specify the path to the Qt4 directory.]),
[QTPATHS="$withval"],
[QTPATHS="/usr/include/qt4 /usr/local/include/qt4 /opt/include/qt4 /opt/local/include/qt4 /opt/local/libexec/qt4-mac/include /usr/include /usr/local/include /opt/include /opt/local/include"])
for x in $QTPATHS; do
if test -d $x/QtCore ; then
QTINCDIR=$x
QTDIR=${x%/include*}
if test -d $QTDIR/lib; then
QTLIBDIR=$QTDIR/lib
break
fi
fi
done
AC_MSG_RESULT($QTDIR)
AM_CONDITIONAL(USE_QT, test -n "$QTLIBDIR")
if test -z "$QTLIBDIR"; then
AC_MSG_WARN(Could not locate QT 4.1)
case $host in
*darwin*)
LDFLAGS+=" -lproxy"
;;
*mingw*|*win*)
LDFLAGS+=" -lwinhttp"
;;
*)
LDFLAGS+=" -lproxy"
;;
esac
else
# by now, Linux/Unix always uses libproxy
case $host in
*darwin*)
LDFLAGS+=" -L$QTLIBDIR -lQtCore -lQtNetwork -lQtGui"
;;
*mingw*|*win*)
LDFLAGS+=" -L$QTLIBDIR -lQtCore4 -lQtNetwork4 -lQtGui4"
;;
*)
LDFLAGS+=" -L$QTLIBDIR -lQtCore -lQtNetwork -lQtGui"
LDFLAGS+=" -lproxy"
;;
esac
CPPFLAGS+=" -DUNICODE -DQT_NO_DEBUG"
CPPFLAGS+=" -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WEBKIT_LIB -DQT_CORE_LIB"
CPPFLAGS+=" -I$QTINCDIR"
AC_CHECK_PROGS([MOC], [moc-qt4 moc-mac moc])
test -n "$MOC" || AC_MSG_ERROR([moc for Qt 4 not found!])
AC_SUBST(MOC)
AC_CHECK_PROGS([RCC], [rcc-qt4 rcc-mac rcc])
test -n "$RCC" || AC_MSG_ERROR([rcc for Qt 4 not found!])
AC_SUBST(RCC)
AC_CHECK_PROGS([UIC], [uic-qt4 uic-mac uic])
test -n "$UIC" || AC_MSG_ERROR([uic for Qt 4 not found!])
AC_SUBST(UIC)
AC_CHECK_PROGS([LRELEASE], [lrelease-qt4 lrelease-mac lrelease])
test -n "$LRELEASE" || AC_MSG_ERROR([lrelease for Qt 4 not found!])
AC_SUBST(LRELEASE)
AC_CHECK_PROGS([LUPDATE], [lupdate-qt4 lupdate-mac lupdate])
test -n "$LUPDATE" || AC_MSG_ERROR([lupdate for Qt 4 not found!])
AC_SUBST(LUPDATE)
AC_ARG_VAR(LUPDATE_ARGS, [arguments for qt lupdate command, e.g. -no-obsolete])
fi
AC_OUTPUT