-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([GTK], [gtk+-2.0 >= 2.16], [],
- [PSPP_REQUIRED_PREREQ([gtk+ 2.0 version 2.16 or later (or use --without-gui)])])
+AM_CONDITIONAL([building_gui], [test "$with_gui" != "no"])
+if 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.22.0], [],
+ [PSPP_REQUIRED_PREREQ([gtk+ 3.0 version 3.22.0 or later (or use --without-gui)])])
+
+ PKG_CHECK_MODULES([GTKSOURCEVIEW], [gtksourceview-4 >= 4.0], [],
+ [PKG_CHECK_MODULES([GTKSOURCEVIEW], [gtksourceview-3.0 >= 3.4.2], [],
+ [PSPP_REQUIRED_PREREQ([gtksourceview 4.x or gtksourceview 3.x version 3.4.2 or later (or use --without-gui)])])])
+
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.44], [],
+ [PSPP_REQUIRED_PREREQ([glib 2.0 version 2.44 or later (or use --without-gui)])])
+
+ PKG_CHECK_MODULES([SPREAD_SHEET_WIDGET], [spread-sheet-widget >= 0.7], [],
+ [PSPP_REQUIRED_PREREQ([spread-sheet-widget 0.7 (or use --without-gui)])])
+ PKG_CHECK_VAR([SPREAD_SHEET_WIDGET_LIBDIR], [spread-sheet-widget], [libdir])