1 dnl Copyright (C) 2003 CEA/DEN, EDF R&D
4 AC_REQUIRE([CHECK_QT])dnl
13 [ --with-qwt=DIR directory path to QWT installation ],
15 AC_MSG_RESULT("select $withval as path to QWT")
19 [ --with-qwt_inc=DIR directory path to QWT includes ],
20 [QWT_INCLUDES="$withval"
21 AC_MSG_RESULT("select $withval as path to QWT includes")
24 if test -z $QWTHOME; then
25 AC_MSG_RESULT(QWTHOME not defined)
27 if test "x$exits_ok" = "xno"; then
28 for d in /usr/local /usr ; do
29 AC_CHECK_FILE(${d}/lib/libqwt.so,exits_ok=yes,exits_ok=no)
30 if test "x$exits_ok" = "xyes"; then
32 AC_MSG_RESULT(libqwt.so detected in $d/lib)
36 if test "x$exits_ok" = "xno"; then
37 for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
38 if test -f $d/libqwt.so ; then
39 AC_MSG_RESULT(libqwt.so detected in $d)
41 QWTHOME=`echo ${QWTHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
47 if test "x$exits_ok" = "xyes"; then
48 if test -z $QWT_INCLUDES; then
49 QWT_INCLUDES=$QWTHOME"/include/qwt"
53 if test -z $QWT_INCLUDES; then
54 QWT_INCLUDES="$QWTHOME/include"
58 if test "x$qwt_ok" = xno -o ! -d "$QWTHOME" ; then
60 AC_MSG_WARN(qwt not found)
65 CPPFLAGS_old=$CPPFLAGS
66 CPPFLAGS="$CPPFLAGS -I$QWT_INCLUDES"
67 CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
69 AC_CHECK_HEADER(qwt.h,qwt_ok=yes,qwt_ok=no)
71 CPPFLAGS=$CPPFLAGS_old
73 if test "x$qwt_ok" = xno ; then
75 AC_MSG_WARN(qwt not found)
80 if test "x$qwt_ok" = "xyes"
82 AC_MSG_CHECKING(linking qwt library)
84 if test "x$QTDIR" = "x/usr"
88 LIBS="$LIBS -L$QTDIR/lib -lqt-mt"
90 if test "x$QWTHOME" = "x/usr/lib"
94 LIBS="$LIBS -L$QWTHOME/lib -lqwt"
97 CXXFLAGS_old=$CXXFLAGS
98 CXXFLAGS="$CXXFLAGS $QT_INCLUDES -I$QWT_INCLUDES"
100 AC_CACHE_VAL(salome_cv_lib_qwt,[
102 #include <qapplication.h>
103 #include <qwt_plot.h>
106 QApplication a(n, s);
110 eval "salome_cv_lib_qwt=yes",eval "salome_cv_lib_qwt=no")
112 qwt_ok="$salome_cv_lib_qwt"
114 if test "x$qwt_ok" = "xno"
116 AC_MSG_RESULT(unable to link with qwt library)
117 AC_MSG_RESULT(QWTHOME environment variable may be wrong)
119 QWT_INCLUDES="-I$QWT_INCLUDES"
120 if test "x$QWTHOME" = "x/usr/lib"
124 QWT_LIBS="-L$QWTHOME/lib -lqwt"
127 AC_SUBST(QWT_INCLUDES)
134 CXXFLAGS=$CXXFLAGS_old