]> Pileus Git - ~andy/gtk/blobdiff - configure.ac
Drop -uninstalled.pc files
[~andy/gtk] / configure.ac
index 522bf69f8b80a128bfa2248b4c51a42def2831e4..22608673b12949ac18010bc686ddd8db83e18aa7 100644 (file)
@@ -8,9 +8,9 @@
 # if backwards compatibility has been broken,
 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
 
-m4_define([gtk_major_version], [2])
-m4_define([gtk_minor_version], [91])
-m4_define([gtk_micro_version], [8])
+m4_define([gtk_major_version], [3])
+m4_define([gtk_minor_version], [3])
+m4_define([gtk_micro_version], [7])
 m4_define([gtk_interface_age], [0])
 m4_define([gtk_binary_age],
           [m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -27,6 +27,7 @@ AC_INIT([gtk+], [gtk_version],
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_SRCDIR([gdk/gdktypes.h])
 AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([build-aux])
 
 # Define a string for the earliest version that this release has
 # backwards binary compatibility with for all interfaces a module
@@ -38,33 +39,36 @@ AC_CONFIG_MACRO_DIR([m4])
 m4_define([gtk_binary_version], [3.0.0])
 
 # required versions of other packages
-m4_define([glib_required_version], [2.27.5])
-m4_define([pango_required_version], [1.20])
-m4_define([atk_required_version], [1.29.2])
+m4_define([glib_required_version], [2.31.6])
+m4_define([pango_required_version], [1.29.0])
+m4_define([atk_required_version], [2.1.5])
 m4_define([cairo_required_version], [1.10.0])
-m4_define([gdk_pixbuf_required_version], [2.21.0])
+m4_define([gdk_pixbuf_required_version], [2.23.5])
+m4_define([introspection_required_version], [0.10.1])
 GLIB_REQUIRED_VERSION=glib_required_version
 PANGO_REQUIRED_VERSION=pango_required_version
 ATK_REQUIRED_VERSION=atk_required_version
 CAIRO_REQUIRED_VERSION=cairo_required_version
 GDK_PIXBUF_REQUIRED_VERSION=gdk_pixbuf_required_version
+INTROSPECTION_REQUIRED_VERSION=introspection_required_version
+
 AC_SUBST(GLIB_REQUIRED_VERSION)
 AC_SUBST(PANGO_REQUIRED_VERSION)
 AC_SUBST(ATK_REQUIRED_VERSION)
 AC_SUBST(CAIRO_REQUIRED_VERSION)
 AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION)
-
+AC_SUBST(INTROSPECTION_REQUIRED_VERSION)
 
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
 
-AM_INIT_AUTOMAKE([1.10 no-define -Wno-portability dist-bzip2])
+AM_INIT_AUTOMAKE([1.11 -Wall no-define -Wno-portability tar-ustar no-dist-gzip dist-xz])
 AM_MAINTAINER_MODE([enable])
 
-# Support silent build rules, requires at least automake-1.11. Disable
+# Support silent build rules. Disable
 # by either passing --disable-silent-rules to configure or passing V=1
 # to make
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AM_SILENT_RULES([yes])
 
 #
 # For each of the libraries we build, we define the following
@@ -170,12 +174,16 @@ dnl
 AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc)
 AC_LANG_PUSH([C++])
 
-AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
+                                   [[class a { int b; } c;]])],
+                  [],[CXX=])
 AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
 
 gtk_save_cxxflags="$CXXFLAGS"
 CXXFLAGS="$CXXFLAGS -x objective-c++"
-AC_TRY_COMPILE([@interface Foo @end],,OBJC=yes,OBJC=no)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@interface Foo @end]],
+                                   [[]])],
+                  [OBJC=yes],[OBJC=no])
 AM_CONDITIONAL(HAVE_OBJC, test "$OBJC" = "yes")
 CXXFLAGS="$gtk_save_cxxflags"
 AC_LANG_POP([C++])
