diff options
64 files changed, 2407 insertions, 1682 deletions
@@ -1,31 +1,201 @@ -commit 7dc01c05fc07433161be74509b985647f6bedd19 -Author: Christoph Reiter <creiter@src.gnome.org> -Date: Sat Oct 24 18:57:22 2015 +0200 +commit bedc7b883febceb3470f1b8e909cfab696d1fc5f +Author: Simon Feltman <sfeltman@src.gnome.org> +Date: Sat Oct 31 14:47:07 2015 -0700 - release 3.18.2 + release 3.19.2 - NEWS | 3 +++ - 1 file changed, 3 insertions(+) + NEWS | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 4164e7088be446fcab65cef642c6853aad3b6a69 +Author: Simon Feltman <sfeltman@src.gnome.org> +Date: Sat Oct 31 14:06:40 2015 -0700 + + tests: Fix failure due to new GTK+ warning regarding size_allocate() -commit a93e821b31010869c2ffd1b3aba9583645294ee0 + Call get_preferred_size() to avoid size_allocated() warning in + size-allocated signal handler test. + + tests/test_overrides_gtk.py | 1 + + 1 file changed, 1 insertion(+) + +commit a8293f411234180d70e9ff979954b28381842e1f +Author: Simon Feltman <sfeltman@src.gnome.org> +Date: Sat Oct 31 14:03:21 2015 -0700 + + Fix build warnings regarding _POSIX_C_SOURCE redefinition + + Move Python.h includes above glib includes to avoid build + warnings with Python 2 as noted here: + https://docs.python.org/2/c-api/intro.html#include-files + + gi/gobjectmodule.c | 1 + + gi/pygi-array.c | 2 +- + gi/pygi-cache.c | 2 +- + gi/pygi-enum-marshal.c | 2 +- + gi/pygi-hashtable.c | 1 + + gi/pygi-hashtable.h | 2 +- + gi/pygi-list.c | 1 + + gi/pygi-object.c | 2 +- + gi/pygi-struct-marshal.c | 2 +- + gi/pygi-value.c | 1 + + 10 files changed, 10 insertions(+), 6 deletions(-) + +commit 3b1d130174951f7648beceac270daa8ac65939c7 +Author: Matthias Clasen <mclasen@redhat.com> +Date: Fri Oct 30 12:15:26 2015 -0400 + + Drop -std=c90 for now + + glib headers have a problem with it, and sorting it out on the + glib side will take a while, so drop this for now. + + configure.ac | 9 --------- + 1 file changed, 9 deletions(-) + +commit ef219cc74a7c6803795692664fc3b2c8ebbb4fe4 Author: Christoph Reiter <creiter@src.gnome.org> -Date: Sat Oct 24 17:54:14 2015 +0200 +Date: Fri Oct 30 16:23:11 2015 +0100 - configure.ac: post release version bump to 3.18.2 + configure.ac: post release version bump to 3.19.2 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -commit 7bd1dbd08db591a7187b08e8392a85181f9db33b +commit 98a4bfe4606bd2c7534533633a20a998f732e248 Author: Christoph Reiter <creiter@src.gnome.org> -Date: Sat Oct 24 12:00:21 2015 +0200 +Date: Fri Oct 30 16:13:46 2015 +0100 - release 3.18.1 + release 3.19.1 - NEWS | 6 ++++++ - 1 file changed, 6 insertions(+) + NEWS | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit 175d10665472e6f4090d707e3b89255814c932b1 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Jun 8 18:14:08 2015 +0200 + + Use a named tuple for returning multiple values + + >>> v = Gtk.Button().get_alignment() + >>> v + (xalign=0.5, yalign=0.5) + >>> v.xalign + 0.5 + + For each GICallable a new gi._gi.ResultTuple subclass + is created which knows the return value names of that + callable and displays them in __repr__, __dir__ and + allows to access tuple items by name. + + The subclass is cached in PyGICallableCache. + + To reduce the number of small tuple allocations use a free list + similar to the one used for pure tuples in CPython. + + https://bugzilla.gnome.org/show_bug.cgi?id=727374 + + gi/Makefile.am | 2 + + gi/gimodule.c | 1 + + gi/pygi-cache.c | 34 +++++ + gi/pygi-cache.h | 6 + + gi/pygi-invoke.c | 35 ++--- + gi/pygi-private.h | 1 + + gi/pygi-resulttuple.c | 354 + ++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-resulttuple.h | 34 +++++ + gi/pyglib-python-compat.h | 5 + + tests/Makefile.am | 1 + + tests/test_resulttuple.py | 87 ++++++++++++ + 11 files changed, 543 insertions(+), 17 deletions(-) + +commit b1788c9a445c8a820121c42260bcbdbc3ae8dfba +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Oct 26 11:17:34 2015 +0100 + + enum/flags: use gir info for type names and __repr__ instead of the + gtype name + + For example __name__ is now SpawnFlags instead of PyGLibSpawnFlags + and __repr__ shows GLib.SpawnFlags in stead of PyGLibSpawnFlags. + + https://bugzilla.gnome.org/show_bug.cgi?id=657915 + + gi/gimodule.c | 35 ++++++++++++++++++++++++---- + gi/pygenum.c | 57 + +++++++++++++++++++++++++++++++-------------- + gi/pygflags.c | 31 +++++++++++++++++++----- + tests/test_gi.py | 41 ++++++++++++++++++++++++++++++++ + tests/test_overrides_gdk.py | 6 ++--- + 5 files changed, 139 insertions(+), 31 deletions(-) + +commit 6b702c052e9f26e809cff494f0c896d17a514c64 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Wed Jun 10 18:24:44 2015 +0200 + + Improve and unify __repr__ format for PyGObject, PyGBoxed and + PyGIStruct + + Includes the module, Python type name, pointer and wrapper pointer + and GType name. e.g. + "<Gtk.Border object at 0x7f26bee9e4c8 (GtkBorder at 0x1c72e30)>" + + In case of PyGObjects created from GType set the module to __gi__ + instead of guessing the old static binding name. Also + remove the code that tries to add them to the guessed static bindings + module while at it. The __repr__ will now return + "<__gi__.X11Keymap ..." instead of "<gtk.gdk.X11Keymap ..." + + https://bugzilla.gnome.org/show_bug.cgi?id=657915 + + gi/pygboxed.c | 31 +++++++++++++++++++++---- + gi/pygi-struct.c | 23 ++++++++++++++++++ + gi/pygobject.c | 71 + +++++++++++++++++++++++++------------------------------- + tests/test_gi.py | 33 ++++++++++++++++++++++++++ + 4 files changed, 113 insertions(+), 45 deletions(-) + +commit 9b821aa0d60857e612cde9dabe9c8f9f9c60214c +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Sun Oct 4 11:13:37 2015 +0200 + + Don't leak internal RepositoryError on import. + + In case a dependency of the imported namespace has a version + conflict with an already loaded version, import would raise + RepositoryError. + + This fixes it to raise an ImportError instead. + + https://bugzilla.gnome.org/show_bug.cgi?id=756033 + + gi/importer.py | 7 +++++-- + gi/module.py | 4 ++++ + 2 files changed, 9 insertions(+), 2 deletions(-) + +commit dba1da9b0770c7dec1abd82303b9b4266fe2ce3f +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Sun Oct 4 10:13:35 2015 +0200 + + Import dependencies when importing typelibs from gi.repository + + Recursively import a modules dependencies when importing from + gi.repository. + + This fixes the case where a library depends on initialization + code of dependency overrides. For example libwnck expects + gdk_init to be called before using its API and gdk_init + gets called in the Gdk overrrides. + + https://bugzilla.gnome.org/show_bug.cgi?id=656314 + + gi/importer.py | 12 +++++++++++- + gi/pygi-repository.c | 35 +++++++++++++++++++++++++++++++++++ + tests/test_import_machinery.py | 13 +++++++++++++ + tests/test_repository.py | 10 ++++++++++ + 4 files changed, 69 insertions(+), 1 deletion(-) -commit 8e7f6f1458cf1c162c13422c72562b00433b762b +commit dfa3a85290dd97ecd7cbe8f12fbc1ff2db5a1155 Author: Christoph Reiter <creiter@src.gnome.org> Date: Sun Oct 11 01:28:48 2015 +0200 @@ -42,7 +212,60 @@ Date: Sun Oct 11 01:28:48 2015 +0200 tests/test_overrides_gdk.py | 9 +++++++++ 2 files changed, 17 insertions(+) -commit 6dc27765f409f080dece033a86fcdf0ce82e2875 +commit 98726caff183491cde1e145861adfcff0c243d9b +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Sun Oct 4 09:53:27 2015 +0200 + + Don't import inspect at module level + + Move it to the only user instead as importing inspect + takes 10msec here. + + gi/_signalhelper.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e1921b7224ca1e909d9fe5483a09414742d0baf4 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Sat Sep 26 21:29:54 2015 +0200 + + invoke state: add a free memory cache for PyGIInvokeArgState + + Keep one free allocation per argument count around + to reduce g_slice_alloc/free usage. + + Reduces CPU time for simple functions by 10% and 5% for closures. + + https://bugzilla.gnome.org/show_bug.cgi?id=750658 + + gi/pygi-closure.c | 6 ++---- + gi/pygi-invoke.c | 61 + +++++++++++++++++++++++++++++++++++++++++++++++++------ + gi/pygi-invoke.h | 4 ++++ + 3 files changed, 61 insertions(+), 10 deletions(-) + +commit f72b6434de82ffa1950ff45a4daf80c84f58eca6 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Sat Sep 26 21:25:38 2015 +0200 + + invoke/closure: reduce g_slice_alloc usage + + Instead of allocating multiple arrays, combine argument + data in a new PyGIInvokeArgState and allocate it in one go. + + This reduces CPU time by 20% for simple functions and by 15% + for closures. + + https://bugzilla.gnome.org/show_bug.cgi?id=750658 + + gi/pygi-array.c | 6 +-- + gi/pygi-closure.c | 99 + +++++++++++++++++++------------------------ + gi/pygi-invoke-state-struct.h | 34 +++++++++------ + gi/pygi-invoke.c | 50 +++++++--------------- + gi/pygi-marshal-cleanup.c | 10 ++--- + 5 files changed, 86 insertions(+), 113 deletions(-) + +commit 640221c099031a55cbc32f5cdac3e6e018256fff Author: Christoph Reiter <creiter@src.gnome.org> Date: Sun Sep 27 11:19:14 2015 +0200 @@ -55,7 +278,90 @@ Date: Sun Sep 27 11:19:14 2015 +0200 Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -commit 5da4041629f833f66b76dc7dfcf5400153d22eb4 +commit 5fcc0b49e5988bfb6893bd56dd25a6257cd9720d +Author: Garrett Regier <garrett.regier@riftio.com> +Date: Tue Sep 22 14:57:13 2015 -0700 + + Bump g-i dependency to latest stable + + This is required for throwing exceptions in closures. + + README | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 0acbf6ad543a928ce75fc6d6839d3e6aa2e9a3d3 +Author: Garrett Regier <garrett.regier@riftio.com> +Date: Tue Jun 9 07:11:51 2015 -0700 + + Avoid calling g_slist_length() during invoke + + We already know the number of Python args. + + gi/pygi-invoke.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 216e94cff0bbe5436efe423b197c9cfc4a00a02d +Author: Garrett Regier <garrett.regier@riftio.com> +Date: Wed Jun 3 08:14:08 2015 -0700 + + Simplify closure_convert_arguments() + + This chunk of work should really be done + in convert_ffi_arguments(). + + gi/pygi-closure.c | 65 + +++++++++++++++++++++++++------------------------------ + 1 file changed, 29 insertions(+), 36 deletions(-) + +commit 7f7d0c52c9b364ba0ec92c9415298c26b103a077 +Author: Garrett Regier <garrett.regier@riftio.com> +Date: Wed Jun 3 08:09:31 2015 -0700 + + Remove a level of indentation in convert_ffi_arguments() + + gi/pygi-closure.c | 138 + ++++++++++++++++++++++++++---------------------------- + 1 file changed, 67 insertions(+), 71 deletions(-) + +commit 3066f3a88103f02c7e22db22efbeb501f4e30d32 +Author: Garrett Regier <garrett.regier@riftio.com> +Date: Wed Jun 3 07:50:37 2015 -0700 + + Prevent passing the user data multiple times to callbacks + + This can happen when a callback has multiple gpointers. + Also, store the closure index as it is hopefully more reliable + than guessing. + + https://bugzilla.gnome.org/show_bug.cgi?id=750347 + + gi/pygi-cache.c | 24 ++++++++++++++++++++++++ + gi/pygi-cache.h | 3 +++ + gi/pygi-closure.c | 8 ++------ + 3 files changed, 29 insertions(+), 6 deletions(-) + +commit 40bba555c835cf53d6aa2645329631e6abe57e6c +Author: Garrett Regier <garrett.regier@riftio.com> +Date: Wed Jun 3 07:06:40 2015 -0700 + + Support throwing exceptions in closures + + This allows exceptions raised in vfunc implemntations + and callbacks to be turned into GErrors. + + NOTE: this requires matchs in + https://bugzilla.gnome.org/show_bug.cgi?id=729543 + thus we must bump the GI req once they are commited. + + https://bugzilla.gnome.org/show_bug.cgi?id=710671 + + gi/pygi-closure.c | 113 + ++++++++++++++++++++++++++++++---------------------- + tests/test_error.py | 22 ++++++++++ + 2 files changed, 88 insertions(+), 47 deletions(-) + +commit ea75a89a7d2bdabc7a29f7f20f792211765f2ac7 Author: Christoph Reiter <creiter@src.gnome.org> Date: Sun Sep 6 05:35:03 2015 +0200 @@ -88,14 +394,14 @@ Date: Sun Sep 6 05:35:03 2015 +0200 tests/test_repository.py | 11 +++++ 4 files changed, 54 insertions(+), 78 deletions(-) -commit 701ec5b3e0a6f96898232d256a028bc4005cda92 -Author: Garrett Regier <garrettregier@gmail.com> -Date: Tue Sep 22 07:08:06 2015 -0700 +commit 65726314de2833ce0364a3f3e23f344d122b342f +Author: Garrett Regier <garrett.regier@riftio.com> +Date: Tue Sep 22 00:17:00 2015 -0700 - configure.ac: post release version bump to 3.18.1 + configure.ac: post release version bump to 3.19.1 - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) commit ea5ecca4916569b1eca6296ff1a8905e42c3c38a Author: Garrett Regier <garrettregier@gmail.com> diff --git a/Makefile.in b/Makefile.in index 73cf539..b4ccd20 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -16,17 +16,7 @@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -90,6 +80,13 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in $(srcdir)/pygobject-3.0.pc.in \ + $(srcdir)/pygobject-3.0-uninstalled.pc.in \ + $(srcdir)/PKG-INFO.in $(nobase_pyexec_PYTHON) py-compile \ + AUTHORS COPYING ChangeLog INSTALL NEWS README compile \ + config.guess config.sub depcomp install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -98,9 +95,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(nobase_pyexec_PYTHON) \ - $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -200,12 +194,6 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/PKG-INFO.in \ - $(srcdir)/config.h.in \ - $(srcdir)/pygobject-3.0-uninstalled.pc.in \ - $(srcdir)/pygobject-3.0.pc.in AUTHORS COPYING ChangeLog \ - INSTALL NEWS README compile config.guess config.sub install-sh \ - ltmain.sh missing py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -283,7 +271,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -407,7 +394,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -512,6 +498,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -532,8 +519,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -602,7 +589,7 @@ install-nobase_pyexecPYTHON: $(nobase_pyexec_PYTHON) echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ fi; \ - $(am__nobase_list) | { while read dir files; do \ + $(am__nobase_list) | while read dir files; do \ xfiles=; for p in $$files; do \ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f "$$b$$p"; then xfiles="$$xfiles $$b$$p"; dlist="$$dlist $$p"; \ @@ -613,11 +600,11 @@ install-nobase_pyexecPYTHON: $(nobase_pyexec_PYTHON) $(MKDIR_P) "$(DESTDIR)$(pyexecdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(pyexecdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(pyexecdir)/$$dir" || exit $$?; }; \ - done; \ - if test -n "$$dlist"; then \ - $(am__py_compile) --destdir "$(DESTDIR)" \ - --basedir "$(pyexecdir)" $$dlist; \ - else :; fi; } + if test -n "$$dlist"; then \ + $(am__py_compile) --destdir "$(DESTDIR)" \ + --basedir "$(pyexecdir)" $$dlist; \ + else :; fi \ + done uninstall-nobase_pyexecPYTHON: @$(NORMAL_UNINSTALL) @@ -853,16 +840,10 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -897,17 +878,16 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -1097,8 +1077,6 @@ uninstall-am: uninstall-local uninstall-nobase_pyexecPYTHON \ uninstall-am uninstall-local uninstall-nobase_pyexecPYTHON \ uninstall-pkgconfigDATA uninstall-pyexecLTLIBRARIES -.PRECIOUS: Makefile - # if we build in a separate tree, we need to symlink the *.py files from the # source tree; Python does not accept the extensions and modules in different @@ -1,11 +1,29 @@ -3.18.2 24-Oct-2015 - - configure.ac: post release version bump to 3.18.2 (Christoph Reiter) - -3.18.1 23-Oct-2015 +3.19.2 31-Oct-2015 + - tests: Fix failure due to new GTK+ warning regarding size_allocate() + (Simon Feltman) + - Fix build warnings regarding _POSIX_C_SOURCE redefinition + (Simon Feltman) + - Drop -std=c90 for now (Matthias Clasen) + +3.19.1 30-Oct-2015 + - Use a named tuple for returning multiple values (Christoph Reiter) (#727374) + - enum/flags: use gir info for type names and __repr__ instead of the gtype name (Christoph Reiter) (#657915) + - Improve and unify __repr__ format for PyGObject, PyGBoxed and PyGIStruct (Christoph Reiter) (#657915) + - Don't leak internal RepositoryError on import. (Christoph Reiter) (#756033) + - Import dependencies when importing typelibs from gi.repository (Christoph Reiter) (#656314) - Fix Gdk.rectangle_intersect/rectangle_union missing with GTK+ 3.18 (Christoph Reiter) (#756364) + - Don't import inspect at module level (Christoph Reiter) + - invoke state: add a free memory cache for PyGIInvokeArgState (Christoph Reiter) (#750658) + - invoke/closure: reduce g_slice_alloc usage (Christoph Reiter) (#750658) - pep8: ignore new errors reported by pep8 1.6 (Christoph Reiter) + - Bump g-i dependency to latest stable (Garrett Regier) + - Avoid calling g_slist_length() during invoke (Garrett Regier) + - Simplify closure_convert_arguments() (Garrett Regier) + - Remove a level of indentation in convert_ffi_arguments() (Garrett Regier) + - Prevent passing the user data multiple times to callbacks (Garrett Regier) (#750347) + - Support throwing exceptions in closures (Garrett Regier) (#710671) - Don't emit require_version warning if namespace was loaded previously using g_irepository_require (Christoph Reiter) (#754491) - - configure.ac: post release version bump to 3.18.1 (Garrett Regier) + - configure.ac: post release version bump to 3.19.1 (Garrett Regier) 3.18.0 22-Sep-2015 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyGObject -Version: 3.18.2 +Version: 3.19.2 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: Simon Feltman Maintainer-email: sfeltman@src.gnome.org License: GNU LGPL -Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.18/pygobject-3.18.2.tar.gz +Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.19/pygobject-3.19.2.tar.gz Description: Python bindings for GLib and GObject Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable @@ -47,7 +47,7 @@ Requirements * C compiler (GCC and MSVC supported) * Python 2.7 or higher * Glib/Gio 2.38.0 or higher - * gobject-introspection 1.38.0 or higher + * gobject-introspection 1.46.0 or higher * libffi (optional) Copyright Information @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.13.4 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,10 +20,221 @@ 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'.])]) -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html -# =========================================================================== +# 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 + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR + # SYNOPSIS # # AX_CODE_COVERAGE() @@ -39,87 +250,47 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # corresponds to the value of the --enable-code-coverage option, which # defaults to being disabled. # -# Test also for gcov program and create GCOV variable that could be -# substituted. -# # Note that all optimisation flags in CFLAGS must be disabled when code # coverage is enabled. # # Usage example: -# # configure.ac: -# -# AX_CODE_COVERAGE +# AX_CODE_COVERAGE # # Makefile.am: +# @CODE_COVERAGE_RULES@ +# my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) … +# my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) … # -# @CODE_COVERAGE_RULES@ -# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ... -# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... -# -# This results in a "check-code-coverage" rule being added to any -# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module -# has been configured with --enable-code-coverage). Running `make -# check-code-coverage` in that directory will run the module's test suite -# (`make check`) and build a code coverage report detailing the code which -# was touched, then print the URI for the report. -# -# This code was derived from Makefile.decl in GLib, originally licenced -# under LGPLv2.1+. +# This results in a “check-code-coverage” rule being added to any Makefile.am +# which includes “@CODE_COVERAGE_RULES@” (assuming the module has been +# configured with --enable-code-coverage). Running `make check-code-coverage` +# in that directory will run the module’s test suite (`make check`) and build +# a code coverage report detailing the code which was touched, then print the +# URI for the report. # # LICENSE # -# Copyright (c) 2012 Philip Withnall -# Copyright (c) 2012 Xan Lopez -# Copyright (c) 2012 Christian Persch -# Copyright (c) 2012 Paolo Borelli -# Copyright (c) 2012 Dan Winship -# Copyright (c) 2015 Bastien ROUCARIES -# -# This library is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or (at -# your option) any later version. -# -# This library 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 Lesser -# General Public License for more details. +# Copyright © 2012, 2014 Philip Withnall +# Copyright © 2012 Xan Lopez +# Copyright © 2012 Christian Persch +# Copyright © 2012 Paolo Borelli +# Copyright © 2012 Dan Winship # -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+. +# This file is licenced under LGPLv2.1+. -#serial 5 +#serial 1 AC_DEFUN([AX_CODE_COVERAGE],[ dnl Check for --enable-code-coverage - AC_REQUIRE([AC_PROG_SED]) - - # allow to override gcov location - AC_ARG_WITH([gcov], - [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) - 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) - + 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" ], [ - # check for gcov - AC_CHECK_TOOL([GCOV], - [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], - [:]) - AS_IF([test "X$GCOV" = "X:"], - [AC_MSG_ERROR([gcov is needed to do coverage])]) - AC_SUBST([GCOV]) - 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]) @@ -178,11 +349,8 @@ CODE_COVERAGE_RULES=' # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage # reports to be created. (Default: # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the lcov instance. -# (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance. -# (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +# (Default: empty) # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml # instance. (Default: empty) # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore @@ -195,9 +363,7 @@ CODE_COVERAGE_RULES=' 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_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +CODE_COVERAGE_LCOV_OPTIONS ?= CODE_COVERAGE_GENHTML_OPTIONS ?= CODE_COVERAGE_IGNORE_PATTERN ?= @@ -506,7 +672,7 @@ See: http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html#ax_code_ # gnome-compiler-flags.m4 # -# serial 2 +# serial 4 # dnl GNOME_COMPILE_WARNINGS @@ -518,7 +684,7 @@ dnl the first argument to the macro, defaulting to 'yes'. dnl Additional warning/error flags can be passed as an optional second argument. dnl dnl For example: GNOME_COMPILE_WARNINGS([maximum],[-Werror=some-flag -Wfoobar]) -AC_DEFUN([GNOME_COMPILE_WARNINGS],[ +AU_DEFUN([GNOME_COMPILE_WARNINGS],[ dnl ****************************** dnl More compiler warnings dnl ****************************** @@ -555,6 +721,7 @@ AC_DEFUN([GNOME_COMPILE_WARNINGS],[ -Werror=format-security \ -Werror=format=2 \ -Werror=missing-include-dirs \ + -Werror=return-type \ " dnl Additional warning or error flags provided by the module author to @@ -625,11 +792,14 @@ AC_DEFUN([GNOME_COMPILE_WARNINGS],[ WARN_CFLAGS="$tested_warning_flags $complCFLAGS" AC_SUBST(WARN_CFLAGS) -]) +], +[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and +eliminate use of --enable-iso-c. +See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]]) dnl For C++, do basically the same thing. -AC_DEFUN([GNOME_CXX_WARNINGS],[ +AU_DEFUN([GNOME_CXX_WARNINGS],[ AC_ARG_ENABLE(cxx-warnings, AS_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@] [Turn on compiler warnings.]),, @@ -680,224 +850,12 @@ AC_DEFUN([GNOME_CXX_WARNINGS],[ WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS" AC_SUBST(WARN_CXXFLAGS) -]) - -# 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 - - -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR - - -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR - - -# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------------------------------------- -# Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])# PKG_CHECK_VAR +], +[[$0: This macro is deprecated. You should use AX_COMPILER_FLAGS instead and +eliminate use of --enable-iso-cxx. +See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]]) -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -909,10 +867,10 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl # 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.15' +[am__api_version='1.13' 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.15], [], +m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -928,14 +886,14 @@ m4_define([_AM_AUTOCONF_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.15])dnl +[AM_AUTOMAKE_VERSION([1.13.4])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 -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -980,14 +938,15 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` +[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` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1018,7 +977,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1209,7 +1168,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1285,7 +1244,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1294,12 +1253,6 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # 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. -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -1375,8 +1328,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. +# 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 @@ -1408,51 +1361,6 @@ dnl macro 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 - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <http://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -1461,6 +1369,7 @@ 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. @@ -1482,7 +1391,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1493,7 +1402,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then +if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -1503,7 +1412,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1524,7 +1433,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1572,9 +1481,41 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) +# Copyright (C) 1999-2013 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_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1613,7 +1554,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1642,54 +1583,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 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_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1924,7 +1818,7 @@ for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1943,7 +1837,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2024,7 +1918,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2084,7 +1978,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2112,7 +2006,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2131,7 +2025,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify diff --git a/config.guess b/config.guess index 1659250..1f5c50c 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2015-08-20' +timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2015-08-20' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches to <config-patches@gnu.org>. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,27 +168,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ - echo unknown)` + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown - ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -204,13 +197,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac - # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` - ;; - esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -221,13 +207,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -249,9 +235,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; - *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix - exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -596,9 +579,8 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -950,9 +932,6 @@ EOF crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; - e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1041,7 +1020,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} diff --git a/config.h.in b/config.h.in index b27c9c2..3645a34 100644 --- a/config.h.in +++ b/config.h.in @@ -37,6 +37,9 @@ */ #undef LT_OBJDIR +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + /* Define shared library extension */ #undef OS_EXT @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2015-08-20' +timestamp='2014-07-28' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ timestamp='2015-08-20' # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to <config-patches@gnu.org>. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +117,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,13 +255,12 @@ case $basic_machine in | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ - | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ + | epiphany \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -303,10 +302,9 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -314,7 +312,6 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -329,9 +326,6 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -377,13 +371,12 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ - | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ + | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -430,13 +423,12 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -444,7 +436,6 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ - | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -521,9 +512,6 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; - asmjs) - basic_machine=asmjs-unknown - ;; aux) basic_machine=m68k-apple os=-aux @@ -785,9 +773,6 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -1031,7 +1016,7 @@ case $basic_machine in ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown @@ -1379,7 +1364,7 @@ case $os in | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for pygobject 3.18.2. +# Generated by GNU Autoconf 2.69 for pygobject 3.19.2. # # 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.18.2' -PACKAGE_STRING='pygobject 3.18.2' +PACKAGE_VERSION='3.19.2' +PACKAGE_STRING='pygobject 3.19.2' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject' PACKAGE_URL='https://wiki.gnome.org/Projects/PyGObject/' @@ -643,7 +643,6 @@ CODE_COVERAGE_LDFLAGS CODE_COVERAGE_CFLAGS GENHTML LCOV -GCOV CODE_COVERAGE_ENABLED CODE_COVERAGE_ENABLED_FALSE CODE_COVERAGE_ENABLED_TRUE @@ -793,7 +792,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -832,7 +830,6 @@ enable_cairo with_common enable_compile_warnings enable_iso_c -with_gcov enable_code_coverage ' ac_precious_vars='build_alias @@ -896,7 +893,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1149,15 +1145,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1295,7 +1282,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1408,7 +1395,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.18.2 to adapt to many kinds of systems. +\`configure' configures pygobject 3.19.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1448,7 +1435,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1479,7 +1465,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pygobject 3.18.2:";; + short | recursive ) echo "Configuration of pygobject 3.19.2:";; esac cat <<\_ACEOF @@ -1520,7 +1506,6 @@ Optional Packages: few standard names such as "python3" or "python2" --without-common For package maintainers: do not install Python version independent files - --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). Some influential environment variables: CC C compiler command @@ -1618,7 +1603,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pygobject configure 3.18.2 +pygobject configure 3.19.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1896,7 +1881,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.18.2, which was +It was created by pygobject $as_me 3.19.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2255,9 +2240,9 @@ $as_echo "#define PYGOBJECT_MAJOR_VERSION 3" >>confdefs.h PYGOBJECT_MAJOR_VERSION=3 -$as_echo "#define PYGOBJECT_MINOR_VERSION 18" >>confdefs.h +$as_echo "#define PYGOBJECT_MINOR_VERSION 19" >>confdefs.h -PYGOBJECT_MINOR_VERSION=18 +PYGOBJECT_MINOR_VERSION=19 $as_echo "#define PYGOBJECT_MICRO_VERSION 2" >>confdefs.h @@ -2306,7 +2291,7 @@ else fi AM_BACKSLASH='\' -am__api_version='1.15' +am__api_version='1.13' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2507,8 +2492,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2527,7 +2512,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh+set}" != xset; then +if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2782,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='pygobject' - VERSION='3.18.2' + VERSION='3.19.2' cat >>confdefs.h <<_ACEOF @@ -2816,8 +2801,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -2833,48 +2818,6 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <http://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" @@ -3933,65 +3876,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -4840,8 +4724,7 @@ else ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + if test -n "$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 @@ -5239,6 +5122,10 @@ freebsd* | dragonfly*) fi ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -5277,11 +5164,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -6372,19 +6259,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac + LD="${LD-ld} -m elf_i386" ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -6403,10 +6283,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -8510,7 +8390,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -8988,9 +8868,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; esac ld_shlibs=yes @@ -9212,7 +9089,7 @@ _LT_EOF fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -9389,7 +9266,6 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -9843,7 +9719,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } link_all_deplibs=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -10680,6 +10556,17 @@ freebsd* | dragonfly*) esac ;; +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -10796,7 +10683,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -10845,10 +10732,14 @@ fi # before this can be enabled. hardcode_into_libs=yes + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -10860,18 +10751,6 @@ fi dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -12438,65 +12317,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -12625,6 +12445,131 @@ else fi +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + # option to specify python interpreter to use; this just sets $PYTHON, so that @@ -13899,16 +13844,16 @@ if test -n "$GI_CFLAGS"; then elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GI_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -13922,16 +13867,16 @@ if test -n "$GI_LIBS"; then elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GI_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -13954,18 +13899,18 @@ else fi if test $_pkg_short_errors_supported = yes; then GI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 " 2>&1` else GI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GI_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.38.0 - gobject-introspection-1.0 >= 1.39.0 + gobject-introspection-1.0 >= 1.46.0 ) were not met: $GI_PKG_ERRORS @@ -14363,6 +14308,7 @@ fi -Werror=format-security \ -Werror=format=2 \ -Werror=missing-include-dirs \ + -Werror=return-type \ " additional_flags="" @@ -14459,19 +14405,7 @@ $as_echo_n "checking for Gnome code coverage support... " >&6; } $as_echo "yes" >&6; } - - - # allow to override gcov location - -# Check whether --with-gcov was given. -if test "${with_gcov+set}" = set; then : - withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov -else - _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 $as_echo_n "checking whether to build with code coverage support... " >&6; } # Check whether --enable-code-coverage was given. if test "${enable_code_coverage+set}" = set; then : @@ -14480,7 +14414,6 @@ else enable_code_coverage=no fi - if test x$enable_code_coverage = xyes; then CODE_COVERAGE_ENABLED_TRUE= CODE_COVERAGE_ENABLED_FALSE='#' @@ -14496,104 +14429,6 @@ $as_echo "$enable_code_coverage" >&6; } if test "$enable_code_coverage" = "yes" ; then : - # check for gcov - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GCOV"; then - ac_cv_prog_GCOV="$GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -GCOV=$ac_cv_prog_GCOV -if test -n "$GCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 -$as_echo "$GCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_GCOV"; then - ac_ct_GCOV=$GCOV - # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_GCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_GCOV"; then - ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV -if test -n "$ac_ct_GCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 -$as_echo "$ac_ct_GCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_GCOV" = x; then - GCOV=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - GCOV=$ac_ct_GCOV - fi -else - GCOV="$ac_cv_prog_GCOV" -fi - - if test "X$GCOV" = "X:"; then : - as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 -fi - - if test "$GCC" = "no" ; then : as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 @@ -14739,11 +14574,8 @@ CODE_COVERAGE_RULES=' # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage # reports to be created. (Default: # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the lcov instance. -# (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance. -# (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +# (Default: empty) # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml # instance. (Default: empty) # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore @@ -14756,9 +14588,7 @@ CODE_COVERAGE_RULES=' 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_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) +CODE_COVERAGE_LCOV_OPTIONS ?= CODE_COVERAGE_GENHTML_OPTIONS ?= CODE_COVERAGE_IGNORE_PATTERN ?= @@ -14949,47 +14779,6 @@ $as_echo "$jh_has_option" >&6; } fi ;; esac - - case $host_os in - solaris*) - ;; - *) - -case " $CFLAGS " in -*[\ \ ]-std=c90[\ \ ]*) - ;; -*) - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -std=c90" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -std=c90" >&5 -$as_echo_n "checking whether $CC understands -std=c90... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - jh_has_option=yes -else - jh_has_option=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jh_has_option" >&5 -$as_echo "$jh_has_option" >&6; } - if test $jh_has_option = no; then - CFLAGS="$save_CFLAGS" - fi - ;; -esac - ;; - esac - fi CFLAGS="$CFLAGS $WARN_CFLAGS $CODE_COVERAGE_CFLAGS" @@ -15547,7 +15336,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.18.2, which was +This file was extended by pygobject $as_me 3.19.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15614,7 +15403,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.18.2 +pygobject config.status 3.19.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 9ce5c6f..eb8e5c2 100644 --- a/configure.ac +++ b/configure.ac @@ -17,12 +17,12 @@ m4_define(python3_min_ver, 3.1) dnl the pygobject version number m4_define(pygobject_major_version, 3) -m4_define(pygobject_minor_version, 18) +m4_define(pygobject_minor_version, 19) m4_define(pygobject_micro_version, 2) m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version) dnl versions of packages we require ... -m4_define(introspection_required_version, 1.39.0) +m4_define(introspection_required_version, 1.46.0) m4_define(py2cairo_required_version, 1.2.0) m4_define(py3cairo_required_version, 1.10.0) m4_define(glib_required_version, 2.38.0) @@ -241,15 +241,6 @@ if test "x$GCC" = "xyes"; then JH_ADD_CFLAG([-Werror=unused-variable]) JH_ADD_CFLAG([-fno-strict-aliasing]) JH_ADD_CFLAG([-Werror=declaration-after-statement]) - - case $host_os in - solaris*) - ;; - *) - JH_ADD_CFLAG([-std=c90]) - ;; - esac - fi CFLAGS="$CFLAGS $WARN_CFLAGS $CODE_COVERAGE_CFLAGS" @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # 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 diff --git a/examples/Makefile.in b/examples/Makefile.in index 9a0bd57..0e8efae 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,17 +14,7 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -88,6 +78,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -96,7 +87,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -121,7 +111,6 @@ am__can_run_installinfo = \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ @@ -158,7 +147,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -282,7 +270,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -307,6 +294,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -481,8 +469,6 @@ uninstall-am: mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am -.PRECIOUS: Makefile - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gi/Makefile.am b/gi/Makefile.am index 2e61af8..314fd41 100644 --- a/gi/Makefile.am +++ b/gi/Makefile.am @@ -78,6 +78,8 @@ _gi_la_SOURCES = \ pygi-source.h \ pygi-argument.c \ pygi-argument.h \ + pygi-resulttuple.c \ + pygi-resulttuple.h \ pygi-type.c \ pygi-type.h \ pygi-boxed.c \ diff --git a/gi/Makefile.in b/gi/Makefile.in index db3afe0..541c6d6 100644 --- a/gi/Makefile.in +++ b/gi/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -16,17 +16,7 @@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -93,6 +83,8 @@ host_triplet = @host@ @ENABLE_CAIRO_TRUE@am__append_2 = _gi_cairo.la subdir = gi +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp $(am__pkginclude_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -101,8 +93,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__pkginclude_HEADERS_DIST) \ - $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -149,12 +139,13 @@ am__gi_la_OBJECTS = _gi_la-gobjectmodule.lo _gi_la-pygboxed.lo \ _gi_la-pygi-repository.lo _gi_la-pygi-info.lo \ _gi_la-pygi-foreign.lo _gi_la-pygi-struct.lo \ _gi_la-pygi-source.lo _gi_la-pygi-argument.lo \ - _gi_la-pygi-type.lo _gi_la-pygi-boxed.lo \ - _gi_la-pygi-closure.lo _gi_la-pygi-ccallback.lo \ - _gi_la-pygi-property.lo _gi_la-pygi-signal-closure.lo \ - _gi_la-pygi-invoke.lo _gi_la-pygi-cache.lo \ - _gi_la-pygi-marshal-cleanup.lo _gi_la-pygi-basictype.lo \ - _gi_la-pygi-list.lo _gi_la-pygi-array.lo _gi_la-pygi-error.lo \ + _gi_la-pygi-resulttuple.lo _gi_la-pygi-type.lo \ + _gi_la-pygi-boxed.lo _gi_la-pygi-closure.lo \ + _gi_la-pygi-ccallback.lo _gi_la-pygi-property.lo \ + _gi_la-pygi-signal-closure.lo _gi_la-pygi-invoke.lo \ + _gi_la-pygi-cache.lo _gi_la-pygi-marshal-cleanup.lo \ + _gi_la-pygi-basictype.lo _gi_la-pygi-list.lo \ + _gi_la-pygi-array.lo _gi_la-pygi-error.lo \ _gi_la-pygi-object.lo _gi_la-pygi-value.lo \ _gi_la-pygi-enum-marshal.lo _gi_la-pygi-struct-marshal.lo \ _gi_la-pygi-hashtable.lo @@ -254,7 +245,6 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -317,7 +307,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -441,7 +430,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -516,6 +504,8 @@ _gi_la_SOURCES = \ pygi-source.h \ pygi-argument.c \ pygi-argument.h \ + pygi-resulttuple.c \ + pygi-resulttuple.h \ pygi-type.c \ pygi-type.h \ pygi-boxed.c \ @@ -612,6 +602,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gi/Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -702,6 +693,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-repository.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-resulttuple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-signal-closure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-source.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-struct-marshal.Plo@am__quote@ @@ -723,14 +715,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -886,6 +878,13 @@ _gi_la-pygi-argument.lo: pygi-argument.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-argument.lo `test -f 'pygi-argument.c' || echo '$(srcdir)/'`pygi-argument.c +_gi_la-pygi-resulttuple.lo: pygi-resulttuple.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-resulttuple.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-resulttuple.Tpo -c -o _gi_la-pygi-resulttuple.lo `test -f 'pygi-resulttuple.c' || echo '$(srcdir)/'`pygi-resulttuple.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-resulttuple.Tpo $(DEPDIR)/_gi_la-pygi-resulttuple.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pygi-resulttuple.c' object='_gi_la-pygi-resulttuple.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-resulttuple.lo `test -f 'pygi-resulttuple.c' || echo '$(srcdir)/'`pygi-resulttuple.c + _gi_la-pygi-type.lo: pygi-type.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-type.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-type.Tpo -c -o _gi_la-pygi-type.lo `test -f 'pygi-type.c' || echo '$(srcdir)/'`pygi-type.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-type.Tpo $(DEPDIR)/_gi_la-pygi-type.Plo @@ -1329,8 +1328,6 @@ uninstall-am: uninstall-pkgincludeHEADERS uninstall-pygiLTLIBRARIES tags tags-am uninstall uninstall-am \ uninstall-pkgincludeHEADERS uninstall-pygiLTLIBRARIES -.PRECIOUS: Makefile - # This is to ensure we have a symlink to the .so in the # build directory, which the Python interpreter can load diff --git a/gi/_gobject/Makefile.in b/gi/_gobject/Makefile.in index 881aeb3..fa96833 100644 --- a/gi/_gobject/Makefile.in +++ b/gi/_gobject/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,17 +14,7 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -88,6 +78,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = gi/_gobject +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(pygobject_PYTHON) $(top_srcdir)/py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -96,8 +88,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(pygobject_PYTHON) \ - $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -154,7 +144,6 @@ am__pep3147_tweak = \ sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|' py_compile = $(top_srcdir)/py-compile am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ @@ -191,7 +180,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -315,7 +303,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -345,6 +332,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gi/_gobject/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gi/_gobject/Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -572,8 +560,6 @@ uninstall-am: uninstall-pygobjectPYTHON mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-pygobjectPYTHON -.PRECIOUS: Makefile - # if we build in a separate tree, we need to symlink the *.py files from the # source tree; Python does not accept the extensions and modules in different diff --git a/gi/_signalhelper.py b/gi/_signalhelper.py index 47e6e2f..30ff541 100644 --- a/gi/_signalhelper.py +++ b/gi/_signalhelper.py @@ -18,7 +18,6 @@ # License along with this library; if not, see <http://www.gnu.org/licenses/>. import sys -import inspect from ._gi import _gobject @@ -220,6 +219,8 @@ def get_signal_annotations(func): return_type = None if hasattr(func, '__annotations__'): + # import inspect only when needed because it takes ~10 msec to load + import inspect spec = inspect.getfullargspec(func) arg_types = tuple(spec.annotations[arg] for arg in spec.args if arg in spec.annotations) diff --git a/gi/gimodule.c b/gi/gimodule.c index 74bf7cd..44f0901 100644 --- a/gi/gimodule.c +++ b/gi/gimodule.c @@ -36,6 +36,33 @@ PyObject *PyGIWarning; PyObject *PyGIDeprecationWarning; PyObject *_PyGIDefaultArgPlaceholder; + +/* Returns a new flag/enum type or %NULL */ +static PyObject * +flags_enum_from_gtype (GType g_type, + PyObject * (add_func) (PyObject *, const char *, + const char *, GType)) +{ + PyObject *new_type; + GIRepository *repository; + GIBaseInfo *info; + const gchar *type_name; + + repository = g_irepository_get_default (); + info = g_irepository_find_by_gtype (repository, g_type); + if (info != NULL) { + type_name = g_base_info_get_name (info); + new_type = add_func (NULL, type_name, NULL, g_type); + g_base_info_unref (info); + } else { + type_name = g_type_name (g_type); + new_type = add_func (NULL, type_name, NULL, g_type); + } + + return new_type; +} + + static PyObject * _wrap_pyg_enum_add (PyObject *self, PyObject *args, @@ -56,7 +83,7 @@ _wrap_pyg_enum_add (PyObject *self, return NULL; } - return pyg_enum_add (NULL, g_type_name (g_type), NULL, g_type); + return flags_enum_from_gtype (g_type, pyg_enum_add); } static PyObject * @@ -152,7 +179,7 @@ _wrap_pyg_enum_register_new_gtype_and_add (PyObject *self, } g_free (full_name); - return pyg_enum_add (NULL, g_type_name (g_type), NULL, g_type); + return pyg_enum_add (NULL, type_name, NULL, g_type); } static PyObject * @@ -175,7 +202,7 @@ _wrap_pyg_flags_add (PyObject *self, return NULL; } - return pyg_flags_add (NULL, g_type_name (g_type), NULL, g_type); + return flags_enum_from_gtype (g_type, pyg_flags_add); } static PyObject * @@ -271,7 +298,7 @@ _wrap_pyg_flags_register_new_gtype_and_add (PyObject *self, } g_free (full_name); - return pyg_flags_add (NULL, g_type_name (g_type), NULL, g_type); + return pyg_flags_add (NULL, type_name, NULL, g_type); } static void @@ -637,6 +664,7 @@ PYGLIB_MODULE_START(_gi, "_gi") _pygi_struct_register_types (module); _pygi_boxed_register_types (module); _pygi_ccallback_register_types (module); + pygi_resulttuple_register_types (module); PyGIWarning = PyErr_NewException ("gi.PyGIWarning", PyExc_Warning, NULL); diff --git a/gi/gobjectmodule.c b/gi/gobjectmodule.c index 33da181..726216d 100644 --- a/gi/gobjectmodule.c +++ b/gi/gobjectmodule.c @@ -22,6 +22,7 @@ # include <config.h> #endif +#include <Python.h> #include <gobject/gvaluecollector.h> #include <girepository.h> #include <pyglib.h> diff --git a/gi/importer.py b/gi/importer.py index 22c272b..5060584 100644 --- a/gi/importer.py +++ b/gi/importer.py @@ -24,10 +24,11 @@ from __future__ import absolute_import import sys import warnings +import importlib from contextlib import contextmanager import gi -from ._gi import Repository +from ._gi import Repository, RepositoryError from ._gi import PyGIWarning from .module import get_introspection_module from .overrides import load_overrides @@ -93,7 +94,11 @@ class DynamicImporter(object): if path != self.path: return - if repository.enumerate_versions(namespace): + # is_registered() is faster than enumerate_versions() and + # in the common case of a namespace getting loaded before its + # dependencies, is_registered() returns True for all dependencies. + if repository.is_registered(namespace) or \ + repository.enumerate_versions(namespace): return self else: raise ImportError('cannot import name %s, ' @@ -111,7 +116,15 @@ class DynamicImporter(object): else: stacklevel = 4 with _check_require_version(namespace, stacklevel=stacklevel): - introspection_module = get_introspection_module(namespace) + try: + introspection_module = get_introspection_module(namespace) + except RepositoryError as e: + raise ImportError(e) + # Import all dependencies first so their init functions + # (gdk_init, ..) in overrides get called. + # https://bugzilla.gnome.org/show_bug.cgi?id=656314 + for dep in repository.get_immediate_dependencies(namespace): + importlib.import_module('gi.repository.' + dep.split("-")[0]) dynamic_module = load_overrides(introspection_module) dynamic_module.__file__ = '<%s>' % fullname diff --git a/gi/module.py b/gi/module.py index f27d516..fd8f508 100644 --- a/gi/module.py +++ b/gi/module.py @@ -117,6 +117,8 @@ class IntrospectionModule(object): These members are then cached on this introspection module. """ def __init__(self, namespace, version=None): + """Might raise gi._gi.RepositoryError""" + repository.require(namespace, version) self._namespace = namespace self._version = version @@ -263,6 +265,8 @@ def get_introspection_module(namespace): """ :Returns: An object directly wrapping the gi module without overrides. + + Might raise gi._gi.RepositoryError """ if namespace in _introspection_modules: return _introspection_modules[namespace] diff --git a/gi/overrides/Makefile.in b/gi/overrides/Makefile.in index e5baa02..d683f56 100644 --- a/gi/overrides/Makefile.in +++ b/gi/overrides/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,17 +14,7 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -88,6 +78,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = gi/overrides +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(pygioverrides_PYTHON) $(top_srcdir)/py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -96,8 +88,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(pygioverrides_PYTHON) \ - $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -154,7 +144,6 @@ am__pep3147_tweak = \ sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|' py_compile = $(top_srcdir)/py-compile am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ @@ -191,7 +180,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -315,7 +303,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -351,6 +338,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gi/overrides/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gi/overrides/Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -578,8 +566,6 @@ uninstall-am: uninstall-pygioverridesPYTHON mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-pygioverridesPYTHON -.PRECIOUS: Makefile - # if we build in a separate tree, we need to symlink the *.py files from the # source tree; Python does not accept the extensions and modules in different diff --git a/gi/pygboxed.c b/gi/pygboxed.c index 9faa652..30ab423 100644 --- a/gi/pygboxed.c +++ b/gi/pygboxed.c @@ -68,13 +68,34 @@ pyg_boxed_hash(PyGBoxed *self) } static PyObject * -pyg_boxed_repr(PyGBoxed *self) +pyg_boxed_repr(PyGBoxed *boxed) { - gchar buf[128]; + PyObject *module, *repr, *self = (PyObject *)boxed; + gchar *module_str, *namespace; - g_snprintf(buf, sizeof(buf), "<%s at 0x%lx>", g_type_name(self->gtype), - (long)pyg_boxed_get_ptr (self)); - return PYGLIB_PyUnicode_FromString(buf); + module = PyObject_GetAttrString (self, "__module__"); + if (module == NULL) + return NULL; + + if (!PYGLIB_PyUnicode_Check (module)) { + Py_DECREF (module); + return NULL; + } + + module_str = PYGLIB_PyUnicode_AsString (module); + namespace = g_strrstr (module_str, "."); + if (namespace == NULL) { + namespace = module_str; + } else { + namespace += 1; + } + + repr = PYGLIB_PyUnicode_FromFormat ("<%s.%s object at %p (%s at %p)>", + namespace, Py_TYPE (self)->tp_name, + self, g_type_name (boxed->gtype), + pyg_boxed_get_ptr (boxed)); + Py_DECREF (module); + return repr; } static int diff --git a/gi/pygenum.c b/gi/pygenum.c index 053518f..fe78fb9 100644 --- a/gi/pygenum.c +++ b/gi/pygenum.c @@ -71,29 +71,50 @@ pyg_enum_richcompare(PyGEnum *self, PyObject *other, int op) static PyObject * pyg_enum_repr(PyGEnum *self) { - GEnumClass *enum_class; - const char *value; - guint index; - static char tmp[256]; - long l; + PyObject *module; + GEnumClass *enum_class; + const char *value; + guint index; + char *namespace, *module_str; + static char tmp[256]; + long l; + + module = PyObject_GetAttrString ((PyObject *)self, "__module__"); + if (module == NULL) + return NULL; - enum_class = g_type_class_ref(self->gtype); - g_assert(G_IS_ENUM_CLASS(enum_class)); + if (!PYGLIB_PyUnicode_Check (module)) { + Py_DECREF (module); + return NULL; + } - l = PYGLIB_PyLong_AS_LONG(self); - for (index = 0; index < enum_class->n_values; index++) - if (l == enum_class->values[index].value) - break; + enum_class = g_type_class_ref(self->gtype); + g_assert(G_IS_ENUM_CLASS(enum_class)); - value = enum_class->values[index].value_name; - if (value) - sprintf(tmp, "<enum %s of type %s>", value, g_type_name(self->gtype)); - else - sprintf(tmp, "<enum %ld of type %s>", PYGLIB_PyLong_AS_LONG(self), g_type_name(self->gtype)); + l = PYGLIB_PyLong_AS_LONG(self); + for (index = 0; index < enum_class->n_values; index++) + if (l == enum_class->values[index].value) + break; - g_type_class_unref(enum_class); + module_str = PYGLIB_PyUnicode_AsString (module); + namespace = g_strrstr (module_str, "."); + if (namespace == NULL) { + namespace = module_str; + } else { + namespace += 1; + } + + value = enum_class->values[index].value_name; + if (value) + sprintf(tmp, "<enum %s of type %s.%s>", value, + namespace, Py_TYPE (self)->tp_name); + else + sprintf(tmp, "<enum %ld of type %s.%s>", PYGLIB_PyLong_AS_LONG(self), + namespace, Py_TYPE (self)->tp_name); + Py_DECREF (module); + g_type_class_unref(enum_class); - return PYGLIB_PyUnicode_FromString(tmp); + return PYGLIB_PyUnicode_FromString(tmp); } static PyObject * diff --git a/gi/pygflags.c b/gi/pygflags.c index a7df8ce..ce146ae 100644 --- a/gi/pygflags.c +++ b/gi/pygflags.c @@ -105,18 +105,37 @@ generate_repr(GType gtype, guint value) static PyObject * pyg_flags_repr(PyGFlags *self) { - char *tmp, *retval; - PyObject *pyretval; + char *tmp, *retval, *module_str, *namespace; + PyObject *pyretval, *module; tmp = generate_repr(self->gtype, PYGLIB_PyLong_AsUnsignedLong(self)); + module = PyObject_GetAttrString ((PyObject *)self, "__module__"); + if (module == NULL) + return NULL; + + if (!PYGLIB_PyUnicode_Check (module)) { + Py_DECREF (module); + return NULL; + } + + module_str = PYGLIB_PyUnicode_AsString (module); + namespace = g_strrstr (module_str, "."); + if (namespace == NULL) { + namespace = module_str; + } else { + namespace += 1; + } + if (tmp) - retval = g_strdup_printf("<flags %s of type %s>", tmp, - g_type_name(self->gtype)); + retval = g_strdup_printf("<flags %s of type %s.%s>", tmp, + namespace, Py_TYPE (self)->tp_name); else - retval = g_strdup_printf("<flags %ld of type %s>", PYGLIB_PyLong_AsUnsignedLong(self), - g_type_name(self->gtype)); + retval = g_strdup_printf("<flags %ld of type %s.%s>", + PYGLIB_PyLong_AsUnsignedLong (self), + namespace, Py_TYPE (self)->tp_name); g_free(tmp); + Py_DECREF (module); pyretval = PYGLIB_PyUnicode_FromString(retval); g_free(retval); diff --git a/gi/pygi-array.c b/gi/pygi-array.c index 121992b..5c34467 100644 --- a/gi/pygi-array.c +++ b/gi/pygi-array.c @@ -18,8 +18,8 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include <glib.h> #include <Python.h> +#include <glib.h> #include <pyglib-python-compat.h> #include "pygi-array.h" @@ -386,7 +386,7 @@ array_success: PyGIArgCache *child_cache = _pygi_callable_cache_get_arg (callable_cache, array_cache->len_arg_index); - if (!gi_argument_from_py_ssize_t (&state->arg_values[child_cache->c_arg_index], + if (!gi_argument_from_py_ssize_t (&state->args[child_cache->c_arg_index].arg_value, length, child_cache->type_tag)) { goto err; @@ -530,7 +530,7 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state, len = g_strv_length ((gchar **)arg->v_pointer); } } else { - GIArgument *len_arg = &state->arg_values[array_cache->len_arg_index]; + GIArgument *len_arg = &state->args[array_cache->len_arg_index].arg_value; PyGIArgCache *arg_cache = _pygi_callable_cache_get_arg (callable_cache, array_cache->len_arg_index); @@ -686,7 +686,7 @@ _wrap_c_array (PyGIInvokeState *state, } else if (array_cache->is_zero_terminated) { len = g_strv_length ((gchar **)data); } else if (array_cache->len_arg_index >= 0) { - GIArgument *len_arg = &state->arg_values[array_cache->len_arg_index]; + GIArgument *len_arg = &state->args[array_cache->len_arg_index].arg_value; len = len_arg->v_long; } diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c index ca24517..62b0961 100644 --- a/gi/pygi-cache.c +++ b/gi/pygi-cache.c @@ -18,6 +18,7 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#include <Python.h> #include <girepository.h> #include "pyglib.h" @@ -465,6 +466,9 @@ _callable_cache_generate_args_cache_real (PyGICallableCache *callable_cache, PyGIArgCache *return_cache; PyGIDirection return_direction; gssize last_explicit_arg_index; + PyObject *tuple_names; + GSList *arg_cache_item; + PyTypeObject* resulttuple_type; /* Return arguments are always considered out */ return_direction = _pygi_get_direction (callable_cache, GI_DIRECTION_OUT); @@ -489,6 +493,8 @@ _callable_cache_generate_args_cache_real (PyGICallableCache *callable_cache, callable_cache->return_cache = return_cache; g_base_info_unref (return_info); + callable_cache->user_data_index = -1; + for (i = 0, arg_index = callable_cache->args_offset; arg_index < _pygi_callable_cache_args_len (callable_cache); i++, arg_index++) { @@ -498,7 +504,9 @@ _callable_cache_generate_args_cache_real (PyGICallableCache *callable_cache, arg_info = g_callable_info_get_arg (callable_info, i); + /* This only happens when dealing with callbacks */ if (g_arg_info_get_closure (arg_info) == i) { + callable_cache->user_data_index = i; arg_cache = pygi_arg_cache_alloc (); _pygi_callable_cache_set_arg (callable_cache, arg_index, arg_cache); @@ -637,6 +645,36 @@ _callable_cache_generate_args_cache_real (PyGICallableCache *callable_cache, } } + if (!return_cache->is_skipped && return_cache->type_tag != GI_TYPE_TAG_VOID) { + callable_cache->has_return = TRUE; + } + + tuple_names = PyList_New (0); + if (callable_cache->has_return) { + PyList_Append (tuple_names, Py_None); + } + + arg_cache_item = callable_cache->to_py_args; + while (arg_cache_item) { + const gchar *arg_name = ((PyGIArgCache *)arg_cache_item->data)->arg_name; + PyObject *arg_string = PYGLIB_PyUnicode_FromString (arg_name); + PyList_Append (tuple_names, arg_string); + Py_DECREF (arg_string); + arg_cache_item = arg_cache_item->next; + } + + /* No need to create a tuple type if there aren't multiple values */ + if (PyList_Size (tuple_names) > 1) { + resulttuple_type = pygi_resulttuple_new_type (tuple_names); + if (resulttuple_type == NULL) { + Py_DECREF (tuple_names); + return FALSE; + } else { + callable_cache->resulttuple_type = resulttuple_type; + } + } + Py_DECREF (tuple_names); + return TRUE; } @@ -647,6 +685,7 @@ _callable_cache_deinit_real (PyGICallableCache *cache) g_slist_free (cache->arg_name_list); g_hash_table_destroy (cache->arg_name_hash); g_ptr_array_unref (cache->args_cache); + Py_XDECREF (cache->resulttuple_type); if (cache->return_cache != NULL) pygi_arg_cache_free (cache->return_cache); @@ -1116,6 +1155,25 @@ pygi_closure_cache_new (GICallableInfo *info) len_arg_cache->meta_type = PYGI_META_ARG_TYPE_PARENT; } + /* Prevent guessing multiple user data arguments. + * This is required because some versions of GI + * do not recognize user_data/data arguments correctly. + */ + if (callable_cache->user_data_index == -1) { + for (i = 0; i < _pygi_callable_cache_args_len (callable_cache); i++) { + PyGIArgCache *arg_cache; + + arg_cache = g_ptr_array_index (callable_cache->args_cache, i); + + if (arg_cache->direction == PYGI_DIRECTION_TO_PYTHON && + arg_cache->type_tag == GI_TYPE_TAG_VOID && + arg_cache->is_pointer) { + + callable_cache->user_data_index = i; + break; + } + } + } + return closure_cache; } - diff --git a/gi/pygi-cache.h b/gi/pygi-cache.h index 098f3f1..4dfabd8 100644 --- a/gi/pygi-cache.h +++ b/gi/pygi-cache.h @@ -170,6 +170,9 @@ struct _PyGICallableCache GHashTable *arg_name_hash; gboolean throws; + /* Index of user_data arg passed to a callable. */ + gssize user_data_index; + /* Index of user_data arg that can eat variable args passed to a callable. */ gssize user_data_varargs_index; @@ -180,6 +183,12 @@ struct _PyGICallableCache * This is used for the length of PyGIInvokeState.out_values */ gssize n_to_py_args; + /* If the callable return value gets used */ + gboolean has_return; + + /* The type used for returning multiple values or NULL */ + PyTypeObject* resulttuple_type; + /* Number of out args for g_function_info_invoke that will be skipped * when marshaling to Python due to them being implicitly available * (list/array length). diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c index 65f7e55..6a68e2b 100644 --- a/gi/pygi-closure.c +++ b/gi/pygi-closure.c @@ -19,6 +19,7 @@ #include "pygi-private.h" #include "pygi-closure.h" +#include "pygi-error.h" #include "pygi-marshal-cleanup.h" @@ -42,7 +43,7 @@ _pygi_closure_assign_pyobj_to_retval (gpointer retval, GIArgument *arg, PyGIArgCache *arg_cache) { - if (PyErr_Occurred () || retval == NULL) + if (retval == NULL) return; switch (arg_cache->type_tag) { @@ -112,14 +113,6 @@ _pygi_closure_assign_pyobj_to_retval (gpointer retval, } static void -_pygi_closure_clear_retval (PyGICallableCache *cache, gpointer retval) -{ - if (cache->return_cache->type_tag != GI_TYPE_TAG_VOID) { - *((ffi_arg *) retval) = 0; - } -} - -static void _pygi_closure_assign_pyobj_to_out_argument (gpointer out_arg, GIArgument *arg, PyGIArgCache *arg_cache) @@ -203,96 +196,101 @@ _pygi_closure_assign_pyobj_to_out_argument (gpointer out_arg, } } -static GIArgument * -_pygi_closure_convert_ffi_arguments (PyGICallableCache *cache, void **args) +static void +_pygi_closure_convert_ffi_arguments (PyGIInvokeArgState *state, + PyGICallableCache *cache, + void **args) { - gint num_args, i; - GIArgument *g_args; + gint i; - num_args = _pygi_callable_cache_args_len (cache); - g_args = g_new0 (GIArgument, num_args); - - for (i = 0; i < num_args; i++) { + for (i = 0; i < _pygi_callable_cache_args_len (cache); i++) { PyGIArgCache *arg_cache = g_ptr_array_index (cache->args_cache, i); if (arg_cache->direction & PYGI_DIRECTION_FROM_PYTHON) { - g_args[i].v_pointer = * (gpointer *) args[i]; - } else { - switch (arg_cache->type_tag) { - case GI_TYPE_TAG_BOOLEAN: - g_args[i].v_boolean = * (gboolean *) args[i]; - break; - case GI_TYPE_TAG_INT8: - g_args[i].v_int8 = * (gint8 *) args[i]; - break; - case GI_TYPE_TAG_UINT8: - g_args[i].v_uint8 = * (guint8 *) args[i]; - break; - case GI_TYPE_TAG_INT16: - g_args[i].v_int16 = * (gint16 *) args[i]; - break; - case GI_TYPE_TAG_UINT16: - g_args[i].v_uint16 = * (guint16 *) args[i]; - break; - case GI_TYPE_TAG_INT32: - g_args[i].v_int32 = * (gint32 *) args[i]; - break; - case GI_TYPE_TAG_UINT32: - g_args[i].v_uint32 = * (guint32 *) args[i]; - break; - case GI_TYPE_TAG_INT64: - g_args[i].v_int64 = * (glong *) args[i]; - break; - case GI_TYPE_TAG_UINT64: - g_args[i].v_uint64 = * (glong *) args[i]; - break; - case GI_TYPE_TAG_FLOAT: - g_args[i].v_float = * (gfloat *) args[i]; - break; - case GI_TYPE_TAG_DOUBLE: - g_args[i].v_double = * (gdouble *) args[i]; - break; - case GI_TYPE_TAG_UTF8: - g_args[i].v_string = * (gchar **) args[i]; - break; - case GI_TYPE_TAG_INTERFACE: - { - GIBaseInfo *interface; - GIInfoType interface_type; - - interface = ((PyGIInterfaceCache *) arg_cache)->interface_info; - interface_type = g_base_info_get_type (interface); - - if (interface_type == GI_INFO_TYPE_OBJECT || - interface_type == GI_INFO_TYPE_INTERFACE) { - g_args[i].v_pointer = * (gpointer *) args[i]; - break; - } else if (interface_type == GI_INFO_TYPE_ENUM || - interface_type == GI_INFO_TYPE_FLAGS) { - g_args[i].v_uint = * (guint *) args[i]; - break; - } else if (interface_type == GI_INFO_TYPE_STRUCT || - interface_type == GI_INFO_TYPE_CALLBACK) { - g_args[i].v_pointer = * (gpointer *) args[i]; - break; - } + state[i].arg_value.v_pointer = * (gpointer *) args[i]; + + if (state[i].arg_value.v_pointer == NULL) + continue; + + state[i].arg_pointer.v_pointer = state[i].arg_value.v_pointer; + state[i].arg_value = *(GIArgument *) state[i].arg_value.v_pointer; + continue; + } + + switch (arg_cache->type_tag) { + case GI_TYPE_TAG_BOOLEAN: + state[i].arg_value.v_boolean = * (gboolean *) args[i]; + break; + case GI_TYPE_TAG_INT8: + state[i].arg_value.v_int8 = * (gint8 *) args[i]; + break; + case GI_TYPE_TAG_UINT8: + state[i].arg_value.v_uint8 = * (guint8 *) args[i]; + break; + case GI_TYPE_TAG_INT16: + state[i].arg_value.v_int16 = * (gint16 *) args[i]; + break; + case GI_TYPE_TAG_UINT16: + state[i].arg_value.v_uint16 = * (guint16 *) args[i]; + break; + case GI_TYPE_TAG_INT32: + state[i].arg_value.v_int32 = * (gint32 *) args[i]; + break; + case GI_TYPE_TAG_UINT32: + state[i].arg_value.v_uint32 = * (guint32 *) args[i]; + break; + case GI_TYPE_TAG_INT64: + state[i].arg_value.v_int64 = * (glong *) args[i]; + break; + case GI_TYPE_TAG_UINT64: + state[i].arg_value.v_uint64 = * (glong *) args[i]; + break; + case GI_TYPE_TAG_FLOAT: + state[i].arg_value.v_float = * (gfloat *) args[i]; + break; + case GI_TYPE_TAG_DOUBLE: + state[i].arg_value.v_double = * (gdouble *) args[i]; + break; + case GI_TYPE_TAG_UTF8: + state[i].arg_value.v_string = * (gchar **) args[i]; + break; + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *interface; + GIInfoType interface_type; + + interface = ((PyGIInterfaceCache *) arg_cache)->interface_info; + interface_type = g_base_info_get_type (interface); + + if (interface_type == GI_INFO_TYPE_ENUM) { + state[i].arg_value.v_int = * (gint *) args[i]; + } else if (interface_type == GI_INFO_TYPE_FLAGS) { + state[i].arg_value.v_uint = * (guint *) args[i]; + } else { + state[i].arg_value.v_pointer = * (gpointer *) args[i]; } - case GI_TYPE_TAG_ERROR: - case GI_TYPE_TAG_GHASH: - case GI_TYPE_TAG_GLIST: - case GI_TYPE_TAG_GSLIST: - case GI_TYPE_TAG_ARRAY: - case GI_TYPE_TAG_VOID: - g_args[i].v_pointer = * (gpointer *) args[i]; - break; - default: - g_warning ("Unhandled type tag %s", - g_type_tag_to_string (arg_cache->type_tag)); - g_args[i].v_pointer = 0; + break; } + case GI_TYPE_TAG_ERROR: + case GI_TYPE_TAG_GHASH: + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + case GI_TYPE_TAG_ARRAY: + case GI_TYPE_TAG_VOID: + state[i].arg_value.v_pointer = * (gpointer *) args[i]; + break; + default: + g_warning ("Unhandled type tag %s", + g_type_tag_to_string (arg_cache->type_tag)); + state[i].arg_value.v_pointer = 0; } } - return g_args; + + if (cache->throws) { + gssize error_index = _pygi_callable_cache_args_len (cache); + + state[error_index].arg_value.v_pointer = * (gpointer *) args[error_index]; + } } static gboolean @@ -303,57 +301,36 @@ _invoke_state_init_from_cache (PyGIInvokeState *state, PyGICallableCache *cache = (PyGICallableCache *) closure_cache; state->n_args = _pygi_callable_cache_args_len (cache); - - state->py_in_args = PyTuple_New (state->n_args); - if (state->py_in_args == NULL) { - PyErr_NoMemory (); - return FALSE; - } state->n_py_in_args = state->n_args; + /* Increment after setting the number of Python input args */ if (cache->throws) { state->n_args++; } - state->args = NULL; - - state->args_cleanup_data = g_slice_alloc0 (state->n_args * sizeof (gpointer)); - if (state->args_cleanup_data == NULL && state->n_args != 0) { - PyErr_NoMemory(); - return FALSE; - } - - state->arg_values = _pygi_closure_convert_ffi_arguments (cache, args); - if (state->arg_values == NULL && state->n_args != 0) { - PyErr_NoMemory (); - return FALSE; - } - - state->arg_pointers = g_slice_alloc0 (state->n_args * sizeof(GIArgument)); - if (state->arg_pointers == NULL && state->n_args != 0) { + state->py_in_args = PyTuple_New (state->n_py_in_args); + if (state->py_in_args == NULL) { PyErr_NoMemory (); return FALSE; } + state->args = NULL; state->error = NULL; - if (cache->throws) { - gssize error_index = state->n_args - 1; - - state->arg_pointers[error_index].v_pointer = &state->error; - state->arg_values[error_index].v_pointer = state->error; + if (!_pygi_invoke_arg_state_init (state)) { + return FALSE; } + state->ffi_args = NULL; + + _pygi_closure_convert_ffi_arguments (state->args, cache, args); return TRUE; } static void _invoke_state_clear (PyGIInvokeState *state) { - g_slice_free1 (state->n_args * sizeof(gpointer), state->args_cleanup_data); - g_free (state->arg_values); - g_slice_free1 (state->n_args * sizeof(GIArgument), state->arg_pointers); - + _pygi_invoke_arg_state_free (state); Py_XDECREF (state->py_in_args); } @@ -365,32 +342,15 @@ _pygi_closure_convert_arguments (PyGIInvokeState *state, gssize n_in_args = 0; gssize i; - /* Must set all the arg_pointers and update the arg_values before - * marshaling otherwise out args wouldn't have the correct values. - */ - for (i = 0; i < _pygi_callable_cache_args_len (cache); i++) { - PyGIArgCache *arg_cache = g_ptr_array_index (cache->args_cache, i); - - if (arg_cache->direction & PYGI_DIRECTION_FROM_PYTHON && - state->arg_values[i].v_pointer) { - state->arg_pointers[i].v_pointer = state->arg_values[i].v_pointer; - state->arg_values[i] = *(GIArgument *) state->arg_values[i].v_pointer; - } - } - for (i = 0; i < _pygi_callable_cache_args_len (cache); i++) { PyGIArgCache *arg_cache; - PyGIDirection direction; arg_cache = g_ptr_array_index (cache->args_cache, i); - direction = arg_cache->direction; - if (direction & PYGI_DIRECTION_TO_PYTHON) { + if (arg_cache->direction & PYGI_DIRECTION_TO_PYTHON) { PyObject *value; - if (direction == PYGI_DIRECTION_TO_PYTHON && - arg_cache->type_tag == GI_TYPE_TAG_VOID && - arg_cache->is_pointer) { + if (cache->user_data_index == i) { if (state->user_data == NULL) { /* user_data can be NULL for connect functions which don't accept * user_data or as the default for user_data in the middle of function @@ -428,7 +388,7 @@ _pygi_closure_convert_arguments (PyGIInvokeState *state, value = arg_cache->to_py_marshaller (state, cache, arg_cache, - &state->arg_values[i]); + &state->args[i].arg_value); if (value == NULL) { pygi_marshal_cleanup_args_to_py_parameter_fail (state, @@ -471,7 +431,7 @@ _pygi_closure_set_out_arguments (PyGIInvokeState *state, cache->return_cache, item, &state->return_arg, - &state->args_cleanup_data[0]); + &state->args[0].arg_cleanup_data); if (!success) { pygi_marshal_cleanup_args_return_fail (state, @@ -491,8 +451,7 @@ _pygi_closure_set_out_arguments (PyGIInvokeState *state, PyObject *item = py_retval; if (arg_cache->type_tag == GI_TYPE_TAG_ERROR) { - /* TODO: check if an exception has been set and convert it to a GError */ - * (GError **) state->arg_pointers[i].v_pointer = NULL; + * (GError **) state->args[i].arg_pointer.v_pointer = NULL; continue; } @@ -509,8 +468,8 @@ _pygi_closure_set_out_arguments (PyGIInvokeState *state, cache, arg_cache, item, - &state->arg_values[i], - &state->args_cleanup_data[i_py_retval]); + &state->args[i].arg_value, + &state->args[i_py_retval].arg_cleanup_data); if (!success) { pygi_marshal_cleanup_args_to_py_parameter_fail (state, @@ -519,8 +478,8 @@ _pygi_closure_set_out_arguments (PyGIInvokeState *state, return FALSE; } - _pygi_closure_assign_pyobj_to_out_argument (state->arg_pointers[i].v_pointer, - &state->arg_values[i], arg_cache); + _pygi_closure_assign_pyobj_to_out_argument (state->args[i].arg_pointer.v_pointer, + &state->args[i].arg_value, arg_cache); i_py_retval++; } @@ -530,6 +489,38 @@ _pygi_closure_set_out_arguments (PyGIInvokeState *state, } static void +_pygi_closure_clear_retvals (PyGIInvokeState *state, + PyGICallableCache *cache, + gpointer resp) +{ + gsize i; + GIArgument arg = { 0, }; + + if (cache->return_cache->type_tag != GI_TYPE_TAG_VOID) { + _pygi_closure_assign_pyobj_to_retval (resp, &arg, + cache->return_cache); + } + + for (i = 0; i < _pygi_callable_cache_args_len (cache); i++) { + PyGIArgCache *arg_cache = g_ptr_array_index (cache->args_cache, i); + + if (arg_cache->direction & PYGI_DIRECTION_FROM_PYTHON) { + _pygi_closure_assign_pyobj_to_out_argument (state->args[i].arg_pointer.v_pointer, + &arg, arg_cache); + } + } + + if (cache->throws) { + gssize error_index = state->n_args - 1; + GError **error = (GError **) state->args[error_index].arg_value.v_pointer; + + if (error != NULL) { + pygi_gerror_exception_check (error); + } + } +} + +static void _pygi_invoke_closure_clear_py_data(PyGICClosure *invoke_closure) { PyGILState_STATE state = PyGILState_Ensure(); @@ -575,16 +566,14 @@ _pygi_closure_handle (ffi_cif *cif, _invoke_state_init_from_cache (&state, closure->cache, args); if (!_pygi_closure_convert_arguments (&state, closure->cache)) { - if (PyErr_Occurred ()) - PyErr_Print (); + _pygi_closure_clear_retvals (&state, closure->cache, result); goto end; } retval = PyObject_CallObject ( (PyObject *) closure->function, state.py_in_args); if (retval == NULL) { - _pygi_closure_clear_retval (closure->cache, result); - PyErr_Print (); + _pygi_closure_clear_retvals (&state, closure->cache, result); goto end; } @@ -593,16 +582,16 @@ _pygi_closure_handle (ffi_cif *cif, if (!success) { pygi_marshal_cleanup_args_from_py_marshal_success (&state, closure->cache); - _pygi_closure_clear_retval (closure->cache, result); - - if (PyErr_Occurred ()) - PyErr_Print (); + _pygi_closure_clear_retvals (&state, closure->cache, result); } Py_DECREF (retval); end: + if (PyErr_Occurred ()) + PyErr_Print (); + /* Now that the closure has finished we can make a decision about how to free it. Scope call gets free'd at the end of wrap_g_function_info_invoke. Scope notified will be freed when the notify is called. @@ -759,7 +748,7 @@ _pygi_marshal_from_py_interface_callback (PyGIInvokeState *state, * The return trip to python will marshal this back and pull the python user data out. */ if (user_data_cache != NULL) { - state->arg_values[user_data_cache->c_arg_index].v_pointer = closure; + state->args[user_data_cache->c_arg_index].arg_value.v_pointer = closure; } /* Setup a GDestroyNotify callback if this method supports it along with @@ -775,7 +764,7 @@ _pygi_marshal_from_py_interface_callback (PyGIInvokeState *state, if (destroy_cache) { if (user_data_cache != NULL) { - state->arg_values[destroy_cache->c_arg_index].v_pointer = _pygi_invoke_closure_free; + state->args[destroy_cache->c_arg_index].arg_value.v_pointer = _pygi_invoke_closure_free; } else { char *full_name = pygi_callable_cache_get_full_name (callable_cache); gchar *msg = g_strdup_printf("Callables passed to %s will leak references because " @@ -789,7 +778,7 @@ _pygi_marshal_from_py_interface_callback (PyGIInvokeState *state, return FALSE; } g_free(msg); - state->arg_values[destroy_cache->c_arg_index].v_pointer = _pygi_destroy_notify_dummy; + state->args[destroy_cache->c_arg_index].arg_value.v_pointer = _pygi_destroy_notify_dummy; } } @@ -815,10 +804,10 @@ _pygi_marshal_to_py_interface_callback (PyGIInvokeState *state, destroy_notify_index = callback_cache->destroy_notify_index; if (user_data_index != -1) - user_data = state->arg_values[user_data_index].v_pointer; + user_data = state->args[user_data_index].arg_value.v_pointer; if (destroy_notify_index != -1) - destroy_notify = state->arg_values[destroy_notify_index].v_pointer; + destroy_notify = state->args[destroy_notify_index].arg_value.v_pointer; return _pygi_ccallback_new (arg->v_pointer, user_data, diff --git a/gi/pygi-enum-marshal.c b/gi/pygi-enum-marshal.c index 32ca9dc..e1a7028 100644 --- a/gi/pygi-enum-marshal.c +++ b/gi/pygi-enum-marshal.c @@ -18,8 +18,8 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include <glib.h> #include <Python.h> +#include <glib.h> #include <pyglib-python-compat.h> #include "pygi-enum-marshal.h" diff --git a/gi/pygi-hashtable.c b/gi/pygi-hashtable.c index 4bf2b4f..d785daa 100644 --- a/gi/pygi-hashtable.c +++ b/gi/pygi-hashtable.c @@ -18,6 +18,7 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#include <Python.h> #include "pygi-hashtable.h" #include "pygi-argument.h" #include "pygi-private.h" diff --git a/gi/pygi-hashtable.h b/gi/pygi-hashtable.h index efd69f6..74cd04f 100644 --- a/gi/pygi-hashtable.h +++ b/gi/pygi-hashtable.h @@ -20,8 +20,8 @@ #ifndef __PYGI_HASHTABLE_H__ #define __PYGI_HASHTABLE_H__ -#include <girepository.h> #include "pygi-cache.h" +#include <girepository.h> G_BEGIN_DECLS diff --git a/gi/pygi-invoke-state-struct.h b/gi/pygi-invoke-state-struct.h index 732f3b6..64711cb 100644 --- a/gi/pygi-invoke-state-struct.h +++ b/gi/pygi-invoke-state-struct.h @@ -7,6 +7,22 @@ G_BEGIN_DECLS +typedef struct _PyGIInvokeArgState +{ + /* Holds memory for the C value of arguments marshaled "to" or "from" Python. */ + GIArgument arg_value; + + /* Holds pointers to values in arg_values or a caller allocated chunk of + * memory via arg_pointer.v_pointer. + */ + GIArgument arg_pointer; + + /* Holds from_py marshaler cleanup data. */ + gpointer arg_cleanup_data; + +} PyGIInvokeArgState; + + typedef struct _PyGIInvokeState { PyObject *py_in_args; @@ -19,23 +35,13 @@ typedef struct _PyGIInvokeState /* List of arguments passed to ffi. Elements can point directly to values held in * arg_values for "in/from Python" or indirectly via arg_pointers for - * "out/inout/to Python". In the latter case, the arg_pointers[x]->v_pointer + * "out/inout/to Python". In the latter case, the args[x].arg_pointer.v_pointer * member points to memory for the value storage. */ - GIArgument **args; - - /* Holds memory for the C value of arguments marshaled "to" or "from" Python. */ - GIArgument *arg_values; + GIArgument **ffi_args; - /* Holds pointers to values in arg_values or a caller allocated chunk of - * memory via arg_pointers[x].v_pointer. - */ - GIArgument *arg_pointers; - - /* Array of pointers allocated to the same length as args which holds from_py - * marshaler cleanup data. - */ - gpointer *args_cleanup_data; + /* Array of size n_args containing per argument state */ + PyGIInvokeArgState *args; /* Memory to receive the result of the C ffi function call. */ GIArgument return_arg; diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c index 0151650..02de46e 100644 --- a/gi/pygi-invoke.c +++ b/gi/pygi-invoke.c @@ -84,7 +84,7 @@ _py_args_combine_and_check_length (PyGICallableCache *cache, { PyObject *combined_py_args = NULL; Py_ssize_t n_py_args, n_py_kwargs, i; - guint n_expected_args; + guint n_expected_args = cache->n_py_args; GSList *l; n_py_args = PyTuple_GET_SIZE (py_args); @@ -94,7 +94,6 @@ _py_args_combine_and_check_length (PyGICallableCache *cache, n_py_kwargs = PyDict_Size (py_kwargs); /* Fast path, we already have the exact number of args and not kwargs. */ - n_expected_args = g_slist_length (cache->arg_name_list); if (n_py_kwargs == 0 && n_py_args == n_expected_args && cache->user_data_varargs_index < 0) { Py_INCREF (py_args); return py_args; @@ -217,6 +216,59 @@ _py_args_combine_and_check_length (PyGICallableCache *cache, return combined_py_args; } +/* To reduce calls to g_slice_*() we (1) allocate all the memory depended on + * the argument count in one go and (2) keep one version per argument count + * around for faster reuse. + */ + +#define PyGI_INVOKE_ARG_STATE_SIZE(n) (n * (sizeof (PyGIInvokeArgState) + sizeof (GIArgument *))) +#define PyGI_INVOKE_ARG_STATE_N_MAX 10 +static gpointer free_arg_state[PyGI_INVOKE_ARG_STATE_N_MAX]; + +/** + * _pygi_invoke_arg_state_init: + * Sets PyGIInvokeState.args and PyGIInvokeState.ffi_args. + * On error returns FALSE and sets an exception. + */ +gboolean +_pygi_invoke_arg_state_init (PyGIInvokeState *state) { + + gpointer mem; + + if (state->n_args < PyGI_INVOKE_ARG_STATE_N_MAX && (mem = free_arg_state[state->n_args]) != NULL) { + free_arg_state[state->n_args] = NULL; + memset (mem, 0, PyGI_INVOKE_ARG_STATE_SIZE (state->n_args)); + } else { + mem = g_slice_alloc0 (PyGI_INVOKE_ARG_STATE_SIZE (state->n_args)); + } + + if (mem == NULL && state->n_args != 0) { + PyErr_NoMemory(); + return FALSE; + } + + if (mem != NULL) { + state->args = mem; + state->ffi_args = (gpointer)((gchar *)mem + state->n_args * sizeof (PyGIInvokeArgState)); + } + + return TRUE; +} + +/** + * _pygi_invoke_arg_state_free: + * Frees PyGIInvokeState.args and PyGIInvokeState.ffi_args + */ +void +_pygi_invoke_arg_state_free(PyGIInvokeState *state) { + if (state->n_args < PyGI_INVOKE_ARG_STATE_N_MAX && free_arg_state[state->n_args] == NULL) { + free_arg_state[state->n_args] = state->args; + return; + } + + g_slice_free1 (PyGI_INVOKE_ARG_STATE_SIZE (state->n_args), state->args); +} + static gboolean _invoke_state_init_from_cache (PyGIInvokeState *state, PyGIFunctionCache *function_cache, @@ -246,27 +298,7 @@ _invoke_state_init_from_cache (PyGIInvokeState *state, } state->n_py_in_args = PyTuple_Size (state->py_in_args); - state->args = g_slice_alloc0 (state->n_args * sizeof (GIArgument *)); - if (state->args == NULL && state->n_args != 0) { - PyErr_NoMemory(); - return FALSE; - } - - state->args_cleanup_data = g_slice_alloc0 (state->n_args * sizeof (gpointer)); - if (state->args_cleanup_data == NULL && state->n_args != 0) { - PyErr_NoMemory(); - return FALSE; - } - - state->arg_values = g_slice_alloc0 (state->n_args * sizeof(GIArgument)); - if (state->arg_values == NULL && state->n_args != 0) { - PyErr_NoMemory (); - return FALSE; - } - - state->arg_pointers = g_slice_alloc0 (state->n_args * sizeof(GIArgument)); - if (state->arg_pointers == NULL && state->n_args != 0) { - PyErr_NoMemory (); + if (!_pygi_invoke_arg_state_init (state)) { return FALSE; } @@ -275,8 +307,8 @@ _invoke_state_init_from_cache (PyGIInvokeState *state, if (cache->throws) { gssize error_index = state->n_args - 1; /* The ffi argument for GError needs to be a triple pointer. */ - state->arg_pointers[error_index].v_pointer = &state->error; - state->args[error_index] = &(state->arg_pointers[error_index]); + state->args[error_index].arg_pointer.v_pointer = &state->error; + state->ffi_args[error_index] = &(state->args[error_index].arg_pointer); } return TRUE; @@ -285,11 +317,7 @@ _invoke_state_init_from_cache (PyGIInvokeState *state, static void _invoke_state_clear (PyGIInvokeState *state, PyGIFunctionCache *function_cache) { - g_slice_free1 (state->n_args * sizeof(GIArgument *), state->args); - g_slice_free1 (state->n_args * sizeof(gpointer), state->args_cleanup_data); - g_slice_free1 (state->n_args * sizeof(GIArgument), state->arg_values); - g_slice_free1 (state->n_args * sizeof(GIArgument), state->arg_pointers); - + _pygi_invoke_arg_state_free (state); Py_XDECREF (state->py_in_args); } @@ -382,17 +410,17 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGIFunctionCache *function_cac } for (i = 0; i < _pygi_callable_cache_args_len (cache); i++) { - GIArgument *c_arg = &state->arg_values[i]; + GIArgument *c_arg = &state->args[i].arg_value; PyGIArgCache *arg_cache = g_ptr_array_index (cache->args_cache, i); PyObject *py_arg = NULL; switch (arg_cache->direction) { case PYGI_DIRECTION_FROM_PYTHON: /* The ffi argument points directly at memory in arg_values. */ - state->args[i] = c_arg; + state->ffi_args[i] = c_arg; if (arg_cache->meta_type == PYGI_META_ARG_TYPE_CLOSURE) { - state->args[i]->v_pointer = state->user_data; + state->ffi_args[i]->v_pointer = state->user_data; continue; } else if (arg_cache->meta_type != PYGI_META_ARG_TYPE_PARENT) continue; @@ -449,7 +477,7 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGIFunctionCache *function_cac * (_invoke_marshal_out_args) can always rely on arg_pointers pointing to * the correct chunk of memory to marshal. */ - state->arg_pointers[i].v_pointer = c_arg; + state->args[i].arg_pointer.v_pointer = c_arg; if (arg_cache->is_caller_allocates) { /* In the case of caller allocated out args, we don't use @@ -458,7 +486,7 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGIFunctionCache *function_cac * above, arg_pointers will also point to this caller allocated * chunk of memory used by out argument marshaling. */ - state->args[i] = c_arg; + state->ffi_args[i] = c_arg; if (!_caller_alloc (arg_cache, c_arg)) { char *full_name = pygi_callable_cache_get_full_name (cache); @@ -474,7 +502,7 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGIFunctionCache *function_cac } else { /* Non-caller allocated out args will use arg_pointers as an * extra level of indirection */ - state->args[i] = &state->arg_pointers[i]; + state->ffi_args[i] = &state->args[i].arg_pointer; } break; @@ -503,7 +531,7 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGIFunctionCache *function_cac py_arg, c_arg, &cleanup_data); - state->args_cleanup_data[i] = cleanup_data; + state->args[i].arg_cleanup_data = cleanup_data; if (!success) { pygi_marshal_cleanup_args_from_py_parameter_fail (state, @@ -525,8 +553,7 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca PyGICallableCache *cache = (PyGICallableCache *) function_cache; PyObject *py_out = NULL; PyObject *py_return = NULL; - gssize total_out_args = cache->n_to_py_args; - gboolean has_return = FALSE; + gssize n_out_args = cache->n_to_py_args - cache->n_to_py_child_args; if (cache->return_cache) { if (!cache->return_cache->is_skipped) { @@ -539,12 +566,6 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca cache); return NULL; } - - - if (cache->return_cache->type_tag != GI_TYPE_TAG_VOID) { - total_out_args++; - has_return = TRUE; - } } else { if (cache->return_cache->transfer == GI_TRANSFER_EVERYTHING) { PyGIMarshalCleanupFunc to_py_cleanup = @@ -560,9 +581,7 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca } } - total_out_args -= cache->n_to_py_child_args; - - if (cache->n_to_py_args - cache->n_to_py_child_args == 0) { + if (n_out_args == 0) { if (cache->return_cache->is_skipped && state->error == NULL) { /* we skip the return value and have no (out) arguments to return, * so py_return should be NULL. But we must not return NULL, @@ -574,13 +593,13 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca } py_out = py_return; - } else if (total_out_args == 1) { + } else if (!cache->has_return && n_out_args == 1) { /* if we get here there is one out arg an no return */ PyGIArgCache *arg_cache = (PyGIArgCache *)cache->to_py_args->data; py_out = arg_cache->to_py_marshaller (state, cache, arg_cache, - state->arg_pointers[arg_cache->c_arg_index].v_pointer); + state->args[arg_cache->c_arg_index].arg_pointer.v_pointer); if (py_out == NULL) { pygi_marshal_cleanup_args_to_py_parameter_fail (state, cache, @@ -589,24 +608,34 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGIFunctionCache *function_ca } } else { + /* return a tuple */ gssize py_arg_index = 0; GSList *cache_item = cache->to_py_args; - /* return a tuple */ - py_out = PyTuple_New (total_out_args); - if (has_return) { + gssize tuple_len = cache->has_return + n_out_args; + + py_out = pygi_resulttuple_new (cache->resulttuple_type, tuple_len); + + if (py_out == NULL) { + pygi_marshal_cleanup_args_to_py_parameter_fail (state, + cache, + py_arg_index); + return NULL; + } + + if (cache->has_return) { PyTuple_SET_ITEM (py_out, py_arg_index, py_return); py_arg_index++; } - for(; py_arg_index < total_out_args; py_arg_index++) { + for (; py_arg_index < tuple_len; py_arg_index++) { PyGIArgCache *arg_cache = (PyGIArgCache *)cache_item->data; PyObject *py_obj = arg_cache->to_py_marshaller (state, cache, arg_cache, - state->arg_pointers[arg_cache->c_arg_index].v_pointer); + state->args[arg_cache->c_arg_index].arg_pointer.v_pointer); if (py_obj == NULL) { - if (has_return) + if (cache->has_return) py_arg_index--; pygi_marshal_cleanup_args_to_py_parameter_fail (state, @@ -645,7 +674,7 @@ pygi_invoke_c_callable (PyGIFunctionCache *function_cache, ffi_call (&function_cache->invoker.cif, state->function_ptr, (void *) &ffi_return_value, - (void **) state->args); + (void **) state->ffi_args); Py_END_ALLOW_THREADS; diff --git a/gi/pygi-invoke.h b/gi/pygi-invoke.h index b49ffa7..dfed2e0 100644 --- a/gi/pygi-invoke.h +++ b/gi/pygi-invoke.h @@ -38,6 +38,10 @@ PyObject *pygi_callable_info_invoke (GIBaseInfo *info, PyObject *py_args, PyObject *_wrap_g_callable_info_invoke (PyGIBaseInfo *self, PyObject *py_args, PyObject *kwargs); +gboolean _pygi_invoke_arg_state_init (PyGIInvokeState *state); + +void _pygi_invoke_arg_state_free (PyGIInvokeState *state); + G_END_DECLS #endif /* __PYGI_INVOKE_H__ */ diff --git a/gi/pygi-list.c b/gi/pygi-list.c index e3f3c67..41a3d32 100644 --- a/gi/pygi-list.c +++ b/gi/pygi-list.c @@ -18,6 +18,7 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#include <Python.h> #include "pygi-list.h" #include "pygi-argument.h" #include "pygi-private.h" diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c index b0ec05a..b2e91eb 100644 --- a/gi/pygi-marshal-cleanup.c +++ b/gi/pygi-marshal-cleanup.c @@ -95,7 +95,7 @@ pygi_marshal_cleanup_args_from_py_marshal_success (PyGIInvokeState *state, for (i = 0; i < _pygi_callable_cache_args_len (cache); i++) { PyGIArgCache *arg_cache = _pygi_callable_cache_get_arg (cache, i); PyGIMarshalCleanupFunc cleanup_func = arg_cache->from_py_cleanup; - gpointer cleanup_data = state->args_cleanup_data[i]; + gpointer cleanup_data = state->args[i].arg_cleanup_data; /* Only cleanup using args_cleanup_data when available. * It is the responsibility of the various "from_py" marshalers to return @@ -107,7 +107,7 @@ pygi_marshal_cleanup_args_from_py_marshal_success (PyGIInvokeState *state, arg_cache->direction & PYGI_DIRECTION_FROM_PYTHON) { PyObject *py_arg = PyTuple_GET_ITEM (state->py_in_args, arg_cache->py_arg_index); cleanup_func (state, arg_cache, py_arg, cleanup_data, TRUE); - state->args_cleanup_data[i] = NULL; + state->args[i].arg_cleanup_data = NULL; } } } @@ -133,7 +133,7 @@ pygi_marshal_cleanup_args_to_py_marshal_success (PyGIInvokeState *state, while (cache_item) { PyGIArgCache *arg_cache = (PyGIArgCache *) cache_item->data; PyGIMarshalCleanupFunc cleanup_func = arg_cache->to_py_cleanup; - gpointer data = state->arg_values[arg_cache->c_arg_index].v_pointer; + gpointer data = state->args[arg_cache->c_arg_index].arg_value.v_pointer; if (cleanup_func != NULL && data != NULL) cleanup_func (state, @@ -165,7 +165,7 @@ pygi_marshal_cleanup_args_from_py_parameter_fail (PyGIInvokeState *state, for (i = 0; i < _pygi_callable_cache_args_len (cache) && i <= failed_arg_index; i++) { PyGIArgCache *arg_cache = _pygi_callable_cache_get_arg (cache, i); PyGIMarshalCleanupFunc cleanup_func = arg_cache->from_py_cleanup; - gpointer cleanup_data = state->args_cleanup_data[i]; + gpointer cleanup_data = state->args[i].arg_cleanup_data; PyObject *py_arg = NULL; if (arg_cache->py_arg_index < 0) { @@ -188,7 +188,7 @@ pygi_marshal_cleanup_args_from_py_parameter_fail (PyGIInvokeState *state, cleanup_data, FALSE); } - state->args_cleanup_data[i] = NULL; + state->args[i].arg_cleanup_data = NULL; } } diff --git a/gi/pygi-object.c b/gi/pygi-object.c index 0404fe7..a082992 100644 --- a/gi/pygi-object.c +++ b/gi/pygi-object.c @@ -18,8 +18,8 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include <glib.h> #include <Python.h> +#include <glib.h> #include <pyglib-python-compat.h> #include "pygi-object.h" diff --git a/gi/pygi-private.h b/gi/pygi-private.h index af12f1c..f70aec4 100644 --- a/gi/pygi-private.h +++ b/gi/pygi-private.h @@ -32,6 +32,7 @@ #include "pygi-invoke.h" #include "pygi-cache.h" #include "pygi-source.h" +#include "pygi-resulttuple.h" G_BEGIN_DECLS #if PY_VERSION_HEX >= 0x03000000 diff --git a/gi/pygi-repository.c b/gi/pygi-repository.c index b8a1931..16356f9 100644 --- a/gi/pygi-repository.c +++ b/gi/pygi-repository.c @@ -319,6 +319,40 @@ _wrap_g_irepository_get_dependencies (PyGIRepository *self, return py_namespaces; } + +static PyObject * +_wrap_g_irepository_get_immediate_dependencies (PyGIRepository *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "namespace", NULL }; + const char *namespace_; + char **namespaces; + PyObject *py_namespaces; + gssize i; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "s:Repository.get_immediate_dependencies", + kwlist, &namespace_)) { + return NULL; + } + + py_namespaces = PyList_New (0); + namespaces = g_irepository_get_immediate_dependencies (self->repository, + namespace_); + + for (i = 0; namespaces[i] != NULL; i++) { + PyObject *py_namespace = PYGLIB_PyUnicode_FromString (namespaces[i]); + PyList_Append (py_namespaces, py_namespace); + Py_DECREF (py_namespace); + } + + g_strfreev (namespaces); + + return py_namespaces; +} + + static PyMethodDef _PyGIRepository_methods[] = { { "enumerate_versions", (PyCFunction) _wrap_g_irepository_enumerate_versions, METH_VARARGS | METH_KEYWORDS }, { "get_default", (PyCFunction) _wrap_g_irepository_get_default, METH_STATIC | METH_NOARGS }, @@ -329,6 +363,7 @@ static PyMethodDef _PyGIRepository_methods[] = { { "get_version", (PyCFunction) _wrap_g_irepository_get_version, METH_VARARGS | METH_KEYWORDS }, { "get_loaded_namespaces", (PyCFunction) _wrap_g_irepository_get_loaded_namespaces, METH_NOARGS }, { "get_dependencies", (PyCFunction) _wrap_g_irepository_get_dependencies, METH_VARARGS | METH_KEYWORDS }, + { "get_immediate_dependencies", (PyCFunction) _wrap_g_irepository_get_immediate_dependencies, METH_VARARGS | METH_KEYWORDS }, { "is_registered", (PyCFunction) _wrap_g_irepository_is_registered, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL, 0 } }; diff --git a/gi/pygi-resulttuple.c b/gi/pygi-resulttuple.c new file mode 100644 index 0000000..9d0b455 --- /dev/null +++ b/gi/pygi-resulttuple.c @@ -0,0 +1,354 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2015 Christoph Reiter <reiter.christoph@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. + */ + +#include "pygi-resulttuple.h" +#include "pyglib-private.h" + +static char repr_format_key[] = "__repr_format"; +static char tuple_indices_key[] = "__tuple_indices"; + +/* A free list similar to the one used for the CPython tuple. Difference + * is that zero length tuples aren't cached (as we don't need them) + * and that the freelist is smaller as we don't free it with the cyclic GC + * as CPython does. This wastes 21kB max. + */ +#define PyGIResultTuple_MAXSAVESIZE 10 +#define PyGIResultTuple_MAXFREELIST 100 +static PyObject *free_list[PyGIResultTuple_MAXSAVESIZE]; +static int numfree[PyGIResultTuple_MAXSAVESIZE]; + +PYGLIB_DEFINE_TYPE ("gi._gi.ResultTuple", PyGIResultTuple_Type, PyTupleObject) + +/** + * ResultTuple.__repr__() implementation. + * Takes the _ResultTuple.__repr_format format string and applies the tuple + * values to it. + */ +static PyObject* +resulttuple_repr(PyObject *self) { + PyObject *format, *repr, *format_attr; + + format_attr = PYGLIB_PyUnicode_FromString (repr_format_key); + format = PyTuple_Type.tp_getattro (self, format_attr); + Py_DECREF (format_attr); + if (format == NULL) + return NULL; + repr = PYGLIB_PyUnicode_Format (format, self); + Py_DECREF (format); + return repr; +} + +/** + * PyGIResultTuple_Type.tp_getattro implementation. + * Looks up the tuple index in _ResultTuple.__tuple_indices and returns the + * tuple item. + */ +static PyObject* +resulttuple_getattro(PyObject *self, PyObject *name) { + PyObject *mapping, *index, *mapping_attr, *item; + + mapping_attr = PYGLIB_PyUnicode_FromString (tuple_indices_key); + mapping = PyTuple_Type.tp_getattro (self, mapping_attr); + Py_DECREF (mapping_attr); + if (mapping == NULL) + return NULL; + g_assert (PyDict_Check (mapping)); + index = PyDict_GetItem (mapping, name); + + if (index != NULL) { + item = PyTuple_GET_ITEM (self, PYGLIB_PyLong_AsSsize_t (index)); + Py_INCREF (item); + } else { + item = PyTuple_Type.tp_getattro (self, name); + } + Py_DECREF (mapping); + + return item; +} + +/** + * ResultTuple.__reduce__() implementation. + * Always returns (tuple, tuple(self)) + * Needed so that pickling doesn't depend on our tuple subclass and unpickling + * works without it. As a result unpickle will give back in a normal tuple. + */ +static PyObject * +resulttuple_reduce(PyObject *self) +{ + PyObject *tuple = PySequence_Tuple (self); + if (tuple == NULL) + return NULL; + return Py_BuildValue ("(O, (N))", &PyTuple_Type, tuple); +} + +/** + * Extends __dir__ with the extra attributes accessible through + * resulttuple_getattro() + */ +static PyObject * +resulttuple_dir(PyObject *self) +{ + PyObject *mapping_attr; + PyObject *items = NULL; + PyObject *mapping = NULL; + PyObject *mapping_values = NULL; + PyObject *result = NULL; + + mapping_attr = PYGLIB_PyUnicode_FromString (tuple_indices_key); + mapping = PyTuple_Type.tp_getattro (self, mapping_attr); + Py_DECREF (mapping_attr); + if (mapping == NULL) + goto error; + items = PyObject_Dir ((PyObject*)self->ob_type); + if (items == NULL) + goto error; + mapping_values = PyDict_Keys (mapping); + if (mapping_values == NULL) + goto error; + result = PySequence_InPlaceConcat (items, mapping_values); + +error: + Py_XDECREF (items); + Py_XDECREF (mapping); + Py_XDECREF (mapping_values); + + return result; +} + +/** + * resulttuple_new_type: + * @args: one list object containing tuple item names and None + * + * Exposes pygi_resulttuple_new_type() as ResultTuple._new_type() + * to allow creation of result types for unit tests. + * + * Returns: A new PyTypeObject which is a subclass of PyGIResultTuple_Type + * or %NULL in case of an error. + */ +static PyObject * +resulttuple_new_type(PyObject *self, PyObject *args) { + PyObject *tuple_names, *new_type; + + if (!PyArg_ParseTuple (args, "O:ResultTuple._new_type", &tuple_names)) + return NULL; + + if (!PyList_Check (tuple_names)) { + Py_DECREF (tuple_names); + PyErr_SetString (PyExc_TypeError, "not a list"); + return NULL; + } + + new_type = (PyObject *)pygi_resulttuple_new_type (tuple_names); + Py_DECREF (tuple_names); + return new_type; +} + +static PyMethodDef resulttuple_methods[] = { + {"__reduce__", (PyCFunction)resulttuple_reduce, METH_NOARGS}, + {"__dir__", (PyCFunction)resulttuple_dir, METH_NOARGS}, + {"_new_type", (PyCFunction)resulttuple_new_type, + METH_VARARGS | METH_STATIC}, + {NULL, NULL, 0}, +}; + +/** + * pygi_resulttuple_new_type: + * @tuple_names: A python list containing str or None items. + * + * Similar to namedtuple() creates a new tuple subclass which + * allows to access items by name and have a pretty __repr__. + * Each item in the passed name list corresponds to an item with + * the same index in the tuple class. If the name is None the item/index + * is unnamed. + * + * Returns: A new PyTypeObject which is a subclass of PyGIResultTuple_Type + * or %NULL in case of an error. + */ +PyTypeObject* +pygi_resulttuple_new_type(PyObject *tuple_names) { + PyTypeObject *new_type; + PyObject *class_dict, *format_string, *empty_format, *named_format, + *format_list, *sep, *index_dict, *slots, *paren_format, *new_type_args, + *paren_string; + Py_ssize_t len, i; + + g_assert (PyList_Check (tuple_names)); + + class_dict = PyDict_New (); + + /* To save some memory don't use an instance dict */ + slots = PyTuple_New (0); + PyDict_SetItemString (class_dict, "__slots__", slots); + Py_DECREF (slots); + + format_list = PyList_New (0); + index_dict = PyDict_New (); + + empty_format = PYGLIB_PyUnicode_FromString ("%r"); + named_format = PYGLIB_PyUnicode_FromString ("%s=%%r"); + len = PyList_Size (tuple_names); + for (i = 0; i < len; i++) { + PyObject *item, *named_args, *named_build, *index; + item = PyList_GET_ITEM (tuple_names, i); + if (item == Py_None) { + PyList_Append (format_list, empty_format); + } else { + named_args = Py_BuildValue ("(O)", item); + named_build = PYGLIB_PyUnicode_Format (named_format, named_args); + Py_DECREF (named_args); + PyList_Append (format_list, named_build); + Py_DECREF (named_build); + index = PYGLIB_PyLong_FromSsize_t (i); + PyDict_SetItem (index_dict, item, index); + Py_DECREF (index); + } + } + Py_DECREF (empty_format); + Py_DECREF (named_format); + + sep = PYGLIB_PyUnicode_FromString (", "); + format_string = PyObject_CallMethod (sep, "join", "O", format_list); + Py_DECREF (sep); + Py_DECREF (format_list); + paren_format = PYGLIB_PyUnicode_FromString ("(%s)"); + paren_string = PYGLIB_PyUnicode_Format (paren_format, format_string); + Py_DECREF (paren_format); + Py_DECREF (format_string); + + PyDict_SetItemString (class_dict, repr_format_key, paren_string); + Py_DECREF (paren_string); + + PyDict_SetItemString (class_dict, tuple_indices_key, index_dict); + Py_DECREF (index_dict); + + new_type_args = Py_BuildValue ("s(O)O", "_ResultTuple", + &PyGIResultTuple_Type, class_dict); + new_type = (PyTypeObject *)PyType_Type.tp_new (&PyType_Type, + new_type_args, NULL); + Py_DECREF (new_type_args); + Py_DECREF (class_dict); + + if (new_type != NULL) { + /* disallow subclassing as that would break the free list caching + * since we assume that all subclasses use PyTupleObject */ + new_type->tp_flags &= ~Py_TPFLAGS_BASETYPE; + } + + return new_type; +} + + +/** + * pygi_resulttuple_new: + * @subclass: A PyGIResultTuple_Type subclass which will be the type of the + * returned instance. + * @len: Length of the returned tuple + * + * Like PyTuple_New(). Return an uninitialized tuple of the given @length. + * + * Returns: An instance of @subclass or %NULL on error. + */ +PyObject * +pygi_resulttuple_new(PyTypeObject *subclass, Py_ssize_t len) { + PyObject *self; + Py_ssize_t i; + + /* Check the free list for a tuple object with the needed size; + * clear it and change the class to ours. + */ + if (len > 0 && len < PyGIResultTuple_MAXSAVESIZE) { + self = free_list[len]; + if (self != NULL) { + free_list[len] = PyTuple_GET_ITEM (self, 0); + numfree[len]--; + for (i=0; i < len; i++) { + PyTuple_SET_ITEM (self, i, NULL); + } + Py_TYPE (self) = subclass; + Py_INCREF (subclass); + _Py_NewReference (self); + PyObject_GC_Track (self); + return self; + } + } + + /* For zero length tuples and in case the free list is empty, alloc + * as usual. + */ + return subclass->tp_alloc (subclass, len); +} + +static void resulttuple_dealloc(PyObject *self) { + Py_ssize_t i, len; + + PyObject_GC_UnTrack (self); + Py_TRASHCAN_SAFE_BEGIN (self) + + /* Free the tuple items and, if there is space, save the tuple object + * pointer to the front of the free list for its size. Otherwise free it. + */ + len = Py_SIZE (self); + if (len > 0) { + for (i=0; i < len; i++) { + Py_XDECREF (PyTuple_GET_ITEM (self, i)); + } + + if (len < PyGIResultTuple_MAXSAVESIZE && numfree[len] < PyGIResultTuple_MAXFREELIST) { + PyTuple_SET_ITEM (self, 0, free_list[len]); + numfree[len]++; + free_list[len] = self; + goto done; + } + } + + Py_TYPE (self)->tp_free (self); + +done: + Py_TRASHCAN_SAFE_END (self) +} + +/** + * pygi_resulttuple_register_types: + * @module: A Python modules to which ResultTuple gets added to. + * + * Initializes the ResultTuple class and adds it to the passed @module. + * + * Returns: -1 on error, 0 on success. + */ +int pygi_resulttuple_register_types(PyObject *module) { + + PyGIResultTuple_Type.tp_base = &PyTuple_Type; + PyGIResultTuple_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; + PyGIResultTuple_Type.tp_repr = (reprfunc)resulttuple_repr; + PyGIResultTuple_Type.tp_getattro = (getattrofunc)resulttuple_getattro; + PyGIResultTuple_Type.tp_methods = resulttuple_methods; + PyGIResultTuple_Type.tp_dealloc = (destructor)resulttuple_dealloc; + + if (PyType_Ready (&PyGIResultTuple_Type)) + return -1; + + Py_INCREF (&PyGIResultTuple_Type); + if (PyModule_AddObject (module, "ResultTuple", + (PyObject *)&PyGIResultTuple_Type)) { + Py_DECREF (&PyGIResultTuple_Type); + return -1; + } + + return 0; +} diff --git a/gi/pygi-resulttuple.h b/gi/pygi-resulttuple.h new file mode 100644 index 0000000..3f63ca0 --- /dev/null +++ b/gi/pygi-resulttuple.h @@ -0,0 +1,34 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2015 Christoph Reiter <reiter.christoph@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __PYGI_RESULTTUPLE_H__ +#define __PYGI_RESULTTUPLE_H__ + +#include "Python.h" + +int +pygi_resulttuple_register_types (PyObject *d); + +PyTypeObject * +pygi_resulttuple_new_type (PyObject *tuple_names); + +PyObject* +pygi_resulttuple_new (PyTypeObject *subclass, Py_ssize_t len); + +#endif /* __PYGI_RESULTTUPLE_H__ */ diff --git a/gi/pygi-struct-marshal.c b/gi/pygi-struct-marshal.c index 9bf3b54..353a2d1 100644 --- a/gi/pygi-struct-marshal.c +++ b/gi/pygi-struct-marshal.c @@ -18,8 +18,8 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#include <glib.h> #include <Python.h> +#include <glib.h> #include <pyglib-python-compat.h> #include "pygi-struct-marshal.h" diff --git a/gi/pygi-struct.c b/gi/pygi-struct.c index adf8e72..d84eed5 100644 --- a/gi/pygi-struct.c +++ b/gi/pygi-struct.c @@ -159,6 +159,28 @@ _pygi_struct_new (PyTypeObject *type, return (PyObject *) self; } +static PyObject * +_struct_repr(PyGIStruct *self) +{ + PyObject* repr; + GIBaseInfo *info; + PyGPointer *pointer = (PyGPointer *)self; + + info = _struct_get_info ((PyObject *)self); + if (info == NULL) + return NULL; + + repr = PYGLIB_PyUnicode_FromFormat ("<%s.%s object at %p (%s at %p)>", + g_base_info_get_namespace (info), + g_base_info_get_name (info), + self, g_type_name (pointer->gtype), + pointer->pointer); + + g_base_info_unref (info); + + return repr; +} + void _pygi_struct_register_types (PyObject *m) { @@ -168,6 +190,7 @@ _pygi_struct_register_types (PyObject *m) PyGIStruct_Type.tp_init = (initproc) _struct_init; PyGIStruct_Type.tp_dealloc = (destructor) _struct_dealloc; PyGIStruct_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + PyGIStruct_Type.tp_repr = (reprfunc)_struct_repr; if (PyType_Ready (&PyGIStruct_Type)) return; diff --git a/gi/pygi-value.c b/gi/pygi-value.c index 79ee596..2cf567d 100644 --- a/gi/pygi-value.c +++ b/gi/pygi-value.c @@ -16,6 +16,7 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#include <Python.h> #include "pygi-value.h" #include "pyglib-python-compat.h" #include "pygobject-private.h" diff --git a/gi/pyglib-python-compat.h b/gi/pyglib-python-compat.h index 58c8cf9..7b67d55 100644 --- a/gi/pyglib-python-compat.h +++ b/gi/pyglib-python-compat.h @@ -48,6 +48,7 @@ #define PYGLIB_PyUnicode_Type PyString_Type #define PYGLIB_PyUnicode_InternFromString PyString_InternFromString #define PYGLIB_PyUnicode_InternInPlace PyString_InternInPlace +#define PYGLIB_PyUnicode_Format PyString_Format #define PYGLIB_PyBytes_FromString PyString_FromString #define PYGLIB_PyBytes_FromStringAndSize PyString_FromStringAndSize @@ -61,6 +62,7 @@ #define PYGLIB_PyLong_FromSsize_t PyInt_FromSsize_t #define PYGLIB_PyLong_FromSize_t PyInt_FromSize_t #define PYGLIB_PyLong_AsLong PyInt_AsLong +#define PYGLIB_PyLong_AsSsize_t PyInt_AsSsize_t #define PYGLIB_PyLongObject PyIntObject #define PYGLIB_PyLong_Type PyInt_Type #define PYGLIB_PyLong_AS_LONG PyInt_AS_LONG @@ -166,11 +168,14 @@ PyTypeObject symbol = { \ #define PYGLIB_PyUnicode_Type PyUnicode_Type #define PYGLIB_PyUnicode_InternFromString PyUnicode_InternFromString #define PYGLIB_PyUnicode_InternInPlace PyUnicode_InternInPlace +#define PYGLIB_PyUnicode_Format PyUnicode_Format #define PYGLIB_PyLong_Check PyLong_Check #define PYGLIB_PyLong_FromLong PyLong_FromLong +#define PYGLIB_PyLong_FromSsize_t PyLong_FromSsize_t #define PYGLIB_PyLong_FromSize_t PyLong_FromSize_t #define PYGLIB_PyLong_AsLong PyLong_AsLong +#define PYGLIB_PyLong_AsSsize_t PyLong_AsSsize_t #define PYGLIB_PyLong_AS_LONG(o) PyLong_AS_LONG((PyObject*)(o)) #define PYGLIB_PyLongObject PyLongObject #define PYGLIB_PyLong_Type PyLong_Type diff --git a/gi/pygobject.c b/gi/pygobject.c index 9839f49..a09ae36 100644 --- a/gi/pygobject.c +++ b/gi/pygobject.c @@ -722,8 +722,6 @@ pygobject_new_with_interfaces(GType gtype) PyObject *dict; PyTypeObject *py_parent_type; PyObject *bases; - PyObject *modules, *module; - gchar *type_name, *mod_name, *gtype_name; state = pyglib_gil_state_ensure(); @@ -739,32 +737,14 @@ pygobject_new_with_interfaces(GType gtype) /* set up __doc__ descriptor on type */ PyDict_SetItemString(dict, "__doc__", pyg_object_descr_doc_get()); - /* generate the pygtk module name and extract the base type name */ - gtype_name = (gchar*)g_type_name(gtype); - if (g_str_has_prefix(gtype_name, "Gtk")) { - mod_name = "gtk"; - gtype_name += 3; - type_name = g_strconcat(mod_name, ".", gtype_name, NULL); - } else if (g_str_has_prefix(gtype_name, "Gdk")) { - mod_name = "gtk.gdk"; - gtype_name += 3; - type_name = g_strconcat(mod_name, ".", gtype_name, NULL); - } else if (g_str_has_prefix(gtype_name, "Atk")) { - mod_name = "atk"; - gtype_name += 3; - type_name = g_strconcat(mod_name, ".", gtype_name, NULL); - } else if (g_str_has_prefix(gtype_name, "Pango")) { - mod_name = "pango"; - gtype_name += 5; - type_name = g_strconcat(mod_name, ".", gtype_name, NULL); - } else { - mod_name = "__main__"; - type_name = g_strconcat(mod_name, ".", gtype_name, NULL); - } + /* Something special to point out that it's not accessible through + * gi.repository */ + o = PYGLIB_PyUnicode_FromString ("__gi__"); + PyDict_SetItemString (dict, "__module__", o); + Py_DECREF (o); type = (PyTypeObject*)PyObject_CallFunction((PyObject *) Py_TYPE(py_parent_type), - "sNN", type_name, bases, dict); - g_free(type_name); + "sNN", g_type_name (gtype), bases, dict); if (type == NULL) { PyErr_Print(); @@ -796,12 +776,6 @@ pygobject_new_with_interfaces(GType gtype) pyglib_gil_state_release(state); return NULL; } - /* insert type name in module dict */ - modules = PyImport_GetModuleDict(); - if ((module = PyDict_GetItemString(modules, mod_name)) != NULL) { - if (PyObject_SetAttrString(module, gtype_name, (PyObject *)type) < 0) - PyErr_Clear(); - } /* stash a pointer to the python class with the GType */ Py_INCREF(type); @@ -1126,15 +1100,32 @@ pygobject_hash(PyGObject *self) static PyObject * pygobject_repr(PyGObject *self) { - gchar buf[256]; + PyObject *module, *repr; + gchar *module_str, *namespace; + + module = PyObject_GetAttrString ((PyObject *)self, "__module__"); + if (module == NULL) + return NULL; + + if (!PYGLIB_PyUnicode_Check (module)) { + Py_DECREF (module); + return NULL; + } + + module_str = PYGLIB_PyUnicode_AsString (module); + namespace = g_strrstr (module_str, "."); + if (namespace == NULL) { + namespace = module_str; + } else { + namespace += 1; + } - g_snprintf(buf, sizeof(buf), - "<%s object at 0x%lx (%s at 0x%lx)>", - Py_TYPE(self)->tp_name, - (long)self, - self->obj ? G_OBJECT_TYPE_NAME(self->obj) : "uninitialized", - (long)self->obj); - return PYGLIB_PyUnicode_FromString(buf); + repr = PYGLIB_PyUnicode_FromFormat ("<%s.%s object at %p (%s at %p)>", + namespace, Py_TYPE (self)->tp_name, self, + self->obj ? G_OBJECT_TYPE_NAME (self->obj) : "uninitialized", + self->obj); + Py_DECREF (module); + return repr; } diff --git a/gi/repository/Makefile.in b/gi/repository/Makefile.in index 7268b61..eb74e7c 100644 --- a/gi/repository/Makefile.in +++ b/gi/repository/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,17 +14,7 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -88,6 +78,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = gi/repository +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(pygirepository_PYTHON) $(top_srcdir)/py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -96,8 +88,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(pygirepository_PYTHON) \ - $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -154,7 +144,6 @@ am__pep3147_tweak = \ sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|' py_compile = $(top_srcdir)/py-compile am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ @@ -191,7 +180,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -315,7 +303,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -343,6 +330,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gi/repository/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gi/repository/Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -570,8 +558,6 @@ uninstall-am: uninstall-pygirepositoryPYTHON mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-pygirepositoryPYTHON -.PRECIOUS: Makefile - # if we build in a separate tree, we need to symlink the *.py files from the # source tree; Python does not accept the extensions and modules in different @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2014-09-12.12; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,15 +41,19 @@ scriptversion=2014-09-12.12; # UTC # This script is compatible with the BSD install script, but was written # from scratch. -tab=' ' nl=' ' -IFS=" $tab$nl" +IFS=" "" $nl" -# Set DOITPROG to "echo" to test this script. +# set DOITPROG to echo to test this script +# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -doit_exec=${doit:-exec} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -64,6 +68,17 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + posix_mkdir= # Desired mode of installed file. @@ -82,7 +97,7 @@ dir_arg= dst_arg= copy_on_change=false -is_target_a_directory=possibly +no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -122,57 +137,46 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) is_target_a_directory=never;; + -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -204,15 +208,6 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -228,16 +223,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -274,15 +269,41 @@ do # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - dstdir=`dirname "$dst"` + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + test -d "$dstdir" dstdir_status=$? fi @@ -293,81 +314,74 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # $RANDOM is not portable (e.g. dash); use it when possible to - # lower collision chance - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # As "mkdir -p" follows symlinks and we work in /tmp possibly; so - # create the $tmpdir first (and fail if unsuccessful) to make sure - # that nobody tries to guess the $tmpdir name. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -377,51 +391,53 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac + eval "$initialize_posix_glob" + oIFS=$IFS IFS=/ - set -f + $posix_glob set -f set fnord $dstdir shift - set +f + $posix_glob set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -456,12 +472,15 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - set +f && + $posix_glob set +f && + test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -474,24 +493,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 @@ -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.11 +# $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.11" +VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 @@ -6124,10 +6124,7 @@ func_mode_link () case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -6447,19 +6444,19 @@ func_mode_link () # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done continue fi # $pass = conv @@ -7352,9 +7349,6 @@ func_mode_link () revision="$number_minor" lt_irix_increment=no ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; esac ;; no) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index d7c043f..f12cfdf 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1324,19 +1324,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac + LD="${LD-ld} -m elf_i386" ;; - powerpc64le-*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1355,10 +1348,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) + powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; - powerpc-*) + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1701,8 +1694,7 @@ 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" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + if test -n "$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 @@ -2526,6 +2518,17 @@ freebsd* | dragonfly*) esac ;; +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2642,7 +2645,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -2672,10 +2675,14 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) # before this can be enabled. hardcode_into_libs=yes + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2687,18 +2694,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -3258,6 +3253,10 @@ freebsd* | dragonfly*) fi ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3296,11 +3295,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4048,7 +4047,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4112,7 +4111,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4347,7 +4346,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4589,9 +4588,6 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4654,9 +4650,6 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4878,7 +4871,7 @@ _LT_EOF fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5055,7 +5048,6 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -5360,7 +5352,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6240,6 +6232,9 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; + gnu*) + ;; + haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6401,7 +6396,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2012-06-26.16; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ give_advice () ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." + echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) @@ -3,7 +3,7 @@ scriptversion=2011-06-08.12; # UTC -# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2013 Free Software Foundation, Inc. # 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 diff --git a/pygtkcompat/Makefile.in b/pygtkcompat/Makefile.in index 37e4c85..fc952c3 100644 --- a/pygtkcompat/Makefile.in +++ b/pygtkcompat/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,17 +14,7 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -88,6 +78,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pygtkcompat +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(pygtkcompat_PYTHON) $(top_srcdir)/py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -96,8 +88,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(pygtkcompat_PYTHON) \ - $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -154,7 +144,6 @@ am__pep3147_tweak = \ sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|' py_compile = $(top_srcdir)/py-compile am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ @@ -191,7 +180,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -315,7 +303,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -345,6 +332,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign pygtkcompat/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign pygtkcompat/Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -571,8 +559,6 @@ uninstall-am: uninstall-pygtkcompatPYTHON mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-pygtkcompatPYTHON -.PRECIOUS: Makefile - # if we build in a separate tree, we need to symlink the *.py files from the # source tree; Python does not accept the extensions and modules in different diff --git a/tests/Makefile.am b/tests/Makefile.am index b36ff51..9d5db5e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -116,6 +116,7 @@ EXTRA_DIST = \ test_generictreemodel.py \ test_docstring.py \ test_repository.py \ + test_resulttuple.py \ compat_test_pygtk.py \ gi/__init__.py \ gi/overrides/__init__.py \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 0fc5f40..35f370f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,17 +14,7 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -92,6 +82,8 @@ host_triplet = @host@ @ENABLE_CAIRO_TRUE@am__append_1 = libregress.la @ENABLE_CAIRO_TRUE@am__append_2 = Regress-1.0.typelib subdir = tests +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -100,7 +92,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -196,7 +187,6 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ @@ -233,7 +223,6 @@ EXEEXT = @EXEEXT@ FFI_CFLAGS = @FFI_CFLAGS@ FFI_LIBS = @FFI_LIBS@ FGREP = @FGREP@ -GCOV = @GCOV@ GENHTML = @GENHTML@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ @@ -357,7 +346,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -429,6 +417,7 @@ EXTRA_DIST = \ test_generictreemodel.py \ test_docstring.py \ test_repository.py \ + test_resulttuple.py \ compat_test_pygtk.py \ gi/__init__.py \ gi/overrides/__init__.py \ @@ -462,6 +451,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile +.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -512,14 +502,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -782,8 +772,6 @@ uninstall-am: mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am -.PRECIOUS: Makefile - # This is a hack to make sure a shared library is built libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES) diff --git a/tests/test_error.py b/tests/test_error.py index baccef5..f5a89ce 100644 --- a/tests/test_error.py +++ b/tests/test_error.py @@ -64,6 +64,14 @@ class TestType(unittest.TestCase): self.assertTrue(issubclass(GLib.Error, RuntimeError)) +class ObjectWithVFuncException(GIMarshallingTests.Object): + def do_vfunc_meth_with_err(self, x): + if x == 42: + return True + + raise GLib.Error('unexpected value %d' % x, 'mydomain', 42) + + class TestMarshalling(unittest.TestCase): def test_array_in_crash(self): # Previously there was a bug in invoke, in which C arrays were unwrapped @@ -111,6 +119,20 @@ class TestMarshalling(unittest.TestCase): self.assertEqual(e.code, GIMarshallingTests.CONSTANT_GERROR_CODE) self.assertEqual(e.message, GIMarshallingTests.CONSTANT_GERROR_MESSAGE) + def test_vfunc_no_exception(self): + obj = ObjectWithVFuncException() + self.assertTrue(obj.vfunc_meth_with_error(42)) + + def test_vfunc_gerror_exception(self): + obj = ObjectWithVFuncException() + with self.assertRaises(GLib.Error) as context: + obj.vfunc_meth_with_error(-1) + + e = context.exception + self.assertEqual(e.message, 'unexpected value -1') + self.assertEqual(e.domain, 'mydomain') + self.assertEqual(e.code, 42) + if __name__ == '__main__': unittest.main() diff --git a/tests/test_gi.py b/tests/test_gi.py index 4cdd1a4..1fbc216 100644 --- a/tests/test_gi.py +++ b/tests/test_gi.py @@ -1544,6 +1544,16 @@ class TestEnum(unittest.TestCase): gi._gi.enum_add, GIMarshallingTests.NoTypeFlags.__gtype__) + def test_type_module_name(self): + self.assertEqual(GIMarshallingTests.Enum.__name__, "Enum") + self.assertEqual(GIMarshallingTests.Enum.__module__, + "gi.repository.GIMarshallingTests") + + def test_repr(self): + self.assertEqual(repr(GIMarshallingTests.Enum.VALUE3), + "<enum GI_MARSHALLING_TESTS_ENUM_VALUE3 of type " + "GIMarshallingTests.Enum>") + class TestEnumVFuncResults(unittest.TestCase): class EnumTester(GIMarshallingTests.Object): @@ -1604,6 +1614,16 @@ class TestGEnum(unittest.TestCase): self.assertTrue(isinstance(genum, GIMarshallingTests.GEnum)) self.assertEqual(genum, GIMarshallingTests.GEnum.VALUE1) + def test_type_module_name(self): + self.assertEqual(GIMarshallingTests.GEnum.__name__, "GEnum") + self.assertEqual(GIMarshallingTests.GEnum.__module__, + "gi.repository.GIMarshallingTests") + + def test_repr(self): + self.assertEqual(repr(GIMarshallingTests.GEnum.VALUE3), + "<enum GI_MARSHALLING_TESTS_GENUM_VALUE3 of type " + "GIMarshallingTests.GEnum>") + class TestGFlags(unittest.TestCase): @@ -1657,6 +1677,16 @@ class TestGFlags(unittest.TestCase): self.assertTrue(isinstance(flags, GIMarshallingTests.Flags)) self.assertEqual(flags, GIMarshallingTests.Flags.VALUE1) + def test_type_module_name(self): + self.assertEqual(GIMarshallingTests.Flags.__name__, "Flags") + self.assertEqual(GIMarshallingTests.Flags.__module__, + "gi.repository.GIMarshallingTests") + + def test_repr(self): + self.assertEqual(repr(GIMarshallingTests.Flags.VALUE2), + "<flags GI_MARSHALLING_TESTS_FLAGS_VALUE2 of type " + "GIMarshallingTests.Flags>") + class TestNoTypeFlags(unittest.TestCase): @@ -1706,6 +1736,17 @@ class TestNoTypeFlags(unittest.TestCase): self.assertEqual(GIMarshallingTests.NoTypeFlags.__gtype__.name, 'PyGIMarshallingTestsNoTypeFlags') + def test_type_module_name(self): + self.assertEqual(GIMarshallingTests.NoTypeFlags.__name__, + "NoTypeFlags") + self.assertEqual(GIMarshallingTests.NoTypeFlags.__module__, + "gi.repository.GIMarshallingTests") + + def test_repr(self): + self.assertEqual(repr(GIMarshallingTests.NoTypeFlags.VALUE2), + "<flags GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE2 of " + "type GIMarshallingTests.NoTypeFlags>") + class TestStructure(unittest.TestCase): @@ -1930,6 +1971,27 @@ class TestStructure(unittest.TestCase): self.assertRaises(TypeError, GIMarshallingTests.Union.method) + def test_repr(self): + self.assertRegexpMatches( + repr(GIMarshallingTests.PointerStruct()), + "<GIMarshallingTests.PointerStruct object at 0x[^\s]+ " + "\(void at 0x[^\s]+\)>") + + self.assertRegexpMatches( + repr(GIMarshallingTests.SimpleStruct()), + "<GIMarshallingTests.SimpleStruct object at 0x[^\s]+ " + "\(void at 0x[^\s]+\)>") + + self.assertRegexpMatches( + repr(GIMarshallingTests.Union()), + "<GIMarshallingTests.Union object at 0x[^\s]+ " + "\(GIMarshallingTestsUnion at 0x[^\s]+\)>") + + self.assertRegexpMatches( + repr(GIMarshallingTests.BoxedStruct()), + "<GIMarshallingTests.BoxedStruct object at 0x[^\s]+ " + "\(GIMarshallingTestsBoxedStruct at 0x[^\s]+\)>") + class TestGObject(unittest.TestCase): @@ -2060,6 +2122,18 @@ class TestGObject(unittest.TestCase): self.assertEqual(object_.__grefcount__, 1) self.assertEqual(new_object.__grefcount__, 1) + def test_repr(self): + self.assertRegexpMatches( + repr(GIMarshallingTests.Object(int=42)), + "<GIMarshallingTests.Object object at 0x[^\s]+ " + "\(GIMarshallingTestsObject at 0x[^\s]+\)>") + + def test_nongir_repr(self): + self.assertRegexpMatches( + repr(Gio.File.new_for_path("")), + "<__gi__.GLocalFile object at 0x[^\s]+ " + "\(GLocalFile at 0x[^\s]+\)>") + # FIXME: Doesn't actually return the same object. # def test_object_inout_same(self): # object_ = GIMarshallingTests.Object() diff --git a/tests/test_import_machinery.py b/tests/test_import_machinery.py index de9f1e9..e1432b1 100644 --- a/tests/test_import_machinery.py +++ b/tests/test_import_machinery.py @@ -77,6 +77,19 @@ class TestModule(unittest.TestCase): # Restore the previous cache gi.module._introspection_modules = old_modules + def test_module_dependency_loading(self): + # Difficult to because this generally need to run in isolation to make + # sure GIMarshallingTests has not yet been loaded. But we can do this with: + # make check TEST_NAMES=test_import_machinery.TestModule.test_module_dependency_loading + if 'gi.repository.Gio' in sys.modules: + return + + from gi.repository import GIMarshallingTests + GIMarshallingTests # PyFlakes + + self.assertIn('gi.repository.Gio', sys.modules) + self.assertIn('gi.repository.GIMarshallingTests', sys.modules) + def test_static_binding_protection(self): # Importing old static bindings once gi has been imported should not # crash but instead give back a dummy module which produces RuntimeErrors diff --git a/tests/test_overrides_gdk.py b/tests/test_overrides_gdk.py index 9559a09..a0ffac4 100644 --- a/tests/test_overrides_gdk.py +++ b/tests/test_overrides_gdk.py @@ -157,16 +157,16 @@ class TestGdk(unittest.TestCase): self.assertEqual(Gdk.ModifierType.META_MASK | 0, 0x10000000) self.assertEqual(hex(Gdk.ModifierType.META_MASK), '0x10000000') self.assertEqual(str(Gdk.ModifierType.META_MASK), - '<flags GDK_META_MASK of type GdkModifierType>') + '<flags GDK_META_MASK of type Gdk.ModifierType>') self.assertEqual(Gdk.ModifierType.RELEASE_MASK | 0, 0x40000000) self.assertEqual(hex(Gdk.ModifierType.RELEASE_MASK), '0x40000000') self.assertEqual(str(Gdk.ModifierType.RELEASE_MASK), - '<flags GDK_RELEASE_MASK of type GdkModifierType>') + '<flags GDK_RELEASE_MASK of type Gdk.ModifierType>') self.assertEqual(Gdk.ModifierType.RELEASE_MASK | Gdk.ModifierType.META_MASK, 0x50000000) self.assertEqual(str(Gdk.ModifierType.RELEASE_MASK | Gdk.ModifierType.META_MASK), - '<flags GDK_META_MASK | GDK_RELEASE_MASK of type GdkModifierType>') + '<flags GDK_META_MASK | GDK_RELEASE_MASK of type Gdk.ModifierType>') def test_color_parse(self): with capture_glib_deprecation_warnings(): diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py index 44f2f6e..9aa592c 100644 --- a/tests/test_overrides_gtk.py +++ b/tests/test_overrides_gtk.py @@ -692,6 +692,7 @@ class TestSignals(unittest.TestCase): with realized(win): win.show() + win.get_preferred_size() win.size_allocate(rect) self.assertTrue(win._alloc_called) self.assertIsInstance(win._alloc_value, Gdk.Rectangle) diff --git a/tests/test_repository.py b/tests/test_repository.py index 4c83acd..f59f86b 100644 --- a/tests/test_repository.py +++ b/tests/test_repository.py @@ -74,6 +74,16 @@ class Test(unittest.TestCase): self.assertFalse(repo.is_registered("GIRepository", "99.0")) self.assertFalse(repo.is_registered("GIRepository", "1.0")) + def test_repo_get_immediate_dependencies(self): + self.assertRaises(TypeError, repo.get_immediate_dependencies) + self.assertEqual(repo.get_immediate_dependencies("GLib"), []) + self.assertEqual( + repo.get_immediate_dependencies("GObject"), ["GLib-2.0"]) + self.assertEqual( + repo.get_immediate_dependencies(namespace="GObject"), ["GLib-2.0"]) + self.assertEqual( + repo.get_immediate_dependencies("GIMarshallingTests"), ["Gio-2.0"]) + def test_arg_info(self): func_info = repo.find_by_name('GIMarshallingTests', 'array_fixed_out_struct') args = func_info.get_arguments() diff --git a/tests/test_resulttuple.py b/tests/test_resulttuple.py new file mode 100644 index 0000000..20f80f3 --- /dev/null +++ b/tests/test_resulttuple.py @@ -0,0 +1,87 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2015 Christoph Reiter <reiter.christoph@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 +# USA + +import unittest +import pickle + +import gi +from gi.repository import GIMarshallingTests +from gi.repository import Regress + + +ResultTuple = gi._gi.ResultTuple + + +class TestResultTuple(unittest.TestCase): + + def test_base(self): + self.assertTrue(issubclass(ResultTuple, tuple)) + + def test_create(self): + new = ResultTuple._new_type([None, "foo", None, "bar"]) + self.assertTrue(issubclass(new, ResultTuple)) + + def test_repr_dir(self): + new = ResultTuple._new_type([None, "foo", None, "bar"]) + inst = new([1, 2, 3, "a"]) + + self.assertEqual(repr(inst), "(1, foo=2, 3, bar='a')") + self.assertTrue("foo" in dir(inst)) + + def test_repr_dir_empty(self): + new = ResultTuple._new_type([]) + inst = new() + self.assertEqual(repr(inst), "()") + dir(inst) + + def test_getatttr(self): + new = ResultTuple._new_type([None, "foo", None, "bar"]) + inst = new([1, 2, 3, "a"]) + + self.assertTrue(hasattr(inst, "foo")) + self.assertEqual(inst.foo, inst[1]) + self.assertRaises(AttributeError, getattr, inst, "nope") + + def test_pickle(self): + new = ResultTuple._new_type([None, "foo", None, "bar"]) + inst = new([1, 2, 3, "a"]) + + inst2 = pickle.loads(pickle.dumps(inst)) + self.assertEqual(inst2, inst) + self.assertTrue(isinstance(inst2, tuple)) + self.assertFalse(isinstance(inst2, new)) + + def test_gi(self): + res = GIMarshallingTests.init_function([]) + self.assertEqual(repr(res), "(True, argv=[])") + + res = GIMarshallingTests.array_return_etc(5, 9) + self.assertEqual(repr(res), "([5, 0, 1, 9], sum=14)") + + res = GIMarshallingTests.array_out_etc(-5, 9) + self.assertEqual(repr(res), "(ints=[-5, 0, 1, 9], sum=4)") + + cb = lambda: (1, 2) + res = GIMarshallingTests.callback_multiple_out_parameters(cb) + self.assertEqual(repr(res), "(a=1.0, b=2.0)") + + def test_regress(self): + res = Regress.TestObj().skip_return_val(50, 42.0, 60, 2, 3) + self.assertEqual(repr(res), "(out_b=51, inout_d=61, out_sum=32)") |