X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fqimage%2Fconfigure;h=7111947edbd64be3d95a3caf93aa5dad52bff997;hb=f4963a6aa07644399b273b5d2b1f9299c9047414;hp=2c41cab0a34cc397d1cc746d03dd28bef989a6f8;hpb=9d9703dfab5c23d5c678dca36260869baf25ad6f;p=melted diff --git a/src/modules/qimage/configure b/src/modules/qimage/configure index 2c41cab..7111947 100755 --- a/src/modules/qimage/configure +++ b/src/modules/qimage/configure @@ -2,51 +2,124 @@ if [ "$help" = "1" ] then - cat << EOF + cat << EOF QImage options: - --qimage-libdir - Location of QT lib directory [/usr/lib/qt3] - --qimage-includedir - Location of QT include directory [/usr/include/qt3] + --force-qt3 - Force compile against Qt3 if Qt4 is present on the system + --qimage-libdir - Location of QT lib directory [/usr/lib/qt4 or /usr/lib/qt3] + --qimage-includedir - Location of QT include directory [/usr/include/qt4 or /usr/include/qt3] + --kde-libdir - Location of KDE lib directory [/usr/lib] + --kde-includedir - Location of KDE include directory [/usr/include/kde] EOF + else targetos=$(uname -s) case $targetos in - MINGW32*) - export LIBSUF=.dll - ;; + MINGW32*) + export LIBSUF=.dll + ;; Darwin) export LIBSUF=.dylib ;; - Linux) + Linux|FreeBSD) export LIBSUF=.so ;; *) ;; esac - qimage_includedir=/usr/include/qt3 - qimage_libdir=/usr/lib/qt3 + qimage_includedir=/usr/include/qt4 + qimage_libdir=/usr/lib/qt4 + + if [ ! -d "$qimage_libdir" -o ! -d "$qimage_includedir" ] + then + qimage_includedir=/usr/include/qt3 + qimage_libdir=/usr/lib/qt3 + kde_includedir=/usr/include/kde + kde_libdir=/usr/lib + if [ "$KDEDIR" != "" ] + then + kde_includedir="$KDEDIR/include" + kde_libdir="$KDEDIR" + fi + fi if [ "$QTDIR" != "" ] then qimage_includedir="$QTDIR/include" - qimage_libdir="$QTDIR" + qimage_libdir="$QTDIR/lib" fi + export force_qt3= + export qt4_found= + for i in "$@" do case $i in --qimage-libdir=* ) qimage_libdir="${i#--qimage-libdir=}" ;; --qimage-includedir=* ) qimage_includedir="${i#--qimage-includedir=}" ;; + --kde-libdir=* ) kde_libdir="${i#--kde-libdir=}" ;; + --kde-includedir=* ) kde_includedir="${i#--kde-includedir=}" ;; + --force-qt3 ) force_qt3="true" ;; esac done - if [ -d "$qimage_libdir" -a -d "$qimage_includedir" ] + pkg-config --exists 'QtGui >= 4' + if [ $? -eq 0 ] && [ "$force_qt3" = "" ] + then + echo "Qt version 4.x detected, will compile Qt4 qimage producer" + qt4_found=true + echo "#define USE_QT4" > config.h + echo "USE_QT4=1" > config.mak + echo QTCXXFLAGS=$(pkg-config --cflags QtGui) >> config.mak + echo QTLIBS=$(pkg-config --libs QtGui) >> config.mak + + elif [ -d "$qimage_libdir" -a -d "$qimage_includedir" ] then - echo QTCXXFLAGS=-I$qimage_includedir > config.mak - echo QTLIBS=-L$qimage_libdir/lib -lqt-mt >> config.mak - echo qimage libmltqimage$LIBSUF >> ../producers.dat + + # test if we have a Qt3 or Qt4 + if [ -f "$qimage_libdir/libQtCore.so" ] || [ -d "$qimage_libdir/QtGui.framework" ] && [ "$force_qt3" = "" ] + then + echo "Qt version 4.x detected, will compile Qt4 qimage producer" + qt4_found=true + else + echo "Qt version 3.x detected, will compile Qt3 qimage producer" + fi + + echo "Include directory: " $qimage_includedir + + echo > config.h + echo > config.mak + if [ "$qt4_found" != "" ] && [ "$force_qt3" = "" ] + then + echo "#define USE_QT4" >> config.h + echo "USE_QT4=1" >> config.mak + if [ -d "$qimage_libdir/QtGui.framework" ] + then + echo QTCXXFLAGS=$(pkg-config --cflags QtGui) >> config.mak + echo QTLIBS=$(pkg-config --libs QtGui) >> config.mak + else + echo QTCXXFLAGS=-I$qimage_includedir >> config.mak + echo QTLIBS=-L$qimage_libdir -lQtGui >> config.mak + fi + else + if [ -d "$kde_includedir" ] + then + echo "#define USE_KDE" >> config.h + echo "USE_KDE=1" >> config.mak + echo "#define USE_QT3" >> config.h + echo "USE_QT3=1" >> config.mak + echo QTCXXFLAGS=-I$qimage_includedir -I$kde_includedir -DQT_THREAD_SUPPORT >> config.mak + echo QTLIBS=-L$qimage_libdir -L$kde_libdir/lib -lqt-mt >> config.mak + else + echo "qimage: KDE environment not found - disabling extra image formats" + echo "#define USE_QT3" >> config.h + echo "USE_QT3=1" >> config.mak + echo QTCXXFLAGS=-I$qimage_includedir -DQT_THREAD_SUPPORT>> config.mak + echo QTLIBS=-L$qimage_libdir -lqt-mt >> config.mak + fi + fi else echo "qimage: QT environment not found - disabling" touch ../disable-qimage