changeset 81263:425fdad2ce24

Make gtk the default toolkit.
author Glenn Morris <rgm@gnu.org>
date Fri, 08 Jun 2007 03:46:32 +0000
parents a3c022187895
children 1b3889e813e5
files configure.in
diffstat 1 files changed, 34 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Fri Jun 08 03:46:12 2007 +0000
+++ b/configure.in	Fri Jun 08 03:46:32 2007 +0000
@@ -84,7 +84,7 @@
 [  --with-x-toolkit=KIT    use an X toolkit
                               (KIT = yes/lucid/athena/motif/gtk/no)],
 [	  case "${withval}" in
-	    y | ye | yes )	val=athena ;;
+	    y | ye | yes )	val=gtk ;;
 	    n | no )		val=no  ;;
 	    l | lu | luc | luci | lucid )	val=lucid ;;
 	    a | at | ath | athe | athen | athena )	val=athena ;;
@@ -98,7 +98,7 @@
 dnl which is `yes', `no', `lucid', `athena', `motif' or `open-look'.])
 AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid\;
 this option's value should be `yes', `no', `lucid', `athena', `motif' or `gtk'.
-Currently, `yes', `athena' and `lucid' are synonyms.])
+Currently, `yes' and `gtk', and `athena' and `lucid' are synonyms.])
 	    ;;
 	  esac
 	  with_x_toolkit=$val
@@ -1880,9 +1880,15 @@
 dnl USE_X_TOOLKIT is set.
             USE_X_TOOLKIT=none ;;
       no ) USE_X_TOOLKIT=none ;;
-dnl If user did not say whether to use a toolkit,
-dnl make this decision later: use the toolkit if we have X11R5 or newer.
-      * ) USE_X_TOOLKIT=maybe ;;
+dnl If user did not say whether to use a toolkit, make this decision later:
+dnl use the toolkit if we have gtk, or X11R5 or newer.
+      * ) 
+          if test x"$with_gtk" = xyes; then
+             USE_X_TOOLKIT=none
+          else
+             USE_X_TOOLKIT=maybe
+          fi
+          ;;
     esac
   ;;
   mac | none )
@@ -2110,7 +2116,8 @@
 if test "${with_gtk}" = "yes" && test "$USE_X_TOOLKIT" = "gtk"; then
   USE_X_TOOLKIT=none
 fi
-if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
+if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk" || \
+ test "$USE_X_TOOLKIT" = "maybe"; then
   if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then
     AC_MSG_ERROR([Conflicting options, --with-gtk is incompatible with --with-x-toolkit=${with_x_toolkit}]);
   fi
@@ -2123,7 +2130,15 @@
     PKG_CONFIG="${with_pkg_config_prog}"
   fi
   dnl Checks for libraries.
-  PKG_CHECK_MODULES(GTK, $GTK_MODULES)
+  PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
+  if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
+     AC_MSG_ERROR($GTK_PKG_ERRORS)
+  fi
+fi
+
+
+if test x"$pkg_check_gtk" = xyes; then
+
   AC_SUBST(GTK_CFLAGS)
   AC_SUBST(GTK_LIBS)
   C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
@@ -2133,12 +2148,19 @@
   GTK_COMPILES=no
   AC_CHECK_FUNCS(gtk_main, GTK_COMPILES=yes)
   if test "${GTK_COMPILES}" != "yes"; then
-    AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?]);
+    if test "$USE_X_TOOLKIT" != "maybe"; then
+      AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?]);
+    fi
+  else
+    HAVE_GTK=yes
+    AC_DEFINE(HAVE_GTK, 1, [Define to 1 if using GTK.])
+    USE_X_TOOLKIT=none
   fi
-  
-  HAVE_GTK=yes
-  AC_DEFINE(HAVE_GTK, 1, [Define to 1 if using GTK.])
-  USE_X_TOOLKIT=none
+
+fi
+
+
+if test "${HAVE_GTK}" = "yes"; then
 
   dnl  GTK scrollbars resemble toolkit scrollbars a lot, so to avoid
   dnl  a lot if #ifdef:s, say we have toolkit scrollbars.