Make gtk the default toolkit.

This commit is contained in:
Glenn Morris 2007-06-08 03:46:32 +00:00
parent 45cb0b589b
commit 4f82305747

View file

@ -84,7 +84,7 @@ AC_ARG_WITH(x-toolkit,
[ --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 AC_MSG_ERROR([the `--with-x-toolkit' option is supposed to have a value
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 Dont set this for GTK. A lot of tests below assumes Xt when
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 @@ HAVE_GTK=no
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 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
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 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
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.