@@ -233,48 +241,172 @@ m4_define([debug_default],
 
 dnl declare --enable-* args and collect ac_help strings
 AC_ARG_ENABLE(debug,
-              AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
-                             [turn on debugging @<:@default=debug_default@:>@]),,
-              enable_debug=debug_default)
+              [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
+                              [turn on debugging @<:@default=debug_default@:>@])],,
+              [enable_debug=debug_default])
 
 AC_ARG_ENABLE(rebuilds,
-              [AC_HELP_STRING([--disable-rebuilds],
+              [AS_HELP_STRING([--disable-rebuilds],
                               [disable all source autogeneration rules])],,
               [enable_rebuilds=yes])
 
+AC_ARG_ENABLE(gtk2-dependency,
+              [AS_HELP_STRING([--enable-gtk2-dependency],
+                              [Do not build gtk-update-icon-cache and other shared tools])],,
+              [enable_gtk2_dependency=no])
+
+AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
+
 AC_ARG_ENABLE(xkb,
-              [AC_HELP_STRING([--enable-xkb],
+              [AS_HELP_STRING([--enable-xkb],
                               [support XKB extension [default=maybe]])],,
               [enable_xkb="maybe"])
 AC_ARG_ENABLE(xinerama,
-              [AC_HELP_STRING([--enable-xinerama],
-                             [support Xinerama extension if available [default=yes]])],,
-              [enable_xinerama="yes"])
+              [AS_HELP_STRING([--enable-xinerama],
+                             [support Xinerama extension [default=maybe]])],,
+              [enable_xinerama="maybe"])
 AC_ARG_ENABLE(xinput,
-              [AC_HELP_STRING([--enable-xinput],
-                              [support XInput extension if available [default=yes]])],,
-              [enable_xinput="yes"])
+              [AS_HELP_STRING([--enable-xinput],
+                              [support XInput extension [default=yes]])],,
+              [enable_xinput="maybe"])
+AC_ARG_ENABLE(xrandr,
+              [AS_HELP_STRING([--enable-xrandr],
+                              [support XRandR extension [default=maybe]])],,
+              [enable_xrandr="maybe"])
+AC_ARG_ENABLE(xfixes,
+              [AS_HELP_STRING([--enable-xfixes],
+                              [support XFixes extension [default=maybe]])],,
+              [enable_xfixes="maybe"])
+AC_ARG_ENABLE(xcomposite,
+              [AS_HELP_STRING([--enable-xcomposite],
+                              [support X Composite extension [default=maybe]])],,
+              [enable_xcomposite="maybe"])
+AC_ARG_ENABLE(xdamage,
+              [AS_HELP_STRING([--enable-xdamage],
+                              [support X Damage extension [default=maybe]])],,
+              [enable_xdamage="maybe"])
+
+AC_ARG_ENABLE(x11-backend,
+              [AS_HELP_STRING([--enable-x11-backend],
+                              [enable the X11 gdk backend])],
+                             [backend_set=yes])
+AC_ARG_ENABLE(win32-backend,
+              [AS_HELP_STRING([--enable-win32-backend],
+                              [enable the Win32 gdk backend])],
+                             [backend_set=yes])
+AC_ARG_ENABLE(quartz-backend,
+              [AS_HELP_STRING([--enable-quartz-backend],
+                              [enable the quartz gdk backend])],
+                             [backend_set=yes])
+AC_ARG_ENABLE(broadway-backend,
+              [AS_HELP_STRING([--enable-broadway-backend],
+                              [enable the broadway (HTML5) gdk backend])],
+                             [backend_set=yes])
+AC_ARG_ENABLE(wayland-backend,
+              [AS_HELP_STRING([--enable-wayland-backend],
+                              [enable the wayland gdk backend])],
+                             [backend_set=yes])
+
+if test -z "$backend_set"; then
+  if test "$platform_win32" = yes; then
+    enable_win32_backend=yes
+  else
+    enable_x11_backend=yes
+  fi
+fi
 
-if test "$platform_win32" = yes; then
-  gdktarget=win32
+AC_ARG_ENABLE(quartz-relocation,
+              [AS_HELP_STRING([--enable-quartz-relocation],
+                              [enable bundle-based relocation functions])],
+                              [quartz_relocation=yes])
+
+cairo_backends=
+backend_immodules=
+GDK_BACKENDS=
+GDK_EXTRA_LIBS=
+GDK_EXTRA_CFLAGS=
+GDK_WINDOWING=
+GIO_PACKAGE=gio-2.0
+PANGO_PACKAGES="pango pangocairo"
+
+if test "$enable_x11_backend" = "yes"; then
+  # GDK calls the xlib backend "x11," cairo calls it "xlib." Other
+  # backend names are identical.
+  cairo_backends="$cairo_backends cairo-xlib"
+  GDK_BACKENDS="$GDK_BACKENDS x11"
+  # Pull in gio-unix for GDesktopAppInfo usage, see at least
+  # gdkapplaunchcontext-x11.c
+  GIO_PACKAGE=gio-unix-2.0
+  backend_immodules="$backend_immodules,xim"
+  GDK_WINDOWING="$GDK_WINDOWING
+#define GDK_WINDOWING_X11"
+fi
+
+if test "$enable_win32_backend" = "yes"; then
+  cairo_backends="$cairo_backends cairo-win32"
+  GDK_BACKENDS="$GDK_BACKENDS win32"
+  backend_immodules="$backend_immodules,ime"
+  GDK_WINDOWING="$GDK_WINDOWING
+#define GDK_WINDOWING_WIN32"
+  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
+  AM_CONDITIONAL(USE_WIN32, true)
+  PANGO_PACKAGES="pangowin32 pangocairo"
 else
-  gdktarget=x11
+  AM_CONDITIONAL(USE_WIN32, false)
 fi
 
-AC_ARG_WITH(gdktarget,
-            AC_HELP_STRING([--with-gdktarget=@<:@x11/win32/quartz@:>@],
-                           [select non-default GDK target]),
-            gdktarget=$with_gdktarget)
+if test "x$enable_quartz_backend" = xyes; then
+  cairo_backends="$cairo_backends cairo-quartz"
+  GDK_BACKENDS="$GDK_BACKENDS quartz"
+  GDK_WINDOWING="$GDK_WINDOWING
+#define GDK_WINDOWING_QUARTZ"
+  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
+  AM_CONDITIONAL(USE_QUARTZ, true)
+  if test "x$quartz_relocation" = xyes; then
+    AC_DEFINE([QUARTZ_RELOCATION], [1], [Use NSBundle functions to determine load paths for libraries, translations, etc.])
+  fi
 
-AC_SUBST(gdktarget)
-case $gdktarget in
-  x11|win32|quartz) ;;
-  *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz or win32.]);;
-esac
+else
+  AM_CONDITIONAL(USE_QUARTZ, false)
+fi
+
+
+if test "x$enable_broadway_backend" == xyes; then
+  GDK_BACKENDS="$GDK_BACKENDS broadway"
+  cairo_backends="$cairo_backends cairo"
+  GDK_WINDOWING="$GDK_WINDOWING
+#define GDK_WINDOWING_BROADWAY"
+  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lz"
+  AM_CONDITIONAL(USE_BROADWAY, true)
+else
+  AM_CONDITIONAL(USE_BROADWAY, false)
+fi
+
+if test "x$enable_wayland_backend" == "xyes"; then
+  # Wayland uses cairo-gl
+  cairo_backends="$cairo_backends cairo-gl"
+  GDK_BACKENDS="$GDK_BACKENDS wayland"
+  GIO_PACKAGE=gio-unix-2.0
+  GDK_WINDOWING="$GDK_WINDOWING
+#define GDK_WINDOWING_WAYLAND"
+  WAYLAND_PACKAGES="wayland-client xkbcommon wayland-egl egl"
+  AM_CONDITIONAL(USE_WAYLAND, true)
+else
+  AM_CONDITIONAL(USE_WAYLAND, false)
+fi
+
+# strip leading space
+GDK_BACKENDS=${GDK_BACKENDS#* }
+
+AC_SUBST(GDK_BACKENDS)
+
+if test -z "$GDK_BACKENDS"; then
+  AC_MSG_ERROR([No GDK backends selected.])
+fi
 
 if test "x$enable_debug" = "xyes"; then
   test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
-  GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES"
+  GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
 else
   if test "x$enable_debug" = "xno"; then
     GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
@@ -312,8 +444,6 @@ if test "x$GCC" = "xyes"; then
 fi
 changequote([,])dnl
 
-CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES"
-
 # Ensure MSVC-compatible struct packing convention is used when
 # compiling for Win32 with gcc.
 # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
@@ -363,18 +493,9 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
    cairo-gobject >= cairo_required_version dnl
    gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
 
-## In addition to checking that cairo is present, we also need to
-## check that the correct cairo backend is there. E.g. if the GDK
-## target is win32 we need the cairo-win32 backend and so on.
-cairo_backend=$gdktarget
+PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
 
-# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
-# backend names are identical.
-if test "x$cairo_backend" = "xx11"; then
-   cairo_backend=xlib
-fi
-PKG_CHECK_MODULES(CAIRO_BACKEND,
-  [cairo-$cairo_backend >= cairo_required_version])
+PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
 
 if test "$os_win32" != yes; then
     # libtool option to control which symbols are exported
@@ -391,7 +512,7 @@ dnl * See whether to include shared library dependencies *
 dnl ******************************************************
 
 AC_ARG_ENABLE(explicit-deps,
-              [AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
+              [AS_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
                               [use explicit dependencies in .pc files [default=auto]])],,
               [enable_explicit_deps=auto])
 
@@ -400,7 +521,7 @@ case $enable_explicit_deps in
   auto)
     export SED
     deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
