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
29 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
33 if test "x$OpenGL_ok" != "xyes" ; then
34 AC_MSG_WARN(Qt needs OpenGL correct configuration, check configure output)
42 if test "x$QTDIR" = "x"
44 AC_MSG_RESULT(please define QTDIR variable)
47 AC_MSG_RESULT(QTDIR is $QTDIR)
50 AC_CHECK_FILE(${QTDIR}/include/qt3/qglobal.h,QTINC="/qt3",QTINC="")
51 QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
52 AC_MSG_RESULT(Qt version is $QT_VERSION)
55 if test "x$qt_ok" = "xyes"
57 if test -f ${QTDIR}/bin/moc
61 AC_PATH_PROG(MOC, moc)
66 AC_MSG_RESULT(moc qt-compiler not in PATH variable)
69 AC_MSG_RESULT(moc found)
73 if test "x$qt_ok" = "xyes"
75 if test -f ${QTDIR}/bin/uic
79 AC_PATH_PROG(UIC, uic)
84 AC_MSG_RESULT(uic qt-interface compiler not in PATH variable)
87 AC_MSG_RESULT(uic found)
94 if test "x$qt_ok" = "xyes"
96 CPPFLAGS_old=$CPPFLAGS
97 CPPFLAGS="$CPPFLAGS -I$QTDIR/include${QTINC}"
100 AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
102 CPPFLAGS=$CPPFLAGS_old
104 AC_MSG_CHECKING(include of qt headers)
106 if test "x$qt_ok" = "xno"
108 AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
109 AC_MSG_RESULT(QTDIR environment variable may be wrong)
112 QT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
113 QT_MT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
117 if test "x$qt_ok" = "xyes"
119 AC_MSG_CHECKING(linking qt library)
121 if test "x$QTDIR" = "x/usr"
123 LIBS="$LIBS -lqt-mt $OGL_LIBS"
125 LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt $OGL_LIBS"
128 CXXFLAGS_old=$CXXFLAGS
129 CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
131 AC_CACHE_VAL(salome_cv_lib_qt,[
133 #include <qapplication.h>
136 QApplication a(n, s);
138 eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
140 qt_ok="$salome_cv_lib_qt"
142 if test "x$qt_ok" = "xno"
144 AC_MSG_RESULT(unable to link with qt library)
145 AC_MSG_RESULT(QTDIR environment variable may be wrong)
148 if test "x$QTDIR" = "x/usr"
151 QT_MT_LIBS=" -lqt-mt"
153 QT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
154 QT_MT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
159 CXXFLAGS=$CXXFLAGS_old
167 AC_SUBST(QT_INCLUDES)
168 AC_SUBST(QT_MT_INCLUDES)
175 AC_MSG_RESULT(for Qt: $qt_ok)