1 dnl Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License.
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl Lesser General Public License for more details.
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 AC_REQUIRE([AC_PROG_CC])dnl
21 AC_REQUIRE([AC_PROG_CXX])dnl
22 AC_REQUIRE([AC_PROG_CPP])dnl
23 AC_REQUIRE([AC_PROG_CXXCPP])dnl
24 AC_REQUIRE([CHECK_OPENGL])dnl
25 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
29 if test "x$OpenGL_ok" != "xyes" ; then
30 AC_MSG_WARN(Qt needs OpenGL correct configuration, check configure output)
38 if test "x$QTDIR" = "x"
40 AC_MSG_RESULT(please define QTDIR variable)
43 AC_MSG_RESULT(QTDIR is $QTDIR)
46 AC_CHECK_FILE(${QTDIR}/include/qt3/qglobal.h,QTINC="/qt3",QTINC="")
47 QT_VERS=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
48 AC_MSG_RESULT(Qt version is $QT_VERS)
49 QT_VERS="Qt_"`echo $QT_VERS | sed -e 's%\"%%g' -e 's%\.%_%g'`
52 if test "x$qt_ok" = "xyes"
54 if test -f ${QTDIR}/bin/moc
58 AC_PATH_PROG(MOC, moc)
63 AC_MSG_RESULT(moc qt-compiler not in PATH variable)
66 AC_MSG_RESULT(moc found)
70 if test "x$qt_ok" = "xyes"
72 if test -f ${QTDIR}/bin/uic
76 AC_PATH_PROG(UIC, uic)
81 AC_MSG_RESULT(uic qt-interface compiler not in PATH variable)
84 AC_MSG_RESULT(uic found)
91 if test "x$qt_ok" = "xyes"
93 CPPFLAGS_old=$CPPFLAGS
94 CPPFLAGS="$CPPFLAGS -I$QTDIR/include${QTINC}"
97 AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
99 CPPFLAGS=$CPPFLAGS_old
101 AC_MSG_CHECKING(include of qt headers)
103 if test "x$qt_ok" = "xno"
105 AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
106 AC_MSG_RESULT(QTDIR environment variable may be wrong)
109 QT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
110 QT_MT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
114 if test "x$qt_ok" = "xyes"
116 AC_MSG_CHECKING(linking qt library)
118 if test "x$QTDIR" = "x/usr"
120 LIBS="$LIBS -lqt-mt $OGL_LIBS"
122 LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt $OGL_LIBS"
125 CXXFLAGS_old=$CXXFLAGS
126 CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
128 AC_CACHE_VAL(salome_cv_lib_qt,[
130 #include <qapplication.h>
133 QApplication a(n, s);
135 eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
137 qt_ok="$salome_cv_lib_qt"
139 if test "x$qt_ok" = "xno"
141 AC_MSG_RESULT(unable to link with qt library)
142 AC_MSG_RESULT(QTDIR environment variable may be wrong)
145 if test "x$QTDIR" = "x/usr"
148 QT_MT_LIBS=" -lqt-mt"
150 QT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
151 QT_MT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
156 CXXFLAGS=$CXXFLAGS_old
164 AC_SUBST(QT_INCLUDES)
165 AC_SUBST(QT_MT_INCLUDES)
172 AC_MSG_RESULT(for Qt: $qt_ok)