-    if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
+    if test "x$deplibs_check_method" != xpass_all || test "x$enable_static" = xyes ; then
       enable_explicit_deps=yes
     else
       enable_explicit_deps=no
@@ -436,10 +557,10 @@ AC_CHECK_FUNCS(localtime_r)
 
 # _NL_TIME_FIRST_WEEKDAY is an enum and not a define
 AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
-AC_TRY_LINK([#include <langinfo.h>], [
-char c;
-c = *((unsigned char *)  nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
-], gtk_ok=yes, gtk_ok=no)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+                                [[char c;
+                                  c = *((unsigned char *)  nl_langinfo(_NL_TIME_FIRST_WEEKDAY));]])],
+               [gtk_ok=yes], [gtk_ok=no])
 AC_MSG_RESULT($gtk_ok)
 if test "$gtk_ok" = "yes"; then
   AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
@@ -448,10 +569,10 @@ fi
 
 # _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
 AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
-AC_TRY_LINK([#include <langinfo.h>], [
-char c;
-c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
-], gtk_ok=yes, gtk_ok=no)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+                                [[char c;
+                                  c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));]])],
+               [gtk_ok=yes], [gtk_ok=no])
 AC_MSG_RESULT($gtk_ok)
 if test "$gtk_ok" = "yes"; then
   AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
@@ -460,10 +581,10 @@ fi
 
 # _NL_PAPER_HEIGHT is an enum and not a define
 AC_MSG_CHECKING([for _NL_PAPER_HEIGHT])
-AC_TRY_LINK([#include <langinfo.h>], [
-char c;
-c = *((unsigned char *)  nl_langinfo(_NL_PAPER_HEIGHT));
-], gtk_ok=yes, gtk_ok=no)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+                                [[char c;
+                                  c = *((unsigned char *)  nl_langinfo(_NL_PAPER_HEIGHT));]])],
+               [gtk_ok=yes], [gtk_ok=no])
 AC_MSG_RESULT($gtk_ok)
 if test "$gtk_ok" = "yes"; then
   AC_DEFINE([HAVE__NL_PAPER_HEIGHT], [1],
@@ -472,10 +593,10 @@ fi
 
 # _NL_PAPER_WIDTH is an enum and not a define
 AC_MSG_CHECKING([for _NL_PAPER_WIDTH])
-AC_TRY_LINK([#include <langinfo.h>], [
-char c;
-c = *((unsigned char *)  nl_langinfo(_NL_PAPER_WIDTH));
-], gtk_ok=yes, gtk_ok=no)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+                                [[char c;
+                                  c = *((unsigned char *)  nl_langinfo(_NL_PAPER_WIDTH));]])],
+               [gtk_ok=yes], [gtk_ok=no])
 AC_MSG_RESULT($gtk_ok)
 if test "$gtk_ok" = "yes"; then
   AC_DEFINE([HAVE__NL_PAPER_WIDTH], [1],
@@ -486,9 +607,11 @@ fi
 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
 AM_GLIB_GNU_GETTEXT
 LIBS="$LIBS $INTLLIBS"
-AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
-        sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
-      esac])
+AC_CONFIG_COMMANDS([po-properties],
+                   [[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
+                       sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
+                     esac]],
+                   [[]])
 
 dnl Snippet below is copied from AM_GLIB_GNU_GETTEXT to generate a first
 dnl po-properties/POTFILES during configure; see GNOME #573515.
@@ -518,22 +641,20 @@ AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
 
 gtk_save_LIBS=$LIBS
 LIBS="$LIBS -lm"
-AC_TRY_RUN([#include <math.h>
-             int main (void) { return (log(1) != log(1.)); }],
-     AC_MSG_RESULT(none needed),
-     gtk_save_CFLAGS="$CFLAGS"
-     CFLAGS="$CFLAGS -std1"
-     AC_TRY_RUN([#include <math.h>
-                int main (void) { return (log(1) != log(1.)); }],
-         AC_MSG_RESULT(-std1),
-         AC_MSG_RESULT()
-         CFLAGS="$gtk_save_CFLAGS"
-         AC_MSG_WARN(
-                [No ANSI prototypes found in library. (-std1 didn't work.)]),
-        true
-     ),
-     AC_MSG_RESULT(none needed)
-)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <math.h>
+                                int main (void) { return (log(1) != log(1.)); }]])],
+              [AC_MSG_RESULT(none needed)],
+              [gtk_save_CFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS -std1"
+               AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <math.h>
+                                               int main (void) { return (log(1) != log(1.)); }]])],
+                             [AC_MSG_RESULT(-std1)],
+                             [AC_MSG_RESULT()
+                              CFLAGS="$gtk_save_CFLAGS"
+                              AC_MSG_WARN([No ANSI prototypes found in library. (-std1 did not work.)])],
+                             [true])],
+              [AC_MSG_RESULT(none needed)])
+
 LIBS=$gtk_save_LIBS
 
 AC_MSG_CHECKING(for the BeOS)
@@ -562,39 +683,15 @@ case $host_os in
   ;;
 esac
 
-dnl NeXTStep cc seems to need this
-AC_MSG_CHECKING([for extra flags for POSIX compliance])
-AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
-  AC_MSG_RESULT(none needed),
-  gtk_save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -posix"
-  AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
-    AC_MSG_RESULT(-posix),
-    AC_MSG_RESULT()
-    CFLAGS="$gtk_save_CFLAGS"
-    AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
-
 #
 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
 #
 
