-dnl Autodetection of Gdk libraries and includes
-dnl -------------------------------------------
-dnl On some systems (FreeBSD springs to mind), they use
-dnl versions on the utility routines, so instead of gtk-config
-dnl you must use gtk12-config, etc, etc.
-
-GNOME_CONFIG=no
-GTK_CONFIG=no
-
-if test "$with_gnome" != "no"; then
- AC_MSG_CHECKING(for GNOME configuration script)
- for possible in gnome-config
- do
- possible_version=`${possible} --version 2> /dev/null`
- if test "x${possible_version}" != "x"; then
- GNOME_CONFIG="${possible}"
- with_gnome=yes
- with_gtk=yes
- break
- fi
- done
- AC_MSG_RESULT([${GNOME_CONFIG}])
-fi
-
-if test "${GNOME_CONFIG}" != "no"; then
- GNOME_LIBS=`${GNOME_CONFIG} --libs gnomeui`
- GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui`
- AC_DEFINE([HAVE_GNOME], [1], [Description here!])
- SXE_APPEND(${GNOME_LIBS}, libs_gtk)
- SXE_APPEND_UNDUP(${GNOME_CFLAGS}, c_switch_gtk)
-fi
-
-if test "$with_gtk" != "no";then
- AC_MSG_CHECKING(for GTK configuration script)
- for possible in gtk12-config gtk14-config gtk-config
- do
- possible_version=`${possible} --version 2> /dev/null`
- if test "x${possible_version}" != "x"; then
- GTK_CONFIG="${possible}"
- case "${possible_version}" in
- 1.0.*) AC_MSG_WARN([GTK 1.2 is required, please upgrade your version of GTK.]); with_gtk=no;;
- 1.3.*) AC_MSG_WARN([GTK 1.3 is not supported right now]); with_gtk=no;;
- 1.2.*)
- with_gtk=yes
- break
- ;;
- *) AC_MSG_WARN([Found unsupported version of GTK: $possible_version]);;
- esac
- fi
- done
- AC_MSG_RESULT([${GTK_CONFIG}])
-fi
-
-if test "${GTK_CONFIG}" != "no"; then
- AC_MSG_CHECKING(gtk version)
- GTK_VERSION=`${GTK_CONFIG} --version`
- AC_MSG_RESULT(${GTK_VERSION})
-
- AC_MSG_CHECKING(gtk libs)
- GTK_LIBS=`${GTK_CONFIG} --libs`
- SXE_APPEND(${GTK_LIBS}, libs_gtk)
- AC_MSG_RESULT(${GTK_LIBS})
-
- AC_MSG_CHECKING(gtk cflags)
- GTK_CFLAGS=`${GTK_CONFIG} --cflags`
- if test "$GCC" = "yes"; then
- GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow"
- fi
- SXE_APPEND_UNDUP(${GTK_CFLAGS}, c_switch_gtk)
- AC_MSG_RESULT(${GTK_CFLAGS})
-
- AC_CHECK_LIB(gdk_imlib, main, SXE_PREPEND(-lgdk_imlib, libs_gtk))
- AC_CHECK_LIB(Imlib, Imlib_init, SXE_APPEND(-lImlib, libs_gtk))
- AC_CHECK_FUNCS(gdk_imlib_init)
-
- AC_DEFINE([HAVE_XPM], [1], [Description here!])
- AC_DEFINE([HAVE_GTK], [1], [Description here!])
- AC_SUBST(GTK_CONFIG)
-
- window_system=gtk
- with_gtk=yes
- if test "$with_x11" != "no"; then
- AC_MSG_WARN([Configuring Gtk, this means:
-*** --with-athena will have no effect
-*** --with-scrollbars has been turned into a boolean option
-*** --with-menubars has been turned into a boolean option
-*** --with-dialogs has been turned into a boolean option
-*** --with-widgets has been turned into a boolean option.])
- with_x11=no
- fi
-
- test "${with_scrollbars}" != "no" && with_scrollbars=gtk
- test "${with_toolbars}" != "no" && with_toolbars=gtk
- test "${with_menubars}" != "no" && with_menubars=gtk
- test "${with_dialogs}" != "no" && with_dialogs=gtk
- test "${with_widgets}" != "no" && with_widgets=gtk
-
- SXE_ADD_SXEUIGTK_OBJS(console-gtk.o device-gtk.o event-gtk.o frame-gtk.o)
- SXE_ADD_SXEUIGTK_OBJS(objects-gtk.o redisplay-gtk.o glyphs-gtk.o)
- SXE_ADD_SXEUIGTK_OBJS(select-gtk.o gccache-gtk.o)
- SXE_ADD_SXEUIGTK_OBJS(gtk-xemacs.o ui-gtk.o)
-
- dnl Check for libglade support (it rocks)
- OLD_CFLAGS="${CFLAGS}"
- OLD_CPPFLAGS="${CPPFLAGS}"
- OLD_LDFLAGS="${LDFLAGS}"
- CFLAGS="${GTK_CFLAGS} ${CFLAGS}"
- CPPFLAGS="${GTK_CFLAGS} ${CFLAGS}"
- LDFLAGS="${LDFLAGS} ${GTK_LIBS}"
- AC_CHECK_HEADERS(glade/glade.h glade.h)
- AC_CHECK_LIB(xml, main, SXE_PREPEND(-lxml, libs_gtk))
- AC_CHECK_LIB(glade, main, SXE_PREPEND(-lglade, libs_gtk))
- AC_CHECK_LIB(glade-gnome, main, SXE_PREPEND(-lglade-gnome, libs_gtk))
- AC_EGREP_HEADER([char \*txtdomain;], [glade/glade-xml.h],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([LIBGLADE_XML_TXTDOMAIN], [1], [Description here!])],
- [AC_MSG_RESULT(no)])
- CFLAGS="${OLD_CFLAGS}"
- CPPFLAGS="${OLD_CPPFLAGS}"
- LDFLAGS="${OLD_LDFLAGS}"
-fi
-
-dnl We may eventually prefer gtk/gdk over vanilla X11...
-dnl Are we mad? We need stuff from the X11 even _with_ gtk!!!
-