KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
  AC_MSG_WARN([Could not find pkg-config])
])

if test -n "$PKGCONFIG"; then
  vers=`$PKGCONFIG libwpd-0.8 --modversion 2>/dev/null`
  if test -n "$vers"
  then
     LIBWPD_LIBS="`$PKGCONFIG libwpd-0.8 --libs`"
     LIBWPD_RPATH=
     for args in $LIBWPD_LIBS; do
          case $args in
            -L*)
               LIBWPD_RPATH="$LIBWPD_RPATH $args"
               ;;
          esac
     done
     LIBWPD_RPATH=`echo $LIBWPD_RPATH | $SED -e "s/-L/-R/g"`
     LIBWPD_CFLAGS="`$PKGCONFIG libwpd-0.8 --cflags`"

     AC_DEFINE_UNQUOTED(HAVE_WPD, 1, [Defines if your system has the libwpd library])
  fi
fi


AC_SUBST(LIBWPD_LIBS)
AC_SUBST(LIBWPD_CFLAGS)
AC_SUBST(LIBWPD_RPATH)

AM_CONDITIONAL(include_wpd_filter, test -n "$LIBWPD_LIBS")