-GLIB_PACKAGES="gobject-2.0 gio-2.0 gmodule-no-export-2.0"
-
 AM_PATH_GLIB_2_0(glib_required_version, :,
   AC_MSG_ERROR([
 *** GLIB glib_required_version or better is required. The latest version of
 *** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
-  gobject gmodule-no-export gthread)
-
-# See if it's safe to turn G_DISABLE_DEPRECATED on.
-GLIB_VERSION_MAJOR_MINOR=`$PKG_CONFIG --modversion glib-2.0 | sed "s/\.@<:@^.@:>@*\$//"`
-GLIB_REQUIRED_VERSION_MAJOR_MINOR=`echo glib_required_version | sed "s/\.@<:@^.@:>@*\$//"`
-if test "x$GLIB_VERSION_MAJOR_MINOR" = "x$GLIB_REQUIRED_VERSION_MAJOR_MINOR"; then
-  CFLAGS="-DG_DISABLE_DEPRECATED $CFLAGS"
-fi
-
-CFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CFLAGS"
-
+  gobject gmodule-no-export)
 
 dnl
 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
@@ -618,9 +715,11 @@ AC_CHECK_HEADERS(ftw.h,
                            [Define to 1 if ftw.h is available]))
 
 AC_MSG_CHECKING([for GNU ftw extensions])
-AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
-#define _GNU_SOURCE
-#include <ftw.h>], [int flags = FTW_ACTIONRETVAL;], gtk_ok=yes, gtk_ok=no)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _XOPEN_SOURCE 500
+                                     #define _GNU_SOURCE
+                                     #include <ftw.h>]],
+                                   [[int flags = FTW_ACTIONRETVAL;]])],
+                  [gtk_ok=yes],[gtk_ok=no])
 if test $gtk_ok = yes; then
     AC_MSG_RESULT([yes])
     AC_DEFINE(HAVE_GNU_FTW, 1, [Have GNU ftw])
@@ -632,47 +731,34 @@ saved_cflags="$CFLAGS"
 saved_ldflags="$LDFLAGS"
 
 
-# Checks for header files.
-AC_HEADER_STDC
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-
 # Checks for library functions.
-AC_TYPE_SIGNAL
 AC_FUNC_MMAP
 
 AC_CHECK_FUNCS(mallinfo)
 AC_CHECK_FUNCS(getresuid)
 AC_TYPE_UID_T
 
-# Check if <sys/select.h> needs to be included for fd_set
-AC_MSG_CHECKING([for fd_set])
-AC_TRY_COMPILE([#include <sys/types.h>],
-        [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
-if test $gtk_ok = yes; then
-    AC_MSG_RESULT([yes, found in sys/types.h])
-else
-    AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
-    if test $gtk_ok = yes; then
-        AC_DEFINE(HAVE_SYS_SELECT_H, 1,
-                  [Define to 1 if sys/select.h is available])
-        AC_MSG_RESULT([yes, found in sys/select.h])
-    else
-       AC_DEFINE(NO_FD_SET, 1,
-                  [Define to 1 if fd_set is not available])
-       AC_MSG_RESULT(no)
-    fi
-fi
-
 # Check for uxtheme.h (for MS-Windows Engine)
 AC_MSG_CHECKING(for uxtheme.h)
-AC_TRY_CPP([#include <uxtheme.h>], gtk_uxtheme_h=yes, gtk_uxtheme_h=no)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <uxtheme.h>]])],
+                  [gtk_uxtheme_h=yes], [gtk_uxtheme_h=no])
 if test $gtk_uxtheme_h = yes; then
    AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
 fi
 AC_MSG_RESULT($gtk_uxtheme_h)
 
+# Check for round()
+AC_CHECK_LIB(m,round,have_round=yes,have_round=no)
+if test $have_round = yes; then
+    AC_DEFINE(HAVE_ROUND, 1, [Define to 1 if round() is available])
+fi
+
+# Check for rint()
+AC_CHECK_LIB(m,rint,have_rint=yes,have_rint=no)
+if test $have_rint = yes; then
+    AC_DEFINE(HAVE_RINT, 1, [Define to 1 if rint() is available])
+fi
+
 # Checks for gdkspawn
 AC_CHECK_HEADERS(crt_externs.h)
 AC_CHECK_FUNCS(_NSGetEnviron)
@@ -680,10 +766,11 @@ AC_CHECK_FUNCS(_NSGetEnviron)
 AC_MSG_CHECKING(whether to build dynamic modules)
 
 AC_ARG_ENABLE(modules,
-              [AC_HELP_STRING([--disable-modules],
+              [AS_HELP_STRING([--disable-modules],
                               [disable dynamic module loading])])
 
 dynworks=false
+build_dynamic_modules=no
 deps=
 if test x$enable_modules = xno; then
     AC_MSG_RESULT(no)
@@ -711,10 +798,12 @@ else
     fi
 
     if $dynworks; then
+        build_dynamic_modules=yes
         AC_DEFINE(USE_GMODULE, 1,
                   [Define to 1 if gmodule works and should be used])
         AC_MSG_RESULT(yes)
     else
+        build_dynamic_modules=no
         AC_MSG_RESULT(no)
     fi
 fi
@@ -726,13 +815,9 @@ AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
 #
 AC_MSG_CHECKING(immodules to build)
 
-dnl due to an autoconf bug, commas in the first arg to
-dnl AC_HELP_STRING cause problems.
-dnl AC_HELP_STRING([--with-included-immodules=MODULE1 MODULE2 ...],
-dnl                [build the specified input method modules into gtk])
 AC_ARG_WITH(included_immodules,
-            AC_HELP_STRING([--with-included-immodules=MODULE1,MODULE2,...],
-                           [build the specified input methods into gtk]))
+            [AS_HELP_STRING([--with-included-immodules=MODULE1,MODULE2,...],
+                            [build the specified input methods into gtk])])
 
 if $dynworks; then
    :
@@ -743,14 +828,7 @@ else
    fi
 fi
 
-all_immodules="am-et,cedilla,cyrillic-translit"
-if test "$gdktarget" = "win32"; then
-   all_immodules="${all_immodules},ime"
-fi
-all_immodules="${all_immodules},inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr"
-if test "$gdktarget" = "x11"; then
-   all_immodules="${all_immodules},xim"
-fi
+all_immodules="am-et,cedilla,cyrillic-translit,inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr$backend_immodules"
 
 included_immodules=""
 # If the switch specified without listing any specific ones, include all
@@ -796,10 +874,6 @@ AM_CONDITIONAL(INCLUDE_IM_TI_ET, [test x"$INCLUDE_ti_et" = xyes])
 AM_CONDITIONAL(INCLUDE_IM_VIQR, [test x"$INCLUDE_viqr" = xyes])
 AM_CONDITIONAL(INCLUDE_IM_XIM, [test x"$INCLUDE_xim" = xyes])
 
-AC_HEADER_SYS_WAIT
-
-AC_TYPE_SIGNAL
-
 # Checks to see whether we should include mediaLib
 # support.
 #
@@ -814,13 +888,15 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
 
 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
 
-if test $cross_compiling = yes; then
+if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
   AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
   if test x$GTK_UPDATE_ICON_CACHE = xno; then
     REBUILD_PNGS=#
   fi
 fi
 
+AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
+
 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
 
 if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
@@ -835,14 +911,12 @@ fi
 # Windowing system checks
 ########################################
 
-GDK_EXTRA_LIBS=
-GDK_EXTRA_CFLAGS=
-
 # GTK+ uses some X calls, so needs to link against X directly
 GTK_DEP_PACKAGES_FOR_X=
 GTK_DEP_LIBS_FOR_X=
+X_EXTENSIONS=
 
-if test "x$gdktarget" = "xx11"; then
+if test "x$enable_x11_backend" = xyes; then
   X_PACKAGES=fontconfig
 
   #
@@ -907,17 +981,17 @@ if test "x$gdktarget" = "xx11"; then
   # Check for xReply
 
   AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
-  AC_TRY_COMPILE([#include <X11/Xlibint.h>],
-      [xReply *rep;],
-      [AC_MSG_RESULT([no])],
-      [AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
-#include <X11/Xlibint.h>],
-           [xReply *rep;],
-           [AC_MSG_RESULT([yes])
-            AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
-                      [Define if <X11/extensions/XIproto.h> needed for xReply])],
-           [AC_MSG_RESULT([unknown])
-            AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
+                                     [[xReply *rep;]])],
+                    [AC_MSG_RESULT([no])],
+                    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
+                                                          #include <X11/Xlibint.h>]],
+                                                        [[xReply *rep;]])],
+                                       [AC_MSG_RESULT([yes])
+                                        AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
+                                                  [Define if <X11/extensions/XIproto.h> needed for xReply])],
+                                       [AC_MSG_RESULT([unknown])
+                                        AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
 
   # Check for XConvertCase, XInternAtoms (X11R6 specific)
 
@@ -940,10 +1014,13 @@ if test "x$gdktarget" = "xx11"; then
   # Check for XKB support.
 
   if test "x$enable_xkb" = "xyes"; then
-        AC_MSG_WARN(XKB support explicitly enabled)
-        AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
+        AC_CHECK_FUNC(XkbQueryExtension,
+                      X_EXTENSIONS="$X_EXTENSIONS XKB"
+                      AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]),
+                      AC_MSG_ERROR([*** XKB extension not found. Check 'config.log' for more details.]))
   elif test "x$enable_xkb" = "xmaybe"; then
         AC_CHECK_FUNC(XkbQueryExtension,
+                      X_EXTENSIONS="$X_EXTENSIONS XKB"
                       AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]))
   else
         AC_MSG_WARN(XKB support explicitly disabled)
