1if test -z "$with_qt"; then
2  with_qt=yes
3fi
4QTLIBS="-lQtCore -lQtGui -lstdc++"
5QTMOC=
6QTLIB=
7QTINC=
8
9if test -n "$with_qt_lib"; then
10  QTLIB="-L$with_qt_lib"
11fi
12if test -n "$with_qt_include"; then
13  QTINC="-I$with_qt_include"
14fi
15
16case "$with_qt" in
17yes)
18   pth=`echo $PATH | tr ':' ' '`;
19   QTMOC=`./locate moc '' $pth`
20   if ! test -n "$QTMOC"; then
21     case "$sizeof_long" in
22       4) addlib="/usr/local/lib32 /lib32 /usr/lib32";;
23       8) addlib="/usr/local/lib64 /lib64 /usr/lib64";;
24     esac
25     pth="$addlib /usr/local/lib /usr/local/share /usr/lib /lib /usr/share"
26     QTMOC=`./locate qt4/bin/moc '' $pth`
27     if ! test -n "$QTMOC"; then
28       QTMOC=`./locate qt/bin/moc '' $pth`
29     fi
30   fi;;
31*) if test ! -d "$with_qt"; then
32     echo "### Qt binary '$with_qt/moc' not found"
33   else
34     QTMOC=$with_qt/moc
35     which_graphic_lib=Qt4
36   fi;;
37esac
38
39if test -n "$QTMOC"; then
40  if test -z "$QTINC"; then
41    QTDIR=`dirname $QTMOC`
42    if test -d "$QTDIR/include"; then
43      QTINC="-I$QTDIR/include"
44    else
45      QTINC="-I/usr/include/qt4"
46    fi
47  fi
48  if test -z "$QTLIB"; then
49    lib=QtCore; . ./locatelib
50    if test -n "$QtCore"; then
51      QTLIB="-L$QtCore"
52    fi
53  fi
54fi
55if test -n "$QTMOC"; then
56  exe=$osname-$arch-Qt4$$$exe_suff
57  cmd="g++ $CFLAGS $extraflag $QTLIB $QTLIBS $QTINC -o $exe has_Qt4.c"
58  . log_cmd;
59  if test ! -r $exe; then
60    QTMOC=
61  fi
62fi
63
64if test -n "$QTMOC"; then
65  echo "Using Qt library, QTMOC = $QTMOC, QTLIB = $QTLIB, QTINC = $QTINC"
66  which_graphic_lib=Qt4
67else
68  which_graphic_lib=none
69  echo "### Qt not found. Building without Qt support"
70fi
71