]> Pileus Git - ~andy/gtk/blobdiff - configure.in
Update version to 2.0.0
[~andy/gtk] / configure.in
index db0738b14a5bc1c9152ca85d75c613f9521d8363..7e9b0601a110ee813823b1db1d042af6b0233ace 100644 (file)
@@ -12,11 +12,6 @@ AC_INIT(gdk/gdktypes.h)
 # foo_DEP_CFLAGS:   All cflags this module requires
 
 
-## We could have pkg-config uniquify the ldflags and cflags by calling
-## it once with both the GLib and Pango package names, but we don't,
-## someone should fix that.
-
-
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
 
@@ -32,13 +27,14 @@ GLIB_AC_DIVERT_BEFORE_HELP([
 # if backwards compatibility has been broken,
 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
 #
-GTK_MAJOR_VERSION=1
-GTK_MINOR_VERSION=3
-GTK_MICRO_VERSION=7
+GTK_MAJOR_VERSION=2
+GTK_MINOR_VERSION=0
+GTK_MICRO_VERSION=0
 GTK_INTERFACE_AGE=0
 GTK_BINARY_AGE=0
 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
-dnl
+dnl This is the X.Y used in -lgtk-FOO-X.Y
+GTK_API_VERSION=2.0
 ])dnl
 
 AC_SUBST(GTK_MAJOR_VERSION)
@@ -46,6 +42,7 @@ AC_SUBST(GTK_MINOR_VERSION)
 AC_SUBST(GTK_MICRO_VERSION)
 AC_SUBST(GTK_INTERFACE_AGE)
 AC_SUBST(GTK_BINARY_AGE)
+AC_SUBST(GTK_API_VERSION)
 AC_SUBST(GTK_VERSION)
 
 # libtool versioning
@@ -53,10 +50,18 @@ LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
 LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
 LT_REVISION=$GTK_INTERFACE_AGE
 LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
+LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
 AC_SUBST(LT_RELEASE)
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
 AC_SUBST(LT_AGE)
+AC_SUBST(LT_CURRENT_MINUS_AGE)
+
+# Define a string for the earliest version that this release has
+# binary compatibility with. This is used for module locations.
+#
+GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
+AC_SUBST(GTK_BINARY_VERSION)
 
 #
 # gdk-pixbuf gets versioned separately, and for now, using standard
@@ -71,6 +76,11 @@ AC_SUBST(GDK_PIXBUF_MINOR)
 AC_SUBST(GDK_PIXBUF_MICRO)
 AC_SUBST(GDK_PIXBUF_VERSION)
 
+## Versions of dependencies
+GLIB_REQUIRED_VERSION=2.0.0
+PANGO_REQUIRED_VERSION=1.0.0
+ATK_REQUIRED_VERSION=1.0.0
+
 # For automake.
 VERSION=$GTK_VERSION
 PACKAGE=gtk+
@@ -89,13 +99,51 @@ AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
 AM_CONFIG_HEADER(config.h)
 
 dnl Initialize libtool
+AC_PROG_CC
+AM_DISABLE_STATIC
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
+dnl Set AS and ASFLAGS so that automake 1.5 will be happy
+AS="\${CC}"
+ASFLAGS="\${CFLAGS}"
+AC_SUBST(AS)
+AC_SUBST(ASFLAGS)
+
 dnl Initialize maintainer mode
 AM_MAINTAINER_MODE
 
 AC_CANONICAL_HOST
 