@@ -965,19 +1042,23 @@ if test "x$gdktarget" = "xx11"; then
 
   CFLAGS="$gtk_save_CFLAGS"
 
-  if test "x$enable_xinerama" = "xyes"; then
+  if test "x$enable_xinerama" != "xno"; then
     # Check for Xinerama extension (Solaris impl or Xfree impl)
+    have_xfree_xinerama=false
+    have_solaris_xinerama=false
+
     gtk_save_cppflags="$CPPFLAGS"
     CPPFLAGS="$CPPFLAGS $x_cflags"
 
     # Check for XFree
-    AC_MSG_CHECKING(for Xinerama support on XFree86)
+    AC_MSG_CHECKING(for Xinerama packages)
 
-    have_xfree_xinerama=false
     if $PKG_CONFIG --exists xinerama ; then
+       AC_MSG_RESULT(yes)
        have_xfree_xinerama=true
        X_PACKAGES="$X_PACKAGES xinerama"
     else
+       AC_MSG_RESULT(no)
        AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
           [AC_CHECK_HEADER(X11/extensions/Xinerama.h,
           [GTK_ADD_LIB(x_extra_libs,Xinerama)
@@ -986,14 +1067,12 @@ if test "x$gdktarget" = "xx11"; then
     fi
 
     if $have_xfree_xinerama ; then
+      X_EXTENSIONS="$X_EXTENSIONS Xinerama"
       AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
                 [Define to 1 if XFree Xinerama is available])
       AC_DEFINE(HAVE_XINERAMA, 1,
                 [Define to 1 is Xinerama is available])
-      AC_MSG_RESULT(yes)
     else
-      AC_MSG_RESULT(no)
-
       case "$host" in
         *-*-solaris*)
             # Check for solaris
@@ -1006,6 +1085,7 @@ if test "x$gdktarget" = "xx11"; then
                    [#include <X11/Xlib.h>])])
 
             if $have_solaris_xinerama ; then
+              X_EXTENSIONS="$X_EXTENSIONS Xinerama"
               AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
                         [Define to 1 if solaris xinerama is available])
              AC_DEFINE(HAVE_XINERAMA, 1,
@@ -1020,6 +1100,15 @@ if test "x$gdktarget" = "xx11"; then
       esac
     fi
   fi
+  if test "x$enable_xinerama" = "xyes" ; then
+    if test "x$have_xfree_xinerama" != "xtrue" -a "x$have_solaris_xinerama" != "xtrue" ; then
+      AC_MSG_ERROR([*** Xinerama extension not found. Check 'config.log' for more details.])
+    fi
+  fi
+
+  # Check for XGetEventData for GenericEvents
+  AC_CHECK_FUNC(XGetEventData,
+                AC_DEFINE(HAVE_XGENERICEVENTS, 1, [Have XGenericEvent]))
 
   # set up things for XInput
   if test "x$enable_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
@@ -1029,9 +1118,14 @@ if test "x$gdktarget" = "xx11"; then
               [Define to 1 if XFree XInput should be used])
 
     X_PACKAGES="$X_PACKAGES xi"
+    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xi"
 
     AC_CHECK_HEADER(X11/extensions/XInput2.h,
-                    have_xinput2=yes; AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
+                    have_xinput2=yes
+                    X_EXTENSIONS="$X_EXTENSIONS XI2"
+                    AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]),
+                    X_EXTENSIONS="$X_EXTENSIONS XInput")
+
   else
     AC_DEFINE(XINPUT_NONE, 1,
               [Define to 1 if no XInput should be used])
@@ -1040,11 +1134,22 @@ if test "x$gdktarget" = "xx11"; then
   AM_CONDITIONAL(XINPUT_XFREE, test "x$have_xinput" = "xyes")
   AM_CONDITIONAL(XINPUT_2,     test "x$have_xinput2" = "xyes")
 
-  # Check for the RANDR extension
-  if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
-     AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
+  if test "x$enable_xinput" = "xyes" ; then
+    if test "x$have_xinput" != "xyes" -a "x$have_xinput2" != "xyes" ; then
+      AC_MSG_ERROR([*** XInput extension not found. Check 'config.log' for more details.])
+    fi
+  fi
 
-     X_PACKAGES="$X_PACKAGES xrandr"
+  # Check for the RANDR extension
+  if test x"$enable_xrandr" != xno; then
+    if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
+      AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
+
+      X_PACKAGES="$X_PACKAGES xrandr"
+      X_EXTENSIONS="$X_EXTENSIONS XRANDR"
+    elif test x"$enable_xrandr" = xyes; then
+      AC_MSG_ERROR([RANDR support requested but xrandr not found])
+    fi
   fi
 
   # Checks for Xcursor library
@@ -1057,29 +1162,44 @@ if test "x$gdktarget" = "xx11"; then
 
   # Checks for XFixes extension
 
-  if $PKG_CONFIG --exists xfixes ; then
-    AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
+  if test x"$enable_xfixes" != xno; then
+    if $PKG_CONFIG --exists xfixes ; then
+      AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
 
-    X_PACKAGES="$X_PACKAGES xfixes"
-    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
+      X_PACKAGES="$X_PACKAGES xfixes"
+      X_EXTENSIONS="$X_EXTENSIONS XFIXES"
+      GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
+    elif test x"$enable_xfixes" = xyes; then
+      AC_MSG_ERROR([XFixes support requested but xfixes not found])
+    fi
   fi
 
   # Checks for Xcomposite extension
 
-  if $PKG_CONFIG --exists xcomposite ; then
-    AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
+  if test x"$enable_xcomposite" != xno; then
+    if $PKG_CONFIG --exists xcomposite ; then
+      AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
 
-    X_PACKAGES="$X_PACKAGES xcomposite"
-    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
+      X_PACKAGES="$X_PACKAGES xcomposite"
+      X_EXTENSIONS="$X_EXTENSIONS Composite"
+      GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
+    elif test x"$enable_xcomposite" = xyes; then
+      AC_MSG_ERROR([Xcomposite support requested but xcomposite not found])
+    fi
   fi
 
   # Checks for Xdamage extension
 
-  if $PKG_CONFIG --exists xdamage ; then
-    AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
+  if test x"$enable_xdamage" != xno; then
+    if $PKG_CONFIG --exists xdamage ; then
+      AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
 
-    X_PACKAGES="$X_PACKAGES xdamage"
-    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
+      X_PACKAGES="$X_PACKAGES xdamage"
+      X_EXTENSIONS="$X_EXTENSIONS DAMAGE"
+      GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
+    elif test x"$enable_xdamage" = xyes; then
+      AC_MSG_ERROR([Xdamage support requested but xdamage not found])
+    fi
   fi
 
   if $have_base_x_pc ; then
@@ -1092,6 +1212,10 @@ if test "x$gdktarget" = "xx11"; then
   LIBS="$gtk_save_libs"
 
   AM_CONDITIONAL(USE_X11, true)
+
+  # strip leading space
+  X_EXTENSIONS=${X_EXTENSIONS#* }
+
 else
   XPACKAGES=
 
@@ -1101,28 +1225,8 @@ else
   AM_CONDITIONAL(HAVE_X11R6, false)
 fi
 
-if test "x$gdktarget" = "xwin32"; then
-  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
-  AM_CONDITIONAL(USE_WIN32, true)
-else
-  AM_CONDITIONAL(USE_WIN32, false)
-fi
-
-if test "x$gdktarget" = "xquartz"; then
-  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
-  AM_CONDITIONAL(USE_QUARTZ, true)
-else
-  AM_CONDITIONAL(USE_QUARTZ, false)
-fi
-
 # Check for Pango flags
 
-if test "x$gdktarget" = "xwin32"; then
-       PANGO_PACKAGES="pangowin32 pangocairo"
-else
-       PANGO_PACKAGES="pango pangocairo"
-fi
-
 AC_MSG_CHECKING(Pango flags)
 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
         PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
@@ -1152,25 +1256,24 @@ fi
 CFLAGS="$saved_cflags"
 LDFLAGS="$saved_ldflags"
 
-# Pull in gio-unix for GDesktopAppInfo usage, see at least gdkapplaunchcontext-x11.c
-if test "x$gdktarget" = "xx11"; then
-  GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
-else
-  GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
+GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 cairo cairo-gobject"
+GDK_PRIVATE_PACKAGES="$GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
+if test "x$enable_x11_backend" = xyes; then
+  GDK_PRIVATE_PACKAGES="$GDK_PRIVATE_PACKAGES pangoft2"
 fi
 
-GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES`"
-GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
+GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES $GDK_PRIVATE_PACKAGES` $MATH_LIB"
+GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PACKAGES $GDK_PRIVATE_PACKAGES` $GDK_EXTRA_CFLAGS"
 #
 # If we aren't writing explicit dependencies, then don't put the extra libraries we need
 # into the pkg-config files
 #
 if test $enable_explicit_deps != yes ; then
-  GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0"
   GDK_EXTRA_LIBS=
 fi
 
 AC_SUBST(GDK_PACKAGES)
+AC_SUBST(GDK_PRIVATE_PACKAGES)
 AC_SUBST(GDK_EXTRA_LIBS)
 AC_SUBST(GDK_EXTRA_CFLAGS)
 AC_SUBST(GDK_DEP_LIBS)
@@ -1207,13 +1310,15 @@ else
 fi
 
 GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
-if test "x$gdktarget" = "xx11"; then
-  GTK_PACKAGES="$GTK_PACKAGES pangoft2"
+GTK_PRIVATE_PACKAGES=""
+if test "x$enable_x11_backend" = xyes; then
+  GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
 fi
 GTK_EXTRA_LIBS=
+
 GTK_EXTRA_CFLAGS=
-GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS"
-GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PACKAGES $GTK_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
+GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES $GTK_PRIVATE_PACKAGES` $GTK_EXTRA_LIBS $MATH_LIB"
+GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PACKAGES $GTK_PACKAGES $GTK_PRIVATE_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
 
 if test x"$os_win32" = xyes; then
   GTK_EXTRA_CFLAGS="$msnative_struct"
@@ -1225,6 +1330,7 @@ PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
 
 AC_SUBST(GTK_PACKAGES)
+AC_SUBST(GTK_PRIVATE_PACKAGES)
 AC_SUBST(GTK_EXTRA_LIBS)
 AC_SUBST(GTK_EXTRA_CFLAGS)
 AC_SUBST(GTK_DEP_LIBS)
@@ -1276,8 +1382,10 @@ LIBS="$old_LIBS"
 # Printing system checks
 ################################################################
 
+PRINT_BACKENDS="file lpr"
+
 AC_ARG_ENABLE(cups,
-              [AC_HELP_STRING([--disable-cups],
+              [AS_HELP_STRING([--disable-cups],
                               [disable cups print backend])],,
               [enable_cups=auto])
 
@@ -1314,14 +1422,16 @@ else
 
     AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
 
+    PRINT_BACKENDS="$PRINT_BACKENDS cups"
     AM_CONDITIONAL(HAVE_CUPS, true)
 
     gtk_save_cflags="$CFLAGS"
     CFLAGS="$CUPS_CFLAGS"
-    AC_TRY_COMPILE([#include <cups/http.h>],
-                   [http_t http; char *s = http.authstring;],
-                   [AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
-                              [Define if cups http_t authstring field is accessible])],)
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cups/http.h>]],
+                                       [[http_t http; char *s = http.authstring;]])],
+                      [AC_DEFINE([HAVE_HTTP_AUTHSTRING], [],
+                                 [Define if cups http_t authstring field is accessible])],
+                      [])
     CFLAGS="$gtk_save_cflags"
 
     AC_SUBST(HAVE_HTTP_AUTHSTRING)
