Skip to content

Commit

Permalink
- Check for include/qwt5, then check the header for QWT5 macro (using…
Browse files Browse the repository at this point in the history
… grep)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12289 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jul 5, 2012
1 parent 2caa5f5 commit 28ac996
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions configure.in
Expand Up @@ -437,22 +437,26 @@ fi

if test -n "$QMAKE"; then
AC_MSG_CHECKING([for qwt])
AC_ARG_WITH(qwt, [ --with-qwt Compile plotting libraries using qwt. Default searches PREFIX/include/{qwt,qwt-qt4}], [], [with_qwt=yes])
AC_ARG_WITH(qwt, [ --with-qwt Compile plotting libraries using qwt5. Default searches PREFIX/include/{qwt5,qwt,qwt-qt4}], [], [with_qwt=yes])

if test x"$with_qwt" = "xyes"; then
with_qwt_checked=""
with_qwt_suffix=""
for f in {/usr,/opt,$PREFIX}/include/{qwt,qwt-qt4}/; do
for f in {/usr,/opt,$PREFIX}/include/{qwt5,qwt,qwt-qt4}/; do
test -f "$f/qwt.h" && with_qwt="$f" || with_qwt_checked="$with_qwt_checked $f"
done
echo $with_qwt | grep -q -- -qt4 && with_qwt_suffix="-qt4"
with_qwt_res=$with_qwt
grep -q 'QWT_VERSION *0x05@<:@0-9@:>@\{4\}$' "$with_qwt/qwt_global.h" || with_qwt="bad"
fi

if test x"$with_qwt" = "xno"; then
QMAKE=""
AC_MSG_RESULT([disabled])
elif test x"$with_qwt" = "xyes"; then
AC_MSG_ERROR([not found (searched $with_qwt_checked)])
elif test x"$with_qwt" = "xbad"; then
AC_MSG_ERROR([$with_qwt_res/qwt_global.h is not a qwt5 header])
else
AC_MSG_RESULT($with_qwt)
fi
Expand Down

0 comments on commit 28ac996

Please sign in to comment.