Salome HOME
Updated copyright comment
[modules/gui.git] / adm_local / unix / config_files / check_qt.m4
1 dnl Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 dnl
3 dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 dnl
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License, or (at your option) any later version.
10 dnl
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 dnl Lesser General Public License for more details.
15 dnl
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 dnl
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 dnl
22
23 dnl  OPTIONS_QT
24 dnl  ------------------------------------------------------------------------
25 dnl  Adds the --with-qt=path
26 dnl
27 AC_DEFUN([OPTIONS_QT], [
28   AC_ARG_WITH([qt],
29               [AC_HELP_STRING([--with-qt], [Possible usage:
30                                              "Qt_Install_Path" - prefix to path where Qt was installd;
31                                              "" or "yes" or "auto" - means seaching installed Qt product in the system (checking $QTDIR and then - standard system paths );
32                                              "no" - not use Qt product (is not supported)
33                                             By default "" option is used)])],
34               [with_qt=$withval], [with_qt=""])
35 ])
36
37 AC_DEFUN([CHECK_QT],[
38 AC_REQUIRE([AC_PROG_CC])dnl
39 AC_REQUIRE([AC_PROG_CXX])dnl
40 AC_REQUIRE([AC_PROG_CPP])dnl
41 AC_REQUIRE([AC_PROG_CXXCPP])dnl
42 AC_REQUIRE([CHECK_OPENGL])dnl
43 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
44 AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
45
46 AC_REQUIRE([OPTIONS_QT])dnl
47
48 AC_CHECKING(for Qt)
49
50 if test "x$OpenGL_ok" != "xyes" ; then
51    AC_MSG_WARN(Qt needs OpenGL correct configuration, check configure output)
52 fi
53
54 qt_ok=yes
55
56 QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%')
57
58 if test -z $QTDIR ; then
59 dnl Trying to search Qt5
60   QTDIR=$(echo $QT5_ROOT_DIR | sed 's%[/]\+$%%')
61 fi
62
63 AC_LANG_SAVE
64 AC_LANG_CPLUSPLUS
65
66 dnl QT install dir
67 if test -z $with_qt ; then
68   with_qt=""
69 fi
70 if test "x$with_qt" = "xyes" ; then
71   dnl in case user wrote --with-qt=yes
72   with_qt=""
73 fi
74 if test "x$with_qt" = "xauto" ; then
75   dnl in case user wrote --with-qt=auto
76   with_qt=""
77 fi
78 if test "x$with_qt" = "xno" ; then
79   dnl in case user wrote --with-qt=no
80   with_qt=""
81   AC_MSG_WARN(Value no, specified for option --with-qt, is not supported)
82 fi
83
84 if test "x$with_qt" != "x" ; then
85   dnl Using "--with-qt" prefix path
86   QTDIR="$with_qt"
87 elif test "$QTDIR" = "/usr/lib/qt3" ; then
88   dnl Using QTDIR environment variable
89   AC_MSG_RESULT(current QTDIR is $QTDIR)
90   dnl 
91   if test -d /usr/lib/qt4 ; then
92     AC_MSG_RESULT(it is strange for a qt4 installation !)
93     AC_MSG_RESULT(/usr/lib/qt4 is present)
94     AC_MSG_RESULT(replacing QTDIR by /usr/lib/qt4)
95     QTDIR=/usr/lib/qt4
96   fi
97 elif test -z $QTDIR ; then
98   AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed, trying to guess using pkg-config)
99   PKG_PROG_PKG_CONFIG()
100   AS_IF([test "x$PKG_CONFIG" != "x"],
101     [
102       QT_REQUIRED_VERSION=4.0.0
103       if $PKG_CONFIG --exists "QtCore >= $QT_REQUIRED_VERSION"
104       then
105         QT_USING_PKGCONFIG=yes
106         QT_VERSION=`$PKG_CONFIG --modversion QtCore --atleast-version=$QT_REQUIRED_VERSION`
107         QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
108
109         MOC=`$PKG_CONFIG --variable=moc_location "QtCore >= $QT_REQUIRED_VERSION"`
110         UIC=`$PKG_CONFIG --variable=uic_location "QtCore >= $QT_REQUIRED_VERSION"`
111         QRCC=`$PKG_CONFIG --variable=rcc_location "QtCore >= $QT_REQUIRED_VERSION"`
112         LRELEASE=`$PKG_CONFIG --variable=lrelease_location "QtCore >= $QT_REQUIRED_VERSION"`
113
114         QTCORE_CPPFLAGS=`$PKG_CONFIG --cflags "QtCore >= $QT_REQUIRED_VERSION"`
115         QTGUI_CPPFLAGS=`$PKG_CONFIG --cflags "QtGui >= $QT_REQUIRED_VERSION"`
116         QTOPENGL_CPPFLAGS=`$PKG_CONFIG --cflags "QtOpenGL >= $QT_REQUIRED_VERSION"`
117         QTXML_CPPFLAGS=`$PKG_CONFIG --cflags "QtXml >= $QT_REQUIRED_VERSION"`
118         QTASSISTANT_CPPFLAGS=`$PKG_CONFIG --cflags "QtAssistant >= $QT_REQUIRED_VERSION"`
119         QTNETWORK_CPPFLAGS=`$PKG_CONFIG --cflags "QtNetwork >= $QT_REQUIRED_VERSION"`
120         QTWEBKIT_CPPFLAGS=`$PKG_CONFIG --cflags "QtWebKit >= $QT_REQUIRED_VERSION"`
121
122         QTCORE_LDFLAGS=`$PKG_CONFIG --libs "QtCore >= $QT_REQUIRED_VERSION"`
123         QTGUI_LDFLAGS=`$PKG_CONFIG --libs "QtGui >= $QT_REQUIRED_VERSION"`
124         QTOPENGL_LDFLAGS=`$PKG_CONFIG --libs "QtOpenGL >= $QT_REQUIRED_VERSION"`
125         QTXML_LDFLAGS=`$PKG_CONFIG --libs "QtXml >= $QT_REQUIRED_VERSION"`
126         QTASSISTANT_LDFLAGS=`$PKG_CONFIG --libs "QtAssistant >= $QT_REQUIRED_VERSION"`
127         QTNETWORK_LDFLAGS=`$PKG_CONFIG --libs "QtNetwork >= $QT_REQUIRED_VERSION"`
128         QTWEBKIT_LDFLAGS=`$PKG_CONFIG --libs "QtWebKit >= $QT_REQUIRED_VERSION"`
129       else
130         AC_MSG_WARN(Qt not found)
131       fi
132     ],
133     [
134       AC_MSG_WARN([pkg-config not found])
135     ]
136   )
137 fi
138 if test -z $QTDIR ; then
139   AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
140   for d in /usr/local/lib/qt4 /usr/lib/qt4 /usr ; do
141     if test -f ${d}/lib/libQtCore.so ; then
142       AC_MSG_RESULT(trying ${d})
143       QTDIR="${d}"
144       break
145     elif test -f ${d}/lib64/libQtCore.so ; then
146       AC_MSG_RESULT(trying ${d})
147       QTDIR="${d}"
148       break
149     elif test -f ${d}/libQtCore.so ; then
150       AC_MSG_RESULT(trying ${d})
151       QTDIR="${d}"
152       break
153     fi
154   done
155 fi
156 #
157 # check QTDIR environment variable
158 #
159 if test "x$QTDIR" = "x" -a "x$QT_USING_PKGCONFIG" != "xyes"
160 then
161    AC_MSG_RESULT(Please define correct path in "--with-qt" option or use correct $QTDIR variable)
162    qt_ok=no
163 fi
164
165 #
166 # check Qt version
167 #
168 if  test "x$qt_ok" = "xyes"
169 then
170    AC_MSG_CHECKING(whether Qt version >= 4.0)
171    if test "x$QT_USING_PKGCONFIG" != "xyes"
172    then
173      qt_inc_ok=no
174      QTINC=""
175      AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
176      if test "x$QTINC" = "x"
177      then
178        AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
179      else
180        qt_inc_ok=yes
181      fi
182
183      if test "x$qt_inc_ok" = "xyes"
184      then
185        QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
186      fi
187    fi
188
189
190   if test "x$qt_inc_ok" = "xyes" -o "x$QT_USING_PKGCONFIG" = "xyes"
191   then
192      QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
193      QT_VERSION_MAJ=`echo $QT_VERSION | awk -F. '{v=$[1];print v}'`     
194      if test $QT_VERSION_ID -ge 40000
195      then
196        AC_MSG_RESULT(yes)
197      else
198        AC_MSG_RESULT(no)
199        qt_ok=no
200      fi
201      AC_MSG_CHECKING(Qt version)
202      AC_MSG_RESULT($QT_VERSION)
203    else
204      qt_ok=no
205    fi
206 fi
207
208 #
209 # check moc presence (meta-object compiler)
210 #
211 qt_add=no
212
213 if  test "x$qt_ok" = "xyes"
214 then
215   if test "x$QT_USING_PKGCONFIG" != "xyes"
216   then
217     if test -f ${QTDIR}/bin/moc
218     then
219       MOC=${QTDIR}/bin/moc
220     else
221       AC_PATH_PROG(MOC, moc)
222     fi
223   fi
224
225   if test "x$MOC" = "x"
226   then
227     qt_ok=no
228     AC_MSG_RESULT(moc (Qt meta-object compiler) is not in the PATH variable)
229   else
230     qt_ok=yes
231     AC_MSG_RESULT(moc (Qt meta-object compiler) is found)
232   fi
233
234   if test "x$qt_ok" = "xyes"
235   then
236     dnl check moc version
237     AC_MSG_CHECKING( equality Qt and moc tool version)
238     dnl Qt4 or Qt5
239     if  test "x$QT_VERSION_MAJ" = "x5"
240     then
241       MOC_VERSION=`$MOC -v 2>&1 | awk 'BEGIN{FS=" "};{print $(NF)}'`
242     else
243       MOC_VERSION=`$MOC -v 2>&1 | awk 'BEGIN{FS="[[ ()]]"};{print $(NF-1)}'`
244     fi
245     if test "x$QT_VERSION" = "x$MOC_VERSION"
246     then
247       AC_MSG_RESULT(yes)
248       qt_ok=yes
249     else
250       AC_MSG_RESULT(moc tool and Qt product are incompatible $MOC_VERSION)
251       AC_MSG_CHECKING(for moc-qt$QT_VERSION_MAJ compatible version)
252       if test -f ${QTDIR}/bin/moc-qt$QT_VERSION_MAJ
253       then
254         MOC=${QTDIR}/bin/moc-qt$QT_VERSION_MAJ
255         qt_ok=yes
256         qt_add=$QT_VERSION_MAJ
257         AC_MSG_RESULT(yes)
258       else
259         AC_MSG_RESULT(no)
260         qt_ok=no
261       fi
262     fi
263   fi
264 fi
265 AC_MSG_CHECKING(moc tool and Qt product done)
266 AC_MSG_RESULT(yes)
267
268 #
269 # check uic presence (user interface compiler)
270 #
271 if  test "x$qt_ok" = "xyes"
272 then
273   if test "x$QT_USING_PKGCONFIG" != "xyes"
274   then
275     if test "x$qt_add" = "xno"
276     then
277        AC_MSG_CHECKING(uic)
278        if test -f ${QTDIR}/bin/uic
279        then
280          UIC=${QTDIR}/bin/uic
281        else
282          AC_PATH_PROG(UIC, uic)
283        fi
284        AC_MSG_RESULT(yes)
285     else
286        AC_MSG_CHECKING(uic-qt$qt_add)
287        if test -f ${QTDIR}/bin/uic-qt$qt_add
288        then
289          UIC=${QTDIR}/bin/uic-qt$qt_add
290        else
291          AC_PATH_PROG(UIC, uic)
292        fi
293        AC_MSG_RESULT(yes)
294     fi
295   fi
296
297   if test "x$UIC" = "x"
298   then
299     qt_ok=no
300     AC_MSG_RESULT(uic (Qt user interface compiler) is not in the PATH variable)
301   else
302     qt_ok=yes
303     AC_MSG_RESULT(uic (Qt user interface compiler) is found)
304   fi
305
306   if test "x$qt_ok" = "xyes"
307   then
308     dnl check uic version
309     AC_MSG_CHECKING(cheching equality Qt and uic tool version)
310     UIC_VERSION=`$UIC -version 2>&1 | awk '{print $NF}'`
311     if test "x$QT_VERSION" = "x$UIC_VERSION"
312     then
313       AC_MSG_RESULT(yes)
314       qt_ok=yes
315     else
316       AC_MSG_RESULT(uic tool and Qt product are incompatible)
317       qt_ok=no
318     fi
319   fi
320 fi
321
322 #
323 # check rcc presence (resources compiler)
324 #
325 if  test "x$qt_ok" = "xyes"
326 then
327   if test "x$QT_USING_PKGONFIG" != "xyes"
328   then
329     if test "x$qt_add" = "xno"
330     then
331        if test -f ${QTDIR}/bin/rcc
332        then
333          QRCC=${QTDIR}/bin/rcc
334        else
335          AC_PATH_PROG(QRCC, rcc)
336        fi
337     else
338        if test -f ${QTDIR}/bin/rcc-qt$qt_add
339        then
340          QRCC=${QTDIR}/bin/rcc-qt$qt_add
341        else
342          AC_PATH_PROG(QRCC, rcc)
343        fi
344     fi
345   fi
346
347   if test "x$QRCC" = "x"
348   then
349     qt_ok=no
350     AC_MSG_RESULT(rcc (Qt resources compiler) is not in the PATH variable)
351   else
352     qt_ok=yes
353     AC_MSG_RESULT(rcc (Qt resources compiler) is found)
354   fi
355
356   if test "x$qt_ok" = "xyes"
357   then
358     dnl check rcc version
359     AC_MSG_CHECKING(cheching equality Qt and rcc tool version)
360     QRCC_VERSION=`$QRCC -v 2>&1 | awk '{print $NF}'`
361     if test "x$QT_VERSION" = "x$QRCC_VERSION"
362     then
363       AC_MSG_RESULT(yes)
364       qt_ok=yes
365     else
366       AC_MSG_RESULT(rcc tool and Qt product are incompatible)
367       qt_ok=no
368     fi
369   fi
370 fi
371
372 #
373 # check lrelease presence (translation files compiler)
374 #
375 if  test "x$qt_ok" = "xyes"
376 then
377   if test "x$QT_USING_PKGCONFIG" != "xyes"
378   then
379     if test "x$qt_add" = "xno"
380     then
381        if test -f ${QTDIR}/bin/lrelease
382        then
383          LRELEASE=${QTDIR}/bin/lrelease
384        else
385          AC_PATH_PROG(LRELEASE, lrelease)
386        fi
387     else
388        if test -f ${QTDIR}/bin/lrelease-qt$qt_add
389        then
390          LRELEASE=${QTDIR}/bin/lrelease-qt$qt_add
391        else
392          AC_PATH_PROG(LRELEASE, lrelease)
393        fi
394     fi
395   fi
396
397   if test "x$LRELEASE" = "x"
398   then
399     qt_ok=no
400     AC_MSG_RESULT(lrelease (Qt translation files compiler) is not in the PATH variable)
401   else
402     qt_ok=yes
403     AC_MSG_RESULT(lrelease (Qt translation files compiler) is found)
404   fi
405   
406   if test "x$qt_ok" = "xyes"
407   then
408     dnl check lrelease version
409     AC_MSG_CHECKING( equality of Qt and lrelease tool version)
410     LRELEASE_VERSION=`$LRELEASE -version 2>&1 | awk '{print $NF}'`
411     if test "x$QT_VERSION" = "x$LRELEASE_VERSION"
412     then
413       AC_MSG_RESULT(yes)
414       qt_ok=yes
415     else
416       AC_MSG_RESULT(lrelease tool and Qt product are incompatible)
417       qt_ok=no
418     fi
419   fi
420 fi
421
422 QT_ROOT=$QTDIR
423
424 #
425 # check Qt header files
426 #
427 if  test "x$qt_ok" = "xyes"
428 then
429   AC_CHECKING(include Qt header files)
430
431   CPPFLAGS_old=$CPPFLAGS
432   if test "x$QT_USING_PKGCONFIG" != "xyes"
433   then
434     CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore -fPIC"
435   else
436     CPPFLAGS="$CPPFLAGS $QTCORE_CPPFLAGS"
437   fi
438   AC_CHECK_HEADER(QObject,qt_ok=yes,qt_ok=no)
439   CPPFLAGS=$CPPFLAGS_old
440
441   if  test "x$qt_ok" = "xno"
442   then
443     AC_MSG_RESULT(qt header files are not found in $QTDIR/include${QTINC}/QtCore)
444     AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
445   else
446     AC_MSG_RESULT(qt header files seem to be OK)
447     if test "x$QT_USING_PKGCONFIG" != "xyes"
448     then
449        QT_BASE="-I${QTDIR}/include${QTINC}"
450        # user header files
451        QTCORE_CPPFLAGS="${QT_BASE}/QtCore"
452        QTGUI_CPPFLAGS="${QT_BASE}/QtGui"
453        QTWIDGETS_CPPFLAGS="${QT_BASE}/QtWidgets"
454        QTOPENGL_CPPFLAGS="${QT_BASE}/QtOpenGL"
455        QTWEBKIT_CPPFLAGS="${QT_BASE}/QtWebKit"
456        QTXML_CPPFLAGS="${QT_BASE}/QtXml"
457
458        QTASSISTANT_CPPFLAGS="${QT_BASE}/QtAssistant"
459        QTNETWORK_CPPFLAGS="${QT_BASE}/QtNetwork"
460      fi
461
462      QT_INCLUDES="$QT_BASE $QTCORE_CPPFLAGS $QTGUI_CPPFLAGS $QTOPENGL_CPPFLAGS $QTXML_CPPFLAGS $QTWEBKIT_CPPFLAGS"
463
464      # Qt5
465      if  test "x$QT_VERSION_MAJ" = "x5"
466      then
467        QT_INCLUDES="$QT_INCLUDES  $QTWIDGETS_CPPFLAGS"
468      fi     
469
470      QT_ASSISTANT_INCLUDES="$QTASSISTANT_CPPFLAGS $QTNETWORK_CPPFLAGS"
471      QT_MT_INCLUDES="${QT_INCLUDES}"
472   fi
473 fi
474
475 #
476 # test Qt libraries
477 #
478 if  test "x$qt_ok" = "xyes"
479 then
480   AC_MSG_CHECKING(linking against Qt library)
481
482      # Qt4
483      QT_LIB_SUFF=""
484      # Qt5
485      if  test "x$QT_VERSION_MAJ" = "x5"
486      then
487        QT_LIB_SUFF="5"
488      fi     
489   CXXFLAGS_old=$CXXFLAGS
490   CXXFLAGS="$CXXFLAGS $QT_INCLUDES -fPIC"
491
492   LIBS_old=$LIBS
493   if test "x$QT_USING_PKGCONFIG" = "xyes"
494   then
495     LIBS="$LIBS $QTCORE_LDFLAGS"
496   else
497     if test "x$QTDIR" = "x/usr" ; then
498       QT_LIB_DIR=""
499     elif test -d ${QTDIR}/lib; then
500       QT_LIB_DIR="-L$QTDIR/lib"
501     elif test -d ${QTDIR}/lib64; then
502       QT_LIB_DIR="-L$QTDIR/lib64"
503     elif test "x$QTDIR" = "x/usr/lib/qt4" ; then
504       QT_LIB_DIR=""
505     else
506       AC_MSG_ERROR(Can't detect Qt library directory )  #'
507       qt_ok=no
508     fi
509     LIBS="$LIBS $QT_LIB_DIR -lQt${QT_LIB_SUFF}Core"
510   fi
511
512   AC_CACHE_VAL(salome_cv_lib_qt,[
513     AC_TRY_LINK(
514 #include <QCoreApplication>
515 ,   int n;
516     char **s;
517     QCoreApplication a(n, s);
518     a.exec();,
519     eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
520   ])
521   qt_ok="$salome_cv_lib_qt"
522
523   # BEGIN: for CCRT (installation of qt have only a "lib" directory)
524   if  test "x$qt_ok" = "xno"
525   then
526     QT_LIB_DIR="-L$QTDIR/lib"
527     LIBS="$LIBS_old $QT_LIB_DIR -lQt${QT_LIB_SUFF}Core"
528
529     AC_CACHE_VAL(salome_cv_lib_qt,[
530       AC_TRY_LINK(
531 #include <QCoreApplication>
532 ,     int n;
533       char **s;
534       QCoreApplication a(n, s);
535       a.exec();,
536       eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
537     ])
538     qt_ok="$salome_cv_lib_qt"
539   fi
540   # END: for CCRT
541
542   if  test "x$qt_ok" = "xno"
543   then
544     AC_MSG_RESULT(no)
545     AC_MSG_RESULT(unable to link with qt library)
546     AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
547   else
548     AC_MSG_RESULT(yes)
549     # core libs
550     if test "x$QT_USING_PKGCONFIG" = "xyes"
551     then
552       QT_CORE_LIBS="$QTCORE_LDFLAGS $QTXML_LDFLAGS"
553       QT_GUI_LIBS="$QTGUI_LDFLAGS $QTOPENGL_LDFLAGS $QTWEBKIT_LDFLAGS"
554       QT_ASSISTANT_LIBS="$QTASSISTANT_LDFLAGS $QTNETWORK_LDFLAGS"
555     else
556       QT_CORE_LIBS="$QT_LIB_DIR -lQt${QT_LIB_SUFF}Core -lQt${QT_LIB_SUFF}Xml"
557       # gui libs
558       QT_GUI_LIBS="$QT_LIB_DIR -lQt${QT_LIB_SUFF}Gui -lQt${QT_LIB_SUFF}OpenGL -lQt${QT_LIB_SUFF}WebKit"
559       if  test "x$QT_VERSION_MAJ" = "x5"
560       then
561         QT_GUI_LIBS="$QT_GUI_LIBS -lQt5Widgets"
562       fi     
563
564       # other libs (currently not used)
565       QT_OTHER_LIBS="$QT_LIB_DIR"
566       # other libs (can be used if necessary)
567       #QT_OTHER_LIBS="$QT_LIB_DIR -lQt3Support -lQtAssistantClient -lQtDesigner -lQtNetwork -lQtSql -lQtSvg -lQtTest -ltQtUiTools"
568       QT_ASSISTANT_LIBS="$QT_LIB_DIR -lQt${QT_LIB_SUFF}AssistantClient -lQt${QT_LIB_SUFF}Network"
569     fi
570     # all libs
571     QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_OTHER_LIBS"
572     # this flag is obsolete with Qt 4
573     QT_MT_LIBS="$QT_LIBS"
574   fi
575   LIBS=$LIBS_old
576   CXXFLAGS=$CXXFLAGS_old
577 fi
578
579 AC_SUBST(QTDIR)
580 AC_SUBST(MOC)
581 AC_SUBST(UIC)
582 AC_SUBST(QRCC)
583 AC_SUBST(LRELEASE)
584
585 AC_SUBST(QT_ROOT)
586 AC_SUBST(QT_INCLUDES)
587 AC_SUBST(QT_MT_INCLUDES)
588 AC_SUBST(QT_ASSISTANT_INCLUDES)
589 AC_SUBST(QT_LIB_DIR)
590 AC_SUBST(QT_CORE_LIBS)
591 AC_SUBST(QT_GUI_LIBS)
592 AC_SUBST(QT_OTHER_LIBS)
593 AC_SUBST(QT_LIBS)
594 AC_SUBST(QT_MT_LIBS)
595 AC_SUBST(QT_ASSISTANT_LIBS)
596 AC_SUBST(QT_VERSION)
597 AC_SUBST(QT_VERSION_ID)
598
599 AC_LANG_RESTORE
600
601 AC_MSG_RESULT(for Qt: $qt_ok)
602
603 # Save cache
604 AC_CACHE_SAVE
605
606 ])dnl
607 dnl