+AC_MSG_CHECKING([for some Win32 platform])
+case "$host" in
+  *-*-mingw*|*-*-cygwin*)
+    platform_win32=yes
+    ;;
+  *)
+    platform_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$platform_win32])
+AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
+
+AC_MSG_CHECKING([for native Win32])
+case "$host" in
+  *-*-mingw*)
+    os_win32=yes
+    ;;
+  *)
+    os_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$os_win32])
+AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
+
+if test "$os_win32" = "yes"; then
+  AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
+fi
+AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
+
 dnl figure debugging default, prior to $ac_help setup
 dnl
 GLIB_AC_DIVERT_BEFORE_HELP([
@@ -122,18 +170,32 @@ AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogenera
 
 AC_ARG_WITH(xinput, [  --with-xinput=[no/gxi/xfree] support XInput ])
 
-gdktarget=x11
-gdktargetlib=libgdk-x11-1.3.la
-gtktargetlib=libgtk-x11-1.3.la
-AC_ARG_WITH(gdktarget, [  --with-gdktarget=[x11/nanox/linux-fb] select GDK target [default=x11] ],
+AC_ARG_WITH(wintab, [  --with-wintab=DIRECTORY use Wintab API with win32 backend])
+AC_ARG_WITH(ie55, [  --with-ie55=DIRECTORY IE5.5 libs and headers (for Active IMM)])
+
+GLIB_AC_DIVERT_BEFORE_HELP([
+if test "$platform_win32" = yes; then
+  gdktarget=win32
+else
+  gdktarget=x11
+fi
+])
+
+AC_ARG_WITH(gdktarget, [  --with-gdktarget=[[x11/linux-fb/win32]] select GDK target [default=$gdktarget]],
        gdktarget=$with_gdktarget)
 
 AC_SUBST(gdktarget)
 case $gdktarget in
-  x11|nanox|linux-fb) ;;
-  *) AC_MSG_ERROR([Invalid target for GDK: use x11, nanox or linux-fb.]);;
+  x11|linux-fb|win32) ;;
+  *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
 esac
 
+gdktargetlib=libgdk-$gdktarget-$GTK_API_VERSION.la
+gtktargetlib=libgtk-$gdktarget-$GTK_API_VERSION.la
+
+AC_SUBST(gdktargetlib)
+AC_SUBST(gtktargetlib)
+
 AC_ARG_ENABLE(shadowfb, [  --disable-shadowfb      disable shadowfb support for linux-fb],,enable_shadowfb=yes)
 
 AC_ARG_ENABLE(fbmanager, [  --enable-fbmanager      enable framebuffer manager support (GtkFB)],enable_fbmanager=yes,enable_fbmanager=no)
@@ -156,7 +218,6 @@ AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
 AM_SANITY_CHECK
 
 # Checks for programs.
-AC_PROG_CC
 AC_ISC_POSIX
 AM_PROG_CC_STDC
 AC_PROG_INSTALL
@@ -180,21 +241,68 @@ if test "x$GCC" = "xyes"; then
     *) CFLAGS="$CFLAGS -pedantic" ;;
     esac
   fi
+
+  if test "$os_win32" = "yes"; then
+    case "$CC $CFLAGS " in
+    *[[\ \     ]]-fnative-struct[[\ \  ]]*) ;;
+    *) CFLAGS="$CFLAGS -fnative-struct" ;;
+    esac
+  fi
 fi
 changequote([,])dnl
 
 # Honor aclocal flags
 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
 
-# libtool option to control which symbols are exported
-# right now, symbols starting with _ are not exported
-LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
+## Initial sanity check, done here so that users get told they 
+## have the wrong dependencies as early in the process as possible.
+## Later on we actually use the cflags/libs from separate pkg-config
+## calls. Oh, also the later pkg-config calls don't include 
+## the version requirements since those make the module lists 
+## annoying to construct
+PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION atk >= $ATK_REQUIRED_VERSION pango >= $PANGO_REQUIRED_VERSION)
+
+if test "$os_win32" != yes; then
+    # libtool option to control which symbols are exported
+    # right now, symbols starting with _ are not exported
+    LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
+else
+    # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
+    LIBTOOL_EXPORT_OPTIONS=
+fi
 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
 
+dnl ******************************************************
+dnl * See whether to include shared library dependencies *
+dnl ******************************************************
+
+AC_ARG_ENABLE(explicit-deps, 
+              [  --enable-explicit-deps=[yes/no/auto]    use explicit dependencies in .pc files [default=auto]],
+              enable_explicit_deps="$enableval", 
+              enable_explicit_deps=auto)
+
+AC_MSG_CHECKING([Whether to write dependencies into .pc files])
+case $enable_explicit_deps in
+  auto)
+    deplib_check_method=`(./libtool --config; echo eval echo \\$deplib_check_method) | sh`
+    if test "X$deplib_check_method" == Xnone || test "x$enable_static" = xyes ; then
+      enable_explicit_deps=yes  
+    else
+      enable_explicit_deps=no  
+    fi
+  ;;
+  yes|no) 
+  ;;
+  *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
+  ;;
+esac
+AC_MSG_RESULT($enable_explicit_deps)
+
+AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
+
 # define a MAINT-like variable REBUILD which is set if Perl
 # and awk are found, so autogenerated sources can be rebuilt
 
