1 dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 dnl This library is free software; you can redistribute it and/or
5 dnl modify it under the terms of the GNU Lesser General Public
6 dnl License as published by the Free Software Foundation; either
7 dnl version 2.1 of the License.
9 dnl This library is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 dnl Lesser General Public License for more details.
14 dnl You should have received a copy of the GNU Lesser General Public
15 dnl License along with this library; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 AC_REQUIRE([AC_PROG_CC])dnl
25 AC_REQUIRE([AC_PROG_CXX])dnl
26 AC_REQUIRE([AC_PROG_CPP])dnl
27 AC_REQUIRE([AC_PROG_CXXCPP])dnl
28 AC_REQUIRE([CHECK_OPENGL])dnl
36 if test "x$QTDIR" = "x"
38 AC_MSG_RESULT(please define QTDIR variable)
41 AC_MSG_RESULT(QTDIR is $QTDIR)
44 AC_CHECK_FILE(${QTDIR}/include/qt3/qglobal.h,QTINC="/qt3",QTINC="")
45 QT_VERS=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
46 AC_MSG_RESULT(Qt version is $QT_VERS)
47 QT_VERS="Qt_"`echo $QT_VERS | sed -e 's%\"%%g' -e 's%\.%_%g'`
50 if test "x$qt_ok" = "xyes"
52 if test -f ${QTDIR}/bin/moc
56 AC_PATH_PROG(MOC, moc)
61 AC_MSG_RESULT(moc qt-compiler not in PATH variable)
64 AC_MSG_RESULT(moc found)
68 if test "x$qt_ok" = "xyes"
70 if test -f ${QTDIR}/bin/uic
74 AC_PATH_PROG(UIC, uic)
79 AC_MSG_RESULT(uic qt-interface compiler not in PATH variable)
82 AC_MSG_RESULT(uic found)
89 if test "x$qt_ok" = "xyes"
91 CPPFLAGS_old=$CPPFLAGS
92 CPPFLAGS="$CPPFLAGS -I$QTDIR/include${QTINC}"
95 AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
97 CPPFLAGS=$CPPFLAGS_old
99 AC_MSG_CHECKING(include of qt headers)
101 if test "x$qt_ok" = "xno"
103 AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
104 AC_MSG_RESULT(QTDIR environment variable may be wrong)
107 QT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
108 QT_MT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
112 if test "x$qt_ok" = "xyes"
114 AC_MSG_CHECKING(linking qt library)
116 if test "x$QTDIR" = "x/usr"
118 LIBS="$LIBS -lqt-mt $OGL_LIBS"
120 LIBS="$LIBS -L$QTDIR/lib -lqt-mt $OGL_LIBS"
123 CXXFLAGS_old=$CXXFLAGS
124 CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
126 AC_CACHE_VAL(salome_cv_lib_qt,[
128 #include <qapplication.h>
131 QApplication a(n, s);
133 eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
135 qt_ok="$salome_cv_lib_qt"
137 if test "x$qt_ok" = "xno"
139 AC_MSG_RESULT(unable to link with qt library)
140 AC_MSG_RESULT(QTDIR environment variable may be wrong)
143 if test "x$QTDIR" = "x/usr"
146 QT_MT_LIBS=" -lqt-mt"
148 QT_LIBS="-L$QTDIR/lib -lqt-mt"
149 QT_MT_LIBS="-L$QTDIR/lib -lqt-mt"
154 CXXFLAGS=$CXXFLAGS_old
162 AC_SUBST(QT_INCLUDES)
163 AC_SUBST(QT_MT_INCLUDES)
170 AC_MSG_RESULT(for qt: $qt_ok)