diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 66 |
1 files changed, 40 insertions, 26 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index d5ef61f..b48ee93 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,4 +1,4 @@ -###############################################################################################################333 +################################################################################################## # Check for Qt compiler flags, linker flags, and binary packages AC_DEFUN([gw_CHECK_QT], [ @@ -9,9 +9,9 @@ AC_MSG_CHECKING([QTDIR]) AC_ARG_WITH([qtdir], [ --with-qtdir=DIR Qt installation directory [default=$QTDIR]], QTDIR=$withval) # Check that QTDIR is defined or that --with-qtdir given if test x"$QTDIR" = x ; then - QT_SEARCH="/usr/lib/qt31 /usr/local/qt31 /usr/lib/qt3 /usr/local/qt3 /usr/lib/qt2 /usr/local/qt2 /usr/lib/qt /usr/local/qt" + QT_SEARCH="/usr/lib/qt4 /usr/local/qt4 /usr/lib/qt /usr/local/qt" for i in $QT_SEARCH; do - if test -f $i/include/qglobal.h -a x$QTDIR = x; then QTDIR=$i; fi + if test -f $i/include/QtCore/QObject -a x$QTDIR = x; then QTDIR=$i; fi done fi if test x"$QTDIR" = x ; then @@ -27,13 +27,10 @@ QTDIR=`echo $QTDIR | perl -p -e 's/\\\\/\\//g'` # Figure out which version of Qt we are using AC_MSG_CHECKING([Qt version]) -QT_VER=`grep 'define.*QT_VERSION_STR\W' $QTDIR/include/qglobal.h | perl -p -e 's/\D//g'` +QT_VER=`grep 'define.*QT_VERSION_STR\W' $QTDIR/include/QtCore/qglobal.h | perl -p -e 's/\D//g'` case "${QT_VER}" in - 2*) - QT_MAJOR="2" - ;; - 3*) - QT_MAJOR="3" + 4*) + QT_MAJOR="4" ;; *) AC_MSG_ERROR([*** Don't know how to handle this Qt major version]) @@ -41,26 +38,43 @@ case "${QT_VER}" in esac AC_MSG_RESULT([$QT_VER ($QT_MAJOR)]) -# Check that moc is in path -AC_CHECK_PROG(MOC, moc, moc) -if test x$MOC = x ; then - AC_MSG_ERROR([*** moc must be in path]) -fi - -# uic is the Qt user interface compiler -AC_CHECK_PROG(UIC, uic, uic) -if test x$UIC = x ; then - AC_MSG_ERROR([*** uic must be in path]) +if test x"$QTDIR" = x ; then + # Check that moc is in path + AC_CHECK_PROG(MOC, $QTDIR/bin/moc, $QTDIR/bin/moc) + if test x$MOC = x ; then + AC_MSG_ERROR([*** moc must be in path]) + fi + + # uic is the Qt user interface compiler + AC_CHECK_PROG(UIC, $QTDIR/bin/uic, $QTDIR/bin/uic) + if test x$UIC = x ; then + AC_MSG_ERROR([*** uic must be in path]) + fi + + # qembed is the Qt data embedding utility. + # It is located in $QTDIR/tools/qembed, and must be compiled and installed + # manually, we'll let it slide if it isn't present + AC_CHECK_PROG(QEMBED, qembed, qembed) +else + # Check that moc is in path + MOC=$QTDIR/bin/moc + + # uic is the Qt user interface compiler + UIC=$QTDIR/bin/uic + + # qembed is the Qt data embedding utility. + # It is located in $QTDIR/tools/qembed, and must be compiled and installed + # manually, we'll let it slide if it isn't present + QEMBED=$QTDIR/bin/qembed + + AC_SUBST(MOC) + AC_SUBST(UIC) + AC_SUBST(QEMBED) fi -# qembed is the Qt data embedding utility. -# It is located in $QTDIR/tools/qembed, and must be compiled and installed -# manually, we'll let it slide if it isn't present -AC_CHECK_PROG(QEMBED, qembed, qembed) - # Calculate Qt include path -QT_CXXFLAGS="-I$QTDIR/include" +QT_CXXFLAGS="-I$QTDIR/include -I$QTDIR/include/Qt -I$QTDIR/include/Qt3Support -I$QTDIR/include/QtCore -I$QTDIR/include/QtDesigner -I$QTDIR/include/QtGui -I$QTDIR/include/QtNetwork -I$QTDIR/include/QtOpenGL -I$QTDIR/include/QtSql -I$QTDIR/include/QtXml" QT_IS_EMBEDDED="no" # On unix, figure out if we're doing a static or dynamic link @@ -137,7 +151,7 @@ case "${host}" in *linux*) QT_LIBS="$QT_LIB" if test $QT_IS_STATIC = yes && test $QT_IS_EMBEDDED = no; then - QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -ldl -ljpeg" + QT_LIBS="$QT_LIBS -L$x_libraries -lQtCore -lQtGui -lXext -lX11 -lm -lSM -lICE -ldl -ljpeg" fi ;; |