Imported Upstream version 3.7.3 13/138313/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 11 Jul 2017 23:48:16 +0000 (08:48 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 11 Jul 2017 23:48:19 +0000 (08:48 +0900)
Change-Id: I340c8ed6916f5312452a0b7b1bf0f0b7a2d91264
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
27 files changed:
ChangeLog
Makefile.am
Makefile.in
NEWS
PKG-INFO
aclocal.m4
configure
configure.ac
gi/_gobject/gobjectmodule.c
gi/_gobject/propertyhelper.py
gi/_gobject/pygtype.c
gi/overrides/GLib.py
gi/pygi-argument.c
gi/pygi-cache.c
gi/pygi-invoke.c
ltmain.sh
m4/libtool.m4
pygi-convert.sh [new file with mode: 0755]
pygtkcompat/pygtkcompat.py
tests/Makefile.am
tests/Makefile.in
tests/test_gdbus.py
tests/test_gi.py
tests/test_glib.py
tests/test_internal_api.py [new file with mode: 0644]
tests/test_overrides_gtk.py
tests/test_properties.py

index 31a2925f6efca5a5c2646dd855a29aac423aed49..ab163674290ec05f56a387cd8cacd10471e8ac1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,353 @@
+commit 061b23d14386c0e54d2c3af113554231bbe85f16
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Dec 17 23:18:31 2012 +0100
+
+    release 3.7.3
+
+ NEWS | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+commit a242f02823a63c9dca5d0b1ce84b031221053690
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Dec 17 23:11:29 2012 +0100
+
+    Add (failing) tests for callbacks with out arguments
+
+    Most of these fail and need marshalling fixes.
+
+ tests/test_gi.py | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+commit 449b1ef0d94450c1e457770a093abd6d6c9e6291
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Dec 17 22:50:59 2012 +0100
+
+    Add tests for internal API
+
+    These cover functions like pygobject_new(), pyg_value_from_pyobject()
+    and
+    pyg_value_as_pyobject() that are wrapped by testhelpermodule.c. With
+    that these
+    functions can be tested in isolation without the whole GI stack
+    around them.
+
+ tests/Makefile.am          |  1 +
+ tests/test_internal_api.py | 73
+ ++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 74 insertions(+)
+
+commit e44312139426f51e576ef9e880819542cc224383
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Dec 17 18:02:15 2012 +0100
+
+    Add support for caller-allocated GArray out arguments
+
+    https://bugzilla.gnome.org/show_bug.cgi?id=690041
+
+ gi/pygi-cache.c  |  2 +-
+ gi/pygi-invoke.c | 57
+ ++++++++++++++++++++++++++++++--------------------------
+ tests/test_gi.py |  5 +++--
+ 3 files changed, 35 insertions(+), 29 deletions(-)
+
+commit f262320ac22b48a9d007c425633f3ca426b7fb4a
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Dec 17 16:18:24 2012 +0100
+
+    Add (failing) test for caller-allocated GArray return value
+
+    Call new GIMarshallingTests.garray_utf8_full_out_caller_allocated()
+    function
+    which reproduces https://bugzilla.gnome.org/show_bug.cgi?id=690041.
+
+    The test is failing and causing a segfault right now, so disable it
+    until this
+    actually works.
+
+ tests/test_gi.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 1cb4c30c3cf19690210010d39b6272965f489c58
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Dec 17 15:56:44 2012 +0100
+
+    GLib overrides: Avoid calling deprecated GLib.unix_signal_add_full()
+
+    glib 2.35.x fixed the API to be GLib.unix_signal_add(). Call the
+    modern API if
+    available, but fall back to GLib.unix_signal_add_full() until we
+    depend on glib
+    2.36.
+
+ gi/overrides/GLib.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+commit 945263a89c3adee61f95d4211cf13b254ad6d51f
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Fri Nov 30 14:17:18 2012 +0100
+
+    Re-support calling GLib.io_add_watch with an fd or Python file
+
+    This does not strictly adhere to the GLib API, but it's very
+    convenient and
+    unlike the other modes, does not change the number or order of
+    arguments. So
+    let's keep support for this and drop the deprecation warning.
+
+ gi/overrides/GLib.py | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+commit 263b9f97e748746e1d26847a82a4d6e53a42798a
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Fri Nov 30 09:04:20 2012 +0100
+
+    Robustify test_glib.TestGLib.test_io_add_watch_pyfile
+
+    Use a longer timeout to avoid races on slow architectures, and cut
+    the main
+    loop as soon as we received all expected events.
+
+ tests/test_glib.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit 8e4e822cb273db4eb7e6e40f4739eeebee00798a
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Fri Nov 30 08:44:56 2012 +0100
+
+    test_overrides_gtk: Ignore GVFS warnings from FileChooserDialog
+
+    Do not cause GVFS warnings from Gtk.FileChooserDialog (which may
+    concern
+    unavailable monitor backends in the test environment) to fail
+    the tests.
+
+ tests/test_overrides_gtk.py | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+commit d47283936b4c0b5e8b6ede8886c4badbf6d6e694
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 16:45:49 2012 +0100
+
+    pygtkcompat: Work around IndexError on large flags
+
+    On 32 bit systems pygtkcompat currently fails with
+
+      File "pygtkcompat/pygtkcompat.py", line 74, in _install_enums
+        name = flag.value_names[-1].replace(modname + '_', '')
+    IndexError: cannot fit 'int' into an index-sized integer
+
+    on 32 bit systems as some flags in Gdk are too large to fit into a
+    32 bit
+    "long". Work around this crash until this gets fixed properly
+    (marked as
+    FIXME).
+
+ pygtkcompat/pygtkcompat.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 3fa31b1a7936c556e76bd8a42030567c6a867e0d
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 14:11:29 2012 +0100
+
+    Fix pyg_value_from_pyobject() range check for uint
+
+    We cannot use PYGLIB_PyLong_AsLong() for the range check, as on 32
+    bit machines
+    this overflows large uints. Use PyLong_AsLongLong() separately to
+    check for
+    negative values, and PyLong_AsUnsignedLong() for the actual
+    conversion.
+
+ gi/_gobject/pygtype.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+commit 05d767a602571805e80099f1db47ad4164575c53
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 13:30:56 2012 +0100
+
+    Fix tests to work with g-i 1.34.2
+
+    Do not try to call GIMarshallingTests API which isn't present
+    when running
+    against g-i 1.34.2. This can be dropped when the g-i dependency gets
+    bumped to
+    1.35.x.
+
+ tests/test_gi.py | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+commit a107c928ef85b4e3b9075a408774b74879586029
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 13:13:14 2012 +0100
+
+    Fix wrong refcount for GVariant property defaults
+
+    Drop the bogus DECREF for the GVariant default argument, as we need
+    to keep it
+    around in the class. Otherwise the refcount drops to zero, and
+    the next
+    garbage collection run causes segfaults.
+
+    https://bugzilla.gnome.org/show_bug.cgi?id=689267
+
+ gi/_gobject/gobjectmodule.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 9b7dd1318cf540d5f8d03655da03534ed72707ec
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 11:44:22 2012 +0100
+
+    test_gi: Fix TestFilename failure under C locale
+
+ tests/test_gi.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 37ab227555ba8628b4fa99aa286bd046208745ed
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 11:16:26 2012 +0100
+
+    Fix array arguments on 32 bit
+
+    In _pygi_argument_from_object() we never put the actual element
+    GType into the
+    constructed array. The array contains GIArguments, or bytes in the
+    case of
+    passing a string as an array.
+
+    This happened to work on 64 bit machines where GIArgument and char*
+    have the
+    same size, but not on 32 bit machines
+    (test_gi.TestPropertiesObject.test_strv
+    fails there).
+
+ gi/pygi-argument.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+commit 7bd852fc82f92dac8723e18b61a56ed1b1a1b81c
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 10:20:27 2012 +0100
+
+    test_gi: Disable failing check in test_module_name()
+
+    When calling this under some conditions, such as
+
+      TEST_NAMES='test_thread test_gi.TestOverrides'
+
+    then the module name of GObject.InitiallyUnowned comes out as
+    "importlib._bootstrap" instead of "gi.repository.GObject". To be
+    investigated.
+    Add a couple of other tests to ensure that it is not broken in
+    general.
+
+ tests/test_gi.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+commit 94a6cc93a104b22dcee2ac73cae36b83a4b5d9c1
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 09:40:32 2012 +0100
+
+    test_gdbus: Drop failure if timeout=0 works differently
+
+    In some test environments we do not actually get a timeout exceptions
+    with
+    timeout=0, but a different error message. So only ensure that we
+    get the right
+    kind of error.
+
+ tests/test_gdbus.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit c3b2f5fee573aa03a8a9563efbbbc1bc4fa25da7
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Thu Nov 29 09:29:05 2012 +0100
+
+    test_glib: Drop some assumptions about XDG dirs
+
+    Some directories do not exist in minimal test environments, and this
+    is not
+    important for testing that calling these GLib functions works.
+
+ tests/test_glib.py | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+commit e45c690bc83b6d513887649de88965a9752e316d
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Wed Nov 28 12:20:31 2012 +0100
+
+    Add backwards compatible API for GLib.unix_signal_add_full()
+
+    This was renamed to GLib.unix_signal_add() in
+    http://git.gnome.org/browse/glib/commit/?id=fca30c3e165
+
+    Provide a backwards compatible shim with a deprecation message.
+
+ gi/overrides/GLib.py | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+commit 00b9ea32d766ae486249f402d9dee511fd9f53a9
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Nov 26 08:11:36 2012 +0100
+
+    Drop MININT64/MAXUINT64 workaround
+
+    g-i 1.34.2 properly handles 64 bit constants now, so bug 685022 has
+    been fixed
+    properly now. Drop the workaround in the overrides to manually
+    set these
+    constants.
+
+ gi/overrides/GLib.py | 7 -------
+ 1 file changed, 7 deletions(-)
+
+commit d16604f64d25d18409270d7537fc993113b65c19
+Author: Simonas Kazlauskas <simonas@kazlauskas.me>
+Date:   Fri Nov 23 19:57:56 2012 +0200
+
+    Fix maximum and minimum ranges of TYPE_(U)INT64 properties
+
+    In corner case where properties use values 2 ** 62 < ±x < 2 ** 63 for
+    TYPE_INT64 and 2 ** 63 < x < 2 ** 64 for TYPE_UINT64 they will raise
+    warnings even tough values are valid.
+
+    https://bugzilla.gnome.org/show_bug.cgi?id=688949
+
+ gi/_gobject/propertyhelper.py |  6 +++---
+ tests/test_properties.py      | 11 ++++-------
+ 2 files changed, 7 insertions(+), 10 deletions(-)
+
+commit 93e9e309d8ba54884881cfca203e8bc355c2727e
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Wed Nov 21 12:58:07 2012 +0100
+
+    Test virtual methods with in and out arguments
+
+    ... and both caller and callee out argument allocation.
+
+    This came up in https://bugzilla.gnome.org/show_bug.cgi?id=688783
+
+ tests/test_gi.py | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+commit 25a9cfb043448efbab9168ef66f852cc34b9909b
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Tue Nov 20 07:00:44 2012 +0100
+
+    Ship pygi-convert.sh in tarballs
+
+    https://bugzilla.gnome.org/show_bug.cgi?id=688697
+
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 4a8d31e6f56a3f1360bdb880ffd9a6eb139c02d8
+Author: Martin Pitt <martinpitt@gnome.org>
+Date:   Mon Nov 19 15:25:38 2012 +0100
+
+    Post-release version bump to 3.7.3
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
 commit d0ed62afbc4cada0bf6abc4f8754e5a8d73036e4
 Author: Martin Pitt <martinpitt@gnome.org>
 Date:   Mon Nov 19 15:13:28 2012 +0100
index eccb79a190b203382ad2de0a256e9ea2a84cf68c..f317f84f5b9f480a6d18f89cd488798e9e07688a 100644 (file)
@@ -12,6 +12,7 @@ EXTRA_DIST = \
        pygobject-$(PLATFORM_VERSION).pc.in \
        PKG-INFO \
        PKG-INFO.in \
+       pygi-convert.sh \
        m4/as-ac-expand.m4 \
        m4/jhflags.m4 \
        m4/python.m4
index fc397cdd0b3a035869237d7858f67ac358390bbd..fc44c8df4dea09b5f8f086e2b14f0456771d2b59 100644 (file)
@@ -346,6 +346,7 @@ EXTRA_DIST = \
        pygobject-$(PLATFORM_VERSION).pc.in \
        PKG-INFO \
        PKG-INFO.in \
+       pygi-convert.sh \
        m4/as-ac-expand.m4 \
        m4/jhflags.m4 \
        m4/python.m4
diff --git a/NEWS b/NEWS
index af8b4e9d2f3eb58e0df2d317050f0756b83e68ad..19ad87223169ecf3abf62fcadfce93233ca169c5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,22 @@
+3.7.3   17-Dec-2012
+       - Add support for caller-allocated GArray out arguments (Martin Pitt)
+         (#690041)
+       - [API add] Re-support calling GLib.io_add_watch with an fd or Python
+         file (Martin Pitt)
+        - pygtkcompat: Work around IndexError on large flags (Martin Pitt)
+        - Fix pyg_value_from_pyobject() range check for uint (Martin Pitt)
+        - Fix tests to work with g-i 1.34.2 (Martin Pitt)
+       - Fix wrong refcount for GVariant property defaults (Martin Pitt)
+         (#689267)
+        - Fix array arguments on 32 bit architectures (Martin Pitt)
+        - Add backwards compatible API for GLib.unix_signal_add_full()
+         (Martin Pitt)
+       - Drop MININT64/MAXUINT64 workaround, current g-i gets this right now
+         (Martin Pitt)
+        - Fix maximum and minimum ranges of TYPE_(U)INT64 properties
+         (Simonas Kazlauskas) (#688949)
+        - Ship pygi-convert.sh in tarballs (Martin Pitt) (#688697)
+
 3.7.2   19-Nov-2012
        - [API change] Drop almost all static GLib bindings and replace them
          with proper introspection. This gets rid of several cases where the
index f99ebc9304024f21047cd3bfce41398c48154414..1956ce7db055fb54120d8e7cd2050687ee1689ac 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: PyGObject
-Version: 3.7.2
+Version: 3.7.3
 Summary: Python bindings for GObject
 Home-page: http://www.pygtk.org/
 Author: James Henstridge
@@ -8,7 +8,7 @@ Author-email: james@daa.com.au
 Maintainer: Johan Dahlin
 Maintainer-email: johan@gnome.org
 License: GNU LGPL
-Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.7/pygobject-3.7.2.tar.gz
+Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.7/pygobject-3.7.3.tar.gz
 Description: Python bindings for GLib and GObject
 Platform: POSIX, Windows
 Classifier: Development Status :: 5 - Production/Stable
index 9bc175c508a1bb254c64c07a3ee8af23d7ff9857..db21f5460a9cd3a09509642573f45ec42e7b47e4 100644 (file)
@@ -20,1091 +20,558 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# Configure paths for GLIB
-# Owen Taylor     1997-2001
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
-dnl gthread, or gio is specified in MODULES, pass to pkg-config
-dnl
-AC_DEFUN([AM_PATH_GLIB_2_0],
-[dnl 
-dnl Get the cflags and libraries from pkg-config
-dnl
-AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
-                   , enable_glibtest=yes)
+# serial 1
 
-  pkg_config_args=glib-2.0
-  for module in . $4
-  do
-      case "$module" in
-         gmodule) 
-             pkg_config_args="$pkg_config_args gmodule-2.0"
-         ;;
-         gmodule-no-export) 
-             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
-         ;;
-         gobject) 
-             pkg_config_args="$pkg_config_args gobject-2.0"
-         ;;
-         gthread) 
-             pkg_config_args="$pkg_config_args gthread-2.0"
-         ;;
-         gio*) 
-             pkg_config_args="$pkg_config_args $module-2.0"
-         ;;
-      esac
-  done
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.6], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
 