@@ -1337,9 +1447,9 @@ fi
 #
 
 AC_ARG_ENABLE(papi,
-              [AC_HELP_STRING([--disable-papi],
+              [AS_HELP_STRING([--disable-papi],
                               [disable papi print backend])],,
-             [enable_papi=auto])
+              [enable_papi=auto])
 
 if test "x$enable_papi" = "xno"; then
   AM_CONDITIONAL(HAVE_PAPI, false)
@@ -1347,6 +1457,7 @@ else
   AC_MSG_CHECKING(libpapi)
   AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
   if test $have_papi = yes; then
+    PRINT_BACKENDS="$PRINT_BACKENDS papi"
     AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
   fi
   AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
@@ -1380,11 +1491,17 @@ CPPFLAGS="$gtk_save_cppflags"
 
 
 AC_ARG_ENABLE(test-print-backend,
-              [AC_HELP_STRING([--enable-test-print-backend],
+              [AS_HELP_STRING([--enable-test-print-backend],
                               [build test print backend])],,
               [enable_test_print_backend=no])
+if test "x$enable_test_print_backend" != "xno" ; then
+  PRINT_BACKENDS="$PRINT_BACKENDS test"
+fi
 AM_CONDITIONAL(TEST_PRINT_BACKEND, test "x$enable_test_print_backend" != "xno")
 
+if test "$os_win32" = "yes"; then
+  AC_CHECK_TYPES([IPrintDialogCallback],[],[],[[#include <windows.h>]])
+fi
 
 ################################################################
 # Strip -export-dynamic from the link lines of various libraries
@@ -1416,40 +1533,95 @@ GLIB_GSETTINGS
 # GObject introspection
 ##################################################
 
-GOBJECT_INTROSPECTION_CHECK([0.9.3])
+GOBJECT_INTROSPECTION_CHECK(introspection_required_version)
 
 ##################################################
 # Packagekit module
 #################################################
 
 AC_ARG_ENABLE(packagekit,
-              AC_HELP_STRING([--disable-packagekit],
-                             [build packagekit open-with module]))
-
-ENABLE_PACKAGEKIT=
-if test "os_win32" != "yes"; then
-        if test "x$enable_packagekit" != "xno"; then
-                ENABLE_PACKAGEKIT=1
-                AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
+              [AS_HELP_STRING([--enable-packagekit=@<:@yes/no/auto@:>@],
+                              [build PackageKit open-with module [default=auto]])],
+              [enable_packagekit="$enableval"],
+              [enable_packagekit=auto])
+if test "$enable_packagekit" = "auto"; then
+  if test "$os_win32" = "yes"; then
+    enable_packagekit=no
+  else
+    enable_packagekit=yes
+  fi
+fi
+
+AC_MSG_CHECKING([whether to use PackageKit])
+build_packagekit=no
+if test "x$enable_packagekit" != "xno"; then
+  if test "$os_win32" != "yes"; then
+    build_packagekit=yes
+    AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
+  else
+    AC_MSG_ERROR([packagekit support is not available on win32])
+  fi
+fi
+AC_MSG_RESULT([$build_packagekit])
+
+AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$build_packagekit" = "xyes")
+
+##################################################
+# colord module
+#################################################
+
+AC_ARG_ENABLE(colord,
+              [AS_HELP_STRING([--enable-colord=@<:@yes/no/auto@:>@],
+                              [build colord support code [default=auto]])],
+              [enable_colord="$enableval"],
+              [enable_colord=auto])
+
+AC_MSG_CHECKING([whether to use colord])
+if test "$enable_colord" = "auto"; then
+  if test "$os_win32" = "yes"; then
+    enable_colord=no
+  fi
+fi
+if test "$enable_colord" != "no"; then
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
+fi
+
+have_colord=no
+if test "$enable_colord" != "no"; then
+        if test "$os_win32" != "yes"; then
+                PKG_CHECK_MODULES(COLORD, colord >= 0.1.9,
+                                  have_colord=yes, have_colord=no)
+                if test "$enable_colord" = "yes"; then
+                        if test "$have_colord" = "no"; then
+                                AC_MSG_ERROR([--enable-colord specified, but not available])
+                        fi
+                fi
+        else
+                AC_MSG_ERROR([colord support is not available on win32])
         fi
 fi
 
-AC_SUBST(ENABLE_PACKAGEKIT)
-AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$ENABLE_PACKAGEKIT" = "x1")
+if test "$have_colord" = "yes"; then
+        AC_DEFINE(HAVE_COLORD, 1, [define if we have colord])
+fi
+AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes")
 
 ##################################################
 # Checks for gtk-doc and docbook-tools
 ##################################################
 
-GTK_DOC_CHECK([1.11])
+GTK_DOC_CHECK([1.11],[--flavour no-tmpl])
 
 AC_CHECK_PROG(DB2HTML, db2html, true, false)
 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
 
 AC_ARG_ENABLE(man,
-              [AC_HELP_STRING([--enable-man],
-                              [regenerate man pages from Docbook [default=no]])],enable_man=yes,
-              enable_man=no)
+              [AS_HELP_STRING([--enable-man],
+                              [regenerate man pages from Docbook [default=no]])],
+              [enable_man=yes],
+              [enable_man=no])
 
 if test "${enable_man}" != no; then
   dnl
@@ -1493,14 +1665,19 @@ AC_CONFIG_COMMANDS([gdk/gdkconfig.h], [
 
 G_BEGIN_DECLS
 
-#ifndef GSEAL
-/* introduce GSEAL() here for all of Gdk and Gtk+ without the need to modify GLib */
-#  ifdef GSEAL_ENABLE
-#    define GSEAL(ident)      _g_sealed__ ## ident
-#  else
-#    define GSEAL(ident)      ident
-#  endif
-#endif /* !GSEAL */
+/* These macros are used to mark deprecated functions in GDK and
+ * GTK+ headers, and thus have to be exposed in installed headers.
+ * But please do *not* use them in other projects. Instead, use
+ * G_DEPRECATED or define your own wrappers around it.
+ */
+
+#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
+#define GDK_DEPRECATED
+#define GDK_DEPRECATED_FOR(f)
+#else
+#define GDK_DEPRECATED G_DEPRECATED
+#define GDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
+#endif
 
 _______EOF
 
@@ -1523,20 +1700,7 @@ _______EOF
          mv $outfile gdk/gdkconfig.h
        fi
 ],[
-gdk_windowing=''
-if expr "$gdktarget" : ".*x11.*" > /dev/null ; then
-  gdk_windowing='$gdk_windowing
-#define GDK_WINDOWING_X11'
-fi
-if expr "$gdktarget" : ".*win32.*" > /dev/null ; then
-  gdk_windowing='$gdk_windowing
-#define GDK_NATIVE_WINDOW_POINTER
-#define GDK_WINDOWING_WIN32'
-fi
-if expr "$gdktarget" : ".*quartz.*" > /dev/null ; then
-  gdk_windowing='$gdk_windowing
-#define GDK_WINDOWING_QUARTZ'
-fi
+gdk_windowing='$GDK_WINDOWING'
 ])
 
 dnl
@@ -1544,16 +1708,17 @@ dnl Check for -Bsymbolic-functions linker flag used to avoid
 dnl intra-library PLT jumps, if available.
 dnl
 AC_ARG_ENABLE(Bsymbolic,
-              [AC_HELP_STRING([--disable-Bsymbolic],
+              [AS_HELP_STRING([--disable-Bsymbolic],
                               [avoid linking with -Bsymbolic])],,
               [SAVED_LDFLAGS="${LDFLAGS}"
                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
                LDFLAGS=-Wl,-Bsymbolic-functions
-               AC_TRY_LINK([], [int main (void) { return 0; }],
-                           AC_MSG_RESULT(yes)
-                           enable_Bsymbolic=yes,
-                           AC_MSG_RESULT(no)
-                           enable_Bsymbolic=no)
+               AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+                                               [[int main (void) { return 0; }]])],
+                              [AC_MSG_RESULT(yes)
+                               enable_Bsymbolic=yes],
+                              [AC_MSG_RESULT(no)
+                               enable_Bsymbolic=no])
                LDFLAGS="${SAVED_LDFLAGS}"])
 
 if test "x${enable_Bsymbolic}" = "xyes" ; then
@@ -1569,16 +1734,19 @@ gdk-3.0.pc
 gtk+-3.0.pc
 gtk+-unix-print-3.0.pc
 gail-3.0.pc
-gtk+-3.0-uninstalled.pc
-gail-3.0-uninstalled.pc
 m4macros/Makefile
 po/Makefile.in
 po-properties/Makefile.in
 demos/Makefile
 demos/gtk-demo/Makefile
 demos/gtk-demo/geninclude.pl
+demos/pixbuf-demo/Makefile
 examples/Makefile
 tests/Makefile
+tests/a11y/Makefile
+tests/css/Makefile
+tests/css/parser/Makefile
+tests/reftests/Makefile
 docs/Makefile
 docs/reference/Makefile
 docs/reference/gdk/Makefile
@@ -1586,28 +1754,29 @@ docs/reference/gdk/version.xml
 docs/reference/gtk/Makefile
 docs/reference/gtk/version.xml
 docs/reference/libgail-util/Makefile
+docs/reference/libgail-util/version.xml
 docs/tools/Makefile
 build/Makefile
 build/win32/Makefile
 build/win32/vs9/Makefile
+build/win32/vs10/Makefile
 gdk/Makefile
+gdk/broadway/Makefile
 gdk/x11/Makefile
 gdk/win32/Makefile
 gdk/win32/rc/Makefile
 gdk/win32/rc/gdk.rc
 gdk/quartz/Makefile
+gdk/wayland/Makefile
 gdk/tests/Makefile
 gtk/Makefile
 gtk/makefile.msc
 gtk/gtkversion.h
 gtk/gtk-win32.rc
-gtk/theme-bits/Makefile
+gtk/a11y/Makefile
 gtk/tests/Makefile
+libgail-util/Makefile
 modules/Makefile
-modules/other/Makefile
-modules/other/gail/Makefile
-modules/other/gail/libgail-util/Makefile
-modules/other/gail/tests/Makefile
 modules/engines/Makefile
 modules/engines/pixbuf/Makefile
 modules/engines/ms-windows/Makefile
@@ -1625,5 +1794,23 @@ perf/Makefile
 
 AC_OUTPUT
 
-echo "configuration:
-        target:             $gdktarget"
+# beautify the immodule list a bit
+included_immodules=$(echo "${included_immodules}" | $SED 's/,/ /g')
+if test -z "${included_immodules}"; then included_immodules="none"; fi
+
+echo ""
+echo "        GTK+ $GTK_VERSION"
+echo "        ==========="
+echo ""
+echo "        GDK backends:         $GDK_BACKENDS"
+if test "$enable_x11_backend" = "yes"; then
+echo "        X11 extensions:       $X_EXTENSIONS"
+fi
+echo "        Print backends:       $PRINT_BACKENDS"
+echo "        Dynamic modules:      $build_dynamic_modules"
+echo "        Included immodules:   $included_immodules"
+echo "        PackageKit support:   $build_packagekit"
+echo "        colord support:       $have_colord"
+echo "        Introspection:        $found_introspection"
+echo "        Debugging:            $enable_debug"
+echo "        Documentation:        $enable_gtk_doc"