-AC_PROG_AWK
 AC_CHECK_PROGS(PERL, perl5 perl)
 
 # We would like indent, but don't require it.
@@ -203,13 +311,23 @@ AC_CHECK_PROG(INDENT, indent, indent)
 REBUILD=\#
 if test "x$enable_rebuilds" = "xyes" && \
      test -n "$PERL" && \
-     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
-     test -n "$AWK" ; then
+     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
   REBUILD=
 fi
 AC_SUBST(REBUILD)
 
-AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset)
+AC_CHECK_FUNCS(lstat mkstemp bind_textdomain_codeset)
+
+# sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
+AC_MSG_CHECKING(for sigsetjmp)
+AC_TRY_LINK([#include <setjmp.h>], [
+sigjmp_buf env;
+sigsetjmp(env, 0);
+], gtk_ok=yes, gtk_ok=no)
+AC_MSG_RESULT($gtk_ok)
+if test "$gtk_ok" = "yes"; then
+  AC_DEFINE(HAVE_SIGSETJMP)
+fi
 
 AC_MSG_CHECKING(whether make is GNU Make)
 STRIP_BEGIN=
@@ -227,7 +345,7 @@ AC_SUBST(STRIP_BEGIN)
 AC_SUBST(STRIP_END)
 
 # i18n stuff
-ALL_LINGUAS="az ca cs da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
+ALL_LINGUAS="az ca cs cy da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt ms nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
 AM_GLIB_GNU_GETTEXT
 LIBS="$LIBS $INTLLIBS"
 
@@ -289,7 +407,6 @@ AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
 # 
 
 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
