+dnl Xmllint is used in the rules to build the documentation. It is not actually necessary,
+dnl but is used for post-build consistency checks. Thus, non-developers can live without it.
+dnl However for it to be usefull, it needs to be a certain version and have certain features.
+dnl The macros below check that it the xmllint available is up to scratch. If it isn't
+dnl then a dummy /bin/echo is subsituted instead.
+
+AC_CACHE_CHECK([for an xmllint program which fits our needs],[ac_cv_path_XMLLINT],
+[AC_PATH_PROGS_FEATURE_CHECK([XMLLINT], [xmllint],
+ [[$ac_path_XMLLINT --version 2>&1 | $GREP XPath > /dev/null &&
+ test `$ac_path_XMLLINT --version 2>&1 | $SED 's/^.* \([0-9]*\).*/\1/'` -gt 20900 &&
+ ac_cv_path_XMLLINT=$ac_path_XMLLINT]],
+ [AC_MSG_WARN([no appropriate xmllint program found. Using a dummy (echo)]); ac_cv_path_XMLLINT=$ECHO])])
+
+AC_SUBST([XMLLINT],[$ac_cv_path_XMLLINT])
+
+# Support for GUI.
+AC_ARG_WITH([gui],
+ [AS_HELP_STRING([--without-gui],
+ [Don't build the PSPPIRE GUI (using GTK+)])],
+ [], [with_gui=yes])
+AM_CONDITIONAL([HAVE_GUI],
+ [test "$with_cairo" != no && test "$with_gui" != "no"])
+if test "$with_cairo" != no && test "$with_gui" != "no"; then
+ PKG_CHECK_MODULES([GTHREAD], [gthread-2.0], [],
+ [PSPP_REQUIRED_PREREQ([gthread 2.0 (or use --without-gui)])])
+
+ PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.4.2], [],
+ [PSPP_REQUIRED_PREREQ([gtk+ 3.0 version 3.4.2 or later (or use --without-gui)])])
+
+ PKG_CHECK_MODULES([GTKSOURCEVIEW], [gtksourceview-3.0 >= 3.4.2], [],
+ [PSPP_REQUIRED_PREREQ([gtksourceview 3.0 version 3.4.2 or later (or use --without-gui)])])
+
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32], [],
+ [PSPP_REQUIRED_PREREQ([glib 2.0 version 2.32 or later (or use --without-gui)])])
+
+ AC_ARG_VAR([GLIB_GENMARSHAL])
+ AC_CHECK_PROGS([GLIB_GENMARSHAL], [glib-genmarshal])
+ if test "x$GLIB_GENMARSHAL" = x; then
+ PSPP_REQUIRED_PREREQ([glib-genmarshal (or use --without-gui)])
+ fi
+
+fi
+
+gl_NEXT_HEADERS([gtk/gtk.h])