1 dnl Copyright (C) 2003 CEA/DEN, EDF R&D
4 AC_REQUIRE([CHECK_QT])dnl
5 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
14 [ --with-qwt=DIR directory path to QWT installation ],
16 AC_MSG_RESULT("select $withval as path to QWT")
20 [ --with-qwt_inc=DIR directory path to QWT includes ],
21 [QWT_INCLUDES="$withval"
22 AC_MSG_RESULT("select $withval as path to QWT includes")
25 if test -z $QWTHOME; then
26 AC_MSG_RESULT(QWTHOME not defined)
28 if test "x$exits_ok" = "xno"; then
29 for d in /usr/local /usr ; do
30 AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exits_ok=yes,exits_ok=no)
31 if test "x$exits_ok" = "xyes"; then
33 AC_MSG_RESULT(libqwt.so detected in $d/lib)
37 if test "x$exits_ok" = "xno"; then
38 for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
39 if test -f $d/libqwt.so ; then
40 AC_MSG_RESULT(libqwt.so detected in $d)
42 QWTHOME=`echo ${QWTHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
48 if test "x$exits_ok" = "xyes"; then
49 if test -z $QWT_INCLUDES; then
50 QWT_INCLUDES=$QWTHOME"/include/qwt"
51 if test ! -f $QWT_INCLUDES/qwt.h ; then
52 QWT_INCLUDES=$QWTHOME"/include"
54 if test ! -f $QWT_INCLUDES/qwt.h ; then
55 QWT_INCLUDES=/usr/lib/qt3/include/qwt
60 if test -z $QWT_INCLUDES; then
61 QWT_INCLUDES="$QWTHOME/include"
65 if test "x$qwt_ok" = xno -o ! -d "$QWTHOME" ; then
67 AC_MSG_WARN(qwt not found)
72 CPPFLAGS_old=$CPPFLAGS
73 CPPFLAGS="$CPPFLAGS -I$QWT_INCLUDES"
74 CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
76 AC_CHECK_HEADER(qwt.h,qwt_ok=yes,qwt_ok=no)
78 CPPFLAGS=$CPPFLAGS_old
80 if test "x$qwt_ok" = xno ; then
82 AC_MSG_WARN(qwt not found)
87 if test "x$qwt_ok" = "xyes"
89 AC_MSG_CHECKING(linking qwt library)
91 if test "x$QTDIR" = "x/usr"
95 LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
97 if test "x$QWTHOME" = "x/usr"
101 LIBS="$LIBS -L$QWTHOME/lib -lqwt"
104 CXXFLAGS_old=$CXXFLAGS
105 CXXFLAGS="$CXXFLAGS $QT_INCLUDES -I$QWT_INCLUDES"
107 AC_CACHE_VAL(salome_cv_lib_qwt,[
109 #include <qapplication.h>
110 #include <qwt_plot.h>
113 QApplication a(n, s);
117 eval "salome_cv_lib_qwt=yes",eval "salome_cv_lib_qwt=no")
119 qwt_ok="$salome_cv_lib_qwt"
121 if test "x$qwt_ok" = "xno"
123 AC_MSG_RESULT(unable to link with qwt library)
124 AC_MSG_RESULT(QWTHOME environment variable may be wrong)
126 QWT_INCLUDES="-I$QWT_INCLUDES"
127 if test "x$QWTHOME" = "x/usr"
131 QWT_LIBS="-L$QWTHOME/lib -lqwt"
134 AC_SUBST(QWT_INCLUDES)
141 CXXFLAGS=$CXXFLAGS_old