-GLIB_REQUIRED_VERSION=1.3.7
 
 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
   AC_MSG_ERROR([
@@ -297,10 +414,74 @@ AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
 *** GLIB is always available from ftp://ftp.gtk.org/.]),
   gobject gmodule gthread)
 
-AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
+AC_CHECK_HEADERS(winsock.h, AC_DEFINE(HAVE_WINSOCK_H))
+
+if test "${with_ie55+set}" = set && test $with_ie55 != no; then
+  AC_MSG_CHECKING([for dimm.h])
+  saved_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -idirafter $with_ie55/Include"
+  AC_TRY_COMPILE([#include <windows.h>
+#include <objbase.h>
+#ifdef __GNUC__
+/* The w32api imm.h clashes a bit with the IE5.5 dimm.h */
+#define IMEMENUITEMINFOA hidden_IMEMENUITEMINFOA
+#define IMEMENUITEMINFOW hidden_IMEMENUITEMINFOW
+#include <imm.h>
+#undef IMEMENUITEMINFOA
+#undef IMEMENUITEMINFOW
+#endif
+#include <dimm.h>
+],
+   [],
+   [AC_MSG_RESULT(yes)
+    AC_MSG_CHECKING([for IE55 uuid.lib])
+    if test -f $with_ie55/Lib/uuid.lib ; then
+      AC_MSG_RESULT(yes)
+      have_ie55=yes
+      AC_DEFINE(HAVE_DIMM_H)
+      IE55_UUID_LIB="$with_ie55/Lib/uuid.lib"
+      AC_SUBST(IE55_UUID_LIB)
+    else
+      AC_MSG_RESULT(no)
+      CFLAGS="$saved_CFLAGS"
+      have_ie55=no
+    fi
+    ],
+   [AC_MSG_RESULT(no)
+    CFLAGS="$saved_CFLAGS"
+    have_ie55=no])
+fi
+AM_CONDITIONAL(HAVE_IE55, test x$have_ie55 = xyes)
+
+if test "${with_wintab+set}" = set && test $with_wintab != no; then
+  AC_MSG_CHECKING([for wintab.h])
+  saved_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -I$with_wintab/include"
+  AC_TRY_COMPILE([#include <windows.h>
+#include <wintab.h>], 
+   [],
+   [AC_MSG_RESULT(yes)
+    AC_MSG_CHECKING([for wntab32x.lib])
+    if test -f $with_wintab/lib/i386/wntab32x.lib ; then
+      AC_MSG_RESULT(yes)
+      have_wintab=yes
+      AC_DEFINE(HAVE_WINTAB)
+      WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
+      AC_SUBST(WINTAB_LIB)
+    else
+      AC_MSG_RESULT(no)
+      CFLAGS="$saved_cflags"
+      have_wintab=no
+    fi
+    ],
+   [AC_MSG_RESULT(no)
+    CFLAGS="$saved_cflags"
+    have_wintab=no])
+fi
+AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
 
 saved_cflags="$CFLAGS"
 saved_ldflags="$LDFLAGS"
@@ -391,7 +572,7 @@ AC_SUBST(GDK_WLIBS)
 
 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
 
-AC_ARG_ENABLE(modules, [  --disable-modules       Disables dynamic module loading],[
+AC_ARG_ENABLE(modules, [  --disable-modules       disable dynamic module loading],[
        if test x$withval = xyes; then 
            with_modules=yes
         else
@@ -416,7 +597,7 @@ fi
 dnl Now we check to see if our libtool supports shared lib deps
 dnl (in a rather ugly way even)
 if $dynworks; then
-   pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
+   pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
    pixbuf_deplibs_check=`$pixbuf_libtool_config | \
       grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
       sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
@@ -434,25 +615,39 @@ else
    AC_MSG_RESULT(no)
 fi
 
+dnl We allow people to disable image loaders explicitely, but if they don't we error
+dnl out so that people don't accidentally build without them.
+
+AC_ARG_WITH(libpng,  [  --without-libpng         disable PNG loader for gdk-pixbuf])
+AC_ARG_WITH(libjpeg, [  --without-libjpeg        disable JPEG loader for gdk-pixbuf])
+AC_ARG_WITH(libtiff, [  --without-libtiff        disable TIFF loader for gdk-pixbuf])
+
 dnl Test for libtiff
-  if test -z "$LIBTIFF"; then
+  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
     AC_CHECK_LIB(tiff, TIFFReadScanline,
-      AC_CHECK_HEADER(tiffio.h,
+      [AC_CHECK_HEADER(tiffio.h,
         TIFF='tiff'; LIBTIFF='-ltiff',
-        AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
-      AC_CHECK_LIB(tiff, TIFFWriteScanline,
-        AC_CHECK_HEADER(tiffio.h,
+        AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
+      [AC_CHECK_LIB(tiff, TIFFWriteScanline,
+        [AC_CHECK_HEADER(tiffio.h,
           TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
-          AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
-        AC_CHECK_LIB(tiff34, TIFFFlushData,
-          AC_CHECK_HEADER(tiffio.h,
+          AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
+        [AC_CHECK_LIB(tiff34, TIFFFlushData,
+          [AC_CHECK_HEADER(tiffio.h,
             TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
-            AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
-        AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm)
+            AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
+        AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
+  fi
+
+  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
+     AC_MSG_ERROR([
+*** Checks for TIFF loader failed. You can build without it by passing 
+*** --without-libtiff to configure but some programs using GTK+ may
+*** not work properly])
   fi
 
 dnl Test for libjpeg
-  if test -z "$LIBJPEG"; then
+  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
     AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
       jpeg_ok=yes,
       jpeg_ok=no
@@ -463,6 +658,7 @@ dnl Test for libjpeg
 [#include <stdio.h>
 #undef PACKAGE
 #undef VERSION
+#undef HAVE_STDLIB_H
 #include <jpeglib.h>],
         jpeg_ok=yes,
         jpeg_ok=no)
@@ -478,12 +674,19 @@ dnl Test for libjpeg
     fi
   fi
 
+  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
+     AC_MSG_ERROR([
+*** Checks for JPEG loader failed. You can build without it by passing 
+*** --without-libjpeg to configure but some programs using GTK+ may
+*** not work properly])
+  fi
+
 dnl Test for libpng
-  if test -z "$LIBPNG"; then
+  if test x$with_libpng != xno && test -z "$LIBPNG"; then
     AC_CHECK_LIB(png, png_read_info,
-      AC_CHECK_HEADER(png.h,
+      [AC_CHECK_HEADER(png.h,
         png_ok=yes,
-        png_ok=no),
+        png_ok=no)],
       AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
     if test "$png_ok" = yes; then
       AC_MSG_CHECKING([for png_structp in png.h])
@@ -502,6 +705,14 @@ dnl Test for libpng
     fi
   fi
 
+  if test x$with_libpng != xno && test -z "$LIBPNG"; then
+     AC_MSG_ERROR([
+*** Checks for PNG loader failed. You can build without it by passing 
+*** --without-libpng to configure but many programs using GTK+ will
+*** not work properly. The PNG loader is also needed if you are compiling
+*** from CVS.])
+  fi
+
 AC_SUBST(LIBTIFF)
 AC_SUBST(LIBJPEG)
 AC_SUBST(LIBPNG)
@@ -513,7 +724,7 @@ AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
 #
 AC_MSG_CHECKING(pixbuf loaders to build)
 
-AC_ARG_WITH(included_loaders, [  --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
+AC_ARG_WITH(included_loaders, [  --with-included-loaders=LOADER1,LOADER2,...  build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
 
 if $dynworks; then 
         :
@@ -553,7 +764,6 @@ IFS="$gtk_save_ifs"
 AC_SUBST(INCLUDED_LOADER_OBJ)
 AC_SUBST(INCLUDED_LOADER_DEFINE)
 
-AC_HEADER_DIRENT
 AC_HEADER_SYS_WAIT
 
 AC_TYPE_SIGNAL
@@ -638,14 +848,59 @@ AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
 GDK_EXTRA_LIBS=$GDK_WLIBS
 GDK_EXTRA_CFLAGS= 
 
+FREETYPE_LIBS=
+FREETYPE_CFLAGS=
+if test "x$gdktarget" = "xlinux-fb" || test "x$gdktarget" = "x11" ; then
+  #
+  # Checks for FreeType
+  #
+  have_freetype=false
+  AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
+  if test "x$FREETYPE_CONFIG" != "xno" ; then
+    FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
+    FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
+
+    AC_CHECK_LIB(freetype, FT_New_Face, have_freetype=true
+                ,:,$FREETYPE_LIBS)
+
+    if $have_freetype ; then
+      gtk_save_cppflags="$CPPFLAGS"
+      CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
+
+      AC_MSG_CHECKING([For sufficiently new FreeType (at least 2.0.1)])
+      AC_TRY_COMPILE([
+#include <freetype/freetype.h>
+#include FT_ERRORS_H
+    ],
+                    [(void)1;],:,have_freetype=yes)
+      if test x$have_freetype = xyes ; then
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+      fi
+
+      CPPFLAGS="$gtk_save_cppflags"
+    fi
+  fi
+  AC_SUBST(FREETYPE_LIBS)
+  AC_SUBST(FREETYPE_CFLAGS)
+fi
+
 if test "x$gdktarget" = "xx11"; then
   # We start off with the libraries from Pango
 
+  if $PKG_CONFIG --exists pangox ; then : ; else
+    AC_MSG_ERROR([pangox Pango backend is required for x11 target])
+  fi
+    
   ## be sure we also have Pango built with xft support
   if $PKG_CONFIG --exists pangoxft ; then
     PANGO_PACKAGES="pangox pangoxft"
     have_xft=true
     AC_DEFINE(HAVE_XFT)
+    if x$have_freetype != xyes ; then
+      AC_MSG_ERROR([pangoxft Pango backend found but did not find freetype libraries])
+    fi
   else
     PANGO_PACKAGES="pangox"
     have_xft=false
@@ -653,10 +908,57 @@ if test "x$gdktarget" = "xx11"; then
 
   AM_CONDITIONAL(HAVE_XFT, $have_xft)
 
+  #
+  # If Pango included the shared library dependencies from X11 in
+  # the pkg-config output, then we use that (to avoid duplicates).
+  # but if they were omitted to avoid binary compatibility problems
+  # then we need to repeat the checks.
+  #
   x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
+  case x_libs in
+    *-lX11*) pango_omitted_x_deps=no ;;
+    *)       pango_omitted_x_deps=yes ;;
+  esac
+
   x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
   x_extra_libs=
 
+  if test $pango_omitted_x_deps = yes ; then
+    AC_PATH_XTRA
+
+    if test x$no_x = xyes ; then
+      AC_MSG_ERROR([X development libraries not found])
+    fi
+
+    x_libs="$X_LIBS -lX11 $X_EXTRA_LIBS"
+
+    #
+    # Checks for Xft/XRender
+    #
+    XFT_LIBS=""
+    XFT_CFLAGS=""
+    if test $have_xft = true ; then
+      gtk_save_cppflags="$CPPFLAGS"
+      CPPFLAGS="$CPPFLAGS $x_cflags"
+      have_xft=false
+
+      AC_CHECK_LIB(Xrender, XRenderFindFormat, 
+        [AC_CHECK_LIB(Xft, XftFontOpen,
+          [AC_CHECK_HEADER(X11/Xft/XftFreetype.h,
+            have_xft=true,:)],
+         :,-lXrender -lXext $x_libs $FREETYPE_LIBS)]
+      ,:,-lXext $x_libs)
+
+      CPPFLAGS="$gtk_save_cppflags"
+
+      if $have_xft ; then
+        x_libs="$X_LIBS -lXft -lXrender -lXext -lX11 $FREETYPE_LIBS $X_EXTRA_LIBS"
+      else
+        AC_MSG_ERROR([pangoxft Pango backend found, but Xft not found])
+      fi
+    fi
+  fi           
+
   ## Strip the .la files
  
   x_libs_for_checks=""
@@ -802,17 +1104,34 @@ if test "x$gdktarget" = "xx11"; then
   fi
 
   GDK_EXTRA_CFLAGS=
-  GDK_EXTRA_LIBS="$x_extra_libs"
-
-  # these are already defined above
-  #gdktargetlib = "libgdk-x11-1.3.la"
-  #gtktargetlib = "libgtk-x11-1.3.la"
+  if test $pango_omitted_x_deps = yes ; then
+    GDK_EXTRA_LIBS="$x_extra_libs $x_libs $GDK_EXTRA_LIBS"
+  else
+    GDK_EXTRA_LIBS="$x_extra_libs $GDK_EXTRA_LIBS"
+  fi
 
   AM_CONDITIONAL(USE_X11, true)
 else
   AM_CONDITIONAL(USE_X11, false)
 fi
 
+if test "x$gdktarget" = "xwin32"; then
+  # We start off with the libraries from Pango
+
+  ## be sure we also have Pango built with win32 support
+  PANGO_PACKAGES="pangowin32"
+
+  if test x$have_wintab = xyes; then
+    GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
+    AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
+  fi
+
+  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -luuid"
+  AM_CONDITIONAL(USE_WIN32, true)
+else
+  AM_CONDITIONAL(USE_WIN32, false)
+fi
+
 AC_SUBST(xinput_progs)
 
 GDK_PIXBUF_XLIB_PACKAGES=
@@ -825,30 +1144,17 @@ AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
 
-if test "x$gdktarget" = "xnanox"; then
-  AC_CHECK_LIB(nano-X, GrOpen,,AC_MSG_ERROR([nano-X libraries not found.]))
-  # nano-X may require additional libraries
-  GDK_EXTRA_LIBS="-lnano-X $GDK_EXTRA_LIBS"
-
-  gdktargetlib="libgdk-nanox-1.3.la"
-  gtktargetlib="libgtk-nanox-1.3.la"
-
-  AM_CONDITIONAL(USE_NANOX, true)
-else
-  AM_CONDITIONAL(USE_NANOX, false)
-fi
-
 if test "x$gdktarget" = "xlinux-fb"; then
-  gdktargetlib="libgdk-linux-fb-1.3.la"
-  gtktargetlib="libgtk-linux-fb-1.3.la"
-
-  AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
-  if test x$FREETYPE_CONFIG = xno ; then
-    AC_MSG_ERROR([*** freetype-config not found])
+  if test x$have_freetype != xyes ; then
+    AC_MSG_ERROR([Using linux-fb backend but freetype was not found])
   fi
 
-  FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
-  FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
+  ft2_libs="`$PKG_CONFIG --libs pangoft2`"
+  case ft2_libs in
+    *-lfreetype*) pango_omitted_ft2_deps=no ;;
+    *)            pango_omitted_ft2_deps=yes ;;
+  esac
+
   CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
 
   if test x$enable_shadowfb = xyes ; then
@@ -862,8 +1168,10 @@ if test "x$gdktarget" = "xlinux-fb"; then
     AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
   fi
   
-  GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
-  GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
+  GDK_EXTRA_CFLAGS=""
+  if test $pango_omitted_ft2_deps = yes ; then
+    GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
+  fi
 
   AM_CONDITIONAL(USE_LINUX_FB, true)
 else
@@ -871,9 +1179,6 @@ else
   AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
 fi
 
-AC_SUBST(gdktargetlib)
-AC_SUBST(gtktargetlib)
-
 #
 # Pick correct Pango packages to use
 #
@@ -884,6 +1189,8 @@ if test "x$gdktarget" = "xx11"; then
         else
             PANGO_PACKAGES=pangox
         fi
+elif test "x$gdktarget" = "xwin32"; then
+        PANGO_PACKAGES=pangowin32
 elif test "x$gdktarget" = "xlinux-fb"; then
         PANGO_PACKAGES=pangoft2
 else
@@ -924,6 +1231,14 @@ GDK_PACKAGES=$PANGO_PACKAGES
 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $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_EXTRA_LIBS=
+fi
+
 AC_SUBST(GDK_PACKAGES)
 AC_SUBST(GDK_EXTRA_LIBS)
 AC_SUBST(GDK_EXTRA_CFLAGS)
@@ -952,7 +1267,7 @@ fi
 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
         :
 else
-        AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
+        AC_CHECK_LIB(atk-1.0, atk_object_get_type, : , AC_MSG_ERROR([
                 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
                 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
 fi
@@ -977,7 +1292,7 @@ AC_SUBST(GTK_XIM_FLAGS)
 # Checks for gtk-doc and docbook-tools
 ##################################################
 
-AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
+AC_ARG_WITH(html-dir, [  --with-html-dir=PATH    path to installed docs ])
 
 if test "x$with_html_dir" = "x" ; then
   HTML_DIR='${datadir}/gtk-doc/html'
@@ -989,7 +1304,7 @@ AC_SUBST(HTML_DIR)
 
 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
 
-gtk_doc_min_version=0.6
+gtk_doc_min_version=0.9
 if $GTKDOC ; then 
     gtk_doc_version=`gtkdoc-mkdb --version`
     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
@@ -1007,13 +1322,11 @@ fi
 AC_CHECK_PROG(DB2HTML, db2html, true, false)
 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
 
-dnl Let people disable the gtk-doc stuff.
-AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
+dnl Make people enable the gtk-doc stuff explicitely.
+AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        use gtk-doc to build documentation [default=no]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
 
-if test x$enable_gtk_doc = xauto ; then
-  if test x$GTKDOC = xtrue ; then
-    enable_gtk_doc=yes
-  else
+if test x$enable_gtk_doc = xyes ; then
+  if test x$GTKDOC != xtrue ; then
     enable_gtk_doc=no 
   fi
 fi
@@ -1088,9 +1401,9 @@ esac
 if test "x$gdktarget" = "xx11" ; then
   gdk_windowing='
 #define GDK_WINDOWING_X11'
-elif test "x$gdktarget" = "xnanox" ; then
+elif test "x$gdktarget" = "xwin32" ; then
   gdk_windowing='
-#define GDK_WINDOWING_NANOX'
+#define GDK_WINDOWING_WIN32'
 elif test "x$gdktarget" = "xlinux-fb" ; then
   gdk_windowing='
 #define GDK_WINDOWING_FB
@@ -1114,12 +1427,12 @@ fi
 ])
 
 AC_PATH_PROG(SGML2HTML, sgml2html, no)
-AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
+AM_CONDITIONAL(HAVE_SGML2HTML, test x$SGML2HTML != xno)
 
 AC_OUTPUT([
 config.h.win32
+gtk-zip.sh
 gtk+.spec
-docs/gtk-config.1
 Makefile
 gdk-pixbuf-2.0.pc
 gdk-2.0.pc
@@ -1131,6 +1444,7 @@ m4macros/Makefile
 po/Makefile.in
 build/Makefile
 build/win32/Makefile
+build/win32/dirent/Makefile
 demos/Makefile
 demos/gtk-demo/Makefile
 tests/Makefile
@@ -1143,6 +1457,7 @@ docs/faq/Makefile
 docs/tutorial/Makefile
 gdk-pixbuf/Makefile
 gdk-pixbuf/makefile.mingw
+gdk-pixbuf/gdk_pixbuf.rc
 gdk-pixbuf/gdk-pixbuf-features.h
 gdk-pixbuf/pixops/Makefile
 gdk-pixbuf/pixops/makefile.mingw
@@ -1153,7 +1468,6 @@ gdk/win32/Makefile
 gdk/win32/makefile.mingw
 gdk/win32/rc/Makefile
 gdk/win32/rc/gdk.rc
-gdk/nanox/Makefile
 gdk/linux-fb/Makefile
 gtk/Makefile
 gtk/makefile.mingw
@@ -1161,6 +1475,7 @@ gtk/makefile.msc
 gtk/gtkversion.h
 gtk/gtk-win32.rc
 gtk/stock-icons/Makefile
+gtk/theme-bits/Makefile
 modules/Makefile
 modules/input/Makefile
 contrib/Makefile