-  PKG_PROG_PKG_CONFIG([0.16])
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
 
-  no_glib=""
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.6])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
-  if test "x$PKG_CONFIG" = x ; then
-    no_glib=yes
-    PKG_CONFIG=no
-  fi
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-  min_glib_version=ifelse([$1], ,2.0.0,$1)
-  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-  if test x$PKG_CONFIG != xno ; then
-    ## don't try to run the test against uninstalled libtool libs
-    if $PKG_CONFIG --uninstalled $pkg_config_args; then
-         echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
-         enable_glibtest=no
-    fi
+# serial 1
 
-    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
-         :
-    else
-         no_glib=yes
-    fi
-  fi
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
 
-  if test x"$no_glib" = x ; then
-    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
-    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
-    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
-    GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
 
-    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
-    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
-    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-    if test "x$enable_glibtest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $GLIB_CFLAGS"
-      LIBS="$GLIB_LIBS $LIBS"
-dnl
-dnl Now check if the installed GLIB is sufficiently new. (Also sanity
-dnl checks the results of pkg-config to some extent)
-dnl
-      rm -f conf.glibtest
-      AC_TRY_RUN([
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
 
-int 
-main ()
-{
-  unsigned int major, minor, micro;
-  char *tmp_version;
+# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-  fclose (fopen ("conf.glibtest", "w"));
+# serial 4
 
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = g_strdup("$min_glib_version");
-  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_glib_version");
-     exit(1);
-   }
+# This was merged into AC_PROG_CC in Autoconf.
 
-  if ((glib_major_version != $glib_config_major_version) ||
-      (glib_minor_version != $glib_config_minor_version) ||
-      (glib_micro_version != $glib_config_micro_version))
-    {
-      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
-             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
-             glib_major_version, glib_minor_version, glib_micro_version);
-      printf ("*** was found! If pkg-config was correct, then it is best\n");
-      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
-      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-      printf("*** required on your system.\n");
-      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
-      printf("*** to point to the correct configuration files\n");
-    } 
-  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
-          (glib_minor_version != GLIB_MINOR_VERSION) ||
-           (glib_micro_version != GLIB_MICRO_VERSION))
-    {
-      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
-            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
-      printf("*** library (version %d.%d.%d)\n",
-            glib_major_version, glib_minor_version, glib_micro_version);
-    }
-  else
-    {
-      if ((glib_major_version > major) ||
-        ((glib_major_version == major) && (glib_minor_version > minor)) ||
-        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
-      {
-        return 0;
-       }
-     else
-      {
-        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
-               glib_major_version, glib_minor_version, glib_micro_version);
-        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
-              major, minor, micro);
-        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
-        printf("***\n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
-        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-      }
-    }
-  return 1;
-}
-],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_glib" = x ; then
-     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
-     ifelse([$2], , :, [$2])     
-  else
-     AC_MSG_RESULT(no)
-     if test "$PKG_CONFIG" = "no" ; then
-       echo "*** A new enough version of pkg-config was not found."
-       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
-     else
-       if test -f conf.glibtest ; then
-        :
-       else
-          echo "*** Could not run GLIB test program, checking why..."
-          ac_save_CFLAGS="$CFLAGS"
-          ac_save_LIBS="$LIBS"
-          CFLAGS="$CFLAGS $GLIB_CFLAGS"
-          LIBS="$LIBS $GLIB_LIBS"
-          AC_TRY_LINK([
-#include <glib.h>
-#include <stdio.h>
-],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
-          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-         echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     GLIB_CFLAGS=""
-     GLIB_LIBS=""
-     GLIB_GENMARSHAL=""
-     GOBJECT_QUERY=""
-     GLIB_MKENUMS=""
-     GLIB_COMPILE_RESOURCES=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(GLIB_CFLAGS)
-  AC_SUBST(GLIB_LIBS)
-  AC_SUBST(GLIB_GENMARSHAL)
-  AC_SUBST(GOBJECT_QUERY)
-  AC_SUBST(GLIB_MKENUMS)
-  AC_SUBST(GLIB_COMPILE_RESOURCES)
-  rm -f conf.glibtest
+AU_DEFUN([AM_PROG_CC_STDC],
+[AC_PROG_CC
+AC_DIAGNOSE([obsolete], [$0:
+       your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
+       `ac_cv_prog_cc_stdc'.  Remove this warning and the assignment when
+       you adjust the code.  You can also remove the above call to
+       AC_PROG_CC if you already called it elsewhere.])
+am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
 ])
+AU_DEFUN([fp_PROG_CC_STDC])
 
-dnl GNOME_CODE_COVERAGE
-dnl
-dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
-dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
-dnl (program or library) which should be built with code coverage support.
-dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
-dnl Makefile; and $enable_code_coverage which can be used in subsequent
-dnl configure output.
-dnl
-dnl Note that all optimisation flags in CFLAGS must be disabled when code
-dnl coverage is enabled.
-dnl
-dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
-dnl This file is licenced under GPLv3. For the full gnome-common licence
-dnl (GPLv3), see the COPYING file.
-dnl
-dnl Usage example:
-dnl configure.ac:
-dnl    GNOME_CODE_COVERAGE
-dnl
-dnl Makefile.am:
-dnl    @GNOME_CODE_COVERAGE_RULES@
-dnl    my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
-dnl    my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
-dnl
-dnl This results in a “check-code-coverage” rule being added to any Makefile.am
-dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
-dnl configured with --enable-code-coverage). Running `make check-code-coverage`
-dnl in that directory will run the module’s test suite (`make check`) and build
-dnl a code coverage report detailing the code which was touched, then print the
-dnl URI for the report.
-
-AC_DEFUN([GNOME_CODE_COVERAGE],[
-       dnl Check for --enable-code-coverage
-       AC_MSG_CHECKING([whether to build with code coverage support])
-       AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
-       AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
-       AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
-       AC_MSG_RESULT($enable_code_coverage)
-
-       AS_IF([ test "$enable_code_coverage" = "yes" ], [
-               dnl Check if gcc is being used
-               AS_IF([ test "$GCC" = "no" ], [
-                       AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
-               ])
-
-               # List of supported lcov versions.
-               lcov_version_list="1.6 1.7 1.8 1.9"
-
-               AC_CHECK_PROG([LCOV], [lcov], [lcov])
-               AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
-
-               AS_IF([ test "$LCOV" ], [
-                       AC_CACHE_CHECK([for lcov version], gnome_cv_lcov_version, [
-                               gnome_cv_lcov_version=invalid
-                               lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
-                               for lcov_check_version in $lcov_version_list; do
-                                       if test "$lcov_version" = "$lcov_check_version"; then
-                                               gnome_cv_lcov_version="$lcov_check_version (ok)"
-                                       fi
-                               done
-                       ])
-               ], [
-                       lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
-                       AC_MSG_ERROR([$lcov_msg])
-               ])
-
-               case $gnome_cv_lcov_version in
-                       ""|invalid[)]
-                               lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
-                               AC_MSG_ERROR([$lcov_msg])
-                               LCOV="exit 0;"
-                       ;;
-               esac
-
-               AS_IF([ test -z "$GENHTML" ], [
-                       AC_MSG_ERROR([Could not find genhtml from the lcov package])
-               ])
-
-               dnl Build the code coverage flags
-               CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
-               CODE_COVERAGE_LDFLAGS="-lgcov"
-
-               AC_SUBST([CODE_COVERAGE_CFLAGS])
-               AC_SUBST([CODE_COVERAGE_LDFLAGS])
-       ])
+# AM_CONDITIONAL                                            -*- Autoconf -*-
 
-GNOME_CODE_COVERAGE_RULES='
-# Code coverage
-#
-# Optional:
-#  - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
-#    (Default: $(top_builddir))
-#  - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
-#    by lcov for code coverage. (Default:
-#    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
-#  - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
-#    reports to be created. (Default:
-#    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
-#  - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
-#    (Default: empty)
-#  - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
-#    instance. (Default: empty)
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
 #
-# The generated report will be titled using the $(PACKAGE_NAME) and
-# $(PACKAGE_VERSION). In order to add the current git hash to the title,
-# use the git-version-gen script, available online.
-
-# Optional variables
-CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
-CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
-CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
-CODE_COVERAGE_LCOV_OPTIONS ?=
-CODE_COVERAGE_GENHTML_OPTIONS ?=
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-# Use recursive makes in order to ignore errors during check
-check-code-coverage:
-ifdef CODE_COVERAGE_ENABLED
-       -$(MAKE) $(AM_MAKEFLAGS) -k check
-       $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
-else
-       @echo "Need to reconfigure with --enable-code-coverage"
-endif
+# serial 9
 
-# Capture code coverage data
-code-coverage-capture: code-coverage-capture-hook
-ifdef CODE_COVERAGE_ENABLED
-       $(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
-       $(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
-       -rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
-       LANG=C $(GENHTML) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
-       @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
 else
-       @echo "Need to reconfigure with --enable-code-coverage"
-endif
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
 
-# Hook rule executed before code-coverage-capture, overridable by the user
-code-coverage-capture-hook:
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-clean: code-coverage-clean
-code-coverage-clean:
-       -$(LCOV) --directory $(top_builddir) -z
-       -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-       -find . -name "*.gcda" -o -name "*.gcov" -delete
+# serial 12
 
-GITIGNOREFILES ?=
-GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
 
-DISTCHECK_CONFIGURE_FLAGS ?=
-DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
 
-.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
-'
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
 
-       AC_SUBST([GNOME_CODE_COVERAGE_RULES])
-       m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
-])
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
 
-# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-# 
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
-m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
 
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
-       _pkg_min_version=m4_default([$1], [0.9.0])
-       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
-       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-               PKG_CONFIG=""
-       fi
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
 
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists.  Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
-    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-  m4_default([$2], [:])
-m4_ifvaln([$3], [else
-  $3])dnl
-fi])
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$$1"; then
-    pkg_cv_[]$1="$$1"
- elif test -n "$PKG_CONFIG"; then
-    PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
-                     test "x$?" != "x0" && pkg_failed=yes ],
-                    [pkg_failed=yes])
- else
-    pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
 
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
+  cd ..
+  rm -rf conftest.dir
 else
-        _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
 
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
 
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
 
-if test $pkg_failed = yes; then
-       AC_MSG_RESULT([no])
-        _PKG_SHORT_ERRORS_SUPPORTED
-        if test $_pkg_short_errors_supported = yes; then
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
-        else 
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
-        fi
-       # Put the nasty error message in config.log where it belongs
-       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-       m4_default([$4], [AC_MSG_ERROR(
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT])[]dnl
-        ])
-elif test $pkg_failed = untried; then
-       AC_MSG_RESULT([no])
-       m4_default([$4], [AC_MSG_FAILURE(
-[The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
-        ])
-else
-       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
-       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
-        AC_MSG_RESULT([yes])
-       $3
-fi[]dnl
-])# PKG_CHECK_MODULES
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.6], [],
-      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too.  Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
-  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+#serial 5
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
-# serial 1
 
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
 
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
-
-# This was merged into AC_PROG_CC in Autoconf.
-
-AU_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-AC_DIAGNOSE([obsolete], [$0:
-       your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
-       `ac_cv_prog_cc_stdc'.  Remove this warning and the assignment when
-       you adjust the code.  You can also remove the above call to
-       AC_PROG_CC if you already called it elsewhere.])
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-])
-AU_DEFUN([fp_PROG_CC_STDC])
-
-# AM_CONDITIONAL                                            -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# serial 8
 
-# serial 9
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
+# Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+# serial 16
 
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
 
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
 
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
   fi
-  am__universal=false
-  m4_case([$1], [CC],
-    [case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac],
-    [CXX],
-    [case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac])
+fi
+AC_SUBST([CYGPATH_W])
 
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_$1_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
 
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                 [_AM_DEPENDENCIES(CC)],
+                 [define([AC_PROG_CC],
+                         defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                 [_AM_DEPENDENCIES(CXX)],
+                 [define([AC_PROG_CXX],
+                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 ])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-  am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
-  # are listed without --file.  Let's play safe and only enable the eval
-  # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
-  shift
-  for mf
-  do
-    # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
-    # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
-  done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake.                             -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 16
-
-# This macro actually does too much.  Some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names.  We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-  fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
-  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-                            [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-                 [_AM_DEPENDENCIES(CC)],
-                 [define([AC_PROG_CC],
-                         defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                 [_AM_DEPENDENCIES(CXX)],
-                 [define([AC_PROG_CXX],
-                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                 [_AM_DEPENDENCIES(OBJC)],
-                 [define([AC_PROG_OBJC],
-                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
-  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
 
 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
 # loop where config.status creates the headers, so we can generate
@@ -1851,6 +1318,539 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+dnl GNOME_CODE_COVERAGE
+dnl
+dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
+dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
+dnl (program or library) which should be built with code coverage support.
+dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
+dnl Makefile; and $enable_code_coverage which can be used in subsequent
+dnl configure output.
+dnl
+dnl Note that all optimisation flags in CFLAGS must be disabled when code
+dnl coverage is enabled.
+dnl
+dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
+dnl This file is licenced under GPLv3. For the full gnome-common licence
+dnl (GPLv3), see the COPYING file.
+dnl
+dnl Usage example:
+dnl configure.ac:
+dnl    GNOME_CODE_COVERAGE
+dnl
+dnl Makefile.am:
+dnl    @GNOME_CODE_COVERAGE_RULES@
+dnl    my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
+dnl    my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
+dnl
+dnl This results in a “check-code-coverage” rule being added to any Makefile.am
+dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
+dnl configured with --enable-code-coverage). Running `make check-code-coverage`
+dnl in that directory will run the module’s test suite (`make check`) and build
+dnl a code coverage report detailing the code which was touched, then print the
+dnl URI for the report.
+
+AC_DEFUN([GNOME_CODE_COVERAGE],[
+       dnl Check for --enable-code-coverage
+       AC_MSG_CHECKING([whether to build with code coverage support])
+       AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
+       AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
+       AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
+       AC_MSG_RESULT($enable_code_coverage)
+
+       AS_IF([ test "$enable_code_coverage" = "yes" ], [
+               dnl Check if gcc is being used
+               AS_IF([ test "$GCC" = "no" ], [
+                       AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
+               ])
+
+               # List of supported lcov versions.
+               lcov_version_list="1.6 1.7 1.8 1.9"
+
+               AC_CHECK_PROG([LCOV], [lcov], [lcov])
+               AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
+
+               AS_IF([ test "$LCOV" ], [
+                       AC_CACHE_CHECK([for lcov version], gnome_cv_lcov_version, [
+                               gnome_cv_lcov_version=invalid
+                               lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
+                               for lcov_check_version in $lcov_version_list; do
+                                       if test "$lcov_version" = "$lcov_check_version"; then
+                                               gnome_cv_lcov_version="$lcov_check_version (ok)"
+                                       fi
+                               done
+                       ])
+               ], [
+                       lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
+                       AC_MSG_ERROR([$lcov_msg])
+               ])
+
+               case $gnome_cv_lcov_version in
+                       ""|invalid[)]
+                               lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
+                               AC_MSG_ERROR([$lcov_msg])
+                               LCOV="exit 0;"
+                       ;;
+               esac
+
+               AS_IF([ test -z "$GENHTML" ], [
+                       AC_MSG_ERROR([Could not find genhtml from the lcov package])
+               ])
+
+               dnl Build the code coverage flags
+               CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+               CODE_COVERAGE_LDFLAGS="-lgcov"
+
+               AC_SUBST([CODE_COVERAGE_CFLAGS])
+               AC_SUBST([CODE_COVERAGE_LDFLAGS])
+       ])
+
+GNOME_CODE_COVERAGE_RULES='
+# Code coverage
+#
+# Optional:
+#  - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
+#    (Default: $(top_builddir))
+#  - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
+#    by lcov for code coverage. (Default:
+#    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
+#  - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
+#    reports to be created. (Default:
+#    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
+#  - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
+#    (Default: empty)
+#  - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
+#    instance. (Default: empty)
+#
+# The generated report will be titled using the $(PACKAGE_NAME) and
+# $(PACKAGE_VERSION). In order to add the current git hash to the title,
+# use the git-version-gen script, available online.
+
+# Optional variables
+CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
+CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
+CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
+CODE_COVERAGE_LCOV_OPTIONS ?=
+CODE_COVERAGE_GENHTML_OPTIONS ?=
+
+# Use recursive makes in order to ignore errors during check
+check-code-coverage:
+ifdef CODE_COVERAGE_ENABLED
+       -$(MAKE) $(AM_MAKEFLAGS) -k check
+       $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
+else
+       @echo "Need to reconfigure with --enable-code-coverage"
+endif
+
+# Capture code coverage data
+code-coverage-capture: code-coverage-capture-hook
+ifdef CODE_COVERAGE_ENABLED
+       $(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
+       $(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
+       -rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
+       LANG=C $(GENHTML) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
+       @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
+else
+       @echo "Need to reconfigure with --enable-code-coverage"
+endif
+
+# Hook rule executed before code-coverage-capture, overridable by the user
+code-coverage-capture-hook:
+
+clean: code-coverage-clean
+code-coverage-clean:
+       -$(LCOV) --directory $(top_builddir) -z
+       -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+       -find . -name "*.gcda" -o -name "*.gcov" -delete
+
+GITIGNOREFILES ?=
+GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
+
+DISTCHECK_CONFIGURE_FLAGS ?=
+DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
+
+.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
+'
+
+       AC_SUBST([GNOME_CODE_COVERAGE_RULES])
+       m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
+])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+       AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Configure paths for GLIB
+# Owen Taylor     1997-2001
+
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
+dnl gthread, or gio is specified in MODULES, pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GLIB_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
+                   , enable_glibtest=yes)
+
+  pkg_config_args=glib-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export) 
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject) 
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+         gio*) 
+             pkg_config_args="$pkg_config_args $module-2.0"
+         ;;
+      esac
+  done
+
+  PKG_PROG_PKG_CONFIG([0.16])
+
+  no_glib=""
+
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
+  fi
+
+  min_glib_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+         echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+         enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+         :
+    else
+         no_glib=yes
+    fi
+  fi
+
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+    GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  unsigned int major, minor, micro;
+  char *tmp_version;
+
+  fclose (fopen ("conf.glibtest", "w"));
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+          (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+            glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
+              major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     GLIB_COMPILE_RESOURCES=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  AC_SUBST(GLIB_GENMARSHAL)
+  AC_SUBST(GOBJECT_QUERY)
+  AC_SUBST(GLIB_MKENUMS)
+  AC_SUBST(GLIB_COMPILE_RESOURCES)
+  rm -f conf.glibtest
+])
+
 m4_include([m4/as-ac-expand.m4])
 m4_include([m4/jhflags.m4])
 m4_include([m4/libtool.m4])
index 52e1300e273734e9bb4e7b429b1b9680096e9f78..5e1cc4607f1a74f07c782a16607207141a615b6e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pygobject 3.7.2.
+# Generated by GNU Autoconf 2.69 for pygobject 3.7.3.
 #
 # Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>.
 #
@@ -591,8 +591,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='pygobject'
 PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='3.7.2'
-PACKAGE_STRING='pygobject 3.7.2'
+PACKAGE_VERSION='3.7.3'
+PACKAGE_STRING='pygobject 3.7.3'
 PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
 PACKAGE_URL='https://live.gnome.org/PyGObject/'
 
@@ -1391,7 +1391,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures pygobject 3.7.2 to adapt to many kinds of systems.
+\`configure' configures pygobject 3.7.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1461,7 +1461,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of pygobject 3.7.2:";;
+     short | recursive ) echo "Configuration of pygobject 3.7.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1593,7 +1593,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-pygobject configure 3.7.2
+pygobject configure 3.7.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1871,7 +1871,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by pygobject $as_me 3.7.2, which was
+It was created by pygobject $as_me 3.7.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2235,9 +2235,9 @@ $as_echo "#define PYGOBJECT_MINOR_VERSION 7" >>confdefs.h
 PYGOBJECT_MINOR_VERSION=7
 
 
-$as_echo "#define PYGOBJECT_MICRO_VERSION 2" >>confdefs.h
+$as_echo "#define PYGOBJECT_MICRO_VERSION 3" >>confdefs.h
 
-PYGOBJECT_MICRO_VERSION=2
+PYGOBJECT_MICRO_VERSION=3
 
 
 ac_config_headers="$ac_config_headers config.h"
@@ -2748,7 +2748,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='pygobject'
- VERSION='3.7.2'
+ VERSION='3.7.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4699,7 +4699,8 @@ else
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -6230,7 +6231,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
            LD="${LD-ld} -m elf_i386_fbsd"
            ;;
          x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
            ;;
          ppc64-*linux*|powerpc64-*linux*)
            LD="${LD-ld} -m elf32ppclinux"
@@ -15957,7 +15965,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by pygobject $as_me 3.7.2, which was
+This file was extended by pygobject $as_me 3.7.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16024,7 +16032,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-pygobject config.status 3.7.2
+pygobject config.status 3.7.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index a87998e2ae54db14da0edaf5d553c76d99021de3..dd5e078095f71ab49b5e53d5308a8f75d9ebcdeb 100644 (file)
@@ -18,7 +18,7 @@ m4_define(python3_min_ver, 3.1)
 dnl the pygobject version number
 m4_define(pygobject_major_version, 3)
 m4_define(pygobject_minor_version, 7)
-m4_define(pygobject_micro_version, 2)
+m4_define(pygobject_micro_version, 3)
 m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
 
 dnl versions of packages we require ...
index 479eb9316c8e4fd728ba07898e428eb9aad52f40..304a041ad0deaa3a2b2d9895f3b19f8e73cb8883 100644 (file)
@@ -648,7 +648,6 @@ create_property (const gchar  *prop_name,
                return NULL;
             if (pydefault != Py_None)
                 default_value = pyg_boxed_get (pydefault, GVariant);
-            Py_DECREF(pydefault);
            pspec = g_param_spec_variant (prop_name, nick, blurb, G_VARIANT_TYPE_ANY, default_value, flags);
        }
        break;
index a951ff352cf55c1d70ece43f31e75103ab684646..a038f1b9e5a0734c90e124f5ef5fcdcddc370395 100644 (file)
@@ -93,14 +93,14 @@ class Property(object):
         TYPE_DOUBLE: -G_MAXDOUBLE,
         TYPE_INT: G_MININT,
         TYPE_LONG: G_MINLONG,
-        TYPE_INT64: -2 ** 62 - 1,
+        TYPE_INT64: -2 ** 63,
     }
 
     _max_value_lookup = {
         TYPE_UINT: G_MAXUINT,
         TYPE_ULONG: G_MAXULONG,
-        TYPE_INT64: 2 ** 62 - 1,
-        TYPE_UINT64: 2 ** 63 - 1,
+        TYPE_INT64: 2 ** 63 - 1,
+        TYPE_UINT64: 2 ** 64 - 1,
         TYPE_FLOAT: G_MAXFLOAT,
         TYPE_DOUBLE: G_MAXDOUBLE,
         TYPE_INT: G_MAXINT,
index adc8c126e4332e35735f3e58c7f05c0106aa1f20..79c838735ddc7e8ed4dd2a5d80b5083253f40b73 100644 (file)
@@ -811,11 +811,15 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj)
     case G_TYPE_UINT:
        {
            if (PYGLIB_PyLong_Check(obj)) {
-               glong val;
+               guint val;
 
-               val = PYGLIB_PyLong_AsLong(obj);
-               if (val >= 0 && val <= G_MAXUINT)
-                   g_value_set_uint(value, (guint)val);
+                /* check that number is not negative */
+                if (PyLong_AsLongLong(obj) < 0)
+                    return -1;
+
+               val = PyLong_AsUnsignedLong(obj);
+               if (val <= G_MAXUINT)
+                   g_value_set_uint(value, val);
                else
                    return -1;
            } else {
index ed63679cf5d148786923f958a77c40c923699f1a..6ae5dba488e170c493d8f203487f23c28f934550 100644 (file)
@@ -490,8 +490,12 @@ class MainLoop(GLib.MainLoop):
             loop.quit()
             loop._quit_by_sigint = True
 
-        self._signal_source = GLib.unix_signal_add_full(
-            GLib.PRIORITY_DEFAULT, signal.SIGINT, _handler, self)
+        # compatibility shim, keep around until we depend on glib 2.36
+        if hasattr(GLib, 'unix_signal_add'):
+            fn = GLib.unix_signal_add
+        else:
+            fn = GLib.unix_signal_add_full
+        self._signal_source = fn(GLib.PRIORITY_DEFAULT, signal.SIGINT, _handler, self)
 
     def __del__(self):
         GLib.source_remove(self._signal_source)
@@ -639,9 +643,10 @@ __all__.append('timeout_add_seconds')
 
 
 # The real GLib API is io_add_watch(IOChannel, priority, condition, callback,
-# user_data). This needs to take into account several deprecated APIs:
+# user_data). This needs to take into account several historical APIs:
 # - calling with an fd as first argument
-# - calling with a Python file object as first argument
+# - calling with a Python file object as first argument (we keep this one as
+#   it's really convenient and does not change the number of arguments)
 # - calling without a priority as second argument
 # and the usual "call without or multiple user_data", in which case the
 # callback gets the same user data arguments.
@@ -673,14 +678,10 @@ def io_add_watch(channel, priority_, condition, *cb_and_user_data, **kwargs):
 
     # backwards compatibility: Allow calling with fd
     if isinstance(channel, int):
-        warnings.warn('Calling io_add_watch with a file descriptor is deprecated; call it with a GLib.IOChannel object',
-                      PyGIDeprecationWarning)
         func_fdtransform = lambda _, cond, data: func(channel, cond, data)
         real_channel = GLib.IOChannel.unix_new(channel)
     elif hasattr(channel, 'fileno'):
         # backwards compatibility: Allow calling with Python file
-        warnings.warn('Calling io_add_watch with a file object is deprecated; call it with a GLib.IOChannel object',
-                      PyGIDeprecationWarning)
         func_fdtransform = lambda _, cond, data: func(channel, cond, data)
         real_channel = GLib.IOChannel.unix_new(channel.fileno())
     else:
@@ -837,15 +838,18 @@ def filename_from_utf8(utf8string, len=-1):
 __all__.append('filename_from_utf8')
 
 
+# backwards compatible API for renamed function
+if not hasattr(GLib, 'unix_signal_add_full'):
+    def add_full_compat(*args):
+        warnings.warn('GLib.unix_signal_add_full() was renamed to GLib.unix_signal_add()',
+                      PyGIDeprecationWarning)
+        return GLib.unix_signal_add(*args)
+
+    GLib.unix_signal_add_full = add_full_compat
+
+
 # obsolete constants for backwards compatibility
 glib_version = (GLib.MAJOR_VERSION, GLib.MINOR_VERSION, GLib.MICRO_VERSION)
 __all__.append('glib_version')
 pyglib_version = version_info
 __all__.append('pyglib_version')
-
-# work around wrong constants in GLib GIR, see
-# https://bugzilla.gnome.org/show_bug.cgi?id=685022
-MININT64 = -9223372036854775808
-MAXUINT64 = 18446744073709551615
-__all__.append('MININT64')
-__all__.append('MAXUINT64')
index 61453e0833cac403df165aa1c2ecea8f62f34acc..4e3c464411c4d432551cbd19a77497d941063a97 100644 (file)
@@ -1146,7 +1146,11 @@ _pygi_argument_from_object (PyObject   *object,
             is_zero_terminated = g_type_info_is_zero_terminated (type_info);
             item_type_info = g_type_info_get_param_type (type_info, 0);
 
-            item_size = _pygi_g_type_info_size (item_type_info);
+            /* we handle arrays that are really strings specially, see below */
+            if (g_type_info_get_tag (item_type_info) == GI_TYPE_TAG_UINT8)
+               item_size = 1;
+            else
+               item_size = sizeof (GIArgument);
 
             array = g_array_sized_new (is_zero_terminated, FALSE, item_size, length);
             if (array == NULL) {
index 21dd58faad9e1d08f9086ed3cb3596197cc0d990..2a44c02f2be4e03dfe7190d731bbd9d659278fc6 100644 (file)
@@ -1370,7 +1370,7 @@ _args_cache_generate (GICallableInfo *callable_info,
         type_info = g_arg_info_get_type (arg_info);
         type_tag = g_type_info_get_tag (type_info);
 
-        if (type_tag == GI_TYPE_TAG_INTERFACE)
+        if (type_tag == GI_TYPE_TAG_INTERFACE || type_tag == GI_TYPE_TAG_ARRAY)
             is_caller_allocates = g_arg_info_is_caller_allocates (arg_info);
 
         /* must be an child arg filled in by its owner
index c0f7179cda1c656baf135054bf0a8fa6a9b8fe65..195a8303f8b4e590a1b82419ed5e4753921580f8 100644 (file)
@@ -361,33 +361,38 @@ static gboolean _caller_alloc (PyGIInvokeState *state,
                                gssize arg_count,
                                gssize out_count)
 {
-    PyGIInterfaceCache *iface_cache;
-
-    g_assert (arg_cache->type_tag == GI_TYPE_TAG_INTERFACE);
-
-    iface_cache = (PyGIInterfaceCache *)arg_cache;
-
-    state->out_args[out_count].v_pointer = NULL;
-    state->args[arg_count] = &state->out_args[out_count];
-    if (iface_cache->g_type == G_TYPE_BOXED) {
-        state->args[arg_count]->v_pointer =
-            _pygi_boxed_alloc (iface_cache->interface_info, NULL);
-    } else if (iface_cache->g_type == G_TYPE_VALUE) {
-        state->args[arg_count]->v_pointer = g_slice_new0 (GValue);
-    } else if (iface_cache->is_foreign) {
-        PyObject *foreign_struct =
-            pygi_struct_foreign_convert_from_g_argument (
-                iface_cache->interface_info,
-                NULL);
-
-            pygi_struct_foreign_convert_to_g_argument (foreign_struct,
-                                                       iface_cache->interface_info,
-                                                       GI_TRANSFER_EVERYTHING,
-                                                       state->args[arg_count]);
+    if (arg_cache->type_tag == GI_TYPE_TAG_INTERFACE) {
+        PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache;
+
+        state->out_args[out_count].v_pointer = NULL;
+        state->args[arg_count] = &state->out_args[out_count];
+        if (iface_cache->g_type == G_TYPE_BOXED) {
+            state->args[arg_count]->v_pointer =
+                _pygi_boxed_alloc (iface_cache->interface_info, NULL);
+        } else if (iface_cache->g_type == G_TYPE_VALUE) {
+            state->args[arg_count]->v_pointer = g_slice_new0 (GValue);
+        } else if (iface_cache->is_foreign) {
+            PyObject *foreign_struct =
+                pygi_struct_foreign_convert_from_g_argument (
+                    iface_cache->interface_info,
+                    NULL);
+
+                pygi_struct_foreign_convert_to_g_argument (foreign_struct,
+                                                           iface_cache->interface_info,
+                                                           GI_TRANSFER_EVERYTHING,
+                                                           state->args[arg_count]);
+        } else {
+                gssize size = g_struct_info_get_size(
+                    (GIStructInfo *)iface_cache->interface_info);
+                state->args[arg_count]->v_pointer = g_malloc0 (size);
+        }
+    } else if (arg_cache->type_tag == GI_TYPE_TAG_ARRAY) {
+        PyGISequenceCache *seq_cache = (PyGISequenceCache *)arg_cache;
+
+        state->out_args[out_count].v_pointer = g_array_new (TRUE, TRUE, seq_cache->item_size);
+        state->args[arg_count] = &state->out_args[out_count];
     } else {
-            gssize size = g_struct_info_get_size(
-                (GIStructInfo *)iface_cache->interface_info);
-            state->args[arg_count]->v_pointer = g_malloc0 (size);
+        return FALSE;
     }
 
     if (state->args[arg_count]->v_pointer == NULL)
index 69a4518bb3a778e40c297825659771fbc6889ed3..b9205eeb4f8876a2a765b18f825a34ff2a7edc08 100644 (file)
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
 #         compiler:            $LTCC
 #         compiler flags:              $LTCFLAGS
 #         linker:              $LD (gnu? $with_gnu_ld)
-#         $progname:   (GNU libtool) 2.4.2 Debian-2.4.2-1.1ubuntu1
+#         $progname:   (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1
 #         automake:    $automake_version
 #         autoconf:    $autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.1ubuntu1"
+VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1"
 TIMESTAMP=""
 package_revision=1.3337
 
index 534d1ccd4194da9fb10c68334042b3cb23afcdb7..02b4bbec520c94a9535cdb7701d4f9201a0709a9 100644 (file)
@@ -1324,7 +1324,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
            LD="${LD-ld} -m elf_i386_fbsd"
            ;;
          x86_64-*linux*)
-           LD="${LD-ld} -m elf_i386"
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
            ;;
          ppc64-*linux*|powerpc64-*linux*)
            LD="${LD-ld} -m elf32ppclinux"
@@ -1688,7 +1695,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
diff --git a/pygi-convert.sh b/pygi-convert.sh
new file mode 100755 (executable)
index 0000000..c5887f8
--- /dev/null
@@ -0,0 +1,350 @@
+#!/bin/sh
+
+if [ -n "$1" ]; then
+    FILES_TO_CONVERT="$@"
+else
+    FILES_TO_CONVERT="$(find . -name '*.py')"
+fi
+
+for f in $FILES_TO_CONVERT; do
+    perl -i -0 \
+    -pe "s/import gconf\n/from gi.repository import GConf\n/g;" \
+    -pe "s/gconf\./GConf\./g;" \
+    -pe "s/GConf\.client_get_default/GConf.Client.get_default/g;" \
+    -pe "s/GConf\.CLIENT_/GConf.ClientPreloadType./g;" \
+    -pe "s/GConf\.VALUE_/GConf.ValueType./g;" \
+    -pe "s/gconf_client.notify_add\('\/desktop\/sugar\/collaboration\/publish_gadget',/return;gconf_client.notify_add\('\/desktop\/sugar\/collaboration\/publish_gadget',/g;" \
+\
+    -pe "s/import pygtk/import gi/g;" \
+    -pe "s/pygtk.require\('2.0'\)/gi.require_version\('Gtk', '3.0'\)/g;" \
+    -pe "s/import gtk\n/from gi.repository import Gtk\n/g;" \
+    -pe "s/(?<!\.)gtk\./Gtk\./g;" \
+    -pe "s/Gtk.ACCEL_/Gtk.AccelFlags./g;" \
+    -pe "s/Gtk.ARROW_/Gtk.ArrowType./g;" \
+    -pe "s/Gtk.ASSISTANT_PAGE_/Gtk.AssistantPageType./g;" \
+    -pe "s/Gtk.BUTTONBOX_/Gtk.ButtonBoxStyle./g;" \
+    -pe "s/Gtk.BUTTONS_/Gtk.ButtonsType./g;" \
+    -pe "s/Gtk.CELL_RENDERER_MODE_/Gtk.CellRendererMode./g;" \
+    -pe "s/Gtk.CELL_RENDERER_FOCUSED/Gtk.CellRendererState.FOCUSED/g;" \
+    -pe "s/Gtk.CELL_RENDERER_INSENSITIVE/Gtk.CellRendererState.INSENSITIVE/g;" \
+    -pe "s/Gtk.CELL_RENDERER_PRELIT/Gtk.CellRendererState.PRELIT/g;" \
+    -pe "s/Gtk.CELL_RENDERER_SORTED/Gtk.CellRendererState.SORTED/g;" \
+    -pe "s/Gtk.CELL_RENDERER_SELECTED/Gtk.CellRendererState.SELECTED/g;" \
+    -pe "s/Gtk.CORNER_/Gtk.CornerType./g;" \
+    -pe "s/Gtk.DIALOG_/Gtk.DialogFlags./g;" \
+    -pe "s/Gtk.ENTRY_ICON_/Gtk.EntryIconPosition./g;" \
+    -pe "s/Gtk.EXPAND/Gtk.AttachOptions.EXPAND/g;" \
+    -pe "s/Gtk.FALSE/False/g;" \
+    -pe "s/Gtk.FILE_CHOOSER_ACTION_/Gtk.FileChooserAction./g;" \
+    -pe "s/Gtk.FILL/Gtk.AttachOptions.FILL/g;" \
+    -pe "s/Gtk.ICON_LOOKUP_/Gtk.IconLookupFlags./g;" \
+    -pe "s/Gtk.ICON_SIZE_/Gtk.IconSize./g;" \
+    -pe "s/Gtk.IMAGE_/Gtk.ImageType./g;" \
+    -pe "s/Gtk.JUSTIFY_/Gtk.Justification./g;" \
+    -pe "s/Gtk.MESSAGE_/Gtk.MessageType./g;" \
+    -pe "s/Gtk.MOVEMENT_/Gtk.MovementStep./g;" \
+    -pe "s/Gtk.ORIENTATION_/Gtk.Orientation./g;" \
+    -pe "s/Gtk.POLICY_/Gtk.PolicyType./g;" \
+    -pe "s/Gtk.POS_/Gtk.PositionType./g;" \
+    -pe "s/Gtk.RELIEF_/Gtk.ReliefStyle./g;" \
+    -pe "s/Gtk.RESPONSE_/Gtk.ResponseType./g;" \
+    -pe "s/Gtk.SELECTION_/Gtk.SelectionMode./g;" \
+    -pe "s/Gtk.SHADOW_/Gtk.ShadowType./g;" \
+    -pe "s/Gtk.SHADOW_NONE/Gtk.ShadowType.NONE/g;" \
+    -pe "s/Gtk.SHRINK/Gtk.AttachOptions.SHRINK/g;" \
+    -pe "s/Gtk.SIZE_GROUP_/Gtk.SizeGroupMode./g;" \
+    -pe "s/Gtk.SORT_/Gtk.SortType./g;" \
+    -pe "s/Gtk.STATE_/Gtk.StateType./g;" \
+    -pe "s/Gtk.TARGET_/Gtk.TargetFlags./g;" \
+    -pe "s/Gtk.TEXT_DIR_/Gtk.TextDirection./g;" \
+    -pe "s/Gtk.TEXT_SEARCH_/Gtk.TextSearchFlags./g;" \
+    -pe "s/Gtk.TEXT_WINDOW_/Gtk.TextWindowType./g;" \
+    -pe "s/Gtk.TREE_VIEW_COLUMN_/Gtk.TreeViewColumnSizing./g;" \
+    -pe "s/Gtk.TREE_VIEW_DROP_/Gtk.TreeViewDropPosition./g;" \
+    -pe "s/Gtk.TRUE/True/g;" \
+    -pe "s/Gtk.WINDOW_/Gtk.WindowType./g;" \
+    -pe "s/Gtk.DEST_DEFAULT_/Gtk.DestDefaults./g;" \
+    -pe "s/Gtk.WIN_POS_/Gtk.WindowPosition./g;" \
+    -pe "s/Gtk.WRAP_/Gtk.WrapMode./g;" \
+    -pe "s/Gtk.UI_MANAGER_/Gtk.UIManagerItemType./g;" \
+    -pe "s/Gtk.accel_map_/Gtk.AccelMap./g;" \
+    -pe "s/Gtk.settings_get_/Gtk.Settings.get_/g;" \
+    -pe "s/Gtk.icon_theme_get_default/Gtk.IconTheme.get_default/g;" \
+    -pe "s/Gtk.image_new_from_stock/Gtk.Image.new_from_stock/g;" \
+    -pe "s/Gtk.image_new_from_icon_name/Gtk.Image.new_from_icon_name/g;" \
+    -pe "s/Gtk.window_set_default_icon_name/Gtk.Window.set_default_icon_name/g; " \
+    -pe "s/Gtk.combo_box_new_text/Gtk.ComboBoxText/g;" \
+    -pe "s/Gtk.keysyms./Gdk.KEY_/g;" \
+    -pe "s/set_flags\(Gtk.CAN_DEFAULT\)/set_can_default\(True\)/g;" \
+    -pe "s/.flags\(\) & Gtk.MAPPED/.get_mapped\(\)/g;" \
+    -pe "s/.flags\(\) & Gtk.REALIZED/.get_realized\(\)/g;" \
+    -pe "s/\.window\.set_type_hint/.set_type_hint/g;" \
+    -pe "s/\.window\.set_skip_taskbar_hint/.set_skip_taskbar_hint/g;" \
+    -pe "s/\.window\.set_transient_for/.set_transient_for/g;" \
+    -pe "s/Gtk.Alignment\(/Gtk.Alignment.new\(/g;" \
+    -pe "#s/Gtk.Window.__init__\(self\)/Gtk.Window.__init__\(Gtk.WindowType.TOPLEVEL\)/g;" \
+    -pe "s/\.child([^_A-Za-z])/.get_child\(\)\1/g;" \
+\
+    -pe "s/column.pack_start\(([^,\)]*)\)/column.pack_start\(\1, True\)/g;" \
+    -pe "s/pack_start\(([^,\)]*)\)/pack_start\(\1, True, True, 0\)/g;" \
+    -pe "s/pack_start\(([^,]*), fill=([^,\)]*)\)/pack_start\(\1, True, \2, 0\)/g;" \
+    -pe "s/pack_start\(([^,]*), expand=([^,\)]*)\)/pack_start\(\1, \2, True, 0\)/g;" \
+    -pe "s/pack_start\(([^,]*),(\s*)padding=([A-Za-z0-9._]*)\)/pack_start\(\1,\2True, True,\2\3\)/g;" \
+    -pe "s/column.pack_end\(([^,\)]*)\)/column.pack_end\(\1, True\)/g;" \
+    -pe "s/pack_end\(([^,\)]*)\)/pack_end\(\1, True, True, 0\)/g;" \
+    -pe "s/pack_end\(([^,]*), fill=([^,\)]*)\)/pack_end\(\1, True, \2, 0\)/g;" \
+    -pe "s/pack_end\(([^,]*), expand=([^,\)]*)\)/pack_end\(\1, \2, True, 0\)/g;" \
+    -pe "s/pack_end\(([^,]*),(\s*)padding=([A-Za-z0-9._]*)\)/pack_end\(\1,\2True, True,\2\3\)/g;" \
+    -pe "#s/Gtk.HBox\(\)/Gtk.HBox\(False, 0\)/g;" \
+    -pe "#s/Gtk.VBox\(\)/Gtk.VBox\(False, 0\)/g;" \
+    -pe "s/Gtk.Label\s*\(([^,\)]+)\)/Gtk.Label\(label=\1\)/g;" \
+    -pe "s/Gtk.AccelLabel\s*\(([^,\)]+)\)/Gtk.AccelLabel\(label=\1\)/g;" \
+    -pe "s/Gtk.((?:Accel)?Label)\(label=label=/Gtk.\1\(label=/g;" \
+    -pe "s/len\(self._content.get_children\(\)\) > 0/self._content.get_children\(\)/g;" \
+    -pe "s/len\(self.menu.get_children\(\)\) > 0/self.menu.get_children\(\)/g;" \
+    -pe "s/import gobject\n/from gi.repository import GObject\n/g;" \
+    -pe "s/Gtk\..*\.__init__/gobject.GObject.__init__/g;" \
+\
+    -pe "s/rsvg.Handle\s*\(data=([^,\)]+)\)/Rsvg.Handle.new_from_data(\1)/g;" \
+\
+    -pe "s/from gtk import gdk\n/from gi.repository import Gdk\n/g;" \
+    -pe "s/import gtk.gdk as gdk\n/from gi.repository import Gdk\n/g;" \
+    -pe "s/Gtk.gdk.x11_/GdkX11.x11_/g;" \
+    -pe "s/Gtk.gdk\./Gdk\./g;" \
+    -pe "s/(?<!\.)gdk\./Gdk\./g;" \
+    -pe "s/Gdk.screen_width/Gdk.Screen.width/g;" \
+    -pe "s/Gdk.screen_height/Gdk.Screen.height/g;" \
+    -pe "s/Gdk.screen_get_default/Gdk.Screen.get_default/g;" \
+    -pe "s/Gdk.display_get_default/Gdk.Display.get_default/g;" \
+    -pe "s/screen_, x_, y_, modmask = display.get_pointer\(\)/x_, y_, modmask = display.get_pointer\(None\)/g;" \
+    -pe "s/Gdk.WINDOW_TYPE_HINT_/Gdk.WindowTypeHint./g;" \
+    -pe "s/Gdk.SHIFT_MASK/Gdk.ModifierType.SHIFT_MASK/g;" \
+    -pe "s/Gdk.LOCK_MASK/Gdk.ModifierType.LOCK_MASK/g;" \
+    -pe "s/Gdk.CONTROL_MASK/Gdk.ModifierType.CONTROL_MASK/g;" \
+    -pe "s/Gdk.MOD1_MASK/Gdk.ModifierType.MOD1_MASK/g;" \
+    -pe "s/Gdk.MOD2_MASK/Gdk.ModifierType.MOD2_MASK/g;" \
+    -pe "s/Gdk.MOD3_MASK/Gdk.ModifierType.MOD3_MASK/g;" \
+    -pe "s/Gdk.MOD4_MASK/Gdk.ModifierType.MOD4_MASK/g;" \
+    -pe "s/Gdk.MOD5_MASK/Gdk.ModifierType.MOD5_MASK/g;" \
+    -pe "s/Gdk.BUTTON1_MASK/Gdk.ModifierType.BUTTON1_MASK/g;" \
+    -pe "s/Gdk.BUTTON2_MASK/Gdk.ModifierType.BUTTON2_MASK/g;" \
+    -pe "s/Gdk.BUTTON3_MASK/Gdk.ModifierType.BUTTON3_MASK/g;" \
+    -pe "s/Gdk.BUTTON4_MASK/Gdk.ModifierType.BUTTON4_MASK/g;" \
+    -pe "s/Gdk.BUTTON5_MASK/Gdk.ModifierType.BUTTON5_MASK/g;" \
+    -pe "s/Gdk.RELEASE_MASK/Gdk.ModifierType.RELEASE_MASK/g;" \
+    -pe "s/Gdk.MODIFIER_MASK/Gdk.ModifierType.MODIFIER_MASK/g;" \
+    -pe "s/Gdk.([A-Z_0-9]*)_MASK/Gdk.EventMask.\1_MASK/g;" \
+    -pe "s/Gdk.VISIBILITY_FULLY_OBSCURED/Gdk.VisibilityState.FULLY_OBSCURED/g;" \
+    -pe "s/Gdk.NOTIFY_ANCESTOR/Gdk.NotifyType.ANCESTOR/g;" \
+    -pe "s/Gdk.NOTIFY_INFERIOR/Gdk.NotifyType.INFERIOR/g;" \
+    -pe "s/Gdk.NOTIFY_NONLINEAR_VIRTUAL/Gdk.NotifyType.NONLINEAR_VIRTUAL/g;" \
+    -pe "s/Gdk.NOTIFY_NONLINEAR/Gdk.NotifyType.NONLINEAR/g;" \
+    -pe "s/Gdk.NOTIFY_UNKNOWN/Gdk.NotifyType.UNKNOWN/g;" \
+    -pe "s/Gdk.NOTIFY_VIRTUAL/Gdk.NotifyType.VIRTUAL/g;" \
+    -pe "s/Gdk.PROP_MODE_APPEND/Gdk.PropMode.APPEND/g;" \
+    -pe "s/Gdk.PROP_MODE_PREPEND/Gdk.PropMode.PREPEND/g;" \
+    -pe "s/Gdk.PROP_MODE_REPLACE/Gdk.PropMode.REPLACE/g;" \
+    -pe "s/Gdk.BUTTON_PRESS/Gdk.EventType.BUTTON_PRESS/g;" \
+    -pe "s/Gdk.ACTION_/Gdk.DragAction./g;" \
+    -pe "s/Gdk.GRAB_/Gdk.GrabStatus./g;" \
+    -pe "s/Gdk.SCROLL_(DOWN|LEFT|RIGHT|UP)/Gdk.ScrollDirection.\1/g;" \
+    -pe "s/Gdk.([A-Z]+_(PTR|CURSOR))/Gdk.CursorType.\1/g;" \
+    -pe "s/Gdk.(CROSSHAIR)/Gdk.CursorType.\1/g;" \
+    -pe "s/Gdk.(WATCH)/Gdk.CursorType.\1/g;" \
+    -pe "s/Gdk.(ARROW)/Gdk.CursorType.\1/g;" \
+    -pe "s/Gdk.(CLOCK)/Gdk.CursorType.\1/g;" \
+    -pe "s/Gdk.WINDOW_STATE_(ABOVE|BELOW|FOCUSED|FULLSCREEN|ICONIFIED|MAXIMIZED|STICKY|WITHDRAWN)/Gdk.WindowState.\1/g;" \
+    -pe "s/Gdk.Cursor\s*\(/Gdk.Cursor.new\(/g;" \
+    -pe "s/#Gdk.Rectangle\(([^,\)]*), ([^,\)]*), ([^,\)]*), ([^,\)]*)\)/\1, \2, \3, \4/g;" \
+    -pe "s/Gdk.Rectangle//g;" \
+    -pe "s/intersection = child_rect.intersect/intersects_, intersection = child_rect.intersect/g;" \
+    -pe "s/event.state/event.get_state\(\)/g;" \
+\
+    -pe "s/Gdk.pixbuf_/GdkPixbuf.Pixbuf./g;" \
+    -pe "s/Gdk.Pixbuf/GdkPixbuf.Pixbuf/g;" \
+    -pe "s/Gdk.INTERP_/GdkPixbuf.InterpType./g;" \
+    -pe "s/Gdk.COLORSPACE_RGB/GdkPixbuf.Colorspace.RGB/g;" \
+\
+    -pe "s/import pango\n/from gi.repository import Pango\n/g;" \
+    -pe "s/pango\./Pango\./g;" \
+    -pe "s/Pango.ALIGN_/Pango.Alignment./g;" \
+    -pe "s/Pango.ELLIPSIZE_/Pango.EllipsizeMode./g;" \
+    -pe "s/Pango.STYLE_/Pango.Style./g;" \
+    -pe "s/Pango.UNDERLINE_/Pango.Underline./g;" \
+    -pe "s/Pango.WEIGHT_/Pango.Weight./g;" \
+    -pe "s/Pango.WRAP_/Pango.WrapMode./g;" \
+    -pe "s/Pango.TAB_/Pango.TabAlign./g;" \
+\
+    -pe "s/import atk\n/from gi.repository import Atk\n/g;" \
+    -pe "s/atk\./Atk\./g;" \
+    -pe "s/Atk.HYPERLINK_/Atk.HyperlinkStateFlags./g;" \
+    -pe "s/Atk.KEY_EVENT_/Atk.KeyEventType./g;" \
+    -pe "s/Atk.LAYER_/Atk.Layer./g;" \
+    -pe "s/Atk.RELATION_/Atk.RelationType./g;" \
+    -pe "s/Atk.ROLE_/Atk.Role./g;" \
+    -pe "s/Atk.STATE_/Atk.StateType./g;" \
+    -pe "s/Atk.TEXT_ATTR_/Atk.TextAttribute./g;" \
+    -pe "s/Atk.TEXT_BOUNDARY_/Atk.TextBoundary./g;" \
+    -pe "s/Atk.TEXT_CLIP_/Atk.TextClipType./g;" \
+\
+    -pe "s/import gio\n/from gi.repository import Gio\n/g;" \
+    -pe "s/gio\./Gio\./g;" \
+    -pe "s/Gio.FILE_COPY_/Gio.FileCopyFlags./g;" \
+    -pe "s/Gio.FILE_CREATE_/Gio.FileCreateFlags./g;" \
+    -pe "s/Gio.FILE_MONITOR_EVENT_/Gio.FileMonitorEvent./g;" \
+    -pe "s/Gio.FILE_MONITOR_/Gio.FileMonitorFlags./g;" \
+    -pe "s/Gio.FILE_TYPE_/Gio.FileType./g;" \
+    -pe "s/Gio.FILE_QUERY_INFO_/Gio.FileQueryInfoFlags./g;" \
+    -pe "s/Gio.MOUNT_MOUNT_/Gio.MountMountFlags./g;" \
+    -pe "s/Gio.MOUNT_OPERATION_/Gio.MountOperationResult./g;" \
+    -pe "s/Gio.MOUNT_UNMOUNT_/Gio.MountUnmountFlags./g;" \
+    -pe "s/Gio.OUTPUT_STREAM_SPLICE_/Gio.OutputStreamSpliceFlags./g;" \
+    -pe "s/Gio.vfs_/Gio.Vfs./g;" \
+\
+    -pe "#s/import glib\n/from gi.repository import GLib\n/g;" \
+    -pe "#s/(?<!\.)glib\./GLib\./g;" \
+    -pe "#s/GLib.IO_(ERR|HUP|IN|NVAL|OUT|PRI)/GLib.IOCondition./g;" \
+    -pe "#s/GLib.IO_FLAG_/GLib.IOFlags./g;" \
+    -pe "#s/GLib.IO_STATUS_/GLib.IOStatus./g;" \
+    -pe "#s/GLib.OPTION_ERROR_/GLib.OptionError./g;" \
+    -pe "#s/GLib.OPTION_FLAG_/GLib.OptionFlags./g;" \
+    -pe "#s/GLib.SPAWN_/GLib.SpawnFlags./g;" \
+    -pe "#s/GLib.USER_DIRECTORY_/GLib.UserDirectory.DIRECTORY_/g;" \
+\
+    -pe "s/(?<!\.)gobject\./GObject\./g;" \
+    -pe "s/GObject.SIGNAL_/GObject.SignalFlags./g;" \
+    -pe "s/GObject.TYPE_NONE/None/g;" \
+\
+    -pe "s/import hippo\n/from gi.repository import Hippo\n/g;" \
+    -pe "s/hippo\./Hippo\./g;" \
+    -pe "s/Hippo\..*\.__init__/gobject.GObject.__init__/g;" \
+    -pe "s/Hippo.PACK_/Hippo.PackFlags./g;" \
+    -pe "s/Hippo.ORIENTATION_/Hippo.Orientation./g;" \
+    -pe "#s/insert_sorted\(([^,\)]*), ([^,\)]*), ([^,\)]*)\)/insert_sorted\(\1, \2, \3, None\)/g;" \
+    -pe "s/self\._box\.insert_sorted/#self\._box\.insert_sorted/g;" \
+    -pe "s/self._box.append\(([^,\)]*)\)/self._box.append\(\1, 0\)/g;" \
+    -pe "s/self.append\(self._buddy_icon\)/self.append\(self._buddy_icon, 0\)/g;" \
+    -pe "s/self._box.sort\(([^,\)]*)\)/self._box.sort\(\1, None\)/g;" \
+\
+    -pe "s/import wnck\n/from gi.repository import Wnck\n/g;" \
+    -pe "s/wnck\./Wnck\./g;" \
+    -pe "s/Wnck.screen_get_default/Wnck.Screen.get_default/g;" \
+    -pe "s/Wnck.WINDOW_/Wnck.WindowType./g;" \
+\
+    -pe "s/from sugar import _sugarext\n/from gi.repository import SugarExt\n/g;" \
+    -pe "s/_sugarext\.ICON_ENTRY_/SugarExt.SexyIconEntryPosition./g;" \
+    -pe "s/_sugarext\.IconEntry/SugarExt.SexyIconEntry/g;" \
+    -pe "s/_sugarext\.SMClientXSMP/SugarExt.GsmClientXSMP/g;" \
+    -pe "s/_sugarext\.VolumeAlsa/SugarExt.AcmeVolumeAlsa/g;" \
+    -pe "s/_sugarext\./SugarExt\./g;" \
+\
+    -pe "s/import gtksourceview2\n/from gi.repository import GtkSource\n/g;" \
+    -pe "s/import gtksourceview2 as gsv\n/from gi.repository import GtkSource\n/g;" \
+    -pe "s/gtksourceview2\./GtkSource\./g;" \
+    -pe "s/gsv\./GtkSource\./g;" \
+    -pe "s/GtkSource.DRAW_SPACES_/GtkSource.DrawSpacesFlags./g;" \
+    -pe "s/GtkSource.SMART_HOME_END_/GtkSource.SmartHomeEndType./g;" \
+    -pe "s/GtkSource.style_scheme_manager_get_default/GtkSource.StyleSchemeManager.get_default/g;" \
+    -pe "s/GtkSource.language_manager_get_default/GtkSource.LanguageManager.get_default/g;" \
+\
+    -pe "#s/import cairo\n/from gi.repository import cairo\n/g;" \
+\
+    -pe "s/SugarExt.xsmp_init\(\)/'mec'/g;" \
+    -pe "s/SugarExt.xsmp_run\(\)/#SugarExt.xsmp_run\(\)/g;" \
+    -pe "s/SugarExt.session_create_global\(\)/None #SugarExt.session_create_global\(\)/g;" \
+    -pe "s/self.session.start\(\)/return #self.session.start\(\)/g;" \
+\
+    -pe "s/self._box.sort\(self._layout.compare_activities, None\)/pass #self._box.sort(self._layout.compare_activities, None)/g;" \
+    -pe "s/attach_points = info.get_attach_points/has_attach_points_, attach_points = info.get_attach_points/g;" \
+    -pe "s/attach_points\[0\]\[0\]/attach_points\[0\].x/g;" \
+    -pe "s/attach_points\[0\]\[1\]/attach_points\[0\].y/g;" \
+    -pe "s/has_attach_points_/return 0,0;has_attach_points_/g;" \
+    -pe "s/gobject.GObject.__init__\(self, self._model_filter\)/gobject.GObject.__init__\(self, model=self._model_filter\)/g;" \
+    -pe "s/self._model_filter.set_visible_func/return;self._model_filter.set_visible_func/g;" \
+    -pe "s/buddies_column.set_cell_data_func/return;buddies_column.set_cell_data_func/g;" \
+    -pe "s/Hippo\.cairo_surface_from_gdk_pixbuf/SugarExt\.cairo_surface_from_pixbuf/g;" \
+\
+    -pe "s/import pynotify\n/from gi.repository import Notify\n/g;" \
+    -pe "s/pynotify\./Notify\./g;" \
+\
+    -pe "s/import webkit\n/from gi.repository import WebKit\n/g;" \
+    -pe "s/import clutter\n/from gi.repository import Clutter\n/g;" \
+    -pe "s/from clutter import cogl\n/from gi.repository import Cogl\n/g;" \
+    -pe "s/(?<!\.)clutter\./Clutter\./g;" \
+    -pe "s/(?<!\.)cogl\./Cogl\./g;" \
+    -pe "s/Clutter.ACTOR_/Clutter.ActorFlags./g;" \
+    -pe "s/Clutter.ALLOCATION_/Clutter.AllocationFlags./g;" \
+    -pe "s/Clutter.BIND_/Clutter.BindCoordinate./g;" \
+    -pe "s/Clutter.BIN_ALIGNMENT_/Clutter.BinAlignment./g;" \
+    -pe "s/Clutter.BOX_ALIGNMENT_/Clutter.BoxAlignment./g;" \
+    -pe "s/Clutter.DRAG_/Clutter.DragAxis./g;" \
+    -pe "s/Clutter.EASE_/Clutter.AnimationMode./g;" \
+    -pe "s/Clutter.FEATURE_/Clutter.FeatureFlags./g;" \
+    -pe "s/Clutter.FLOW_/Clutter.FLOW_ORIENTATION./g;" \
+    -pe "s/Clutter.FONT_/Clutter.FontFlags./g;" \
+    -pe "s/Clutter.GRAVITY_/Clutter.Gravity./g;" \
+    -pe "s/Clutter.INTERPOLATION/Clutter.Interpolation./g;" \
+    -pe "s/Clutter.LINEAR/Clutter.AnimationMode.LINEAR/g;" \
+    -pe "s/Clutter.PATH_/Clutter.PathNodeType./g;" \
+    -pe "s/Clutter.PICK_/Clutter.PickMode./g;" \
+    -pe "s/Clutter.REQUEST_/Clutter.RequestMode./g;" \
+    -pe "s/Clutter.ROTATE_/Clutter.RotateDirection./g;" \
+    -pe "s/Clutter.SCRIPT_/Clutter.ScriptError./g;" \
+    -pe "s/Clutter.STAGE_STATE_/Clutter.StageState./g;" \
+    -pe "s/Clutter.TABLE_ALIGNMENT_/Clutter.TableAlignment./g;" \
+    -pe "s/Clutter.TEXTURE_ERROR_/Clutter.TextureError./g;" \
+    -pe "s/Clutter.TEXTURE_/Clutter.TextureFlags./g;" \
+    -pe "s/Clutter.TEXT_/Clutter.TextDirection./g;" \
+    -pe "s/Clutter.TIMELINE_/Clutter.TimelineDirection./g;" \
+    -pe "s/Clutter.UNIT_/Clutter.UnitType./g;" \
+    -pe "s/Clutter.X_AXIS/Clutter.RotateAxis.X_AXIS/g;" \
+    -pe "s/Clutter.Y_AXIS/Clutter.RotateAxis.Y_AXIS/g;" \
+    -pe "s/Clutter.Z_AXIS/Clutter.RotateAxis.Z_AXIS/g;" \
+    -pe "s/Clutter.ENTER/Clutter.EventType.ENTER/g;" \
+    -pe "s/Clutter.LEAVE/Clutter.EventType.LEAVE/g;" \
+    -pe "s/Clutter.BUTTON_PRESS/Clutter.EventType.BUTTON_PRESS/g;" \
+    -pe "s/Clutter.BUTTON_RELEASE/Clutter.EventType.BUTTON_RELEASE/g;" \
+    -pe "s/Clutter.KEY_PRESS/Clutter.EventType.KEY_PRESS/g;" \
+    -pe "s/Clutter.KEY_RELEASE/Clutter.EventType.KEY_RELEASE/g;" \
+    -pe "s/Clutter.SCROLL/Clutter.EventType.SCROLL/g;" \
+    -pe "s/Clutter.DELETE/Clutter.EventType.DELETE/g;" \
+    -pe "s/Clutter.CLIENT_MESSAGE/Clutter.EventType.CLIENT_MESSAGE/g;" \
+    -pe "s/Clutter.DESTROY_NOTIFY/Clutter.EventType.DESTROY_NOTIFY/g;" \
+    -pe "s/Clutter.STAGE_STATE/Clutter.EventType.STAGE_STATE/g;" \
+    -pe "s/Clutter.MOTION/Clutter.EventType.MOTION/g;" \
+    -pe "s/Clutter.BUTTON1_MASK/Clutter.ModifierType.BUTTON1_MASK/g;" \
+    -pe "s/Clutter.BUTTON2_MASK/Clutter.ModifierType.BUTTON2_MASK/g;" \
+    -pe "s/Clutter.BUTTON3_MASK/Clutter.ModifierType.BUTTON3_MASK/g;" \
+    -pe "s/Clutter.BUTTON4_MASK/Clutter.ModifierType.BUTTON4_MASK/g;" \
+    -pe "s/Clutter.BUTTON5_MASK/Clutter.ModifierType.BUTTON5_MASK/g;" \
+    -pe "s/Clutter.CONTROL_MASK/Clutter.ModifierType.CONTROL_MASK/g;" \
+    -pe "s/Clutter.HYPER_MASK/Clutter.ModifierType.HYPER_MASK/g;" \
+    -pe "s/Clutter.LOCK_MASK/Clutter.ModifierType.LOCK_MASK/g;" \
+    -pe "s/Clutter.META_MASK/Clutter.ModifierType.META_MASK/g;" \
+    -pe "s/Clutter.MOD1_MASK/Clutter.ModifierType.MOD1_MASK/g;" \
+    -pe "s/Clutter.MOD2_MASK/Clutter.ModifierType.MOD2_MASK/g;" \
+    -pe "s/Clutter.MOD3_MASK/Clutter.ModifierType.MOD3_MASK/g;" \
+    -pe "s/Clutter.MOD4_MASK/Clutter.ModifierType.MOD4_MASK/g;" \
+    -pe "s/Clutter.MOD5_MASK/Clutter.ModifierType.MOD5_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_MASK/Clutter.ModifierType.MODIFIER_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_13_MASK/Clutter.ModifierType.MODIFIER_RESERVED_13_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_14_MASK/Clutter.ModifierType.MODIFIER_RESERVED_14_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_15_MASK/Clutter.ModifierType.MODIFIER_RESERVED_15_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_16_MASK/Clutter.ModifierType.MODIFIER_RESERVED_16_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_17_MASK/Clutter.ModifierType.MODIFIER_RESERVED_17_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_18_MASK/Clutter.ModifierType.MODIFIER_RESERVED_18_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_19_MASK/Clutter.ModifierType.MODIFIER_RESERVED_19_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_20_MASK/Clutter.ModifierType.MODIFIER_RESERVED_20_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_21_MASK/Clutter.ModifierType.MODIFIER_RESERVED_21_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_22_MASK/Clutter.ModifierType.MODIFIER_RESERVED_22_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_23_MASK/Clutter.ModifierType.MODIFIER_RESERVED_23_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_24_MASK/Clutter.ModifierType.MODIFIER_RESERVED_24_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_25_MASK/Clutter.ModifierType.MODIFIER_RESERVED_25_MASK/g;" \
+    -pe "s/Clutter.MODIFIER_RESERVED_29_MASK/Clutter.ModifierType.MODIFIER_RESERVED_29_MASK/g;" \
+    -pe "s/Clutter.RELEASE_MASK/Clutter.ModifierType.RELEASE_MASK/g;" \
+    -pe "s/Clutter.SHIFT_MASK/Clutter.ModifierType.SHIFT_MASK/g;" \
+    -pe "s/Clutter.SUPER_MASK/Clutter.ModifierType.SUPER_MASK/g;" \
+    $f
+done
+
+
index 7b37599ba7e0110f5566ae60610b57528ff49bcd..18ebd7b97e56662204b4271471b13e140b5dce52 100644 (file)
@@ -71,7 +71,12 @@ def _install_enums(module, dest=None, strip=''):
         try:
             if issubclass(obj, GObject.GFlags):
                 for value, flag in obj.__flags_values__.items():
-                    name = flag.value_names[-1].replace(modname + '_', '')
+                    try:
+                        name = flag.value_names[-1].replace(modname + '_', '')
+                    except IndexError:
+                        # FIXME: this happens for some large flags which do not
+                        # fit into a long on 32 bit systems
+                        continue
                     setattr(dest, name, flag)
         except TypeError:
             continue
index a91c814a36436bd512130a6230b6af1f5894508d..77efd2eb581c4bd8fb685590aa4aa39056bbeb56 100644 (file)
@@ -88,6 +88,7 @@ EXTRA_DIST = \
        test_gobject.py \
        test_gtype.py \
        test_interface.py \
+       test_internal_api.py \
        test_iochannel.py \
        test_mainloop.py \
        test_option.py \
index 60fc5cc4bcb8c199db9f12bc81f2303d70fdcb81..5aa69dc71fed01d62064ee9838a24032db986237 100644 (file)
@@ -334,6 +334,7 @@ EXTRA_DIST = \
        test_gobject.py \
        test_gtype.py \
        test_interface.py \
+       test_internal_api.py \
        test_iochannel.py \
        test_mainloop.py \
        test_option.py \
index bb5f2d938bc2100210215803cec12f1aa48f6f41..805633a3d65e17e4be489738cb2f791493b3ca66 100644 (file)
@@ -133,7 +133,9 @@ class TestGDBusClient(unittest.TestCase):
             self.dbus_proxy.GetConnectionUnixProcessID('(s)', '1', timeout=0)
             self.fail('call with timeout=0 should raise an exception')
         except Exception as e:
-            self.assertTrue('Timeout' in str(e), str(e))
+            # FIXME: this is not very precise, but in some environments we
+            # do not always get an actual timeout
+            self.assertTrue(isinstance(e, GLib.GError), str(e))
 
     def test_python_calls_sync_noargs(self):
         # methods without arguments don't need an explicit signature
index 4837204b96e4b2588ff2f236c23ed20b89f3b3b3..a2664f181d1c5641f11ec6712648d10fa831b232 100644 (file)
@@ -711,6 +711,7 @@ class TestFilename(unittest.TestCase):
 
         dirname = GLib.Dir.make_tmp('testäø.XXXXXX')
         self.assertTrue('/testäø.' in dirname, dirname)
+        dirname = _bytes(dirname)
         self.assertTrue(os.path.isdir(dirname))
         os.rmdir(dirname)
 
@@ -958,6 +959,11 @@ class TestGArray(unittest.TestCase):
     def test_garray_utf8_full_out(self):
         self.assertEqual(['0', '1', '2'], GIMarshallingTests.garray_utf8_full_out())
 
+    @unittest.skipUnless(hasattr(GIMarshallingTests, 'garray_utf8_full_out_caller_allocated'),
+                         'too old gobject-introspection')
+    def test_garray_utf8_full_out_caller_allocated(self):
+        self.assertEqual(['0', '1', '2'], GIMarshallingTests.garray_utf8_full_out_caller_allocated())
+
     def test_garray_utf8_none_inout(self):
         self.assertEqual(['-2', '-1', '0', '1'], GIMarshallingTests.garray_utf8_none_inout(Sequence(('0', '1', '2'))))
 
@@ -1355,6 +1361,42 @@ class TestGClosure(unittest.TestCase):
         self.assertRaises(TypeError, GIMarshallingTests.gclosure_in, None)
 
 
+class TestCallbacks(unittest.TestCase):
+    def test_return_value_only(self):
+        def cb():
+            return 5
+        self.assertEqual(GIMarshallingTests.callback_return_value_only(cb), 5)
+
+    @unittest.expectedFailure
+    def test_one_out_arg(self):
+        def cb():
+            return 5.5
+        self.assertAlmostEqual(GIMarshallingTests.callback_one_out_parameter(cb), 5.5)
+
+    @unittest.expectedFailure
+    def test_multiple_out_args(self):
+        def cb():
+            return (5.5, 42.0)
+        res = GIMarshallingTests.callback_multiple_out_parameters(cb)
+        self.assertAlmostEqual(res[0], 5.5)
+        self.assertAlmostEqual(res[1], 42.0)
+
+    @unittest.expectedFailure
+    def test_return_and_one_out_arg(self):
+        def cb():
+            return (5, 42.0)
+        res = GIMarshallingTests.callback_return_value_and_one_out_parameter(cb)
+        self.assertEqual(res[0], 5)
+        self.assertAlmostEqual(res[1], 42.0)
+
+    @unittest.expectedFailure
+    def test_return_and_multiple_out_arg(self):
+        def cb():
+            return (5, 42, -1000)
+        self.assertEqual(GIMarshallingTests.callback_return_value_and_multiple_out_parameters(cb),
+                         (5, 42, -1000))
+
+
 class TestPointer(unittest.TestCase):
     def test_pointer_in_return(self):
         self.assertEqual(GIMarshallingTests.pointer_in_return(42), 42)
@@ -1916,6 +1958,15 @@ class TestPythonGObject(unittest.TestCase):
         def do_method_int8_out(self):
             return 42
 
+        def do_method_int8_arg_and_out_caller(self, arg):
+            return arg + 1
+
+        def do_method_int8_arg_and_out_callee(self, arg):
+            return arg + 1
+
+        def do_method_str_arg_out_ret(self, arg):
+            return (arg.upper(), len(arg))
+
         def do_method_with_default_implementation(self, int8):
             GIMarshallingTests.Object.do_method_with_default_implementation(self, int8)
             self.props.int += int8
@@ -1971,6 +2022,12 @@ class TestPythonGObject(unittest.TestCase):
         self.assertEqual(object_.val, 84)
         self.assertEqual(object_.method_int8_out(), 42)
 
+        # can be dropped when bumping g-i dependencies to >= 1.35.2
+        if hasattr(object_, 'method_int8_arg_and_out_caller'):
+            self.assertEqual(object_.method_int8_arg_and_out_caller(42), 43)
+            self.assertEqual(object_.method_int8_arg_and_out_callee(42), 43)
+            self.assertEqual(object_.method_str_arg_out_ret('hello'), ('HELLO', 5))
+
         object_.method_with_default_implementation(42)
         self.assertEqual(object_.props.int, 84)
 
@@ -2302,8 +2359,16 @@ class TestOverrides(unittest.TestCase):
         self.assertTrue(isinstance(object_, GIMarshallingTests.OverridesObject))
 
     def test_module_name(self):
+        # overridden types
         self.assertEqual(GIMarshallingTests.OverridesStruct.__module__, 'gi.overrides.GIMarshallingTests')
-        self.assertEqual(GObject.InitiallyUnowned.__module__, 'gi.repository.GObject')
+        self.assertEqual(GIMarshallingTests.OverridesObject.__module__, 'gi.overrides.GIMarshallingTests')
+        self.assertEqual(GObject.Object.__module__, 'gi.overrides.GObject')
+
+        # not overridden
+        self.assertEqual(GIMarshallingTests.SubObject.__module__, 'gi.repository.GIMarshallingTests')
+        # FIXME: does not work with TEST_NAMES='test_thread test_gi.TestOverrides',
+        # it is importlib._bootstrap then
+        #self.assertEqual(GObject.InitiallyUnowned.__module__, 'gi.repository.GObject')
 
 
 class TestDir(unittest.TestCase):
index 1a45fd8bcc0a81dafeb6a28e5f6d7c83474675ae..9ef60e4201a6e18fe0220e4024495ad89d705f45 100644 (file)
@@ -36,8 +36,10 @@ class TestGLib(unittest.TestCase):
         self.assertEqual(GLib.get_application_name(), 'moo')
 
     def test_xdg_dirs(self):
-        self.assertTrue(os.path.isdir(GLib.get_user_data_dir()))
-        self.assertTrue(os.path.isdir(GLib.get_user_special_dir(GLib.USER_DIRECTORY_DESKTOP)))
+        d = GLib.get_user_data_dir()
+        self.assertTrue('/' in d, d)
+        d = GLib.get_user_special_dir(GLib.USER_DIRECTORY_DESKTOP)
+        self.assertTrue('/' in d, d)
         # also works with backwards compatible enum names
         self.assertEqual(GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_MUSIC),
                          GLib.get_user_special_dir(GLib.USER_DIRECTORY_MUSIC))
@@ -45,7 +47,7 @@ class TestGLib(unittest.TestCase):
         for d in GLib.get_system_config_dirs():
             self.assertTrue('/' in d, d)
         for d in GLib.get_system_data_dirs():
-            self.assertTrue('/' in d, d)
+            self.assertTrue(isinstance(d, str), d)
 
     def test_main_depth(self):
         self.assertEqual(GLib.main_depth(), 0)
@@ -171,6 +173,9 @@ https://my.org/q?x=1&y=2
 
         def cb(file, condition):
             call_data.append((file, condition, file.readline()))
+            if len(call_data) == 2:
+                # avoid having to wait for the full timeout
+                ml.quit()
             return True
 
         # io_add_watch() takes an IOChannel, calling with a Python file is deprecated
@@ -180,7 +185,7 @@ https://my.org/q?x=1&y=2
             self.assertTrue(issubclass(warn[0].category, PyGIDeprecationWarning))
 
         ml = GLib.MainLoop()
-        GLib.timeout_add(400, ml.quit)
+        GLib.timeout_add(2000, ml.quit)
         ml.run()
 
         cmd.wait()
diff --git a/tests/test_internal_api.py b/tests/test_internal_api.py
new file mode 100644 (file)
index 0000000..ca50f6b
--- /dev/null
@@ -0,0 +1,73 @@
+# -*- Mode: Python -*-
+
+import unittest
+
+from gi.repository import GLib, GObject
+
+import testhelper
+import testmodule
+
+
+class TestObject(unittest.TestCase):
+    def test_create_ctor(self):
+        o = testmodule.PyGObject()
+        self.assertTrue(isinstance(o, GObject.Object))
+        self.assertTrue(isinstance(o, testmodule.PyGObject))
+
+        # has expected property
+        self.assertEqual(o.props.label, 'hello')
+        o.props.label = 'goodbye'
+        self.assertEqual(o.props.label, 'goodbye')
+        self.assertRaises(AttributeError, getattr, o.props, 'nosuchprop')
+
+    def test_pyobject_new_test_type(self):
+        o = testhelper.create_test_type()
+        self.assertTrue(isinstance(o, testmodule.PyGObject))
+
+        # has expected property
+        self.assertEqual(o.props.label, 'hello')
+        o.props.label = 'goodbye'
+        self.assertEqual(o.props.label, 'goodbye')
+        self.assertRaises(AttributeError, getattr, o.props, 'nosuchprop')
+
+    def test_new_refcount(self):
+        # TODO: justify why this should be 2
+        self.assertEqual(testhelper.test_g_object_new(), 2)
+
+
+class TestGValueConversion(unittest.TestCase):
+    def test_int(self):
+        self.assertEqual(testhelper.test_value(0), 0)
+        self.assertEqual(testhelper.test_value(5), 5)
+        self.assertEqual(testhelper.test_value(-5), -5)
+        self.assertEqual(testhelper.test_value(GObject.G_MAXINT32), GObject.G_MAXINT32)
+        self.assertEqual(testhelper.test_value(GObject.G_MININT32), GObject.G_MININT32)
+
+    def test_str(self):
+        self.assertEqual(testhelper.test_value('hello'), 'hello')
+
+    def test_int_array(self):
+        self.assertEqual(testhelper.test_value_array([]), [])
+        self.assertEqual(testhelper.test_value_array([0]), [0])
+        ar = list(range(100))
+        self.assertEqual(testhelper.test_value_array(ar), ar)
+
+    def test_str_array(self):
+        self.assertEqual(testhelper.test_value_array([]), [])
+        self.assertEqual(testhelper.test_value_array(['a']), ['a'])
+        ar = ('aa ' * 1000).split()
+        self.assertEqual(testhelper.test_value_array(ar), ar)
+
+
+class TestErrors(unittest.TestCase):
+    def test_gerror(self):
+        callable_ = lambda: GLib.file_get_contents('/nonexisting ')
+        self.assertRaises(GLib.GError, testhelper.test_gerror_exception, callable_)
+
+    def test_no_gerror(self):
+        callable_ = lambda: GLib.file_get_contents(__file__)
+        self.assertEqual(testhelper.test_gerror_exception(callable_), None)
+
+
+if __name__ == '__main__':
+    unittest.main()
index 61484799663fbd4a0e45346a1166764d89f4076c..7ed83447f134b4a5c7464fc580d9024fa52b2afb 100644 (file)
@@ -277,9 +277,15 @@ class TestGtk(unittest.TestCase):
         self.assertEqual('color selection dialog test', dialog.get_title())
 
         # Gtk.FileChooserDialog
-        dialog = Gtk.FileChooserDialog(title='file chooser dialog test',
-                                       buttons=('test-button1', 1),
-                                       action=Gtk.FileChooserAction.SAVE)
+        # might cause a GVFS warning, do not break on this
+        old_mask = GLib.log_set_always_fatal(
+            GLib.LogLevelFlags.LEVEL_CRITICAL | GLib.LogLevelFlags.LEVEL_ERROR)
+        try:
+            dialog = Gtk.FileChooserDialog(title='file chooser dialog test',
+                                           buttons=('test-button1', 1),
+                                           action=Gtk.FileChooserAction.SAVE)
+        finally:
+            GLib.log_set_always_fatal(old_mask)
         self.assertTrue(isinstance(dialog, Gtk.Dialog))
         self.assertTrue(isinstance(dialog, Gtk.Window))
 
index ccb80a65e03a838d25aa807cddbb0d5d4d07d645..fe286e275606cdb724a33f918565b5980c0ca583 100644 (file)
@@ -16,7 +16,8 @@ from gi.repository.GObject import \
     TYPE_STRING, TYPE_PYOBJECT, TYPE_VARIANT
 
 from gi.repository.GObject import \
-    G_MININT, G_MAXINT, G_MAXUINT, G_MINLONG, G_MAXLONG, G_MAXULONG
+    G_MININT, G_MAXINT, G_MAXUINT, G_MINLONG, G_MAXLONG, G_MAXULONG, \
+    G_MAXUINT64, G_MAXINT64, G_MININT64
 
 from gi.repository import Gio
 from gi.repository import GLib
@@ -584,17 +585,13 @@ class TestProperty(unittest.TestCase):
         self.assertEqual(o.prop_name, 10)
 
     def test_range(self):
-        maxint64 = 2 ** 62 - 1
-        minint64 = -2 ** 62 - 1
-        maxuint64 = 2 ** 63 - 1
-
         types_ = [
             (TYPE_INT, G_MININT, G_MAXINT),
             (TYPE_UINT, 0, G_MAXUINT),
             (TYPE_LONG, G_MINLONG, G_MAXLONG),
             (TYPE_ULONG, 0, G_MAXULONG),
-            (TYPE_INT64, minint64, maxint64),
-            (TYPE_UINT64, 0, maxuint64),
+            (TYPE_INT64, G_MININT64, G_MAXINT64),
+            (TYPE_UINT64, 0, G_MAXUINT64),
             ]
 
         for gtype, min, max in types_: