From 1a48cb6e7504163228442a2894af21af66e93eb2 Mon Sep 17 00:00:00 2001 From: "Graydon, Tracy" Date: Fri, 30 Nov 2012 12:11:38 -0800 Subject: [PATCH] Update to 2.28 for TINF-96 --- ChangeLog | 9899 ++++++++++++++++++- MANIFEST.in | 2 +- Makefile.am | 44 +- Makefile.in | 82 +- NEWS | 623 +- PKG-INFO | 4 +- README.win32 | 13 +- aclocal.m4 | 2256 ++--- codegen/Makefile.am | 2 + codegen/Makefile.in | 33 +- codegen/argtypes.py | 8 +- codegen/definitions.py | 14 +- codegen/docextract_to_xml.py | 2 +- config.h.in | 7 +- configure | 12760 ++++++++++++++----------- configure.ac | 111 +- docs/Makefile.am | 2 + docs/Makefile.in | 33 +- docs/html/class-gioappinfo.html | 12 +- docs/html/class-gioapplaunchcontext.html | 8 +- docs/html/class-gioasyncresult.html | 12 +- docs/html/class-giobufferedinputstream.html | 10 +- docs/html/class-giobufferedoutputstream.html | 10 +- docs/html/class-giocancellable.html | 10 +- docs/html/class-giodatainputstream.html | 8 +- docs/html/class-giodataoutputstream.html | 8 +- docs/html/class-giodrive.html | 10 +- docs/html/class-gioemblem.html | 12 +- docs/html/class-gioemblemedicon.html | 10 +- docs/html/class-giofile.html | 12 +- docs/html/class-giofileattributeinfo.html | 6 +- docs/html/class-giofileenumerator.html | 8 +- docs/html/class-giofileicon.html | 8 +- docs/html/class-giofileinfo.html | 8 +- docs/html/class-giofileinputstream.html | 10 +- docs/html/class-giofilemonitor.html | 8 +- docs/html/class-giofileoutputstream.html | 10 +- docs/html/class-giofilterinputstream.html | 8 +- docs/html/class-giofilteroutputstream.html | 8 +- docs/html/class-gioicon.html | 14 +- docs/html/class-gioinputstream.html | 8 +- docs/html/class-gioloadableicon.html | 12 +- docs/html/class-giomemoryinputstream.html | 12 +- docs/html/class-giomemoryoutputstream.html | 10 +- docs/html/class-giomount.html | 14 +- docs/html/class-giomountoperation.html | 10 +- docs/html/class-giooutputstream.html | 8 +- docs/html/class-gioseekable.html | 10 +- docs/html/class-giosimpleasyncresult.html | 10 +- docs/html/class-giothemedicon.html | 8 +- docs/html/class-giounixinputstream.html | 8 +- docs/html/class-giounixoutputstream.html | 8 +- docs/html/class-giovolume.html | 12 +- docs/html/class-giovolumemonitor.html | 12 +- docs/html/class-glibmaincontext.html | 20 +- docs/html/class-glibmainloop.html | 16 +- docs/html/class-gobject.html | 16 +- docs/html/class-gobjectgboxed.html | 8 +- docs/html/class-gobjectginterface.html | 6 +- docs/html/class-gobjectgpointer.html | 8 +- docs/html/gio-class-reference.html | 2 +- docs/html/gio-constants.html | 2 +- docs/html/gio-functions.html | 4 +- docs/html/giounix-class-reference.html | 2 +- docs/html/glib-class-reference.html | 2 +- docs/html/glib-constants.html | 2 +- docs/html/glib-functions.html | 24 +- docs/html/gobject-class-reference.html | 2 +- docs/html/gobject-constants.html | 2 +- docs/html/gobject-functions.html | 12 +- docs/html/index.html | 2 +- docs/html/pygobject-introduction.html | 2 +- docs/reference/pygio-mount.xml | 5 +- docs/reference/pyglib-functions.xml | 18 +- docs/reference/pyglib-maincontext.xml | 12 +- docs/reference/pyglib-mainloop.xml | 6 +- docs/reference/pygobject-functions.xml | 6 +- docs/reference/pygobject.xml | 4 +- dsextras.py | 290 +- examples/Makefile.am | 4 +- examples/Makefile.in | 35 +- examples/cairo-demo.py | 123 + gi/Makefile.am | 94 + gi/Makefile.in | 1017 ++ gi/__init__.py | 55 + gi/gimodule.c | 531 + gi/importer.py | 79 + gi/module.py | 287 + gi/overrides/GIMarshallingTests.py | 67 + gi/overrides/GLib.py | 303 + gi/overrides/Gdk.py | 291 + gi/overrides/Gio.py | 215 + gi/overrides/Gtk.py | 1251 +++ gi/overrides/Makefile.am | 17 + gi/overrides/Makefile.in | 485 + gi/overrides/Pango.py | 51 + gi/overrides/__init__.py | 66 + gi/overrides/keysyms.py | 1499 +++ gi/pygi-argument.c | 2154 +++++ gi/pygi-argument.h | 70 + gi/pygi-boxed.c | 182 + gi/pygi-boxed.h | 42 + gi/pygi-callbacks.c | 221 + gi/pygi-callbacks.h | 48 + gi/pygi-closure.c | 445 + gi/pygi-closure.h | 57 + gi/pygi-foreign-cairo.c | 136 + gi/pygi-foreign-gvariant.c | 62 + gi/pygi-foreign-gvariant.h | 39 + gi/pygi-foreign.c | 173 + gi/pygi-foreign.h | 48 + gi/pygi-info.c | 1617 ++++ gi/pygi-info.h | 73 + gi/pygi-invoke.c | 1034 ++ gi/pygi-invoke.h | 38 + gi/pygi-private.h | 84 + gi/pygi-property.c | 349 + gi/pygi-property.h | 39 + gi/pygi-repository.c | 292 + gi/pygi-repository.h | 39 + gi/pygi-signal-closure.c | 245 + gi/pygi-signal-closure.h | 46 + gi/pygi-struct.c | 146 + gi/pygi-struct.h | 40 + gi/pygi-type.c | 99 + gi/pygi-type.h | 45 + gi/pygi.h | 208 + gi/pygobject-external.h | 83 + gi/repository/Makefile.am | 10 + gi/repository/Makefile.in | 478 + gi/repository/__init__.py | 30 + gi/types.py | 301 + gio/Makefile.am | 1 + gio/Makefile.in | 157 +- gio/gappinfo.override | 5 + gio/gfile.override | 13 +- gio/gio.override | 7 +- gio/giomodule.c | 153 +- gio/pygio-utils.c | 42 +- glib/Makefile.am | 6 +- glib/Makefile.in | 159 +- glib/glibmodule.c | 157 +- glib/option.py | 22 +- glib/pygiochannel.c | 112 +- glib/pyglib-private.h | 3 + glib/pyglib-python-compat.h | 197 +- glib/pyglib.c | 176 +- glib/pyglib.h | 17 +- glib/pygmaincontext.c | 39 +- glib/pygmaincontext.h | 2 +- glib/pygmainloop.c | 22 +- glib/pygoptioncontext.c | 45 +- glib/pygoptioncontext.h | 2 + glib/pygoptiongroup.c | 48 +- glib/pygoptiongroup.h | 2 + glib/pygsource.c | 28 +- glib/pygspawn.c | 33 +- gobject/Makefile.am | 14 +- gobject/Makefile.in | 200 +- gobject/__init__.py | 16 +- gobject/gobjectmodule.c | 271 +- gobject/propertyhelper.py | 43 +- gobject/pygboxed.c | 22 +- gobject/pygenum.c | 126 +- gobject/pygflags.c | 194 +- gobject/pygi-external.h | 67 - gobject/pygobject-private.h | 25 +- gobject/pygobject.c | 239 +- gobject/pygobject.h | 31 + gobject/pygparamspec.c | 43 +- gobject/pygpointer.c | 21 +- gobject/pygtype.c | 320 +- ltmain.sh | 3968 +++++--- m4/libtool.m4 | 2003 ++-- m4/ltoptions.m4 | 13 +- m4/ltversion.m4 | 12 +- m4/lt~obsolete.m4 | 12 +- m4/python.m4 | 40 +- packaging/pygobject-rpmlintrc | 3 - packaging/pygobject.spec | 358 +- pygobject-2.0.pc.in | 1 + pygobject_postinstall.py | 71 +- setup.py | 259 +- tests/Makefile.am | 158 +- tests/Makefile.in | 297 +- tests/common.py | 48 - tests/compathelper.py | 69 + tests/org.gnome.test.gschema.xml | 25 + tests/runtests.py | 58 +- tests/test-floating.c | 66 + tests/test-floating.h | 41 + tests/test_everything.py | 467 + tests/test_gcancellable.py | 15 + tests/test_gdbus.py | 218 + tests/test_gi.py | 1752 ++++ tests/test_gicon.py | 3 +- tests/test_gio.py | 19 +- tests/test_gobject.py | 161 +- tests/test_gresolver.py | 68 + tests/test_gsocket.py | 126 + tests/test_interface.py | 6 +- tests/test_mainloop.py | 14 +- tests/test_option.py | 120 + tests/test_overrides.py | 1505 +++ tests/test_properties.py | 80 +- tests/test_signal.py | 16 +- tests/test_source.py | 8 +- tests/test_subprocess.py | 5 +- tests/test_thread.py | 29 + tests/test_unknown.py | 15 - tests/test_uris.py | 15 + tests/testhelpermodule.c | 324 +- 212 files changed, 46464 insertions(+), 11247 deletions(-) create mode 100755 examples/cairo-demo.py create mode 100644 gi/Makefile.am create mode 100644 gi/Makefile.in create mode 100644 gi/__init__.py create mode 100644 gi/gimodule.c create mode 100644 gi/importer.py create mode 100644 gi/module.py create mode 100644 gi/overrides/GIMarshallingTests.py create mode 100644 gi/overrides/GLib.py create mode 100644 gi/overrides/Gdk.py create mode 100644 gi/overrides/Gio.py create mode 100644 gi/overrides/Gtk.py create mode 100644 gi/overrides/Makefile.am create mode 100644 gi/overrides/Makefile.in create mode 100644 gi/overrides/Pango.py create mode 100644 gi/overrides/__init__.py create mode 100644 gi/overrides/keysyms.py create mode 100644 gi/pygi-argument.c create mode 100644 gi/pygi-argument.h create mode 100644 gi/pygi-boxed.c create mode 100644 gi/pygi-boxed.h create mode 100644 gi/pygi-callbacks.c create mode 100644 gi/pygi-callbacks.h create mode 100644 gi/pygi-closure.c create mode 100644 gi/pygi-closure.h create mode 100644 gi/pygi-foreign-cairo.c create mode 100644 gi/pygi-foreign-gvariant.c create mode 100644 gi/pygi-foreign-gvariant.h create mode 100644 gi/pygi-foreign.c create mode 100644 gi/pygi-foreign.h create mode 100644 gi/pygi-info.c create mode 100644 gi/pygi-info.h create mode 100644 gi/pygi-invoke.c create mode 100644 gi/pygi-invoke.h create mode 100644 gi/pygi-private.h create mode 100644 gi/pygi-property.c create mode 100644 gi/pygi-property.h create mode 100644 gi/pygi-repository.c create mode 100644 gi/pygi-repository.h create mode 100644 gi/pygi-signal-closure.c create mode 100644 gi/pygi-signal-closure.h create mode 100644 gi/pygi-struct.c create mode 100644 gi/pygi-struct.h create mode 100644 gi/pygi-type.c create mode 100644 gi/pygi-type.h create mode 100644 gi/pygi.h create mode 100644 gi/pygobject-external.h create mode 100644 gi/repository/Makefile.am create mode 100644 gi/repository/Makefile.in create mode 100644 gi/repository/__init__.py create mode 100644 gi/types.py delete mode 100644 gobject/pygi-external.h delete mode 100644 packaging/pygobject-rpmlintrc delete mode 100644 tests/common.py create mode 100644 tests/compathelper.py create mode 100644 tests/org.gnome.test.gschema.xml create mode 100644 tests/test_everything.py create mode 100644 tests/test_gcancellable.py create mode 100644 tests/test_gdbus.py create mode 100644 tests/test_gi.py create mode 100644 tests/test_gresolver.py create mode 100644 tests/test_gsocket.py create mode 100644 tests/test_option.py create mode 100644 tests/test_overrides.py create mode 100644 tests/test_thread.py delete mode 100644 tests/test_unknown.py create mode 100644 tests/test_uris.py diff --git a/ChangeLog b/ChangeLog index fa99267..8a72a87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,228 +1,9204 @@ -commit a7fa8b80406227a06cf18f8675dbc1f471283829 -Author: Tomeu Vizoso -Date: Mon Jun 21 18:10:32 2010 +0200 +commit 42970db5949c615078c38a039da4745eeb194ac1 +Author: Ignacio Casal Quinteiro +Date: Fri Jun 10 14:01:32 2011 +0200 - Update NEWS and release PyGObject-2.21.3 + closure: avoid double free crash - NEWS | 7 +++++++ - 1 files changed, 7 insertions(+), 0 deletions(-) + gi/pygi-closure.c | 12 ++++-------- + 1 files changed, 4 insertions(+), 8 deletions(-) -commit 79acac7b86ec52cd3681d94d7f116314c3f00167 -Author: Ludovic L'Hours -Date: Tue Jul 21 16:28:34 2009 +0200 +commit 78366697d8f7fc53f20d9f52f9f39552c5e99bd1 +Author: John (J5) Palmieri +Date: Fri Jun 10 16:48:28 2011 -0400 - Proper handling of null-ok in virtual methods + [gi] backport of "GVariant has a GType" fe386a - https://bugzilla.gnome.org/show_bug.cgi?id=589253 + * backport the switch to using GIInterfaceInfo instead of GITypeInfo + for foreign types to support this patch - 01596a - codegen/codegen.py | 2 ++ - codegen/reversewrapper.py | 18 +++++++++++++++--- - 2 files changed, 17 insertions(+), 3 deletions(-) + gi/pygi-argument.c | 10 +++++----- + gi/pygi-foreign-cairo.c | 18 ++++++++++-------- + gi/pygi-foreign-gvariant.c | 15 +++++++-------- + gi/pygi-foreign-gvariant.h | 14 ++++++-------- + gi/pygi-foreign.c | 21 +++++++++------------ + gi/pygi-foreign.h | 16 ++++++++-------- + gi/pygi-invoke.c | 26 ++++++++++++++++---------- + 7 files changed, 61 insertions(+), 59 deletions(-) -commit 259a4b08f009aa01451caed20dbb6e68b402da2a +commit 0c348da3d974f63629c44e75067b8056dacc60d3 +Author: John (J5) Palmieri +Date: Fri Jun 10 16:46:20 2011 -0400 + + [gi] fixes to backport commit 6b5a65 - in older glib GVariants are + still structs + + gi/gimodule.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 6b5a656a3b77438c9bbb897c65343634b981c0e5 Author: Tomeu Vizoso -Date: Mon Jun 21 17:34:54 2010 +0200 +Date: Mon Jun 6 19:05:07 2011 +0200 - Add *~ and *.orig to .gitignore + GVariantType is a boxed struct - .gitignore | 5 ++++- - 1 files changed, 4 insertions(+), 1 deletions(-) + https://bugzilla.gnome.org/show_bug.cgi?id=647509 -commit 00a85f6a844714d1715e2f67431747d1a4cdacb1 + gi/gimodule.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 3f6bba909486d0ad1a27592fcf09c7ac8744fded Author: Tomeu Vizoso -Date: Mon Jun 21 17:33:56 2010 +0200 +Date: Mon Jun 6 17:38:21 2011 +0200 - Fall back to use the floating references API in glib if there isn't - a sinkfunc defined. + Use _gi.Struct to wrap fundamentals - * tests/*: Add ref counting tests for floating objects - * gobject/gobjectmodule.c, gobject/pygobject.c: Fall back to - g_object_ref_sink - or g_object_ref if there isn't a sinkfunc defined. Make sure that - pygobject_sink gets called only once per GObject instance. + https://bugzilla.gnome.org/show_bug.cgi?id=647509 - https://bugzilla.gnome.org/show_bug.cgi?id=583909 + gi/module.py | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) - gobject/gobjectmodule.c | 2 - - gobject/pygobject.c | 50 +++++++++++++-------- - gobject/pygobject.h | 1 + - tests/Makefile.am | 2 + - tests/test-floating.c | 95 ++++++++++++++++++++++++++++++++++++++++ - tests/test-floating.h | 60 +++++++++++++++++++++++++ - tests/test_gobject.py | 19 ++++++++- - tests/testhelpermodule.c | 109 - ++++++++++++++++++++++++++++++++++++++++++++++ - 8 files changed, 315 insertions(+), 23 deletions(-) +commit b7f5ce021bf16a422dc410b3ff44303e0757dc6e +Author: Jason Siefken +Date: Fri Jun 3 23:11:17 2011 -0700 -commit e71238a699ae783fd1a59c8a76e3555d8066cf82 -Author: Tomeu Vizoso -Date: Mon Jun 21 13:06:13 2010 +0200 + Added __eq__ method for Gdk.Color and Gdk.RGBA - Revert "Drop sinkfuncs." + Call Gdk.Color.equal and Gdk.RGBA.equal when + == equality testing is used. - This reverts commit 04627488220b4f2a16e11f8982af7866fea9f7eb. + gi/overrides/Gdk.py | 6 ++++++ + tests/test_overrides.py | 4 ++++ + 2 files changed, 10 insertions(+), 0 deletions(-) - gobject/gobjectmodule.c | 3 ++- - gobject/pygobject.c | 42 ++++++++++++++++++++++++++++++++++-------- - gobject/pygobject.h | 1 - - 3 files changed, 36 insertions(+), 10 deletions(-) +commit c016c27f545f398f1b57cf31f37392c97d2b5e50 +Author: Ignacio Casal Quinteiro +Date: Wed Jun 8 19:21:23 2011 +0200 -commit ec8d148eccbb3714093f21b595ea77ae4c7c3bce -Author: Johan Dahlin -Date: Sun Jun 20 10:49:55 2010 -0300 + Remove useless import - [giounix] Make it possible to compile on glib 2.20 + tests/test_everything.py | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 1598047c0ddd6a1d04d41e59dd182f3c0524f3c4 +Author: Ignacio Casal Quinteiro +Date: Wed Jun 8 19:18:23 2011 +0200 + + Revert "[gi] Removed hack to avoid using GLib.Variant.new_variant." + + This reverts commit dfe95b9ec598b57deaabd98ab488ab054a44ec09. + + gi/overrides/GLib.py | 14 +++++++++++++- + 1 files changed, 13 insertions(+), 1 deletions(-) + +commit ae9e098c14de3d2364c8b16c862aa77570c06a4a +Author: Ignacio Casal Quinteiro +Date: Wed Jun 8 19:13:48 2011 +0200 + + closure: Check the out arg is not null. Fixes bug #651812 + + gi/pygi-closure.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit eca590a3ff6bbfb78eef7b88d36cee59eb51b1d0 +Author: Daniel Drake +Date: Fri Jun 3 16:59:15 2011 +0100 + + Fix GC-related crash during PyGObject deallocation + + Python-2.7.1's GC source has the following comment: + + /* Python's cyclic gc should never see an incoming refcount + * of 0: if something decref'ed to 0, it should have been + * deallocated immediately at that time. + * Possible cause (if the assert triggers): a tp_dealloc + * routine left a gc-aware object tracked during its teardown + * phase, and did something-- or allowed something to + happen -- + * that called back into Python. gc can trigger then, and may + * see the still-tracked dying object. Before this assert + * was added, such mistakes went on to allow gc to try to + * delete the object again. In a debug build, that caused + * a mysterious segfault, when _Py_ForgetReference tried + * to remove the object from the doubly-linked list of all + * objects a second time. In a release build, an actual + * double deallocation occurred, which leads to corruption + * of the allocator's internal bookkeeping pointers. That's + * so serious that maybe this should be a release-build + * check instead of an assert? + */ + + As shown in a backtrace at + https://bugzilla.redhat.com/show_bug.cgi?id=640972 , pygobject + is making + this exact mistake. Before untracking its object, pygobject_dealloc + calls PyObject_ClearWeakRefs() which can call back into python, create + new allocations, and trigger the GC. + + This is causing Sugar (based on pygobject2 + pygtk2 static bindings) + to + crash on a regular basis while interacting with widgets or launching + applications. + + Fix this by untracking the object early. Also fix the same issue + spotted + in the GSource wrapper. + + Thanks to Bernie Innocenti for initial diagnosis. + + glib/pygsource.c | 6 ++++-- + gobject/pygobject.c | 8 +++++++- + 2 files changed, 11 insertions(+), 3 deletions(-) + +commit ad96a3f1d187a640ec0a463b766fd5e027f3c16a +Author: Martin Pitt +Date: Mon May 2 15:49:52 2011 +0200 + + Fix symbol names to be locale independent + + We currently use upper() to present enum values, which are usually + defined in + lower case in the typelib, in upper cases. However, upper() is locale + dependent, so that e. g. in tr_TR.UTF-8, "invalid" becomes "iNVALiD" + because Turkish has some extra variants of "i". + + Use a local ASCII-only translate() call instead to avoid this. Thanks + to Nils + Philippsen for the idea! + + This also adds a test locale "te_ST@nouppera" which defines + toupper('a') == 'a'. + Run the Enum tests under this locale to reproduce the bug and verify + the fix. + + https://bugzilla.gnome.org/show_bug.cgi?id=649165 + + gi/module.py | 9 ++++++++- + tests/te_ST@nouppera | 50 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + tests/test_gi.py | 30 ++++++++++++++++++++++++++++++ + 3 files changed, 88 insertions(+), 1 deletions(-) + +commit 90530b52f6eaa30bb704e413c01bb94ee511a0bb +Author: Sebastian Pölsterl +Date: Mon Apr 18 18:36:25 2011 +0200 + + Updated DOAP file + + pygobject.doap | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 996e5676a00e8d8fc55ef7400d15ccf5a4d904eb +Author: Sebastian Pölsterl +Date: Mon Apr 18 18:16:42 2011 +0200 + + Post release version bump to 2.28.5 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit afbcc71b71343b5a16dc8873c2ac7b9ca7dd801a +Author: Sebastian Pölsterl +Date: Mon Apr 18 18:06:56 2011 +0200 + + Release 2.28.4 + + NEWS | 11 +++++++++++ + configure.ac | 2 +- + 2 files changed, 12 insertions(+), 1 deletions(-) + +commit 4643bcad5845f5ec3dd9961616e3ed3b0946001f +Author: Sebastian Pölsterl +Date: Sat Apr 16 16:02:05 2011 +0200 - gio/unix.override | 2 ++ + [gi] Don't create variant twice + + gi/overrides/GLib.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 0e9e4ec7c28ac4564e15283636adc8b7bc1a83be +Author: Sebastian Pölsterl +Date: Fri Apr 15 16:14:43 2011 +0200 + + pygi-convert.sh: Make sure the uppercase GObject module is imported + instead of the lowercase + + https://bugzilla.gnome.org/show_bug.cgi?id=647736 + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit dfe95b9ec598b57deaabd98ab488ab054a44ec09 +Author: Sebastian Pölsterl +Date: Fri Apr 15 15:58:53 2011 +0200 + + [gi] Removed hack to avoid using GLib.Variant.new_variant. + + The bug in the annotations of GLib is fixed now. + https://bugzilla.gnome.org/show_bug.cgi?id=639952 + https://bugzilla.gnome.org/show_bug.cgi?id=647796 + + gi/overrides/GLib.py | 14 +------------- + 1 files changed, 1 insertions(+), 13 deletions(-) + +commit cfccd55128377864e3a42a64785637bd453621b2 +Author: Sebastian Pölsterl +Date: Fri Apr 15 15:58:31 2011 +0200 + + [gi] Added additional test case for GVariant handling + + tests/test_overrides.py | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 666ec192a4369e2fae508261a7a81b34326fc227 +Author: Sebastian Pölsterl +Date: Mon Apr 11 18:34:31 2011 +0200 + + [gi] Added support for GVariant arguments + + This is required in order for the "g-signal" signal of GDBusProxy + to work properly and thus to properly receive DBus signals with any + type of argument. + + https://bugzilla.gnome.org/show_bug.cgi?id=647477 + + gi/pygi-argument.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -commit 433ee2aa029a1482961f478252a06492bd3498e6 -Author: Sjoerd Simons -Date: Tue Jun 15 11:42:28 2010 +0200 +commit cc0e8423f36486d15f751bd3c14351edda28538d +Author: Steve Frécinaux +Date: Mon Apr 4 21:12:18 2011 +0200 - Release the lock when potentially invoking Python code. + Fix ABI break in old static bindings. - * gobject/pygobject.c: Release GIL lock when retrieving properties - and when clearing a PyGObject. + Commit 84d6142c14a7ebfb7284d3db52e14d3393f93905 (Always register a new + GType when a GObject class is subclassed) breaks the more advanced + usage + of PyGObject with regards to "metaclass hackery" as used in for + example + the kiwi and sqlkit projects. But the users of the gi-based bindings + now rely on the new behaviour. - https://bugzilla.gnome.org/show_bug.cgi?id=530935 + We fix this by restraining the systematical registering of new + types to + the new gi-based bindings, leaving the old pygtk ones untouched. - gobject/pygobject.c | 11 ++++++++++- - 1 files changed, 10 insertions(+), 1 deletions(-) + https://bugzilla.gnome.org/show_bug.cgi?id=646437 -commit d182630e1128fef6f1c2aea28ccd8da4bddd2c8f -Author: Tomeu Vizoso -Date: Thu Jun 10 20:23:13 2010 +0200 + gi/types.py | 9 +++++++++ + gobject/__init__.py | 16 +++++++++------- + 2 files changed, 18 insertions(+), 7 deletions(-) - Post release version bump to 2.21.3 +commit b0e499744d337adc608e2aa8996469bca2df044a +Author: Mike Gorse +Date: Sat Apr 2 18:45:40 2011 -0500 + + fetch size from an enum type + + Do not assume that an enum is returned as a long; treat it as an + int if + the type indicates that its size is that of an int. + + http://bugzilla.gnome.org/show_bug.cgi?id=646581 + gi/pygi-argument.c | 25 ++++++++++++++++++++++--- + 1 files changed, 22 insertions(+), 3 deletions(-) + +commit 4f59bee3a875eb71b8c9adce855b9addc965fe3b +Author: Dieter Verfaillie +Date: Tue Mar 22 20:47:51 2011 +0100 + + dsextras.py: ensure eol characters are preserved when writing template + files (so \n does not become \r\n) + + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b7a6f884e9ea5946691dd661b79e3094b6e1b34c +Author: John (J5) Palmieri +Date: Thu Mar 24 12:10:47 2011 -0400 + + release 2.28.3 + + NEWS | 3 +++ configure.ac | 2 +- + 2 files changed, 4 insertions(+), 1 deletions(-) + +commit 99689e2849a9df78980c9d25d9ddabc1e95f1252 +Author: John (J5) Palmieri +Date: Thu Mar 24 12:08:10 2011 -0400 + + Revert "dsextras.py: ensure eol characters are preserved when writing + template files (so \n does not become \r\n)" + + This reverts commit 27496e0e86e7d8798caf019fd09af5c6a30ec633. + + dsextras.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -commit c4e64d5d264593051b9a3131e4985a58e8e76f8b -Author: Tomeu Vizoso -Date: Thu Jun 10 20:21:13 2010 +0200 +commit 27496e0e86e7d8798caf019fd09af5c6a30ec633 +Author: Dieter Verfaillie +Date: Tue Mar 22 20:47:51 2011 +0100 - Update NEWS and release PyGObject-2.21.2 + dsextras.py: ensure eol characters are preserved when writing template + files (so \n does not become \r\n) - NEWS | 26 ++++++++++++++++++++++++++ - 1 files changed, 26 insertions(+), 0 deletions(-) + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) -commit e0fe844d5fe8f7e26316f197444fd4143ed36adf -Author: Tomeu Vizoso -Date: Thu Jun 10 20:09:07 2010 +0200 +commit b7449d63e0c1bdfb5acbd8c5ec073711441301b9 +Author: Dieter Verfaillie +Date: Tue Mar 22 11:35:44 2011 +0100 - Remove deleted files from the Makefile. + dsextras.py: remove \r as wel as \n character - test_conversion.py - test_enum.py - test_gtype.py - test_subtype.py + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) - tests/Makefile.am | 4 ---- - 1 files changed, 0 insertions(+), 4 deletions(-) +commit 075ead0533ba311120b3ca9ac9ae75ca84ace8fb +Author: John (J5) Palmieri +Date: Wed Mar 23 10:39:19 2011 -0400 -commit 495a301cb81c5e914bcef905999265604faa27fc -Author: Tomeu Vizoso -Date: Thu Jun 10 19:39:09 2010 +0200 + fix a typo when converting objects to strings gvalues - Add myself to the maintainers list in the README + gobject/pygtype.c | 4 ++-- + tests/test_properties.py | 8 ++++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) - README | 1 + +commit a904f0dea4b7f04aac7c9ddd3b01ffbbd808375e +Author: John (J5) Palmieri +Date: Tue Mar 22 21:56:14 2011 -0400 + + prep 2.28.2 release + + NEWS | 6 ++++++ + configure.ac | 2 +- + 2 files changed, 7 insertions(+), 1 deletions(-) + +commit c1ee6642d4b69a8c417cf92534ba091f89c7f68c +Author: John (J5) Palmieri +Date: Tue Mar 22 18:46:28 2011 -0400 + + fix static ABI for setting string gvalues from python objects + + * the static bindings used to be able to set a string gvalue to + any python + object that implemented __str__, for instance when setting a + treemodel column + * this restores that code while still keeping unicode and python 3 + compatability + + gobject/pygtype.c | 28 +++++++++++++++++++--------- + 1 files changed, 19 insertions(+), 9 deletions(-) + +commit cd38572b9781502d3228e74c017cb7cc39a07b3d +Author: Martin Pitt +Date: Tue Mar 22 15:04:01 2011 +0100 + + Fix GSchema tests for separate build tree + + When using a separate build tree, the compiled GSettings schema will + be in the + build tree, but as the test scripts are only in the source tree they + won't find + the compiled schema. Pass the build dir as environment variable and + prefer it + over test_overrides.py's directory. + + tests/Makefile.am | 3 ++- + tests/test_overrides.py | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +commit be81ea00d6cd92a5ae77c5bb301b6f6baeb6d89a +Author: Martin Pitt +Date: Tue Mar 22 14:02:46 2011 +0100 + + GIO tests: Fix remaining test case for separate build tree + + tests/test_gio.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 178df3e438835bec9b40dea243867784dee35815 +Author: Martin Pitt +Date: Tue Mar 22 13:21:27 2011 +0100 + + GIO tests: Fix for separate build tree + + When using a separate build tree, "test_gio.py" is not in the + current working + dir (which is the build tree), but in the srcdir. Use __file__ + instead. + + tests/test_gio.py | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +commit 27dcb9b1963be0c0d18e19a0b108a4a64d5e048b +Author: John (J5) Palmieri +Date: Mon Mar 21 12:42:36 2011 -0400 + + prep for 2.28.1 release + + NEWS | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 072d45cbfa7b360a0e616c4c56ba75d4dc08e7df +Author: John Stowers +Date: Sun Mar 6 23:41:30 2011 +1300 + + pygi-convert.sh remove gobject tests, GObject works now + + https://bugzilla.gnome.org/show_bug.cgi?id=644347 + + pygi-convert.sh | 28 ---------------------------- + 1 files changed, 0 insertions(+), 28 deletions(-) + +commit 205fee1622e461c0bcbe50e8befe30f01aac81eb +Author: John Stowers +Date: Sun Mar 6 23:41:01 2011 +1300 + + pygi-convert.sh add GObject.xxx and webkit + + https://bugzilla.gnome.org/show_bug.cgi?id=644347 + + pygi-convert.sh | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit f5ee2924af489c17b64e56be5d2bd1c39d1293d1 +Author: John (J5) Palmieri +Date: Wed Mar 16 17:34:18 2011 -0400 + + [gi] marshal raw closures + + * before we were able to marshal python callables into methods + that took + GClosures but we had no way to take a GClosure returned from one + method and pass it to another - this enables that usecase + + https://bugzilla.gnome.org/show_bug.cgi?id=644757 + + gi/pygi-argument.c | 15 ++++++++++----- + tests/test_gi.py | 4 ++++ + 2 files changed, 14 insertions(+), 5 deletions(-) + +commit ac11dc70b34fe077be18f7e605c9f3cce03ad3fa +Author: Martin Pitt +Date: Mon Mar 21 13:25:12 2011 +0100 + + Revert "Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES" + + This reverts commit fc7d7f7f153d57ff3866b7bfd5e6479d702cc4d9. + + This introduces additional libpython dependencies, which breaks + distributions + which support multiple Python versions, and also causes the python + interpreter + to be in memory twice in some cases. + + https://bugzilla.gnome.org/show_bug.cgi?id=620215 + + gi/Makefile.am | 4 +--- + gio/Makefile.am | 2 +- + glib/Makefile.am | 2 +- + m4/python.m4 | 7 ++----- + tests/Makefile.am | 2 +- + 5 files changed, 6 insertions(+), 11 deletions(-) + +commit aed7582de1c0623042601c8038a7631fa41d087d +Author: Dieter Verfaillie +Date: Fri Mar 18 17:06:08 2011 +0100 + + setup.py: fix user_access_control option + + setup.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6f0d33101a2451854f216291813951349d5ac471 +Author: John (J5) Palmieri +Date: Wed Mar 16 15:20:43 2011 -0400 + + [gi-overrides] fix marshalling pygobjects in treemodels + + * PyGObjects wern't being marshalled correctly as python objects + when a + treemodel column was set to take pyobjects + * Fix this by explicetly marshalling all PyObjects as boxed gvalue + types + in the overrides + + gi/overrides/Gtk.py | 9 +++++---- + tests/test_overrides.py | 34 ++++++++++++++++++++++++++-------- + 2 files changed, 31 insertions(+), 12 deletions(-) + +commit adb6f0320bed9a00a96c99424d4982199dc85af2 +Author: Martin Pitt +Date: Wed Mar 16 10:22:35 2011 +0100 + + [gi] Respect the MessageType for Gtk.MessageDialog + + Don't just ignore the type argument, actually pass it on. Thanks + to Tualatrix + Chou for spotting this! + + gi/overrides/Gtk.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -commit 04627488220b4f2a16e11f8982af7866fea9f7eb -Author: Tomeu Vizoso -Date: Thu Jun 10 19:24:31 2010 +0200 +commit 115c4750f071270b648218c9678931a65a4b3e3d +Author: Martin Pitt +Date: Tue Mar 15 10:22:39 2011 +0100 - Drop sinkfuncs. + [gi] Do not require signature for D-BUS methods without arguments - * use g_object methods to sink floating refs instead of allowing - custom sink functions to be registered - * we now sink inside of pygobject_new_full to handle cases where - a library creates its own gobject via g_object_new and just - needs a python wrapper - - a previous patch had done the sink when creating the gobject, - since it needs to call pygobject_new_full to wrap the object, - this patch handles both cases (e.g. pygobject created object - and externally created gobject) + Calling methods on DBusProxy objects usually requires specifying + the signature + as first argument. However, if the D-BUS method does not take any + arguments, + specifying the empty '()' signature does not give any additional + information, + so allow the caller to just call the proxy method without any + arguments. - https://bugzilla.gnome.org/show_bug.cgi?id=583909 + Also ensure that passing a non-string signature raises a + comprehensible + exception, instead of crashing deep in the GVariant leaf constructor. - gobject/gobjectmodule.c | 3 +-- - gobject/pygobject.c | 42 ++++++++---------------------------------- - gobject/pygobject.h | 1 + - 3 files changed, 10 insertions(+), 36 deletions(-) + https://bugzilla.gnome.org/show_bug.cgi?id=644260 -commit 87774a17bd607724a56e18c2eb1ac71b04b7079d -Author: Tomeu Vizoso -Date: Tue Jun 8 10:40:39 2010 +0200 + gi/overrides/Gio.py | 16 +++++++++++++++- + tests/test_gdbus.py | 13 +++++++++++++ + 2 files changed, 28 insertions(+), 1 deletions(-) + +commit 0df9e153812e1e5077bb906449e211ecb0af8736 +Author: John (J5) Palmieri +Date: Fri Mar 11 14:09:02 2011 -0500 + + [gi-demos] add pickers demo + + demos/gtk-demo/demos/pickers.py | 74 + +++++++++++++++++++++++++++++++++++++++ + 1 files changed, 74 insertions(+), 0 deletions(-) + +commit 419bfdd44b566ffb88f71165c00728872987dc5e +Author: John (J5) Palmieri +Date: Thu Mar 10 18:12:50 2011 -0500 + + [gi-demos] add menu demo + + demos/gtk-demo/demos/menus.py | 122 + +++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 122 insertions(+), 0 deletions(-) + +commit 0877670e184a591866cbf3ab14284fcb217b540b +Author: John Stowers +Date: Sun Mar 6 23:05:33 2011 +1300 + + [gi-overrides] TreeViewColumn.set_cell_data_func func_data can be None + + https://bugzilla.gnome.org/show_bug.cgi?id=644343 + + gi/overrides/Gtk.py | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 1f69c520d95fec30094fac47cb0efa31c79da81c +Author: John Stowers +Date: Sun Mar 6 17:48:04 2011 +1300 + + [gi-demos] dont try and run demos that represent directories + + demos/gtk-demo/gtk-demo.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit f06ad511725b28d821532acae45a25d0a186fc9f +Author: John (J5) Palmieri +Date: Wed Mar 9 13:02:50 2011 -0500 + + [gi-overrides] fix exception block so it works in Python 2.5 + + gi/overrides/Gio.py | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit a784350b6e76c6c66fb2856dd597238f4ac992e9 +Author: John (J5) Palmieri +Date: Tue Mar 8 13:25:57 2011 -0500 + + post release version bump + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit aa745352bb99862c360dc56e2fececc4b2968cbc +Author: John (J5) Palmieri +Date: Tue Mar 8 13:20:31 2011 -0500 + + prep 2.28.0 release + + NEWS | 25 +++++++++++++++++++++++++ + configure.ac | 4 ++-- + 2 files changed, 27 insertions(+), 2 deletions(-) + +commit d3bafc0a8bacf99e22b18c978012ab719e70954e +Author: John (J5) Palmieri +Date: Mon Mar 7 18:09:18 2011 -0500 + + [gi-demos] some python 3 compat fixes + + demos/gtk-demo/demos/Icon View/iconviewbasics.py | 6 ++++++ + demos/gtk-demo/demos/Tree View/liststore.py | 2 +- + demos/gtk-demo/demos/rotatedtext.py | 4 ++-- + demos/gtk-demo/gtk-demo.py | 4 ++-- + 4 files changed, 11 insertions(+), 5 deletions(-) + +commit eaafff23d397852b08384b4e15d68e3888e99b48 +Author: John (J5) Palmieri +Date: Mon Mar 7 18:08:40 2011 -0500 + + [gi-demos] catch the correct error class + + demos/gtk-demo/demos/images.py | 11 ++++++----- + 1 files changed, 6 insertions(+), 5 deletions(-) + +commit b113540b452638601945f63297e68b7564c3d4df +Author: Steve Frécinaux +Date: Mon Mar 7 01:58:36 2011 +0100 + + Try not to sink objects returned by C functions. + + When creating a wrapper around an object to call a python function, we + try to avoid calling pygobject_sink() when the object was not + created by + pygobject or the static bindings because otherwise we can end + up leaking + one reference for GInitiallyUnowned subclasses if the object was + already + owned by someone else. + + https://bugzilla.gnome.org/show_bug.cgi?id=644067 + + gobject/pygobject-private.h | 1 + + gobject/pygobject.c | 7 +++++++ + gobject/pygtype.c | 6 +++--- + 3 files changed, 11 insertions(+), 3 deletions(-) + +commit 7bece91e83e3c72a7bd04d2096dcf9b31aa9d366 +Author: Steve Frécinaux +Date: Sun Mar 6 21:18:36 2011 +0100 + + Do not leak python references when using the gobject.property() + helper. + + Since this helper was storing plain references in a long-lived + dict, the + refcount for the instances would never drop to zero, and so they would + never get finalized. + + https://bugzilla.gnome.org/show_bug.cgi?id=644039 + + gobject/propertyhelper.py | 5 ++--- + tests/test_properties.py | 23 +++++++++++++++++++++++ + 2 files changed, 25 insertions(+), 3 deletions(-) + +commit 030695cb4306d915044aea4fae7c7122ccde31b4 +Author: John (J5) Palmieri +Date: Mon Mar 7 11:13:12 2011 -0500 + + [gi] fix try except blocks so they work in Python 2.5 + + * use etype, e = sys.exc_info[:2] to extract error details instead of + except Exception as e or except Exception, e + + tests/test_gdbus.py | 27 ++++++++++++++++++++------- + 1 files changed, 20 insertions(+), 7 deletions(-) + +commit 7e6d833c7f74031b010b45b635214cde5d85f7ae +Author: John (J5) Palmieri +Date: Fri Mar 4 12:25:49 2011 -0500 + + handle uchar as bytes, not strings in python 3 + + * This worked in Python2 because bytes and strings are equivilant + and the macro + PYGLIB_PyString_FromStringAndSize evaluated to a PyString + * In Python 3 PYGLIB_PyString_FromStringAndSize evaluates to + a PyUnicode + * PYGLIB_PyBytes_FromStringAndSize evaluates to a PyString in Python 2 + and a PyBytes object in Python 3 + + gobject/pygtype.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit aae4ce5d9e9b7747bf5847071a72a6cdd1371a3e +Author: John (J5) Palmieri +Date: Fri Mar 4 12:24:35 2011 -0500 + + [gi-overrides] handle unichar gvalues when setting treemodels + + gi/overrides/Gtk.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit 0d65223992abec46eee7b2b3c76f68da67de4905 +Author: John (J5) Palmieri +Date: Fri Mar 4 11:43:51 2011 -0500 + + [gi-overrides] special case python 2 keywords that crept in + + gi/overrides/Gtk.py | 6 +++++- + tests/test_overrides.py | 8 ++++---- + 2 files changed, 9 insertions(+), 5 deletions(-) + +commit 094b355a785fbe7ebc776cbbd059e6a3d9241ce2 +Author: John (J5) Palmieri +Date: Fri Mar 4 11:10:16 2011 -0500 + + check for the py3 _thread module in configure.ac if thread is + not found + + configure.ac | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit b0d537c58e6997b546a9a367860abb3b93ce3440 +Author: John (J5) Palmieri +Date: Fri Mar 4 00:39:23 2011 -0500 + + [gi-demos] add iconview demo + + demos/gtk-demo/demos/Icon View/iconviewbasics.py | 212 + ++++++++++++++++++++++ + 1 files changed, 212 insertions(+), 0 deletions(-) + +commit e5aa7268c2a0fc285d60b30e135fd79d039b9ae5 +Author: John (J5) Palmieri +Date: Thu Mar 3 18:39:16 2011 -0500 + + [gi] wrap the keyword argument in a dict so we don't break Python 2.5 + + * python < 2.6 does not allow sending in keyword litterals after + sending in + *args. You can only send in **kwds. + + gi/types.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 79d03b40b2395874556860e7e39e0c607b6a676a +Author: John (J5) Palmieri +Date: Thu Mar 3 18:30:40 2011 -0500 + + [gi-demos] add the combobox with string ids section to the demos + + demos/gtk-demo/demos/combobox.py | 49 + +++++++++++++++++++++++++++++++++++++- + 1 files changed, 48 insertions(+), 1 deletions(-) + +commit 1b4ac8bef90ed1d3d51d45dafa61bfd70c6f9eb7 +Author: John (J5) Palmieri +Date: Thu Mar 3 16:47:51 2011 -0500 + + [gi-overrides] add an override for Gdk.RGBA + + gi/overrides/Gdk.py | 18 ++++++++++++++++++ + tests/test_overrides.py | 10 ++++++++++ + 2 files changed, 28 insertions(+), 0 deletions(-) + +commit c1c491c8cb4684a10404fee59b2706bec6b8606b +Author: John (J5) Palmieri +Date: Thu Mar 3 16:10:17 2011 -0500 + + [gi-demos] fix up search-entry to reflect annotations fixed in Gtk+ + master + + demos/gtk-demo/demos/Entry/search_entry.py | 23 +++++++++-------------- + 1 files changed, 9 insertions(+), 14 deletions(-) + +commit 9687fbcf75582986e95188c5b2a24d0fe6b855db +Author: John (J5) Palmieri +Date: Wed Mar 2 18:13:43 2011 -0500 + + [gi-demos] add search entry demo + + demos/gtk-demo/demos/Entry/search_entry.py | 257 + ++++++++++++++++++++++++++++ + 1 files changed, 257 insertions(+), 0 deletions(-) + +commit 28fbd6a11bda726fecfd7322f4acf41d06c54ec3 +Author: John (J5) Palmieri +Date: Wed Mar 2 15:37:27 2011 -0500 + + [gi] wrap map in a list for Python 3 compat + + gi/types.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d71224aa5b329cbb7116d35b8f98027fc27e630d +Author: John (J5) Palmieri +Date: Tue Mar 1 14:52:00 2011 -0500 + + [gi-demos] fix up the validation combobox + + demos/gtk-demo/demos/combobox.py | 21 +++++++++++++++------ + 1 files changed, 15 insertions(+), 6 deletions(-) + +commit d7d2f9c185773b35a6b89379be9bd96d04be79fb +Author: John (J5) Palmieri +Date: Tue Mar 1 12:31:35 2011 -0500 + + add overridesdir variable in the .pc file for 3rd party overrides + + pygobject-2.0.pc.in | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit c2cfdfa6c08b9da6bff9fc9d479e441a83cbf60a +Author: John (J5) Palmieri +Date: Tue Mar 1 12:19:28 2011 -0500 + + [gi] remove unref for closures since they are floating objects that + get sunk + + * right now we trust that the containers we send the closures into + will sink + them + * we should research this a bit more to see if there is a better + way to handle + floating closures once we are free to break static binding ABI + * for now this is the least invasive of all the options + * don't assert on transfer != GI_TRANSFER_NONE since the behavior for + closures is always the same (and should actually be + GI_TRANSFER_FULL) + + gi/pygi-argument.c | 6 ------ + tests/test_overrides.py | 8 ++++++++ + 2 files changed, 8 insertions(+), 6 deletions(-) + +commit e016486cbb24f696ebfc0cf1f457ec4e37a123cb +Author: Dieter Verfaillie +Date: Fri Feb 11 17:14:11 2011 +0100 + + setup.py: Set bdist_wininst user-access-control property + + setup.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 2923f26c7850d12ece67b3ef96054721d38f888f +Author: Martin Pitt +Date: Wed Mar 2 16:29:00 2011 +0100 + + Fix uninitialized variable in gi.require_version() + + gi/__init__.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit aaaa00bb4027432503efee88622d9289319b1983 +Author: Martin Pitt +Date: Tue Mar 1 23:26:07 2011 +0100 + + Run tests with LC_MESSAGES="C" + + Some tests, such as tests/test_gdbus.py check parts of error messages + or other + visible strings. Ensure that these do not get translated in the + test suite. + + tests/runtests.py | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 3aa089668f9ff3de86d2ca28e72c206c16c3403a +Author: John (J5) Palmieri +Date: Mon Feb 28 18:21:43 2011 -0500 + + [gi-overrides] override Gtk.stock_lookup to not return success + + demos/gtk-demo/demos/combobox.py | 2 +- + gi/overrides/Gtk.py | 9 +++++++++ + 2 files changed, 10 insertions(+), 1 deletions(-) + +commit 9614680269a267f8cf32a2d5534c50fb76ec48ec +Author: John (J5) Palmieri +Date: Mon Feb 28 14:23:04 2011 -0500 + + post release bump + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 093334ee29b5846ff57b4e9f74380efc9ed591e7 +Author: John (J5) Palmieri +Date: Mon Feb 28 14:16:00 2011 -0500 + + prep for 2.27.91 release + + NEWS | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 50 insertions(+), 0 deletions(-) + +commit 4b49a4f6123f0bbd5a36eba65b00142e3df7e595 +Author: John (J5) Palmieri +Date: Mon Feb 28 14:08:05 2011 -0500 + + [gi-tests] use Gdk.test_simulate_button instead of emitting event + ourselves + + * this function is available specifically so we can test events so + use this + instead of creating our own button press event + + tests/test_overrides.py | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit baa9865e6ff8b4eee4b16235b8dcc5dc48d2634d +Author: Laszlo Pandy +Date: Thu Feb 24 19:30:32 2011 +0100 + + [gi-tests] tests for EventButton override. + + * John (J5) Palmieri - fixed up original patch so that we actually + emit the event instead of just creating a Gdk.ButtonEvent object + + https://bugzilla.gnome.org/show_bug.cgi?id=642554 + + tests/test_overrides.py | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +commit 6366307ba020a40f6dfa22e64fd6345b118fd2e5 +Author: Tomeu Vizoso +Date: Wed Feb 16 09:44:12 2011 +0100 + + Skip interfaces when checking for conflicts in the MRO + + https://bugzilla.gnome.org/show_bug.cgi?id=642437 + + gi/types.py | 40 ++++++++++++++++++++++++++++++++++++++++ + gobject/gobjectmodule.c | 9 +++++++-- + tests/test_gi.py | 16 ++++++++++++++++ + 3 files changed, 63 insertions(+), 2 deletions(-) + +commit 14c787541966be8f497905d33d554343dabf8b73 +Author: John (J5) Palmieri +Date: Wed Feb 23 18:43:27 2011 -0500 + + [gi-overrides] Add event methods to all event union members + + https://bugzilla.gnome.org/show_bug.cgi?id=642554 + + gi/overrides/Gdk.py | 70 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 70 insertions(+), 0 deletions(-) + +commit 7f013383063c1d1e5a95cf4c056ff152d4aa2645 +Author: John (J5) Palmieri +Date: Wed Feb 23 14:14:16 2011 -0500 + + [gi] check to see if object is a member of a union when validating + paramaters + + * union members are not subclasses of the union they belong to so + if an + inteface requires you pass a union but you pass one of its members + there will be a type error + * this patch checks to see if the type you are passing is a member + of the + union and passes the checks if it is + * this works in python 3 but in python 2 methods do their own + isinstance + check on the instance parameter (e.g. self) so we need to figure + out how to override that for union methods + (e.g. Gdk.Event.get_state) + + https://bugzilla.gnome.org/show_bug.cgi?id=642554 + + gi/pygi-argument.c | 38 ++++++++++++++++++++++++++++++++++++++ + 1 files changed, 38 insertions(+), 0 deletions(-) + +commit 284e775b6caa86ef6465d17c87ec77376e66931c +Author: Laszlo Pandy +Date: Thu Feb 24 18:46:15 2011 +0100 + + [gi] Remove DyanmicModule.load() to _load() to prevent overriding + GI attrs. + + gi/importer.py | 2 +- + gi/module.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 6d6d4fcf4678b512558c2c0e44c0c2e235c810f4 +Author: Laszlo Pandy +Date: Wed Feb 23 12:05:03 2011 +0100 + + Test case with John's fix for crash with C arrays and a GError is set. + + I have added a test case, and made a few fixes to John's patch, + but the + solution is the same his. + + Workaround a bug when freeing C array types + + * This is a hack and there is really no way around it without + ripping out + the current array handling code which spans between pygi-invoke.c + and + pygi-argument.c and completely rewriting it. + * The is no time before our stable release + * This patch trades a segfault for a leak in the very unusual + case where + an error occures inside an interface that takes one or more C + arrays. Since + we wrap C arrays in GArrays internally but have to unwrap them + to send them + to the introspected C function, there is a period of time where + an error + can occure with the C array in an unknown state (some being true + C arrays + and others still wrapped in a GArray) + * This patch adds a c_arrays_are_wrapped state to signal that it + is safe to + free them. However since c_arrays_are_wrapped can only track + arrays + as a group, not individually, if it is set to FALSE we can + not assume + that every array is a pure C array, so instead we will simply + leak them + to avoid incorrectly freeing one and causing a segfault. + * This issue is fixed in the invoke rewrite branch as it treats + C arrays and + GArrays separately, however that branch is not yet ready to be + merged and + won't be until the next release. + + https://bugzilla.gnome.org/show_bug.cgi?id=642708 + + gi/pygi-invoke.c | 54 + ++++++++++++++++++++++++++++++++++++++++++++++++++---- + tests/test_gi.py | 9 +++++++++ + 2 files changed, 59 insertions(+), 4 deletions(-) + +commit 3534c1d4babefd4ee63e46119b279126058b7a71 +Author: John (J5) Palmieri +Date: Wed Feb 23 15:11:59 2011 -0500 + + [gi-overrides] fix setting rows in treeview to accept None as a value + + * as done in PyGTK None indicates the column should not be set + + gi/overrides/Gtk.py | 3 +++ + tests/test_overrides.py | 18 +++++++++++++----- + 2 files changed, 16 insertions(+), 5 deletions(-) + +commit ecbfaf60914a87f29ff0529614db9b6afca94c82 +Author: Laszlo Pandy +Date: Wed Feb 23 14:23:19 2011 +0100 + + [gi] Add value_name for enum and flags from introspection + "c:identifier" (if attr is available). + + gi/gimodule.c | 22 ++++++++++++++++++---- + tests/test_gi.py | 36 ++++++++++++++++++++++++++++++++++++ + 2 files changed, 54 insertions(+), 4 deletions(-) + +commit e5ae620ad772f62cb14ab7c049ba0ce00cc501f2 +Author: Laszlo Pandy +Date: Tue Feb 22 21:37:33 2011 +0100 + + Don't force loading of DynamicModule until set in sys.modules + + This fixes Tomeu's previous commit, which removed lazy loading. + Forcing the loading of a module before it is installed in sys.modules + prevents some overrides from being registered (namely Gtk.main_quit). + + https://bugzilla.gnome.org/show_bug.cgi?id=642305 + + gi/importer.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 992c0c1096c77bc299a40a34ec30a2ac0c562ed4 +Author: Laszlo Pandy +Date: Wed Feb 23 11:40:55 2011 +0100 + + Fix flags with multiple names for the same value. + + Flags constructs a dict __flags_values__ and uses it to cache + instances. However some flags in Glib such as G_IO_FLAG_MASK and + G_IO_FLAG_GET_MASK are aliases for the same int value, and will + override each other's place in the dictionary. + + The dict length check is not necessary. It only reduces the number + of duplicate instances we keep, because if an instance is not + found in the dict, a new one is created anyway. + + gobject/pygflags.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 8bf3f6ed075994eb3e29950670395bcf1b9dc2a0 +Author: John (J5) Palmieri +Date: Tue Feb 22 15:07:40 2011 -0500 + + [gi-demos] add liststore demo + + demos/gtk-demo/demos/Tree View/liststore.py | 205 + +++++++++++++++++++++++++++ + 1 files changed, 205 insertions(+), 0 deletions(-) + +commit 788fc96771046fc64cede392e748b2d1b6b3aa1c +Author: John (J5) Palmieri +Date: Tue Feb 22 14:35:44 2011 -0500 + + [gi-demos] run through the demos and remove the FIXMEs that have + been fixed + + demos/gtk-demo/demos/appwindow.py | 18 ++++++------------ + demos/gtk-demo/demos/assistant.py | 3 --- + demos/gtk-demo/demos/builder.py | 3 --- + demos/gtk-demo/demos/button_box.py | 10 +++------- + demos/gtk-demo/demos/clipboard.py | 8 ++------ + demos/gtk-demo/demos/colorselector.py | 2 -- + demos/gtk-demo/demos/combobox.py | 4 +--- + demos/gtk-demo/demos/drawingarea.py | 3 --- + 8 files changed, 12 insertions(+), 39 deletions(-) + +commit adf7aec853878681b450c3ef1f89bfe9ba85fec1 +Author: Tomeu Vizoso +Date: Wed Feb 16 11:53:18 2011 +0100 + + Load typelibs at import time, add gi.require_version() + + also adds Repository.get_loaded_namespaces() + + https://bugzilla.gnome.org/show_bug.cgi?id=642305 + + gi/__init__.py | 29 ++++++++++++++++++++++++++++- + gi/importer.py | 1 + + gi/module.py | 21 ++++----------------- + gi/pygi-repository.c | 23 +++++++++++++++++++++++ + 4 files changed, 56 insertions(+), 18 deletions(-) + +commit 6fe7783b96366f380f9168909932a87e35d994b3 +Author: John (J5) Palmieri +Date: Mon Feb 21 17:20:57 2011 -0500 + + use GValue support to marshal GtkTreeModel values correctly + + * needs patch from https://bugzilla.gnome.org/show_bug.cgi?id=642914 + + https://bugzilla.gnome.org/show_bug.cgi?id=642921 + + gi/overrides/Gtk.py | 37 ++++++++++++++++++-- + tests/test_overrides.py | 87 + ++++++++++++++++++++++++++++++++++++++++------- + 2 files changed, 107 insertions(+), 17 deletions(-) + +commit bc4a570bcc0a02029d746fbbcfdf4cc14c37f2ad +Author: John (J5) Palmieri +Date: Mon Feb 21 16:14:20 2011 -0500 + + [gi] pass raw GValues instead of trying to marshal them + + * Right now GValues are transparent to the user but this leave us no + way to describe fundimental types other than those supported + directly + by python (e.g. int, str, etc) + * If an interface is expecting a uint or other GValue type a user + can now use + the raw GValue interfaces and expect paramaters that take + GValues to + marshal them correctly e.g.: + value = GObject.Value() + value.int(GObject.TYPE_UINT) + value.set_uint(1234) + * The objective here is to not for users to use this API but for + overrides + to be able to utilize them. For instance in the TreeModel API + we can + get the expected type for a column and them create a GValue with + the correct + type so that he underlying python object is marshalled correctly. + + https://bugzilla.gnome.org/show_bug.cgi?id=642914 + + gi/pygi-argument.c | 24 ++++++++++++++++++------ + tests/test_gi.py | 9 ++++++++- + 2 files changed, 26 insertions(+), 7 deletions(-) + +commit 428fc90eb12f26ceb7c868879ad05788890d32a3 +Author: John (J5) Palmieri +Date: Sat Feb 19 19:42:41 2011 -0500 + + [gi-demos] add icon view edit and drag-and-drop demo + + demos/gtk-demo/demos/Icon View/iconviewedit.py | 101 + ++++++++++++++++++++++++ + 1 files changed, 101 insertions(+), 0 deletions(-) + +commit eb0e179bff167303db1c20412f4bc9c8baa94582 +Author: Laszlo Pandy +Date: Sat Feb 19 23:11:25 2011 +0100 + + [gi] Register GType for non-GType enums and flags at runtime. + + Note: rebuild of gobject-introspection is required for new tests. + + Previously non-GType enums used a separate type implemented in + Python, and non-GType flags had no implementation at all. This + removes the separate type for enums, and registers a new GType at + runtime if there isn't one. + + This allows non-GType enums and flags to use the same Python type + as GType enums and flags. This removes duplication of code, and + make both kinds behave identically. + + https://bugzilla.gnome.org/show_bug.cgi?id=642607 + + gi/gimodule.c | 117 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + gi/module.py | 24 +++++++---- + gi/pygi-info.c | 15 +++++++ + gi/types.py | 16 ------- + gobject/pygflags.c | 13 ++++-- + tests/test_gi.py | 35 +++++++++++++++ + 6 files changed, 191 insertions(+), 29 deletions(-) + +commit d5e67257361609036d2bbfa47ea85a6c759b332a +Author: John (J5) Palmieri +Date: Sat Feb 19 17:26:42 2011 -0500 + + [gi-demos] add info bars demo + + demos/gtk-demo/demos/infobars.py | 99 + ++++++++++++++++++++++++++++++++++++++ + 1 files changed, 99 insertions(+), 0 deletions(-) + +commit 372f480b078d1befb30532a0ebe0ad9c90e78df0 +Author: Martin Pitt +Date: Sat Feb 19 15:44:52 2011 +0100 + + tests/runtests.py: Add missing "import sys" + + master already has this. + + tests/runtests.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit c1b35fc49680ad25e996de57e3e020bd43d9186c +Author: Martin Pitt +Date: Tue Feb 8 15:38:21 2011 +0100 + + [gi] Add Pythonic gdbus method invocation + + Provide a wrapper for Gio.DBusProxy for calling D-Bus methods like + on a normal + Python object. This will handle the Python object <-> GVariant + conversion, and + optional keyword arguments for flags, timeout, and a result handler + for + asynchronous calls. + + Require specifying the input argument signature as the first argument + of each + method call. This ensures that the types of e. g. integers are + always correct, + and avoids having to do expensive D-Bus introspection for each call. + + https://bugzilla.gnome.org/show_bug.cgi?id=640181 + + gi/overrides/Gio.py | 99 + +++++++++++++++++++++++++++++++++++++++++++++++++ + tests/test_gdbus.py | 102 + ++++++++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 199 insertions(+), 2 deletions(-) + +commit 2737e1c2c506cd324a0aa2abfdfeb3ad4f08e678 +Author: Laszlo Pandy +Date: Fri Feb 18 22:48:59 2011 +0100 + + Skip GError out parameters in Python closure. + + Python code should have never have to explicitely return a GError. + Once we are able to marshal exceptions the Python code should + throw an exception instead. Until then, set GError to NULL, and + don't complain if a Python function doesn't return an arg for it. + + https://bugzilla.gnome.org/show_bug.cgi?id=642715 + + gi/pygi-closure.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 93677502c12a3ee123dd565bf1b404ef47ec1c47 +Author: John (J5) Palmieri +Date: Thu Feb 17 19:46:49 2011 -0500 + + [gi-demos] added rotate text demo + + * needs some Pango Attr fixes to be 100% done, See FIXME + + demos/gtk-demo/demos/rotatedtext.py | 196 + +++++++++++++++++++++++++++++++++++ + 1 files changed, 196 insertions(+), 0 deletions(-) + +commit 8495ab57f49fb507a8004a9cf967d6fe91bb4ef0 +Author: John (J5) Palmieri +Date: Thu Feb 17 17:25:00 2011 -0500 + + [gi-demos] add images demo + + * needs annotation fix from GdkPixbuf for ImageLoader to work + + demos/gtk-demo/demos/images.py | 311 + ++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 311 insertions(+), 0 deletions(-) + +commit 60b9dd8d021e550089f44dc489ffeb77af6976ee +Author: John (J5) Palmieri +Date: Thu Feb 17 14:48:24 2011 -0500 + + [gi-demos] add pixbuf demo + + demos/gtk-demo/demos/pixbuf.py | 183 + ++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 183 insertions(+), 0 deletions(-) + +commit f57153dd6786858ff2ab79c28227cd021755d693 +Author: John (J5) Palmieri +Date: Thu Feb 17 14:47:12 2011 -0500 + + [gi-demos] remove fixmes from print demo, fixed in pango + + demos/gtk-demo/demos/printing.py | 10 +++------- + 1 files changed, 3 insertions(+), 7 deletions(-) + +commit b8345be15c7f65e97f6bc148ad6c35ff80ff3870 +Author: John (J5) Palmieri +Date: Wed Feb 16 19:39:30 2011 -0500 + + [gi-demos] add printing demo + + * needs some annotations for pango before it is 100% useful + + demos/gtk-demo/demos/printing.py | 177 + ++++++++++++++++++++++++++++++++++++++ + 1 files changed, 177 insertions(+), 0 deletions(-) + +commit 123877715145038a5877b8c538a48a1285f1ed54 +Author: John (J5) Palmieri +Date: Wed Feb 16 17:52:38 2011 -0500 + + [gi-overrides] add cursor overrides + + https://bugzilla.gnome.org/show_bug.cgi?id=635947 + + gi/overrides/Gdk.py | 41 +++++++++++++++++++++++++++++++++++++++++ + tests/test_overrides.py | 23 +++++++++++++++++++++++ + 2 files changed, 64 insertions(+), 0 deletions(-) + +commit 68d72e015997da8d5732527c7ab96dd8c61fa664 +Author: John (J5) Palmieri +Date: Wed Feb 16 16:18:24 2011 -0500 + + [gi-demos] add the links demo + + demos/gtk-demo/demos/links.py | 74 + +++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 74 insertions(+), 0 deletions(-) + +commit 00505a9a5445b85a091650a777a47f632ddc9d6d +Author: John (J5) Palmieri +Date: Wed Feb 16 15:48:40 2011 -0500 + + [gi-demos] add expander demo + + demos/gtk-demo/demos/expander.py | 60 + ++++++++++++++++++++++++++++++++++++++ + 1 files changed, 60 insertions(+), 0 deletions(-) + +commit ed8710c7aa05cc0c919366536c94bf43955f1b71 +Author: John (J5) Palmieri +Date: Wed Feb 16 15:14:35 2011 -0500 + + [gi-overrides] use pop instead of del and add extra tests for + Gtk.Table kwargs + + gi/overrides/Gtk.py | 6 ++---- + tests/test_overrides.py | 8 ++++++++ + 2 files changed, 10 insertions(+), 4 deletions(-) + +commit 888675f85c895a60d4432b992961ec3067da6e20 +Author: Laszlo Pandy +Date: Tue Feb 15 20:07:42 2011 +0100 + + [tests] Separate processes for GI and static binding tests. + + Importing and using both static gobject bindings and + introspection GObject bindings in the same process can cause + conflicts with types which otherwise wouldn't be there. + + This patch changes "make check" to call runtests.py twice -- once + for each set of tests. + + In the case of a test failure, runtests.py now sets the exit code + so that make does not continue. Otherwise you might miss the + failures from the first batch of tests in the scrollback. + + tests/Makefile.am | 29 ++++++++++++----------------- + tests/runtests.py | 4 +++- + 2 files changed, 15 insertions(+), 18 deletions(-) + +commit 71b0dd93d524afce9f4a4b0b393c8a16a1f70e2f +Author: Laszlo Pandy +Date: Tue Feb 15 16:26:24 2011 +0100 + + [GI] Remove implicit loading of gi module preserve the code path + for static bindings. + + Previously type lookups (as well as property accesses and signal + connects would trigger an import of the gi module). Now we make + those paths fail, and fallback to the old static binding code + paths *unless* the gi module is already in sys.modules. + + So if Python code calls: + from gi.repository import Gtk + + or even just: + import gi + + then everything will work just like it did without this patch. If gi + is not explicitly imported, the code skips the introspection code + and acts like the old static bindings did. + + https://bugzilla.gnome.org/show_bug.cgi?id=642387 + + gi/pygi.h | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +commit 97e78181813f15f693e650df5a8901bd2fe71541 +Author: John (J5) Palmieri +Date: Tue Feb 15 14:47:10 2011 -0500 + + [gi-demos] add dialogs demo + + demos/gtk-demo/demos/dialogs.py | 153 + +++++++++++++++++++++++++++++++++++++++ + 1 files changed, 153 insertions(+), 0 deletions(-) + +commit a23a48edafb9d08fec5411b828d1e0c6763e84af +Author: John (J5) Palmieri +Date: Tue Feb 15 14:46:41 2011 -0500 + + [gi-overrides] fix typo in GtkTable constructor + + gi/overrides/Gtk.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit bcccff3b2ad9c8054a4d5462c62cde566587eba6 +Author: John (J5) Palmieri +Date: Tue Feb 15 13:26:38 2011 -0500 + + [gi-demos] keep popup menu from destroying itself by holding a ref + in app class + + demos/gtk-demo/demos/clipboard.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 9dc0979ba7d35b6ff9bb219a21926c2fd88451c7 +Author: John (J5) Palmieri +Date: Tue Feb 15 13:25:13 2011 -0500 + + [gi-overrides] add a Gtk.Menu override for the popup method + + gi/overrides/Gtk.py | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 317278a3ddf15f1f9da53051295a0b533b1b1a11 +Author: John (J5) Palmieri +Date: Tue Feb 15 13:24:33 2011 -0500 + + [gi-demos] fix the about dialog in appwindow demo + + demos/gtk-demo/demos/appwindow.py | 22 +++++++++------------- + 1 files changed, 9 insertions(+), 13 deletions(-) + +commit cb2d2aad023789991b20036e22cae5ad3eee9b36 +Author: John (J5) Palmieri +Date: Tue Feb 15 11:21:13 2011 -0500 + + [gi-demos] fix clipboard demo so DnD works + + * menu popups don't work because the API takes a callback without + a destroy + notify + + demos/gtk-demo/demos/clipboard.py | 20 ++++++++++---------- + 1 files changed, 10 insertions(+), 10 deletions(-) + +commit 5434b7aac323170ea9469afbda520b801462c246 +Author: John (J5) Palmieri +Date: Tue Feb 15 10:18:53 2011 -0500 + + [gi-demos] fix clipboard demo to reflect new API + + demos/gtk-demo/demos/clipboard.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit b6c97de9680f3d5d629132415c1f7a9c42e558f8 +Author: John (J5) Palmieri +Date: Mon Feb 14 18:17:20 2011 -0500 + + [gi-demo] Fix color dialog demo to run with new draw, style and + color apis + + demos/gtk-demo/demos/colorselector.py | 44 + ++++++++++++-------------------- + 1 files changed, 17 insertions(+), 27 deletions(-) + +commit 7147bd635fb03439a5f9edbce56c5558d092428c +Author: John (J5) Palmieri +Date: Mon Feb 14 17:58:25 2011 -0500 + + [gi-demos] fix most of the combobox app + + * Still having some issues with filtering the ComboBoxText widget + + demos/gtk-demo/demos/combobox.py | 17 ++++++++--------- + 1 files changed, 8 insertions(+), 9 deletions(-) + +commit a64b8fe89492ae47172979f1900686455cd1f9a8 +Author: Laszlo Pandy +Date: Mon Feb 14 19:36:27 2011 +0100 + + Use PyGI type conversion (to fix foreign types) for signal callbacks. + + First attempt at patch to fix foreign types in signal callbacks. + Tests are not implemented yet. + + https://bugzilla.gnome.org/show_bug.cgi?id=637601 + + gi/Makefile.am | 2 + + gi/gimodule.c | 1 + + gi/pygi-argument.c | 91 +++++++++++++++++ + gi/pygi-argument.h | 2 + + gi/pygi-private.h | 1 + + gi/pygi-signal-closure.c | 245 + ++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-signal-closure.h | 46 +++++++++ + gi/pygi.h | 28 +++++ + gobject/pygobject.c | 24 ++++- + 9 files changed, 436 insertions(+), 4 deletions(-) + +commit 36ddad6af4a579c070171fd0522d7ffd93d5d73e +Author: John (J5) Palmieri +Date: Mon Feb 14 16:47:03 2011 -0500 + + [gi-demos] fix drawingarea app to use the new draw api + + demos/gtk-demo/demos/drawingarea.py | 144 + ++++++++++++----------------------- + 1 files changed, 50 insertions(+), 94 deletions(-) + +commit ddde83ebd4dbb179aa5388057a14faf32ece26ae +Author: John (J5) Palmieri +Date: Mon Feb 14 16:43:35 2011 -0500 + + [gi-overrides] for Gtk 3 alias Gdk.Rectangle to cairo.RectangleInt + + * note this is the introspected gobject-cairo boxed type not the + static cairo + bindings + * we alias this so people do not get confused + + gi/overrides/Gdk.py | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 8617d0e2a63771eba04983c7319f18638aa6d81e +Author: John (J5) Palmieri +Date: Mon Feb 14 15:07:11 2011 -0500 + + [gi-overrides] let user set the proper property names in Gtk.Table + + * the old override added a columns and rows parameters to the Table + constuctor + to be in sync with PyGtk. + * The GTK properties are n_columns and n_rows + * support both + + gi/overrides/Gtk.py | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 09c0534e4ac673ffdbfb41bc0aa34353be3b88e2 +Author: John (J5) Palmieri +Date: Mon Feb 14 15:06:38 2011 -0500 + + [gi-demos] get appwindow demo working again + + demos/gtk-demo/demos/appwindow.py | 24 ++++-------------------- + 1 files changed, 4 insertions(+), 20 deletions(-) + +commit 1944349cc59ddaf4fd7308ffce10b521c885c88b +Author: John (J5) Palmieri +Date: Mon Feb 14 15:05:44 2011 -0500 + + [gi-demos] fixed use of tree_iter_get + + demos/gtk-demo/gtk-demo.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 29efc5a31c2879cefcf31d1d9bdbab65052d3b24 +Author: John (J5) Palmieri +Date: Fri Feb 11 11:18:24 2011 -0500 + + pre-release version bump + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5dae6386ef74b6334daa3d0baf7c2e43d93a7e40 +Author: John (J5) Palmieri +Date: Fri Feb 11 11:05:04 2011 -0500 + + bump version and edit NEWS for release + + NEWS | 289 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 2 +- + 2 files changed, 290 insertions(+), 1 deletions(-) + +commit e12097a3fc006f435ae01156e55cacd7622a6e06 +Author: John (J5) Palmieri +Date: Thu Feb 10 16:46:08 2011 -0500 + + fix build to correctly use python-config + + autogen.sh | 3 +++ + configure.ac | 6 ------ + m4/python.m4 | 9 +++++---- + tests/runtests.py | 1 + + 4 files changed, 9 insertions(+), 10 deletions(-) + +commit 5ec107f805e32d4183b3c1a015d411992fc46a48 +Author: Martin Pitt +Date: Wed Feb 9 18:00:34 2011 +0100 + + Run gio tests separately when enabled + + As we can't load both gio and gi.repository.Gio at the same time, + run the gio + tests separately when gio is enabled. + + tests/Makefile.am | 13 ++++++++++++- + 1 files changed, 12 insertions(+), 1 deletions(-) + +commit 02ac041ba001bdda506f749e90aebc86a414d7c1 +Author: Martin Pitt +Date: Wed Feb 2 13:33:55 2011 +0100 + + Revert "Remove gio static bindings" + + This reverts commit bca5834fc8fa342149e0eec7b396877a2abe6d33. + + We still need the static gio bindings for now. + + https://bugzilla.gnome.org/show_bug.cgi?id=638899 + + Makefile.am | 2 +- + configure.ac | 22 +- + gio/.gitignore | 3 + + gio/Makefile.am | 117 + + gio/__init__.py | 40 + + gio/gappinfo.override | 213 ++ + gio/gapplaunchcontext.override | 99 + + gio/gbufferedinputstream.override | 70 + + gio/gcancellable.override | 38 + + gio/gdatainputstream.override | 250 ++ + gio/gdrive.override | 347 ++ + gio/gfile.override | 2215 +++++++++++ + gio/gfileattribute.override | 153 + + gio/gfileenumerator.override | 184 + + gio/gfileinfo.override | 121 + + gio/gfileinputstream.override | 68 + + gio/gfileiostream.override | 68 + + gio/gfileoutputstream.override | 68 + + gio/gicon.override | 310 ++ + gio/ginputstream.override | 344 ++ + gio/gio-types.defs | 807 ++++ + gio/gio.defs | 7465 + +++++++++++++++++++++++++++++++++++++ + gio/gio.override | 409 ++ + gio/giomodule.c | 208 + + gio/giostream.override | 68 + + gio/gmemoryinputstream.override | 91 + + gio/gmemoryoutputstream.override | 45 + + gio/gmount.override | 454 +++ + gio/goutputstream.override | 292 ++ + gio/gresolver.override | 312 ++ + gio/gsocket.override | 575 +++ + gio/gvolume.override | 237 ++ + gio/gvolumemonitor.override | 94 + + gio/pygio-utils.c | 236 ++ + gio/pygio-utils.h | 49 + + gio/unix-types.defs | 55 + + gio/unix.defs | 475 +++ + gio/unix.override | 62 + + gio/unixmodule.c | 52 + + tests/Makefile.am | 9 + + tests/runtests-windows.py | 3 + + tests/test_gcancellable.py | 15 + + tests/test_gicon.py | 112 + + tests/test_gio.py | 1138 ++++++ + tests/test_gresolver.py | 68 + + tests/test_gsocket.py | 126 + + 46 files changed, 18187 insertions(+), 2 deletions(-) + +commit a535e4af7c38fd7917d804470e8c46da4c2a86ea +Author: Steve Frécinaux +Date: Wed Feb 9 17:32:03 2011 +0100 + + Decrease the refcount for GInitiallyUnowned constructors. + + This mimicks the weird legacy pygtk behaviour and makes all the tests + pass despite the proper fixes having been reverted. + + https://bugzilla.gnome.org/show_bug.cgi?id=641525 + + gi/pygi-invoke.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 657d113c766c5ff9c5e7285ff5309283333983e4 +Author: Steve Frécinaux +Date: Wed Feb 9 17:03:30 2011 +0100 + + Ensure the sink functions are only ran once. + + This mitigates in a not-so-clean way the leak experienced in pygobject + for wrappers created multiple times, without breaking pygtk. + + https://bugzilla.gnome.org/show_bug.cgi?id=641525 + + gobject/pygobject.c | 23 +++++++++++++++-------- + 1 files changed, 15 insertions(+), 8 deletions(-) + +commit d32c0ecc6cde743047054e65355cbbfbf808d5ce +Author: Steve Frécinaux +Date: Wed Feb 9 17:15:41 2011 +0100 + + Revert "Fix wrong refcount when calling introspected widget + constructors" + + This reverts commit 7bc4122897d9d05172a2bd5b56bded87e2afaec4. + + https://bugzilla.gnome.org/show_bug.cgi?id=641525 + + gobject/pygobject.c | 4 +--- + 1 files changed, 1 insertions(+), 3 deletions(-) + +commit 4c9715b29f8883e23027cca10157ea96013b0dbc +Author: Steve Frécinaux +Date: Wed Feb 9 16:33:42 2011 +0100 + + Revert "Fix reference leaks for GInitiallyUnowned objects" + + This reverts commit f0a0b6c2eda89622de2b1e5ebb6a48103ad72a42. + The test cases have been kept. + + https://bugzilla.gnome.org/show_bug.cgi?id=641525 + + gobject/gobjectmodule.c | 2 -- + gobject/pygobject.c | 14 +++++++------- + 2 files changed, 7 insertions(+), 9 deletions(-) + +commit 14c4cf8e6edae893538680964380d543bde4a14d +Author: Martin Pitt +Date: Wed Feb 9 11:34:59 2011 +0100 + + Run test suite under dbus-launch + + When available, run the test suite in dbus-launch, so that the + GDBus tests + succeed even when building this in an environment without a running + session + D-BUS (such as distribution package builds). + + tests/Makefile.am | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 0858f550e2b6f75e3f583f963f5952f5ddae4e0e +Author: Martin Pitt +Date: Tue Feb 8 15:46:36 2011 +0100 + + Fix test_gdbus.py to be Python3 friendly + + - TestCase.assert_() has been deprecated by assertTrue(). + - Exceptions don't have a message attribute any more, use str(e) + + tests/test_gdbus.py | 34 +++++++++++++++------------------- + 1 files changed, 15 insertions(+), 19 deletions(-) + +commit b7f32e4cca0cef201489b55653f96ac64a8f9ab9 +Author: Martin Pitt +Date: Sat Jan 29 12:20:50 2011 +0100 + + [gi] Provide comfortable GSettings API + + Make Gio.Settings behave like a dictionary, with transparent + conversion from/to + GVariants. Also provide a more comfortable constructor. + + https://bugzilla.gnome.org/show_bug.cgi?id=640838 + + gi/overrides/Gio.py | 54 ++++++++++++++++++++++++++++ + tests/org.gnome.test.gschema.xml | 9 +++++ + tests/test_overrides.py | 73 + ++++++++++++++++++++++++++++++------- + 3 files changed, 122 insertions(+), 14 deletions(-) + +commit 8dad0eaed60a9de26e9a729a48a1f6bc74be486e +Author: Laszlo Pandy +Date: Fri Feb 4 16:36:07 2011 +0100 + + Fix vfunc search bug when using GInterfaces and a do_* method. + + If a class inherits from a GInterface, as well as implements a do_* + method (which is not in a super class), all the base interfaces + will be searched for an __info__ attribute. GInterface doesn't + have one, causing an error on class creation. + + https://bugzilla.gnome.org/show_bug.cgi?id=641493 + + gi/types.py | 4 +++- + tests/test_gi.py | 8 ++++++++ + 2 files changed, 11 insertions(+), 1 deletions(-) + +commit 2660be1f227be7a53092483bc9d8ead1bd1fb266 +Author: Laszlo Pandy +Date: Thu Feb 3 15:31:42 2011 +0100 + + [GI] Add tests for Gtk.Widget.drag_* methods. + + Previously all the drag_* methods were accessible as Gtk.drag_*. + Now that the (method) attribute has been included for these + methods in Gtk+, this test checks that they are included as class + methods when using pygobject introspection. + + https://bugzilla.gnome.org/show_bug.cgi?id=639945 + + tests/test_overrides.py | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 40 insertions(+), 0 deletions(-) + +commit 09acaff29dfaabc77477cffca2c7137f68991e7f +Author: Ignacio Casal Quinteiro +Date: Wed Feb 2 21:00:48 2011 +0100 + + [python 3] use the right syntaxis to raise exceptions + + codegen/argtypes.py | 8 ++++---- + codegen/definitions.py | 14 +++++++------- + gi/overrides/Gtk.py | 2 +- + 3 files changed, 12 insertions(+), 12 deletions(-) + +commit 36094e5982d3e05d5662843b6d401f0974f5235f +Author: Ignacio Casal Quinteiro +Date: Wed Feb 2 20:50:12 2011 +0100 + + [gi] return PYGLIB_MODULE_ERROR_RETURN on error and use pygobject_init + + tests/testhelpermodule.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit c913c1789296310c2cf27554ce719d7f6e9c94cd +Author: Ignacio Casal Quinteiro +Date: Wed Feb 2 20:37:21 2011 +0100 + + [gi] return PYGLIB_MODULE_ERROR_RETURN on error + + This is to avoid some warnings when building with python 3 + + gi/gimodule.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 7bc4122897d9d05172a2bd5b56bded87e2afaec4 +Author: Steve Frécinaux +Date: Sat Jan 29 00:16:50 2011 +0100 + + Fix wrong refcount when calling introspected widget constructors + + Introspected widget constructors, like Gtk.Button.new(), can return + objects with a floating reference, which was then reffed by pygobject, + resulting in two references, despite the object is not owned by + anyone. + + This patch uses ref_sink() when pygobject takes its own reference, to + avoid adding that extra reference. Hence we now claim ownership on + objects returned by constructors with transfer=none (which is the case + for nearly all the widget constructors, despite the floating ref). + + https://bugzilla.gnome.org/show_bug.cgi?id=640868 + + gobject/pygobject.c | 4 +++- + tests/test_everything.py | 9 ++++++++- + 2 files changed, 11 insertions(+), 2 deletions(-) + +commit afeaaa126f7cd6556fb855ecd0facc174c0f946c +Author: Simon Schampijer +Date: Wed Jan 19 16:19:46 2011 +0100 + + Gdk.Window: Map the standard constructor to the *new* constructor + + Gdk.Window had to be made abstract + (see c4a36d875235e0bf1e52dbf2fa14d08bfc8bd4ec in gtk), + this override allows using the standard constructor + + This commit adds as well a testcase. + + https://bugzilla.gnome.org/show_bug.cgi?id=639936 + + gi/overrides/Gdk.py | 6 ++++++ + tests/test_overrides.py | 8 ++++++++ + 2 files changed, 14 insertions(+), 0 deletions(-) + +commit 858669f92c9907dd70b4966d6a8521ed122225be +Author: Martin Pitt +Date: Mon Jan 31 17:38:52 2011 +0100 + + Ship tests/org.gnome.test.gschema.xml in dist tarballs + + tests/Makefile.am | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 69207910209ebfe450df616aeb8fa4cc2e7eccf3 +Author: Martin Pitt +Date: Fri Jan 28 17:14:19 2011 +0100 + + [gi] Add GSettings tests + + Ryan Lortie proposed an override for more convenient GSettings access, + so let's + first make sure that the canonical GLib API works. + + tests/Makefile.am | 7 +++++-- + tests/org.gnome.test.gschema.xml | 16 ++++++++++++++++ + tests/test_overrides.py | 31 +++++++++++++++++++++++++++++++ + 3 files changed, 52 insertions(+), 2 deletions(-) + +commit 488478a83640d50baee963337fcc870fec76b784 +Author: Martin Pitt +Date: Fri Jan 28 07:20:26 2011 +0100 + + [gi] Provide GtkTextBuffer.insert_with_tags_by_name() + + Provide an actual insert_with_tags_by_name() instead of overloading + insert_with_tags() to handle both types. This keeps the overrides + consistent + with the actual GTK API. + + gi/overrides/Gtk.py | 19 ++++++++++++++----- + tests/test_overrides.py | 4 ++-- + 2 files changed, 16 insertions(+), 7 deletions(-) + +commit dace1a553793fb7fb054b60760f02c9e5cf00b38 +Author: Martin Pitt +Date: Thu Jan 27 13:37:18 2011 +0100 + + [gi] Support tag names in GtkTextBuffer.insert_with_tags() + + Neither insert_with_tags() nor insert_with_tags_by_name() are + introspectable + due to using varargs. As both are useful, support both cases in + the override. + + gi/overrides/Gtk.py | 5 +++++ + tests/test_overrides.py | 9 +++++++++ + 2 files changed, 14 insertions(+), 0 deletions(-) + +commit 91d34124b2a5128e93e13c7fee8693d5edc4e9bb +Author: Ignacio Casal Quinteiro +Date: Thu Jan 27 12:23:18 2011 +0100 + + Add MAINTAINERCLEANFILES + + This var behaves like .gitignore and allows us to skip some specific + files. + + Makefile.am | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + +commit 8a98d26981ce68809a21c64cac4962e58c927905 +Author: Ignacio Casal Quinteiro +Date: Thu Jan 27 12:15:30 2011 +0100 + + Remove .gitignore files and use git.mk + + git.mk is a script maintained in pango. From time to time we must + check if it was updated and update it here. + + .gitignore | 46 ---------- + Makefile.am | 2 + + codegen/.gitignore | 2 - + codegen/Makefile.am | 2 + + docs/.gitignore | 7 -- + docs/Makefile.am | 2 + + examples/Makefile.am | 2 + + gi/.gitignore | 40 --------- + gi/Makefile.am | 2 + + gi/overrides/Makefile.am | 2 + + gi/repository/Makefile.am | 2 + + gi/tests/Makefile.am | 2 + + git.mk | 200 + +++++++++++++++++++++++++++++++++++++++++++++ + glib/Makefile.am | 2 + + gobject/.gitignore | 3 - + gobject/Makefile.am | 2 + + tests/.gitignore | 2 - + tests/Makefile.am | 2 + + 18 files changed, 222 insertions(+), 100 deletions(-) + +commit 331c42b63bc60a3b906fa21e1c0a7c1b9428f347 +Author: Martin Pitt +Date: Thu Jan 27 12:04:19 2011 +0100 + + pygi-convert.sh: Convert Pango.TabAlign.* + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit be1a2959fa0a3d8682e0e8aef389d73dacab0689 +Author: Martin Pitt +Date: Thu Jan 27 12:02:39 2011 +0100 + + pygi-convert.sh: Drop window -> get_window() conversion + + It is doing more harm than good for projects which use things like + self.window. + + pygi-convert.sh | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit dd7deb4b658c56857c26b1a278a3d688f2ea6a2a +Author: Martin Pitt +Date: Thu Jan 27 11:58:26 2011 +0100 + + pygi-convert.sh: Don't convert self.window assignments + + pygi-convert.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 975341a26772966d4afc87a88a6a566d61237fa0 +Author: Steve Frécinaux +Date: Fri Jan 21 18:41:54 2011 +0100 + + Fix leaked python reference in python-defined subclasses + + https://bugzilla.gnome.org/show_bug.cgi?id=640184 + + gobject/gobjectmodule.c | 1 + + tests/test_gobject.py | 4 ++++ + 2 files changed, 5 insertions(+), 0 deletions(-) + +commit a59e2d58bdb3f31a4f415dbe14b7d9988ac28ce3 +Author: Steve Frécinaux +Date: Fri Jan 21 15:54:43 2011 +0100 + + Add some tests for the number of python refs held at creation time + + https://bugzilla.gnome.org/show_bug.cgi?id=640184 + + tests/test_gobject.py | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +commit 7d70105eb324ea4b6a58c2d3fb3f2dda36e7ab33 +Author: Steve Frécinaux +Date: Fri Jan 21 17:24:49 2011 +0100 + + Factor out parameter marshalling from construction functions. + + https://bugzilla.gnome.org/show_bug.cgi?id=640197 + + gobject/gobjectmodule.c | 35 ++------------------- + gobject/pygobject-private.h | 5 +++ + gobject/pygobject.c | 71 + +++++++++++++++++++++++++----------------- + 3 files changed, 50 insertions(+), 61 deletions(-) + +commit a3e0cfe8924887ecd1e07cedd2cfb999c853ac62 +Author: John (J5) Palmieri +Date: Wed Jan 26 15:34:24 2011 -0500 + + [gi] in python 3 an array of uint8 can be bytes but not string + + tests/test_gi.py | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 843553ea958eddec185bb660851a310dc050a14b +Author: John (J5) Palmieri +Date: Wed Jan 26 15:30:06 2011 -0500 + + [gi] fix Gio.FileEnumerator to reflect the Python 3 iter protocol + + gi/overrides/Gio.py | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit 6ff357839feb39930a5f3175de3d0ed35f24d3f4 +Author: John (J5) Palmieri +Date: Wed Jan 26 15:17:03 2011 -0500 + + [gi] python 3 fixes + + Patches need to work in Python 3 - here are some of the issues I + fixed up. + Patch submitters should keep this in mind. When I note to only + use something + in tests it means that there is a compat module that is only available + to the + tests. Actuall code should either add the workaround to the top + of their + module or try not to have a distinction between things such as + unicode and + longs which no longer exist in Python 3 + + * use range instead of xrange - loss of performance in Python 2 but + Python 3 i + treats range similarly to python 2's xrange + * use dict.items() instead of dict.iteritems() - same as the xrange + issue + * callable does not exist in 3.x, use hasattr(obj, '__call__') or + + if sys.version_info > (3, 0): + def callable(obj): + return hasattr(obj, '__call__') + + * using unicode in tests is tricky, you can't use u'' even in + a versioned + conditional as python3's parser chokes on it. Do this in tests + (and only i + in tests): + + from compathelper import _unicode + unicode_string = _unicode('this is a unicode string') + + * exception caching changed in 2.7, instead of except Exception, + e we now use + except Exception as e. Do this to be compatible with older + versions: + + except Exception: + etype, e = sys.exc_info()[:2] + + * Unbound methods with an im_func attribute no longer exits in 3.x. + Unbound methods are now just functions so class.method in 3.x is + equivalent to class.method.im_func in 2.x. If you have to go this + low level do this: + + func = class1.method + if sys.version_info < (3,0): + func = func.im_func + + * all numbers are long in 3.x so 42L is invalid in 3.x. In tests (and + only in tests) do this: + + from compathelper import _long + l = _long(42) + + gi/overrides/GLib.py | 16 ++++++++-------- + gi/types.py | 5 ++++- + tests/compathelper.py | 19 +++++++++++++++++++ + tests/test_gdbus.py | 12 ++++++++---- + tests/test_gi.py | 19 ++++++++++++------- + tests/test_overrides.py | 8 +++++--- + 6 files changed, 56 insertions(+), 23 deletions(-) + +commit 832d662b9f90f5762bbf28b3cca73f947c1f83ce +Author: John (J5) Palmieri +Date: Wed Jan 26 14:00:08 2011 -0500 + + [gi] fix try/except blocks using depricated raise format + + gi/overrides/GLib.py | 4 ++-- + gi/overrides/Gdk.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit d3e30e240fed6ef1dd40fd29fd13dc2effc6c7b1 +Author: Martin Pitt +Date: Wed Jan 26 19:03:48 2011 +0100 + + [gi] Add docstring to GLib.Variant constructor + + gi/overrides/GLib.py | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +commit 963cd52fec26f7a4fb34414f8ac6662932ede322 +Author: Martin Pitt +Date: Wed Jan 26 18:45:38 2011 +0100 + + [gi] update gdbus test cases for previous GVariant change + + tests/test_gdbus.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 27e3a6276ff5f2cdc03ddf69ee80d44c3bf2c094 +Author: Martin Pitt +Date: Wed Jan 26 18:39:17 2011 +0100 + + [gi] Accept only a single object in GLib.Variant constructor + + We previously allowed flat arguments for tuple signatures, e. g. + + GLib.Variant('(ii)', 1, 2) + + However, that's not how GVariant is supposed to work. Remove the + special case + to handle flat argument lists, and only accept a single value, i. e. + + GLib.Variant('(ii)', (1, 2)) + + Note that this breaks the current API, but as it is not used widely + yet, let's + better fix it now. + + Thanks to Ryan Lortie for pointing this out! + + gi/overrides/GLib.py | 25 ++++++++++--------------- + tests/test_overrides.py | 32 +++++++++++++------------------- + 2 files changed, 23 insertions(+), 34 deletions(-) + +commit b15e8e2c0c933d0f827a70280faf875ac383d81b +Author: Laszlo Pandy +Date: Wed Jan 26 00:40:49 2011 +0100 + + Speed up _setup_native_vfuncs() + + This changes _setup_native_vfuncs() to only install native + vfunc wrappers from the current class on the current class. + Native vfuncs will not be propogated up or down the class + hierarchy as this is unnecessary and wastes CPU and memory. + + Since the normal process in python to retrieve a method or + attribute recurses to the base classes if an attribute is not + found in the subclass, there is no need to setup all base class + virtual functions on a subclass. + + This patch removes the recursion in _setup_native_vfuncs() + and lets Python find them in the base classes like a normal + Python class would work. This significantly increases the speed + of any class which is or inherits from a C class which includes + virtual methods. + + https://bugzilla.gnome.org/show_bug.cgi?id=640629 + + gi/types.py | 26 +++++++++++++------------- + tests/test_gi.py | 13 +++++++++++++ + 2 files changed, 26 insertions(+), 13 deletions(-) + +commit 569d42ac2f50fb706ef289ff631db743483f40ee +Author: Laszlo Pandy +Date: Thu Jan 20 16:26:18 2011 +0100 + + Speed up class creation: rewrite _setup_vfuncs() to be much more + efficient. + + This patch rewrites the _setup_vfuncs() method to remove recursion and + make the running time linear in the number of virtual functions to + hook up + (ie. methods starting with "do_") instead of linear in the number of + virtual functions in the base class which could possibly be + overridden. + + Since most classes do not override all of the virtual functions in the + base class (and many override none), this runs much faster. + + It is possible to not recurse on all base classes because + non-interface + base classes will have the virtual function installed as an attribute. + Thus getattr() can be called, which recurses to the base classes much + faster than a custom implementation in Python. If the method cannot be + found with getattr(), all interface bases classes are searched + manually. + + The function is_function_in_classes() has been deleted. Because of the + above changes, it is not used anymore. + + https://bugzilla.gnome.org/show_bug.cgi?id=640073 + + gi/types.py | 104 + +++++++++++++++++++++++++++++++++--------------------- + tests/test_gi.py | 13 +++++++ + 2 files changed, 77 insertions(+), 40 deletions(-) + +commit 8f4e6536f3c2edf38a45632d1c23eb7c6681c3be +Author: Sebastian Pölsterl +Date: Mon Jan 24 19:23:19 2011 +0100 + + pygi-convert.sh: Convert gtk.UI_MANAGER_* + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 1f473b5164407a178203eb8cc7f3c786e0d0e5c2 +Author: Sebastian Pölsterl +Date: Fri Jan 21 18:41:54 2011 +0100 + + pygi-convert.sh: Convert gdk.GRAB_* + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit f5d0b7b9d189f65503c0bf66d8bda4186ca3223a +Author: Ignacio Casal Quinteiro +Date: Fri Jan 21 16:45:07 2011 +0100 + + [gi] set the gtype GValue correctly + + gi/pygi-property.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit ce521011d7f6d7f082aaea76fa05c5af9f6e93f5 +Author: Ignacio Casal Quinteiro +Date: Fri Jan 21 16:20:23 2011 +0100 + + [gi] use the right argument type for callback + + gi/pygi-foreign-cairo.c | 8 ++++---- + gi/pygi-foreign-gvariant.c | 4 ++-- + gi/pygi-foreign-gvariant.h | 2 +- + gi/pygi-foreign.c | 2 +- + gi/pygi.h | 2 +- + 5 files changed, 9 insertions(+), 9 deletions(-) + +commit a060287d1a6d190acb9d344f08fd5662e3296da5 +Author: Martin Pitt +Date: Fri Jan 21 11:00:27 2011 +0100 + + [gi] Add test cases for GDBus client operations + + tests/Makefile.am | 1 + + tests/test_gdbus.py | 94 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 95 insertions(+), 0 deletions(-) + +commit e97e28048efb966ecc1a03277d36cbaa81b8db7d +Author: Martin Pitt +Date: Fri Jan 21 09:54:14 2011 +0100 + + [gi] Add Variant construction/unpack support for boxed Variants + + Construction uses a GVariantBuilder for now, as the new_variant() + constructor + currently does not work (see + https://bugzilla.gnome.org/show_bug.cgi?id=639952) + + gi/overrides/GLib.py | 18 +++++++++++++++++- + tests/test_overrides.py | 26 ++++++++++++++++++++++++++ + 2 files changed, 43 insertions(+), 1 deletions(-) + +commit 71dd03261fc06b8180c14cd31b54d8e4b200be3a +Merge: bc29600 bd002c7 +Author: Dieter Verfaillie +Date: Fri Jan 21 09:33:16 2011 +0100 + + Merge branch 'windows-setup-fixes' + +commit bc29600a2a04c972ceab7ef8d3292e8633977591 +Author: Thomas Hindoe Paaboel Andersen +Date: Thu Jan 20 19:48:23 2011 +0100 + + pygi-convert.sh: GdkPixbuf methods + + GNOME bug #639880 + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit d1b0fa501cc431baa530d96fb50f4c35590890ac +Author: Thomas Hindoe Paaboel Andersen +Date: Thu Jan 20 19:45:01 2011 +0100 + + pygi-convert.sh: Gdk.COLORSPACE_RGB + + GNOME bug #639880 + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 6d8ff4d5bdda5480089543869535cc3ee83da2f5 +Author: Martin Pitt +Date: Wed Jan 19 11:41:11 2011 +0100 + + [gi] Support nested objects and empty sequences in GLib.Variant + building + + The GVariant constructor (in the overrides) previously did not + support empty + arrays/dictionaries or nested structures. Rewrite the VariantCreator + class to + be fully recursive and determine the element types of + arrays/dictionaries. + + This now also allows you to use actual tuples as input values for + GVariant + tuple types. Taking values from the flat argument list is still + supported for + convenience, though. + + https://bugzilla.gnome.org/show_bug.cgi?id=639939 + + gi/overrides/GLib.py | 229 + +++++++++++++++++++++++++---------------------- + tests/test_overrides.py | 159 +++++++++++++++++++++++++++++++-- + 2 files changed, 273 insertions(+), 115 deletions(-) + +commit ac095f5435f106e175fa3297cb273e63c85d2809 +Author: Tomeu Vizoso +Date: Thu Jan 20 15:55:45 2011 +0100 + + Uncomment test_gi.TestInterfaceClash + + tests/test_gi.py | 22 +++++++++++----------- + 1 files changed, 11 insertions(+), 11 deletions(-) + +commit f0a0b6c2eda89622de2b1e5ebb6a48103ad72a42 +Author: Steve Frécinaux +Date: Thu Jan 20 14:14:15 2011 +0100 + + Fix reference leaks for GInitiallyUnowned objects + + References were leaked for GInitiallyUnowned objects which got their + wrappers created several times, because someone else holds reference + on it and it got out of python scope at some point. + + https://bugzilla.gnome.org/show_bug.cgi?id=639949 + + gobject/gobjectmodule.c | 2 + + gobject/pygobject.c | 14 +++++----- + tests/test-floating.c | 36 ++++++++++++++++++++++++++ + tests/test-floating.h | 21 +++++++++++++++ + tests/test_gobject.py | 63 + ++++++++++++++++++++++++++++++++++++++++++++++ + tests/testhelpermodule.c | 50 ++++++++++++++++++++++++++++++++++++ + 6 files changed, 179 insertions(+), 7 deletions(-) + +commit cae2cf3d4fb049c94389bf8f84d7d97a544d7a3f +Author: Steve Frécinaux +Date: Wed Jan 19 16:57:57 2011 +0100 + + Add tests for refcount of a GObject owned by a library + + When the object is constructed, its refcount is 2 because the library + refs it once. It should remain around until we ask the library to + release its reference. + + https://bugzilla.gnome.org/show_bug.cgi?id=639949 + + tests/test-floating.c | 30 ++++++++++++++++++++++ + tests/test-floating.h | 20 +++++++++++++++ + tests/test_gobject.py | 62 + ++++++++++++++++++++++++++++++++++++++++++++++ + tests/testhelpermodule.c | 51 +++++++++++++++++++++++++++++++++++++ + 4 files changed, 163 insertions(+), 0 deletions(-) + +commit b6737b91938d527872eff1d645a205cacf94e15d +Author: Steve Frécinaux +Date: Wed Jan 19 14:52:41 2011 +0100 + + Add a test to check for regular object reference count + + https://bugzilla.gnome.org/show_bug.cgi?id=639949 + + tests/test_gobject.py | 8 +++++++- + 1 files changed, 7 insertions(+), 1 deletions(-) + +commit 2b0f1ede820414ef1cfd6b37569fcb946d2031fc +Author: Martin Pitt +Date: Thu Jan 20 14:15:52 2011 +0100 + + [gi] Update TreeView.enable_model_drag_{source,dest} to current GTK + + GTK master now landed a lot of annotation fixes which also correctly + marks the + array length argument of + Gtk.TreeView.enable_model_drag_{source,dest}(). Thus + drop the explicit array length argument from the call in the override. + + gi/overrides/Gtk.py | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +commit b59edf4f0f7cab44033f9d704d476e10ee0d0c0a +Author: Steve Frécinaux +Date: Wed Jan 19 18:04:10 2011 +0100 + + Fix a typo in a private symbol name. + + gobject/gobjectmodule.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 6447688e283a8fb22de3ab68cbc06e34ad23d198 +Author: Martin Pitt +Date: Thu Jan 20 11:49:08 2011 +0100 + + pygi-convert.sh: Convert glib.source_remove() + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 84ee8de4bc00a8f901926cc6386d73c12dbd0b0b +Author: Martin Pitt +Date: Thu Jan 20 11:42:34 2011 +0100 + + Fix typo in previous commit to actually convert glib.GError + + pygi-convert.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b238cb614338f46e6feb7935cca0a55c7a929418 +Author: Martin Pitt +Date: Thu Jan 20 11:40:14 2011 +0100 + + pygi-convert.sh: Move some glib bits which are better handled + by gobject + + pygi-convert.sh | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 21c09a7ee294b59abb3eca6f64f13bf5c8a2fa0e +Author: Laszlo Pandy +Date: Wed Jan 19 12:00:02 2011 +0100 + + Modify override for Gtk.Adjustment to allow position or keyword + arguments in __init__(). + + Previously passing no arguments was not working, because the default + value for each parameter was None, and GObject.__init__() refuses to + allow None for integer properties. This patch does not pass None up + to GObject.__init__. Instead it does not pass the parameter at all, + and uses the class's default values. + + https://bugzilla.gnome.org/show_bug.cgi?id=639934 + + gi/overrides/Gtk.py | 14 ++++++++++++-- + tests/test_overrides.py | 34 +++++++++++++++++++++++++++------- + 2 files changed, 39 insertions(+), 9 deletions(-) + +commit d465e25297ad6589ff2cd0c00e11e8bd8ffe3f78 +Author: Martin Pitt +Date: Wed Jan 19 22:52:51 2011 +0100 + + [gi] Fix small typo in previous commit + + The GVariant signature of the self test had a trailing 'i'. The + current + GVariant builder doesn't mind, but the new implementation proposed + in bug + 639939 does. + + tests/test_overrides.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2b8e1d0531dcb8f57dc9f2fddf25970bee3daa90 +Author: Martin Pitt +Date: Wed Jan 19 20:18:19 2011 +0100 + + [gi] Add pythonic iterator and indexing for string GVariants + + This extends commit b1a98083c to also work for strings. + + gi/overrides/GLib.py | 8 +++++++- + tests/test_overrides.py | 13 +++++++++++++ + 2 files changed, 20 insertions(+), 1 deletions(-) + +commit 7c2f48bb6d67ec9a1ee5ac03a5aee34b54c6ebdd +Author: Tomeu Vizoso +Date: Wed Jan 19 18:09:23 2011 +0100 + + Construct structs using default API constructor + + If the struct has something that looks like a default constructor, + use it instead of trying to directly allocate it, as it will fail + if the struct fields are not exposed. + + https://bugzilla.gnome.org/show_bug.cgi?id=627444 + + gi/pygi-info.c | 37 +++++++++++++++++++++++++++++++++++++ + gi/types.py | 7 +++++++ + 2 files changed, 44 insertions(+), 0 deletions(-) + +commit db7300e173388d9557dcd2333781bfaa6b021605 +Author: Martin Pitt +Date: Wed Jan 19 18:54:39 2011 +0100 + + pygi-convert.sh: Migrate Gdk.Cursor constructor, and some cursor names + + pygi-convert.sh | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 4c1d4faddf1c9cb233c484da3eadd8e31c231f70 +Author: Martin Pitt +Date: Wed Jan 19 18:43:29 2011 +0100 + + pygi-convert.sh: Handle .window attributes + + In general, convert them to .get_window(). For some of them, prefer + calling the + GtkWidget methods instead. + + pygi-convert.sh | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit b1049b947d073fb569ba900a4d5c8519482d831e +Author: Tomeu Vizoso +Date: Wed Jan 19 17:35:09 2011 +0100 + + Also deal with foreign boxed structs + + cairo.Context has been boxed and our tests started failing + + https://bugzilla.gnome.org/show_bug.cgi?id=639967 + + gi/pygi-argument.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 25b69ae257a12b6dc97ed3f2f7ea54b166ddbba1 +Author: Laszlo Pandy +Date: Wed Jan 19 17:45:11 2011 +0100 + + [gi] Convert GErrors to GObject.GError exceptions, and throw them + upon returning from calling the C function. + + This changes gi to make use of pyglib_error_check() which already + exists in pyglib. + + The included tests make use of the other patch attached to this bug, + to check that the right exception is thrown from the new function + in GIMarshallingTests. + two Gtk C functions. + + https://bugzilla.gnome.org/show_bug.cgi?id=639834 + + gi/Makefile.am | 3 ++- + gi/pygi-invoke.c | 12 +++--------- + tests/test_gi.py | 10 ++++++++++ + 3 files changed, 15 insertions(+), 10 deletions(-) + +commit e6fcafc6179e963cbae7774e7ee50415bde2c523 +Author: Martin Pitt +Date: Wed Jan 19 17:03:06 2011 +0100 + + pygi-convert.sh: Don't convert glib -> GLib for now + + This currently leads to a load of crashes, MemoryErrors, etc, as + GLib is not + very well introspectable, due to the low-level operations that + it performs. + + John Palmieri confirms that using the static "glib" binding is + preferred for + now, so disable the replacement rules. + + pygi-convert.sh | 19 ++++++++++--------- + 1 files changed, 10 insertions(+), 9 deletions(-) + +commit 167261d556eab0d2e448c7ed28eef540a024ba1d +Author: Tomeu Vizoso +Date: Wed Jan 19 16:47:08 2011 +0100 + + Link libregress.so to GIO_LIBS again + + configure.ac | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit d143afa6da4f5b5f47be8df11fa41d7b47ab1794 +Author: Laszlo Pandy +Date: Wed Jan 19 16:14:42 2011 +0100 + + Fix attributes 2BUTTON_PRESS and 3BUTTON_PRESS of Gdk.EventType. + + This puts an underscore in front of 2BUTTON_PRESS and 3BUTTON_PRESS + because in Python attributes starting with a numeral causes a + syntax error. + + gi/overrides/Gdk.py | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit 614b6ca7f45c4acbee088fe74fecf279ed50cc0c +Author: Sebastian Pölsterl +Date: Wed Jan 19 15:27:33 2011 +0100 + + [gi] Fixed typo in exception + + gi/overrides/Gtk.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b2189424f9dd6d3a4a5b9792f0d5843fc27657d1 +Author: Sebastian Pölsterl +Date: Wed Jan 19 15:12:25 2011 +0100 + + [gi] Enable handling of Gdk.EventType.2BUTTON_PRESS and 3BUTTON_PRESS + + gi/overrides/Gdk.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 5eca5ff2c9509ec96158fe43b29f0fd951243efe +Author: Martin Pitt +Date: Wed Jan 19 14:54:57 2011 +0100 + + Revert "Fix Pango FontDescription override" + + According to + http://library.gnome.org/devel/pango/1.28/pango-Fonts.html#pango-font-description-new + the default constructor actually does take no arguments; we should + actually fix + the MemoryError. Add a test case for this. + + Remove the FIXME though, as pango_font_description_from_string() + is not a + FontDescription constructor, but a static factory method. + + Thanks to Paolo Borelli for pointing this out! + + This reverts commit 8878c57676091c08e66bc6cbe735d898cb420582. + + gi/overrides/Pango.py | 5 ++++- + tests/test_overrides.py | 5 +++++ + 2 files changed, 9 insertions(+), 1 deletions(-) + +commit 9e7b95b3676a1b502662523a9bd4ebe40ccb4845 +Author: Tony Young +Date: Thu Dec 16 23:39:33 2010 +0000 + + Python iterator interface support for GFileEnumerator. + + gi/overrides/Gio.py | 41 +++++++++++++++++++++++++++++++++++++++++ + gi/overrides/Makefile.am | 1 + + tests/test_overrides.py | 20 ++++++++++++++++++++ + 3 files changed, 62 insertions(+), 0 deletions(-) + +commit bca5834fc8fa342149e0eec7b396877a2abe6d33 +Author: Tomeu Vizoso +Date: Fri Jan 7 12:10:37 2011 +0100 + + Remove gio static bindings + + https://bugzilla.gnome.org/show_bug.cgi?id=638899 + + Makefile.am | 2 +- + configure.ac | 25 - + gio/.gitignore | 3 - + gio/Makefile.am | 117 - + gio/__init__.py | 40 - + gio/gappinfo.override | 213 -- + gio/gapplaunchcontext.override | 99 - + gio/gbufferedinputstream.override | 70 - + gio/gcancellable.override | 38 - + gio/gdatainputstream.override | 250 -- + gio/gdrive.override | 347 -- + gio/gfile.override | 2215 ----------- + gio/gfileattribute.override | 153 - + gio/gfileenumerator.override | 184 - + gio/gfileinfo.override | 121 - + gio/gfileinputstream.override | 68 - + gio/gfileiostream.override | 68 - + gio/gfileoutputstream.override | 68 - + gio/gicon.override | 310 -- + gio/ginputstream.override | 344 -- + gio/gio-types.defs | 807 ---- + gio/gio.defs | 7465 + ------------------------------------- + gio/gio.override | 409 -- + gio/giomodule.c | 208 - + gio/giostream.override | 68 - + gio/gmemoryinputstream.override | 91 - + gio/gmemoryoutputstream.override | 45 - + gio/gmount.override | 454 --- + gio/goutputstream.override | 292 -- + gio/gresolver.override | 312 -- + gio/gsocket.override | 575 --- + gio/gvolume.override | 237 -- + gio/gvolumemonitor.override | 94 - + gio/pygio-utils.c | 236 -- + gio/pygio-utils.h | 49 - + gio/unix-types.defs | 55 - + gio/unix.defs | 475 --- + gio/unix.override | 62 - + gio/unixmodule.c | 52 - + tests/Makefile.am | 9 - + tests/runtests-windows.py | 3 - + tests/test_gcancellable.py | 15 - + tests/test_gicon.py | 112 - + tests/test_gio.py | 1138 ------ + tests/test_gresolver.py | 68 - + tests/test_gsocket.py | 126 - + 46 files changed, 1 insertions(+), 18191 deletions(-) + +commit 09f7ca7e2378e6679002677ac3f4802f4cc7d9d5 +Author: Ignacio Casal Quinteiro +Date: Wed Jan 19 12:04:15 2011 +0100 + + [gi] set length when marshalling guint8 erases + + gi/pygi-argument.c | 1 + + tests/test_gi.py | 4 ++++ + 2 files changed, 5 insertions(+), 0 deletions(-) + +commit 22eee43e50a150ace80694213fb87be9f0c72f51 +Author: Sebastian Pölsterl +Date: Wed Jan 19 10:27:47 2011 +0100 + + Convert Gdk.Pixbuf to GdkPixbuf.Pixbuf + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit a4b210d69c832629894090b7154ae194209b0c60 +Author: Arnaud Charlet +Date: Tue Jan 18 18:31:29 2011 +0100 + + Disable calls to PyGILState_* when threads are disabled + + Since threads may also be disabled in Python too, those symbols + may not + be resolved. + + https://bugzilla.gnome.org/show_bug.cgi?id=374603 + + glib/pyglib.c | 12 ++++++++++++ + gobject/pygobject-private.h | 6 ++++++ + 2 files changed, 18 insertions(+), 0 deletions(-) + +commit a000627ec3904b9414ce375aec8d144fc0c26248 +Author: Martin Pitt +Date: Tue Jan 18 18:29:50 2011 +0100 + + pygi-convert.sh: Do not comment out set_cell_data_func() calls; + these should be ported properly + + pygi-convert.sh | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 99ff4610fb5ece2fc8d2f9eba13e661968adf3f0 +Author: Martin Pitt +Date: Tue Jan 18 18:26:01 2011 +0100 + + pygi-convert.sh: Fix match for adding missing imports + + pygi-convert.sh | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 3aa95011fad67df20370e92bf25236a34d7d08d3 +Author: Martin Pitt +Date: Tue Jan 18 18:09:30 2011 +0100 + + pygi-convert.sh: Fix Gtk.Label handling to be idempotent + + As we are not replacing line by line, but the whole file at once, + this is a bit + hackish unfortunately. We can't use a match test or a lookahead/behind + assertion. + + pygi-convert.sh | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit 36bc1c17e7d4189059337cc6a73c64edd819ec12 +Author: Laszlo Pandy +Date: Tue Jan 18 17:29:52 2011 +0100 + + Remove trailing whitespace from gi/overrides/Gtk.py + + gi/overrides/Gtk.py | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +commit 8878c57676091c08e66bc6cbe735d898cb420582 +Author: Martin Pitt +Date: Tue Jan 18 16:47:10 2011 +0100 + + Fix Pango FontDescription override + + Trying to call __new__() on a record crashes with a MemoryError, + so just call + the intended static factory method for a None argument as well + (which works + just fine now). + + gi/overrides/Pango.py | 7 +------ + 1 files changed, 1 insertions(+), 6 deletions(-) + +commit efbbe71634037fa100b17327389b883b259cca54 +Author: Martin Pitt +Date: Tue Jan 18 16:23:39 2011 +0100 + + tests: Respect existing $GI_TYPELIB_PATH + + This allows us to run the test suite against local typelibs. + + tests/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f56d85a7f39c2088bf9fd50b1b1e5b67c03104d3 +Merge: 84d6142 7d997b6 +Author: Sebastian Pölsterl +Date: Tue Jan 18 13:14:45 2011 +0100 + + Merge branch 'value' + +commit 7d997b6fe88343776c4d67a9f3437ba0c4122da0 +Author: Sebastian Pölsterl +Date: Tue Jan 18 13:12:36 2011 +0100 + + GTK overrides: Do type conversion to column types of ListStore and + TreeStore in set_value + + gi/overrides/Gtk.py | 28 ++++++++++++++++++---------- + tests/test_overrides.py | 12 +++++++++++- + 2 files changed, 29 insertions(+), 11 deletions(-) + +commit 84d6142c14a7ebfb7284d3db52e14d3393f93905 +Author: Steve Frécinaux +Date: Mon Jan 17 18:57:58 2011 +0100 + + Always register a new GType when a GObject class is subclassed + + This patch makes the GType <-> python mapping much more predictible, + and fixes the bug caused by overriding methods without specifying a + __gtype_name__ member in the subclass, and makes type_register useless + for real :-) + + It is still possible to provide an explicit __gtype_name__ member + in the + subclass as it allows having a predictible GType name, which is handy + for some of our tests. There is also an explicit special case for + overrides because we obviously do not want to register new GTypes for + those ones as it would clearly defeat the purpose of overrides. + + https://bugzilla.gnome.org/show_bug.cgi?id=543056 + + gobject/__init__.py | 6 +++--- + tests/test_gi.py | 21 ++------------------- + 2 files changed, 5 insertions(+), 22 deletions(-) + +commit 30750ccef31e6c864628f418fc00e8c573d29a1b +Author: Simon van der Linden +Date: Tue Jan 18 12:57:13 2011 +0100 + + Raise required versions of GLib and GObject-Introspection + + https://bugzilla.gnome.org/show_bug.cgi?id=612126 + + configure.ac | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 761e98d32729f5894f4c75a54c65ed11329dc9d5 +Author: Martin Pitt +Date: Tue Jan 18 12:52:32 2011 +0100 + + pygi-convert.sh: Handle keysyms + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit d62cdfa38a675c1daf3bc12d5cd769434eea5dc8 +Author: Martin Pitt +Date: Tue Jan 18 12:14:09 2011 +0100 + + GLib overrides: Add test case for array variant building + + tests/test_overrides.py | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 69a78307f3762e3f54d28d98514cec7d31ff20db +Author: Tomeu Vizoso +Date: Tue Jan 18 10:21:03 2011 +0100 + + Remove cairo.RectangleInt from the foreign module + + https://bugzilla.gnome.org/show_bug.cgi?id=639824 + + gi/pygi-foreign-cairo.c | 96 + ----------------------------------------------- + 1 files changed, 0 insertions(+), 96 deletions(-) + +commit 017680c9a5e163021628bf29543598861a3b600a +Author: Tomeu Vizoso +Date: Tue Jan 18 10:20:25 2011 +0100 + + Dont try to guess the transfer if its a boxed + + https://bugzilla.gnome.org/show_bug.cgi?id=639823 + + gi/pygi-invoke.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 771ef76574690eb98926249f38661d741d1ebbb0 +Author: Ignacio Casal Quinteiro +Date: Tue Jan 18 12:02:01 2011 +0100 + + The tags can be Empty not None. + + gi/overrides/Gtk.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b1a98083cdc50653e1d7bfb809bdf089f833df3d +Author: Martin Pitt +Date: Tue Jan 18 12:01:28 2011 +0100 + + Add Pythonic iterators and indexing to GVariant + + Add the usual set of iterators and index accessors to GLib.Variant + objects + which are containers. + + Add corresponding test cases. + + gi/overrides/GLib.py | 50 ++++++++++++++++++++++++++++++++++++++++++ + tests/test_overrides.py | 55 + +++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 105 insertions(+), 0 deletions(-) + +commit ecb9f824c503c529d43e585b4cdb4c1c9ab14593 +Author: Martin Pitt +Date: Tue Jan 18 10:48:03 2011 +0100 + + Add GLib.Variant.unpack() + + This method decomposes a GLib.Variant into a native Python object, + i. e. the + counterpart of _VariantCreator. This makes it a lot nicer for + application + developers to use e. g. return values from gdbus calls. + + Add appropriate test case. + + gi/overrides/GLib.py | 45 + +++++++++++++++++++++++++++++++++++++++++++++ + tests/test_overrides.py | 33 ++++++++++++++++++++++++++++++++- + 2 files changed, 77 insertions(+), 1 deletions(-) + +commit 31c73dee34a52fd22b5ff3a23adce92cea5ddc3d +Author: Ignacio Casal Quinteiro +Date: Tue Jan 18 10:56:18 2011 +0100 + + Add override for gtk_text_buffer_insert_with_tags + + gi/overrides/Gtk.py | 12 ++++++++++++ + tests/test_overrides.py | 6 ++++++ + 2 files changed, 18 insertions(+), 0 deletions(-) + +commit fc7d7f7f153d57ff3866b7bfd5e6479d702cc4d9 +Author: Simon van der Linden +Date: Mon Jan 17 14:35:14 2011 +0100 + + Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES + + https://bugzilla.gnome.org/show_bug.cgi?id=620215 + + gi/Makefile.am | 6 ++++-- + gio/Makefile.am | 2 +- + glib/Makefile.am | 2 +- + m4/python.m4 | 7 +++++-- + tests/Makefile.am | 2 +- + 5 files changed, 12 insertions(+), 7 deletions(-) + +commit bceec758b27e6c396d17a79424633b5dc9116f54 +Author: Simon van der Linden +Date: Mon Jan 17 14:20:55 2011 +0100 + + Kill JD_CHECK_PYTHON_HEADERS + + Use AM_CHECK_PYTHON_HEADERS instead, which is identical. + + https://bugzilla.gnome.org/show_bug.cgi?id=620215 + + configure.ac | 2 +- + m4/python.m4 | 31 +------------------------------ + 2 files changed, 2 insertions(+), 31 deletions(-) + +commit e2dea065da94d17a915abe1ce4671b1dc48e02c0 +Author: Sebastian Pölsterl +Date: Mon Jan 17 19:09:27 2011 +0100 + + Revert "Override Gtk.Box.pack_start and pack_end to set default + values to be compliant with pygtk" + + This reverts commit a8c727b9c4195d8085a45661683a18614ae84485. + + Conflicts: + + gi/overrides/Gtk.py + + gi/overrides/Gtk.py | 10 ---------- + 1 files changed, 0 insertions(+), 10 deletions(-) + +commit 4fbae9629adc166627de05bb0946b71485343d69 +Author: Sebastian Pölsterl +Date: Mon Jan 17 19:08:23 2011 +0100 + + Revert "Override Gtk.CellLayout.pack_start and pack_end to add + default values to be compliant with pygtk" + + This reverts commit 232841148f35684be83a2f47b5b18da4fb74f63a. + + gi/overrides/Gtk.py | 13 ++----------- + 1 files changed, 2 insertions(+), 11 deletions(-) + +commit c054f0aca67952876b3519bb75ddc62c5517f7cb +Author: Sebastian Pölsterl +Date: Mon Jan 17 19:08:06 2011 +0100 + + Revert "Override Gtk.TreeViewColumn.pack_start, pack_end and + set_cell_data_func to add default values to be compliant with pygtk" + + This reverts commit ed7e7a8f22b1481acf78c0c2e4c489dbad72f599. + + gi/overrides/Gtk.py | 9 --------- + 1 files changed, 0 insertions(+), 9 deletions(-) + +commit 2d9534f347505573da46743b47318e08bf073aef +Author: Martin Pitt +Date: Mon Jan 17 18:54:10 2011 +0100 + + pygi-convert.sh: Handle gtk.combo_box_new_text() + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 914d3a0a29680f4d3aa0e1f8afdd625b017b013a +Author: Sebastian Pölsterl +Date: Mon Jan 17 16:57:53 2011 +0100 + + Override TreeSortable.set_sort_func and set_default_sort_func to + add default values to be pygtk compliant + + gi/overrides/Gtk.py | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit ed7e7a8f22b1481acf78c0c2e4c489dbad72f599 +Author: Sebastian Pölsterl +Date: Mon Jan 17 16:29:28 2011 +0100 + + Override Gtk.TreeViewColumn.pack_start, pack_end and + set_cell_data_func to add default values to be compliant with pygtk + + gi/overrides/Gtk.py | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +commit 232841148f35684be83a2f47b5b18da4fb74f63a +Author: Sebastian Pölsterl +Date: Mon Jan 17 16:28:51 2011 +0100 + + Override Gtk.CellLayout.pack_start and pack_end to add default values + to be compliant with pygtk + + gi/overrides/Gtk.py | 13 +++++++++++-- + 1 files changed, 11 insertions(+), 2 deletions(-) + +commit 1dec12826753756fcadefc8ef8c756fc902c320b +Author: Sebastian Pölsterl +Date: Mon Jan 17 15:54:32 2011 +0100 + + Override Gtk.Paned pack1 and pack2 to add default values to be + compliant with pygtk + + gi/overrides/Gtk.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit a8c727b9c4195d8085a45661683a18614ae84485 +Author: Sebastian Pölsterl +Date: Mon Jan 17 15:46:25 2011 +0100 + + Override Gtk.Box.pack_start and pack_end to set default values to + be compliant with pygtk + + gi/overrides/Gtk.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit 7cc8ac35bb0d8dbf7d66f014f8cd7ff070b3acb8 +Author: Steve Frécinaux +Date: Wed Aug 4 00:30:05 2010 +0200 + + Handle GObject subclasses in the property helper. + + https://bugzilla.gnome.org/show_bug.cgi?id=625982 + + gobject/propertyhelper.py | 26 +++++++++++++------------- + tests/test_properties.py | 9 +++++++++ + 2 files changed, 22 insertions(+), 13 deletions(-) + +commit 7a0548dbfbdfe481f75315b6bc7824a9f1a8a87b +Author: Martin Pitt +Date: Mon Jan 17 17:52:15 2011 +0100 + + Fix handling of unicode for GtkTreeModels + + The code previously converted an unicode object into unicode, but + in Python 2.X + models actually have to specify 'str' (GTK expects a gchararray). So + encode to + UTF-8 instead to get what GTK expects. + + Add corresponding test case. + + gi/overrides/Gtk.py | 2 +- + tests/test_overrides.py | 12 +++++++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +commit 09c21c79fb6063c8451f53d4588363d2be7239f4 +Author: Laszlo Pandy +Date: Mon Jan 17 16:46:08 2011 +0100 + + In IntrospectionModule and DynamicModule classes, make all instance + attributes start with an underscore. + + This changes IntrospectionModule.version to _version and + DynamicModule.introspection_module to _introspection_module. + This is done to mark the attributes as private, and also avoid name + collisions with attributes from the typelib. + In Gstreamer, there is a function gst_version, which was previously + inaccessible because of IntrospectionModule.version overriding it. + + gi/module.py | 26 +++++++++++++------------- + gi/overrides/GIMarshallingTests.py | 2 +- + gi/overrides/GLib.py | 2 +- + gi/overrides/Gdk.py | 10 +++++----- + gi/overrides/Gtk.py | 2 +- + gi/overrides/Pango.py | 2 +- + gi/overrides/__init__.py | 2 +- + tests/test_everything.py | 2 +- + 8 files changed, 24 insertions(+), 24 deletions(-) + +commit 2c70beca9e76e4dc253453c556e6985ce59a3dd9 +Author: Laszlo Pandy +Date: Mon Jan 17 16:17:25 2011 +0100 + + Amend previous enum wrapping commit to remove redundant setting of + __info__ attribute. + + gi/module.py | 2 +- + gi/types.py | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 6fbb6be5a5d0d9cd43e1504b8dda5aa75feb95ca +Author: Martin Pitt +Date: Mon Jan 17 16:16:45 2011 +0100 + + pygi-convert.sh: Handle GdkPixbuf.InterpType + + pygi-convert.sh | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 66a5784f4ab5de5b6d8d51eb4ce869fa26f6a601 +Author: Laszlo Pandy +Date: Mon Jan 17 15:43:34 2011 +0100 + + Fix wrapping of enums: Create new Python type for each non-gtype enum. + + Previously non-gtype enums used the same class, which meant they + were all the same type. + This caused another problem that since they were all the same class, + attributes from different enums were available from each other. + + A new test case is created to check for this bug. It requires a new + enum from the GIMarshallingTests (updating gobject-introspection + will be required). + + gi/module.py | 2 +- + gi/types.py | 2 ++ + tests/test_gi.py | 10 ++++++++++ + 3 files changed, 13 insertions(+), 1 deletions(-) + +commit da50d5620a42046d4fc905bb28a0890d73533cb1 +Author: Tomeu Vizoso +Date: Mon Dec 13 18:03:51 2010 +0100 + + Use g_vfunc_info_invoke for chaining up in vfuncs + + https://bugzilla.gnome.org/show_bug.cgi?id=637165 + + gi/pygi-info.c | 4 +- + gi/pygi-invoke.c | 72 + +++++++++++++++++++++++++++++++++++++++++------------ + gi/pygi-invoke.h | 3 +- + gi/types.py | 28 ++++++++++++++++++++- + tests/test_gi.py | 5 ++- + 5 files changed, 89 insertions(+), 23 deletions(-) + +commit 8ceef79c98a1c2e22ed8ab655ef1169f1763dd23 +Author: Simon van der Linden +Date: Fri Dec 31 18:38:04 2010 +0100 + + Move pyglib_{main_context, option_context, option_group}_new into + _PyGLib_API + + _PyG{MainContext, OptionContext, and OptionGroup_Type} were not + be initialized + when used inside the glib module, since pyglib_init is not called. + + pyglib.c is compiled as a stand-alone library loaded by the _glib + module that + declares the above-mentioned types. Hence, they cannot be accessed + by the + former. This patch moves the functions that need those symbols + into the + glib._glib module and exports them to the pyglib library through + _PyGLib_API. + + https://bugzilla.gnome.org/show_bug.cgi?id=636656 + + glib/glibmodule.c | 5 +++- + glib/pyglib-private.h | 3 ++ + glib/pyglib.c | 48 + ++-------------------------------------------- + glib/pygmaincontext.c | 22 +++++++++++++++++++++ + glib/pygmaincontext.h | 2 +- + glib/pygmainloop.c | 2 +- + glib/pygoptioncontext.c | 21 ++++++++++++++++++++ + glib/pygoptioncontext.h | 2 + + glib/pygoptiongroup.c | 26 +++++++++++++++++++++++++ + glib/pygoptiongroup.h | 2 + + glib/pygsource.c | 2 +- + 11 files changed, 86 insertions(+), 49 deletions(-) + +commit 17caffe4eeefeaf33a56ececbc6c7454f60b9d76 +Author: Martin Pitt +Date: Mon Jan 17 14:51:26 2011 +0100 + + pygi-convert.sh: Handle Gdk.DragAction + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit aa390aa80f06ac83ec89e5c5ee143d21ace97917 +Author: Martin Pitt +Date: Mon Jan 17 14:46:58 2011 +0100 + + pygi-convert.sh: Generalize Gtk.Settings migration + + There are other GSettings.get_* functions like get_for_screen(). + + pygi-convert.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2e6d5bb49425e6087ca61765ecb72e7a760f2ab2 +Author: Martin Pitt +Date: Mon Jan 17 11:22:46 2011 +0100 + + pygi-convert.sh: Don't change the name of "glib" submodules + + This particular affects dbus.mainloop.glib.* + + pygi-convert.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 3887b030fc19d25e0cd7b4ed504f4ed23363c3d6 +Author: Paolo Borelli +Date: Sun Jan 16 22:09:56 2011 +0100 + + Plug another memory leak + + Do not leak interface info in (g|s)_et_property. + + gi/pygi-property.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit a4950b4cbb3c7567a8586061bb361adb7d9afb98 +Author: Paolo Borelli +Date: Sun Jan 16 21:43:30 2011 +0100 + + Plug a small memory leak. + + Do not leak type_info in find_vfunc_info + + gi/gimodule.c | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +commit d0cbcc45366d40702c69cef207d3c0f361260c02 +Author: Paolo Borelli +Date: Sun Jan 16 12:16:31 2011 +0100 + + Override Table.attach() to behave like pygtk + + It is fairly common and even gtk itself still has attach_defaults. + + gi/overrides/Gtk.py | 3 +++ + tests/test_overrides.py | 4 ++++ + 2 files changed, 7 insertions(+), 0 deletions(-) + +commit 6409d659326bf3cefdf6051379e8bc2031f16733 +Author: Martin Pitt +Date: Sat Jan 15 11:20:23 2011 -0600 + + pygi-convert.sh: Convert Pango.WrapMode + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 6aaa6a38198e84a189ca1e8d26b1871d5b6bb711 +Author: Martin Pitt +Date: Sat Jan 15 11:17:09 2011 -0600 + + pygi-convert.sh: Don't change the name of "gtk" submodules + + Some projects have local modules like "myproject.ui.gtk". Avoid + changing those, + just change module names which start with "gtk" or "gdk". + + pygi-convert.sh | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit c36fbf4918c8557a8e274a12004a412da3b22b2c +Author: Laszlo Pandy +Date: Tue Jan 11 21:41:47 2011 +0100 + + Fix the __dir__() methods on DynamicModule and IntrospectionModule + + Previously the __dir__() methods did not list all attributes. + A simple test case is included. It does not test to see if + every attribute is listed, it just tests a few of each kind: + - (wrapped) typelib attributes + - class attributes and methods + - instance attributes + + A set() is used to avoid returning duplicate attributes. + The test case checks for this as well. + + https://bugzilla.gnome.org/show_bug.cgi?id=639229 + + gi/module.py | 28 +++++++++++++++++++++------- + tests/test_everything.py | 18 ++++++++++++++++++ + 2 files changed, 39 insertions(+), 7 deletions(-) + +commit 1679e6af3f212e4d4644e048dc3c6177ed3fac6b +Author: Paolo Borelli +Date: Thu Jan 13 00:02:20 2011 +0100 + + pygi-convert.sh: handle ReliefStyle + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit bd002c72675d35b5e60ab773181e7c36c30d2625 +Author: Dieter Verfaillie +Date: Tue Jan 11 22:21:18 2011 +0100 + + setup.py: fix the provides keyword argument + + setup.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 59dac72d0fa8e1d68bbbc13d76c2747f1cb11857 +Author: Dieter Verfaillie +Date: Tue Jan 11 22:19:18 2011 +0100 + + setup.py: use the same spaces-less format for all setup() parameters + + setup.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit 4992dca9f5cea68d85eb2ed86105c9c6b8311d79 +Author: Laszlo Pandy +Date: Tue Jan 11 19:30:38 2011 +0100 + + Add a __repr__() method to DynamicModule. + + This patch adds a __repr__() method to DynamicModule so that modules + provide a + meaningful string with the typelib path included: + + >>> from gi.repository import Gtk + >>> Gtk + + + https://bugzilla.gnome.org/show_bug.cgi?id=639232 + + gi/module.py | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +commit 2ffaec59e7349c145a0e2a5edba2ffb7d8628369 +Author: Tomeu Vizoso +Date: Tue Jan 11 19:40:19 2011 +0100 + + Go back to using getattr() in DynamicModule.__getattr__ + + Breaks marshalling of some types + + gi/module.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 52a298cc0f05ceec96457f17f9a801e9838fb757 +Author: Laszlo Pandy +Date: Tue Jan 11 19:26:50 2011 +0100 + + Change __dir__() to report all the attributes that __getattr__ + supports + + Change DynamicModule.__dir__() to return the local class members as + well as the + typelib attributes. + + Change DynamicModule.__getattr__() to call + IntrospectionModule.__getattr__() + directly, so that it won't inadvertently return class attributes from + IntrospectionModule. + + https://bugzilla.gnome.org/show_bug.cgi?id=639229 + + gi/module.py | 10 +++++++--- + 1 files changed, 7 insertions(+), 3 deletions(-) + +commit 202a268db7f98f5a3c525c6e65ec4bff1917257e +Author: Emilio Pozuelo Monfort +Date: Sat Jan 8 02:19:52 2011 +0000 + + Bump the minimum gio dependency + + Needed for G_TYPE_CONVERTER_FLAGS and others. + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c3aa36151fdef9ed9884d93114786bbe86387983 +Author: Tomeu Vizoso +Date: Fri Jan 7 12:58:11 2011 +0100 + + Add test for incorrect attributes in Gdk.Event + + tests/test_overrides.py | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 204b45c7e95eb50d9e3843127fb10e13b1b17fee +Author: Simon van der Linden +Date: Sun Jan 2 19:25:55 2011 +0100 + + Don't call getattr again in gi.overrides.Gdk.Event.__getattr__ + + __getattr__ is only called when the attribute is not found through + the normal + mechanism, so getattr must not be called again in __getattr__ + (which would + create an infinite loop). + + Another possibility would be to implement __getattribute__ instead, + which is + called in place of the normal mechanism. In that case, calling + getattr would be + needed for normal attributes. + + https://bugzilla.gnome.org/show_bug.cgi?id=638523 + + gi/overrides/Gdk.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6cf298ca5565d0eb99824f050ff47407e50a5c01 +Author: Mike Gorse +Date: Fri Jan 7 09:08:31 2011 +0100 + + Release allocated array of arguments when handling closures + + https://bugzilla.gnome.org/show_bug.cgi?id=638847 + + gi/pygi-closure.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 1be76d5e006efa24598ff7bf26153660dbe0a890 +Author: Mike Gorse +Date: Fri Jan 7 09:07:35 2011 +0100 + + Release GIValueInfo when checking an enum argument + + https://bugzilla.gnome.org/show_bug.cgi?id=638847 + + gi/pygi-argument.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 8d5a7857876669f56bb03bf618bcfdcc290721c0 +Author: Eitan Isaacson +Date: Wed Dec 22 12:34:10 2010 -0800 + + Respect different type lengths when assigning out-argument pointers. + + https://bugzilla.gnome.org/show_bug.cgi?id=637832 + + gi/pygi-closure.c | 66 + +++++++++++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 56 insertions(+), 10 deletions(-) + +commit f14976ffabec28f6cafe1e37dc81d207a947d4ca +Author: Tomeu Vizoso +Date: Tue Dec 28 18:34:25 2010 +0100 + + Fix stupid name clash + + gi/module.py | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit 01b2a193d403beb861eab524300b4f1af63157ce +Author: Tomeu Vizoso +Date: Tue Dec 28 13:49:18 2010 +0100 + + Add /usr/share to XDG_DATA_DIRS when running the tests + + tests/Makefile.am | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit efc186f692f9eac781cc47456be74a3da7f14dcd +Author: Tomeu Vizoso +Date: Tue Dec 28 13:25:34 2010 +0100 + + Comment out tests that require SRV lookups + + tests/test_gresolver.py | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit d2462cc1ab51d76fb4625c47c3d34de1d5d0dee8 +Author: Tomeu Vizoso +Date: Tue Dec 28 13:00:16 2010 +0100 + + Use suppresion file when running valgrind + + tests/Makefile.am | 2 +- + tests/python.supp | 387 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 388 insertions(+), 1 deletions(-) + +commit 0ee58113ecbea72784c52de928c041fc8fc88984 +Author: Ignacio Casal Quinteiro +Date: Thu Dec 23 00:10:41 2010 +0100 + + Fix warnings. + + gi/pygi-argument.c | 16 +++++++--------- + gi/pygi-foreign-cairo.c | 13 ++----------- + gio/gfile.override | 5 ++--- + glib/pyglib-python-compat.h | 3 +++ + glib/pyglib.c | 2 +- + glib/pygmainloop.c | 3 ++- + 6 files changed, 17 insertions(+), 25 deletions(-) + +commit 78ea84cd91392400ebac5a361ef8793bfe928fd0 +Author: Jesse van den Kieboom +Date: Sun Dec 19 23:10:57 2010 +0100 + + Allow comparing Gtk.TreePath to None + + https://bugzilla.gnome.org/show_bug.cgi?id=637615 + + gi/overrides/Gtk.py | 12 ++++++------ + tests/test_overrides.py | 6 ++++++ + 2 files changed, 12 insertions(+), 6 deletions(-) + +commit 046cc5915286e042d1040271a90676b77632409e +Author: John (J5) Palmieri +Date: Thu Dec 16 15:41:10 2010 -0500 + + handle unicode objects in properties + + * There are still some cavets in Python 2: + - properties are returned as String objects with the unicode + code points + - you must add # coding=utf-8 to the top of your python file + or python + will error out if it sees embeded unicode charaters (such as when + supporting python 3 and python 2 from the same source) + + https://bugzilla.gnome.org/show_bug.cgi?id=620579 + + gobject/pygtype.c | 35 ++++++++++++++++++++++++++--------- + tests/test_properties.py | 16 ++++++++++++++++ + 2 files changed, 42 insertions(+), 9 deletions(-) + +commit 7aa783d5cd674f34da318f826bd5f4a0e09d24cb +Author: Dieter Verfaillie +Date: Tue Dec 14 12:29:54 2010 +0100 + + dsextras.py: check if gcc is there when platform is win32 and compiler + is mingw32 + + dsextras.py | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit cebf5f09a6c5018ced64f35e7747fc81b93b823e +Author: Dieter Verfaillie +Date: Tue Dec 14 12:29:01 2010 +0100 + + dsextras.py: be consistent in how distutils imports are done + + dsextras.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 35e590d48c78f2e76c47c2b4eaf0f7e8d1ed5c93 +Author: Dieter Verfaillie +Date: Tue Dec 14 12:25:07 2010 +0100 + + dsextras.py: add have_gcc() function + + dsextras.py | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 637c2c287cfb0e89365026531c651111f5593ac7 +Author: Dieter Verfaillie +Date: Tue Dec 14 12:24:41 2010 +0100 + + dsextras.py: use distutils.spawn.find_executable for have_pkgconfig() + + dsextras.py | 8 ++------ + 1 files changed, 2 insertions(+), 6 deletions(-) + +commit 020d00bc0ce7b77006b4d4f42d63122d79bcbf89 +Author: Dieter Verfaillie +Date: Tue Dec 14 12:22:54 2010 +0100 + + setup.py: fix another case of use True/False instead of 1/0 + + setup.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b03cc9e0d66d8caea3cd6a63db198c43de9267e9 +Author: Paolo Borelli +Date: Mon Dec 13 10:21:52 2010 +0100 + + pygi-convert.sh: improve GtkSourceView conversion + + pygi-convert.sh | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit fbc12cd7c09a67de9e28b7b0b28de9dc0e0e3418 +Author: Paolo Borelli +Date: Mon Dec 13 10:27:56 2010 +0100 + + pygi-convert.sh: Gtk.DialogFlags conversion + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 73e933d2429aea4d14e15350a538da1c5c3f71eb +Author: José Alburquerque +Date: Sun Dec 12 20:38:46 2010 -0500 + + Doc Extractor: Print the gtk-doc blocks sorted by function name. + + * codegen/docextract_to_xml.py: Print the xml of the gtk-doc + block in + alphabetical order according to the identifier (function name) + so that + the generation of xml files in the C++ bindings is deterministic. + Thanks to Krzesimir Nowak for suggesting this in a gtksourceviewmm + recent commit. + + codegen/docextract_to_xml.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit db7ffa75b007074cb6b33b547c6d8140da300a3e +Author: Paolo Borelli +Date: Mon Dec 13 00:17:26 2010 +0100 + + pygi-convert.sh: add more Gtk conversions and sort + + pygi-convert.sh | 50 ++++++++++++++++++++++++++------------------------ + 1 files changed, 26 insertions(+), 24 deletions(-) + +commit f4bfe73d0ccedf7f671d3acd6d9e262d5383b733 +Author: Paolo Borelli +Date: Mon Dec 13 00:01:40 2010 +0100 + + pygi-convert.sh: convert Atk + + pygi-convert.sh | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit e55ce3667eb1d352bf96f265bf018ffe8aea75f9 +Author: Paolo Borelli +Date: Sun Dec 12 23:48:48 2010 +0100 + + pygi-convert.sh: convert a few more Gio types + + pygi-convert.sh | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +commit acc9f84bc6e13d76c6516cefe393d4a4f868aa24 +Author: Paolo Borelli +Date: Sun Dec 12 14:19:00 2010 +0100 + + pygi-convert.sh: more GLib conversion + + pygi-convert.sh | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit c903390814bebdc62d530472f6f94feecc59b8b3 +Author: Paolo Borelli +Date: Sun Dec 12 14:00:34 2010 +0100 + + pygi-convert.sh: remove two cases handled by overrides + + pygi-convert.sh | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +commit d33c987e505ec8ddffa2b8cb5526f05b9b5f62be +Author: Paolo Borelli +Date: Sun Dec 12 13:38:56 2010 +0100 + + Override Gtk.ScrolledWindow constructor + + gi/overrides/Gtk.py | 7 +++++++ + tests/test_overrides.py | 7 +++++++ + 2 files changed, 14 insertions(+), 0 deletions(-) + +commit 1c24bb089fcd69e3104ae72a0e7560a8c5a3f05b +Author: Paolo Borelli +Date: Sun Dec 12 12:32:39 2010 +0100 + + pygi-convert.sh: Fix 'find' syntax + + pygi-convert.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f0a1d6b6bb53d0fa2788d8b9027d737b0aef8dfc +Author: Paolo Borelli +Date: Sun Dec 12 12:29:38 2010 +0100 + + pygi-convert.sh: start handling Gio and GLib + + pygi-convert.sh | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 365bf3251af3498dc797a58cce071805451b49b1 +Author: Paolo Borelli +Date: Sat Dec 11 23:05:31 2010 +0100 + + pygi-convert.sh: convert Gdk.ScrollDirection. + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit bca603de0f217fb290189a0ea330f82961c46d5d +Author: Paolo Borelli +Date: Sat Dec 11 15:03:21 2010 +0100 + + Override Pango.Layout constructor. + + I must take a Pango.Context argument. Unfortumately the context is + not a + gobject property so we need to jump through some oops. + + gi/overrides/Pango.py | 13 +++++++++++++ + tests/test_overrides.py | 6 ++++++ + 2 files changed, 19 insertions(+), 0 deletions(-) + +commit df233301802e3f7f9ce338cde015ca2a2fc648ab +Author: Paolo Borelli +Date: Sat Dec 11 14:18:53 2010 +0100 + + Remove Pango.FontDescription() conversion. + + It is now properly handled by an override. + + pygi-convert.sh | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit d8abcc9463542af9cd43d71849d0ad4c183b570b +Author: Paolo Borelli +Date: Fri Dec 10 14:05:20 2010 +0100 + + Override GtkAction and GtkRadioAction constructors. + + gi/overrides/Gtk.py | 20 +++++++++++++++++--- + tests/test_overrides.py | 18 ++++++++++++++++++ + 2 files changed, 35 insertions(+), 3 deletions(-) + +commit 7924b18a99a0680c04aca46be4b64a7aa507dfe5 +Author: Dmitrijs Ledkovs +Date: Sat Dec 4 22:13:28 2010 +0000 + + Override Adjustment constructor to behave like pygtk + + https://bugzilla.gnome.org/show_bug.cgi?id=636486 + + gi/overrides/Gtk.py | 7 +++++++ + tests/test_overrides.py | 9 +++++++++ + 2 files changed, 16 insertions(+), 0 deletions(-) + +commit e76352dd83c8706e68ad57d00d185da9afea99c4 +Author: John (J5) Palmieri +Date: Thu Dec 9 13:23:10 2010 -0500 + + add secondary_text apis to MessageDialog + + gi/overrides/Gtk.py | 8 ++++++++ + tests/test_overrides.py | 8 ++++++++ + 2 files changed, 16 insertions(+), 0 deletions(-) + +commit de682b2d36c362140ab7d43c0743b01ec0865a74 +Author: John (J5) Palmieri +Date: Wed Dec 8 16:39:27 2010 -0500 + + [gi] get rid of some debug prints and fix error messages + + gi/overrides/Gtk.py | 7 +++---- + 1 files changed, 3 insertions(+), 4 deletions(-) + +commit dbb16571803bf51f497768bf80944514f4290ee5 +Author: Paolo Borelli +Date: Wed Dec 8 18:25:15 2010 +0100 + + Fix demo for override changes. + + demos/gtk-demo/gtk-demo.py | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit 2adcd95762944a4e27123093d3c8d080e49be1ea +Author: Paolo Borelli +Date: Wed Dec 8 18:06:01 2010 +0100 + + Override Pango.FontDescription. + + demos/gtk-demo/gtk-demo.py | 2 +- + gi/overrides/Makefile.am | 1 + + gi/overrides/Pango.py | 40 + ++++++++++++++++++++++++++++++++++++++++ + tests/test_overrides.py | 7 +++++++ + 4 files changed, 49 insertions(+), 1 deletions(-) + +commit 769da968c9187414d0420412d8fb8c833d12042a +Author: Tomeu Vizoso +Date: Wed Dec 8 17:38:11 2010 +0100 + + Stop checking that all vfuncs are implemented + + Because some methods are optionally implementable but g-i won't + tell us. + + https://bugzilla.gnome.org/show_bug.cgi?id=619606 + + gi/gimodule.c | 4 +++- + gi/types.py | 12 ++---------- + tests/test_gi.py | 10 ---------- + 3 files changed, 5 insertions(+), 21 deletions(-) + +commit 167a01c46b3fa0b3c8339502c875d32bd2bca974 +Author: Paolo Borelli +Date: Wed Dec 8 17:37:00 2010 +0100 + + Fix usage of TreeIter api that is now an override. + + demos/gtk-demo/gtk-demo.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit d2cfd6e9250d40de7c715ac74e299deddf137683 +Author: Paolo Borelli +Date: Wed Dec 8 17:34:54 2010 +0100 + + Fix Gtk.Label(label="Foo") + + Use 'label' as an argument name instead of 'str', otherwise we may + end up up with two 'label' in the kwds dict. Besides 'str' is a + reserved keyword. + + gi/overrides/Gtk.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit c0c684c9bb4e2bc08d7cb6ac246705e8a3b77656 +Author: Paolo Borelli +Date: Wed Dec 8 14:16:39 2010 +0100 + + Fix typo when raising an exception + + gi/types.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 88c9a3ad49d9fcf779c3523672d8bf4767910301 +Author: Sebastian Pölsterl +Date: Wed Dec 8 10:46:27 2010 +0100 + + pygi-convert.sh: Added more conversions + + pygi-convert.sh | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +commit 4d8d96326b2cac91e6d75e6601b92e202d1918ff +Author: Paolo Borelli +Date: Tue Dec 7 20:39:15 2010 +0100 + + Override LinkButton constructor to make 'uri' mandatory + + gi/overrides/Gtk.py | 7 +++++++ + tests/test_overrides.py | 6 ++++++ + 2 files changed, 13 insertions(+), 0 deletions(-) + +commit f4f7fb35af1b41598dc050f5df155a01c370a920 +Author: Dmitry Morozov +Date: Sat Dec 4 19:19:19 2010 +0600 + + Container should be iterable. + + gi/overrides/Gtk.py | 9 +++++++++ + tests/test_overrides.py | 6 +++++- + 2 files changed, 14 insertions(+), 1 deletions(-) + +commit d2ad05d6d8d53b941e0ad33fcb200f1245a2d308 +Author: Paolo Borelli +Date: Tue Dec 7 14:13:00 2010 +0100 + + No need to import Gdk + + gi/overrides/Gtk.py | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit b6a40badf0b2b59e690ce818efb03c7c816b8a04 +Author: Paolo Borelli +Date: Tue Dec 7 14:07:53 2010 +0100 + + Remove semicolumns + + gi/overrides/Gtk.py | 7 +++---- + 1 files changed, 3 insertions(+), 4 deletions(-) + +commit cdc9c26553bf47ea488676e7bdc5f8ab0a2c906b +Author: John (J5) Palmieri +Date: Mon Dec 6 16:05:30 2010 -0500 + + [gi] make sure Gtk.Button override passes all keywords to parent + constructor + + gi/overrides/Gtk.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit cede81ad65db017e95543d8d35715751aa202fed +Author: Paolo Borelli +Date: Sun Dec 5 13:31:20 2010 +0100 + + Fix cut&paste error in the Label override + + gi/overrides/Gtk.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 607c59b74ebbc1e39cb4121c870b689e1888c106 +Author: Paolo Borelli +Date: Sat Dec 4 16:03:27 2010 +0100 + + pygi-convert.sh: handle TextWindowType + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit dfeabe0b68938e27da2e65903983b5113dc422f1 +Author: Paolo Borelli +Date: Sat Dec 4 15:49:15 2010 +0100 + + Override Label constructor to behave like pygtk + + gi/overrides/Gtk.py | 7 +++++++ + tests/test_overrides.py | 4 ++++ + 2 files changed, 11 insertions(+), 0 deletions(-) + +commit da4e045e5abbed2796cc4ed39df35a0dde2de31b +Author: Paolo Borelli +Date: Sat Dec 4 15:40:35 2010 +0100 + + Override GtkTable constructor to behave like pygtk + + gi/overrides/Gtk.py | 7 +++++++ + tests/test_overrides.py | 12 ++++++++++++ + 2 files changed, 19 insertions(+), 0 deletions(-) + +commit 81452c23ab1befa59ff375692e582791432796a5 +Author: Paolo Borelli +Date: Sat Dec 4 12:59:43 2010 +0100 + + pygi-convert.sh: convert MovementStep + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 4d097eea94258eda0c328711491fd456cbd6741b +Author: Paolo Borelli +Date: Sat Dec 4 11:57:02 2010 +0100 + + Update Gdk overrides to work with latest Gtk+ 3 + + For now added consitionals on version == 2.0, but maybe at some + point we + shuld just clean up the old stuff. + + gi/overrides/Gdk.py | 22 ++++++++++++++++------ + 1 files changed, 16 insertions(+), 6 deletions(-) + +commit cda317195566711d66190145b545e26ed7226172 +Author: Johan Dahlin +Date: Thu Dec 2 23:47:40 2010 -0200 + + Gtk: add an override for Gtk.main_quit + + Override gtk.main_quit so that it can be used as a callback + to signals, most importantly to the destroy signal of a widget: + + widget.connect('destroy', gtk.main_quit) + + This is compatible with what PyGTK does. + + https://bugzilla.gnome.org/show_bug.cgi?id=636336 + + gi/overrides/Gtk.py | 5 ++++- + gi/overrides/__init__.py | 27 +++++++++++++++++++++++++-- + 2 files changed, 29 insertions(+), 3 deletions(-) + +commit 82689cbf53d92b1b951a459fe3de0e1d3a91791a +Author: John (J5) Palmieri +Date: Thu Dec 2 16:27:04 2010 -0500 + + [gi] handle subtypes when inserting into tree models + + * Often modules will give back basic types wrapped in a subtype. + This is the case with D-Bus where you may want to keep some of the + metadata around. More often than not, the developer is just looking + to use the basetype. + + * This override checks the column type and handles basic types such as + gchararrays, ints, longs, floats and doubles, converting them + to their + base types before sending them to the generic GI type marshaller. + + * More types may need to be supported but these are the common + cases where + apps break. + + https://bugzilla.gnome.org/show_bug.cgi?id=635172 + + gi/overrides/Gtk.py | 38 ++++++++++++++++++++++++++++++++++++-- + tests/test_overrides.py | 8 +++++++- + 2 files changed, 43 insertions(+), 3 deletions(-) + +commit 677490e9402bad7b7c2a832345ef54f7f0c5fc7f +Author: Paolo Borelli +Date: Fri Dec 3 23:39:50 2010 +0100 + + Override TreeSelection.select_path and TreeView.scroll_to_cell + + The "path" argument may also be a string or a tuple + + gi/overrides/Gtk.py | 10 ++++++++++ + tests/test_overrides.py | 29 +++++++++++++++++++++++++++++ + 2 files changed, 39 insertions(+), 0 deletions(-) + +commit dacfe618fa244445c979f1a5efa80c1f9a5a4ae9 +Author: Paolo Borelli +Date: Fri Dec 3 23:29:00 2010 +0100 + + Override TreePath.__new__ + + Instead of having a private _tree_path_from_string it is cleaner to + override __new__ and it will be useful for all the api that take a + TreePath or a string or a tuple. + + gi/overrides/Gtk.py | 33 +++++++++++++++------------------ + tests/test_overrides.py | 18 ++++++++++++++++++ + 2 files changed, 33 insertions(+), 18 deletions(-) + +commit 7a8af9e220ee48aa28f6b025c5dae324b14fe128 +Author: Paolo Borelli +Date: Sun Nov 28 13:02:30 2010 +0100 + + Override Container to behave like a sequence + + gi/overrides/Gtk.py | 6 ++++++ + tests/test_overrides.py | 11 +++++++++++ + 2 files changed, 17 insertions(+), 0 deletions(-) + +commit 94e8befc935d4a6c7f766e34195e10fc3fb3b93a +Author: John (J5) Palmieri +Date: Tue Nov 30 16:57:05 2010 -0500 + + refactor Jonathan Matthew recurse vfunc patch so it applys and clean + up a bit + + * this patch does the recursion using the previous patche's support + functions + + gi/types.py | 55 + +++++++++++++++++++++++++++++++++++++++++++++---------- + 1 files changed, 45 insertions(+), 10 deletions(-) + +commit 9c5aee4f06f92457f9ae987656c0c469f76d0ee8 +Author: Jonathan Matthew +Date: Thu Jul 22 23:19:51 2010 +1000 + + Recurse up through base classes when setting up vfuncs + + * this patch adds the support methods to do the recursion + + https://bugzilla.gnome.org/show_bug.cgi?id=625033 + + gi/gimodule.c | 130 + +++++++++++++++++++++++++++++++++++++++--------------- + tests/test_gi.py | 37 +++++++++++++++ + 2 files changed, 131 insertions(+), 36 deletions(-) + +commit 78358e1ab54d02317f397276adee03ecb2187588 +Author: John (J5) Palmieri +Date: Mon Nov 29 18:29:57 2010 -0500 + + add a profiling torture test for when we fix up invoke + + tests/test_everything.py | 67 + ++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 67 insertions(+), 0 deletions(-) + +commit 792e679c06df4357843fd310c7953a931172fc99 +Author: John (J5) Palmieri +Date: Mon Nov 29 16:41:38 2010 -0500 + + moved dynamic and base modules outside of gtk-2.0 directory + + * do not move header files yet as they are mostly used by static + bindings + * do not remove pygtk.pth and pygtk.py files yet - there is a debate + on moving + these back to pygtk but you might want to import gio static + bindings without + having to have pygtk installed + * I have not tested this with pygtk, committing it so we can find + out if it + causes any issues with legacy modules and code + + gi/Makefile.am | 2 +- + gi/overrides/Makefile.am | 2 +- + gi/repository/Makefile.am | 2 +- + glib/Makefile.am | 2 +- + gobject/Makefile.am | 2 +- + tests/test_gi.py | 2 -- + tests/test_overrides.py | 3 --- + 7 files changed, 5 insertions(+), 10 deletions(-) + +commit c587e1ace7429195ac6fd4db03d2f33e2af09838 +Author: John (J5) Palmieri +Date: Mon Nov 29 15:11:46 2010 -0500 + + add test for inout argument count + + tests/test_gi.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 5de88b4bcffdafcf8c7c20033cdf95dc690199ce +Author: John (J5) Palmieri +Date: Mon Nov 22 19:17:23 2010 -0500 + + [gi] add check for UNICHAR + + https://bugzilla.gnome.org/show_bug.cgi?id=623615 + + gi/pygi-argument.c | 27 ++++++++++++++++++++++++++- + tests/test_everything.py | 17 +++++++++++++++-- + 2 files changed, 41 insertions(+), 3 deletions(-) + +commit f129b3db2c78d3cce3614993fdd1619fb9eb9c79 +Author: Paolo Borelli +Date: Sun Nov 21 12:16:53 2010 +0100 + + Support gunichar + + https://bugzilla.gnome.org/show_bug.cgi?id=623615 + + gi/pygi-argument.c | 60 + ++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-info.c | 5 ++++ + tests/test_everything.py | 5 ++++ + 3 files changed, 70 insertions(+), 0 deletions(-) + +commit fd2c0288eb67823fca1265348a27a9f8f147ae50 +Author: Paolo Borelli +Date: Sat Nov 27 23:01:42 2010 +0100 + + pygi-convert.sh: gtk.accel_map -> Gtk.AccelMap._ + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 13d0ff1d9c129bb458e234b630ebe920b50e2e0f +Author: Paolo Borelli +Date: Sat Nov 27 22:34:13 2010 +0100 + + pygi-convert.sh: handle "from gtk import gdk" + + pygi-convert.sh | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 63a97634031c3d159ad77fdaa1f6341d7656eb07 +Author: Paolo Borelli +Date: Sat Nov 27 22:23:24 2010 +0100 + + pygi-convert.sh: add some Pango special cases + + pygi-convert.sh | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 57e42bf4230d1aa20a47e3b0df2e509602333892 +Author: Paolo Borelli +Date: Sat Nov 27 19:51:38 2010 +0100 + + Override TextIter (begins|ends|toggles)_tag() + + Make the tag argument optional. + + gi/overrides/Gtk.py | 9 +++++++++ + tests/test_overrides.py | 17 +++++++++++++++++ + 2 files changed, 26 insertions(+), 0 deletions(-) + +commit 828b698e47ee819a60d24a772a3cc51ff9cd6601 +Author: Paolo Borelli +Date: Sat Nov 27 19:32:48 2010 +0100 + + Override TextBuffer.set_text() to make length optional + + gi/overrides/Gtk.py | 3 +++ + tests/test_overrides.py | 11 ++++++++++- + 2 files changed, 13 insertions(+), 1 deletions(-) + +commit bf55dc862755a57bb1b998702d284fc460e88a30 +Author: Paolo Borelli +Date: Sat Nov 27 16:46:40 2010 +0100 + + Override TextBuffer.create_mark() + + Override create_mark to make the left_gravity argument optional + + gi/overrides/Gtk.py | 3 +++ + tests/test_overrides.py | 3 +++ + 2 files changed, 6 insertions(+), 0 deletions(-) + +commit 94c0e2f71636d055bdebe3ec378f3d339eea66c9 +Author: Paolo Borelli +Date: Sat Nov 27 16:10:33 2010 +0100 + + Fix TextBuffer.get_selection_bounds() override + + Fix the override and add unit test + + gi/overrides/Gtk.py | 8 +++++--- + tests/test_overrides.py | 7 +++++++ + 2 files changed, 12 insertions(+), 3 deletions(-) + +commit 0cd717e3926276540b9145e58a4a3368136b00de +Author: John (J5) Palmieri +Date: Mon Nov 22 18:35:09 2010 -0500 + + [gi] fix ActionGroup constructor to allow other keyword properties + to be set + + gi/overrides/Gtk.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 226777cdb70fc72d206664ffd8b6737f7239d23f +Author: John (J5) Palmieri +Date: Mon Nov 22 18:32:28 2010 -0500 + + [gi] require the name parameter when creatin a Gtk.ActionGroup + + gi/overrides/Gtk.py | 3 +++ + tests/test_overrides.py | 2 ++ + 2 files changed, 5 insertions(+), 0 deletions(-) + +commit d0049fa9982d13b3553b05569fb0a227e48b6647 +Author: Paolo Borelli +Date: Sun Nov 21 15:20:58 2010 +0100 + + Override UIManager.insert_action_group + + https://bugzilla.gnome.org/show_bug.cgi?id=635437 + + gi/overrides/Gtk.py | 3 +++ + tests/test_overrides.py | 34 +++++++++++++++++++++------------- + 2 files changed, 24 insertions(+), 13 deletions(-) + +commit e1db544e46aeed984133896af34b671a6a5547df +Author: Paolo Borelli +Date: Sun Nov 21 23:03:25 2010 +0100 + + Override TreeModel.get() to return a tuple + + https://bugzilla.gnome.org/show_bug.cgi?id=635466 + + gi/overrides/Gtk.py | 15 +++++++++++++++ + tests/test_overrides.py | 6 ++++++ + 2 files changed, 21 insertions(+), 0 deletions(-) + +commit a5e806ad8a8b279402ff7adb1c1cdc04f9f3da76 +Author: Paolo Borelli +Date: Sun Nov 21 21:57:40 2010 +0100 + + Make TreeSelection.get_selected_rows compatible with PyGtk + + https://bugzilla.gnome.org/show_bug.cgi?id=635464 + + gi/overrides/Gtk.py | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit 1c537bc67107948c92b51ba6ba749747e84263e2 +Author: John (J5) Palmieri +Date: Mon Nov 22 15:04:00 2010 -0500 + + [gi] switch to using sequences/tuples when marshalling + cairo_rectangle_int_t + + * Upstream pycairo didn't want to add a new wrapper for + cairo_rectangle_int_t + * this works around that issue by using 4 element squences instead + which + should be accepted by pycairo for any API that takes a rect + + gi/pygi-foreign-cairo.c | 85 + +++++++++++++++++++++++++++++++++++----------- + 1 files changed, 64 insertions(+), 21 deletions(-) + +commit 4cede8f12321bed6c3b71813a62c01b61853ba69 +Author: John (J5) Palmieri +Date: Fri Nov 19 16:46:53 2010 -0500 + + [gi] overrides for treeview Drag and Drop + + https://bugzilla.gnome.org/show_bug.cgi?id=627367 + + gi/overrides/Gdk.py | 7 +++++++ + gi/overrides/Gtk.py | 25 +++++++++++++++++++++++++ + 2 files changed, 32 insertions(+), 0 deletions(-) + +commit 3fd51bb903724b752f72f49c7cb35652b819791d +Author: John (J5) Palmieri +Date: Fri Nov 19 16:44:32 2010 -0500 + + [gi] when encountering guint8 arrays treat them as byte arrays + + * In Python 2 this means returning a PyString object + * In Python 3 we return a PyBytes object + + https://bugzilla.gnome.org/show_bug.cgi?id=627367 + + gi/pygi-argument.c | 65 + ++++++++++++++++++++++++++++++++++++++++++--------- + tests/test_gi.py | 6 +++- + 2 files changed, 57 insertions(+), 14 deletions(-) + +commit 7ddb0f7fd8b1b9e8f691c6d42a83cb16c6561d26 +Author: Martin Pitt +Date: Fri Nov 19 18:19:38 2010 +0100 + + pygi-convert.sh: Add pynotify -> Notify + + pygi-convert.sh | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit bf03d4db03a7739ac16ddc4e614441557ede554d +Author: Martin Pitt +Date: Fri Nov 19 09:08:07 2010 +0100 + + pygi-convert.sh: Remove sugar specifics, and allow command line + file list + + This script is generally useful for converting pygtk2 projects, + not just for + sugar. Remove the sugar specific bits, since they will just cause + errors. + + Also allow the user to specify the files to convert as command line + arguments. If not given, all *.py files will be processed. + + https://bugzilla.gnome.org/show_bug.cgi?id=635244 + + pygi-convert.sh | 25 +++++-------------------- + 1 files changed, 5 insertions(+), 20 deletions(-) + +commit 18f5d229d3a4b9520c1c456be2635c8e36015c12 +Author: Martin Pitt +Date: Fri Nov 19 09:00:35 2010 +0100 + + pygi-convert.sh: Cover Message and Buttons types + + https://bugzilla.gnome.org/show_bug.cgi?id=635244 + + pygi-convert.sh | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit ef74273c2043944708515e59a654ebe4944b46ff +Author: John (J5) Palmieri +Date: Thu Nov 18 13:54:48 2010 -0500 + + [gi] fix actiongroup test since actions are hashed + + * when actions are listed they may not show up in the order they + were entered + since they reside in an unordered hash internally + + tests/test_overrides.py | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit 2c25886bf6710568d0646f82dce4770faa44c40d +Author: John (J5) Palmieri +Date: Wed Nov 17 14:38:09 2010 -0500 + + [gi] when converting to UTF-8 accept Python Unicode objects as input + (Python 2) + + https://bugzilla.gnome.org/show_bug.cgi?id=620579 + + gi/pygi-argument.c | 14 ++++++++++++-- + glib/pyglib-python-compat.h | 5 +++++ + tests/test_gi.py | 3 +++ + 3 files changed, 20 insertions(+), 2 deletions(-) + +commit 8c2d32c8205b971b4353e3d5d2ed1efa6ef0e06c +Author: Damien Caliste +Date: Fri Nov 12 10:20:32 2010 +0100 + + Correct a bug in the freeing of memory in pygi-invoke.c. + + When a method with inout arguments is called from Python with + a wrong number of arguments, the system crashs because of an + assertion fail. This patch corrects this behaviour. + + https://bugzilla.gnome.org/show_bug.cgi?id=634671 + + gi/pygi-invoke.c | 25 ++++++++++++++----------- + 1 files changed, 14 insertions(+), 11 deletions(-) + +commit d9bab3b185bb59bd29e3c3f6225f3636f58ec45e +Author: John (J5) Palmieri +Date: Wed Nov 10 14:11:56 2010 -0500 + + update news for release + + NEWS | 73 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 73 insertions(+), 0 deletions(-) + +commit 1338a95339e21cc02b9df6d10166996c8b97a6bf +Author: Jonathan Matthew +Date: Tue Sep 28 13:44:13 2010 +1000 + + Implement richcompare for GIBaseInfo + + https://bugzilla.gnome.org/show_bug.cgi?id=625033 + + gi/pygi-info.c | 29 +++++++++++++++++++++++++++++ + 1 files changed, 29 insertions(+), 0 deletions(-) + +commit 9ce3edf69824935aeca9e676eaa9782786c22a97 +Author: John (J5) Palmieri +Date: Tue Nov 9 22:57:41 2010 -0500 + + [gi] add the rectangle_int_t forign cairo type + + * the pycairo maintainer is not being responsive so you will need + the patch at + https://bugs.freedesktop.org/show_bug.cgi?id=31111 + * added conditionals, if the api doesn't exist in PyCairo we will + compile + without the forign structs + + gi/pygi-foreign-cairo.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 68b8211d8b014cf26ca7e9ab751fb3f61f228290 +Author: John (J5) Palmieri +Date: Mon Oct 25 18:28:36 2010 -0400 + + add a foreign type for cairo_rectangle_int_t and allow it to be + caller-allocated + + * this is needed because Gdk and Gtk switched from returning a + GdkRectangle + to a CairoRectangleInt structure + * the patch in https://bugs.freedesktop.org/show_bug.cgi?id=31111 + is required + for pycairo (however there is currently no patch for python 2) + * added fix for foreign types to allow them to be caller allocated + * in order for a type to be caller allocated it must be able to take + a NULL + and create an empty struct in foreign_struct_from_arg and it must + be able + to handle GI_TRANFER_EVERYTHING in foreign_struct_to_arg. + + https://bugzilla.gnome.org/show_bug.cgi?id=627545 + + gi/pygi-foreign-cairo.c | 57 + +++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-invoke.c | 15 ++++++++++- + 2 files changed, 70 insertions(+), 2 deletions(-) + +commit ce8b948310220288e9eef904eef4ec8f4e24a376 +Author: John (J5) Palmieri +Date: Tue Nov 9 22:11:51 2010 -0500 + + [gi] add overrides to Gtk.Editable + + gi/overrides/Gtk.py | 17 +++++++++++++++++ + tests/test_overrides.py | 12 ++++++++++++ + 2 files changed, 29 insertions(+), 0 deletions(-) + +commit 87dbc716f26cefc0e9427c3d6e8befe8eabd3d1e +Author: John (J5) Palmieri +Date: Tue Nov 9 21:12:54 2010 -0500 + + [gi] handle virtual invokers + + * right now we check to see if there is an method with the same name + as the virtual method and assume that is the invoker + * some invokers are named different so we now ask the VFuncInfo if + the vfunc has an invoker + * this is still not completly correct, gi needs to support telling + us which vfuncs must be overridden. + * this keeps the old way of checking vfuncs while adding the edge case + where vfunc is named differently from their invoker + + gi/pygi-info.c | 16 ++++++++++++++++ + gi/types.py | 2 +- + 2 files changed, 17 insertions(+), 1 deletions(-) + +commit 540e9f1f349ba3625e28b7673c92210eb8974098 +Author: John (J5) Palmieri +Date: Tue Nov 9 12:17:05 2010 -0500 + + add overrides for the insert* apis of list_store and tree_store + + * add set_row to tree_model as convinience method for both list and + tree stores + + https://bugzilla.gnome.org/show_bug.cgi?id=634423 + + gi/overrides/Gtk.py | 80 + ++++++++++++++++++++++++++++++++++++---------- + tests/test_overrides.py | 53 ++++++++++++++++++++++++++++++- + 2 files changed, 114 insertions(+), 19 deletions(-) + +commit 0bcb58b9541d9ae52e1d96e6239e9dbe0698872a +Author: John (J5) Palmieri +Date: Fri Nov 5 13:56:12 2010 -0400 + + fix dialogs overrides which were relying on broken inheritance + behavior + + gi/overrides/Gtk.py | 14 ++++++++++++-- + 1 files changed, 12 insertions(+), 2 deletions(-) + +commit 89c104d17d79d7b935cd76101cba19d49390f7be +Author: John (J5) Palmieri +Date: Thu Nov 4 12:00:14 2010 -0400 + + Add a overrides registry so we can refrence overrides inside the + module + + * Overrides have a reentrancy issue when doing inheritance. If an + override + inherits from another override down the stack it won't see the + override + because the module is not finished loading and will inherit from the + non-overriden object instead. This causes type errors later. + * By adding the overrides to a registry outside of the module we + can order + registration and make the override available as soon as the class + is parsed, + not when the whole module is parsed. + + https://bugzilla.gnome.org/show_bug.cgi?id=633347 + + gi/module.py | 12 +++++++++- + gi/overrides/GIMarshallingTests.py | 2 +- + gi/overrides/Gdk.py | 2 +- + gi/overrides/Gtk.py | 2 +- + gi/overrides/__init__.py | 43 + ++++++++++++++++++++++++++++++++++++ + gi/types.py | 8 ------ + tests/test_overrides.py | 27 ++++++++++++++++++++++ + 7 files changed, 84 insertions(+), 12 deletions(-) + +commit 878b8f630acd2146bee364054acd45cd33eea37a +Merge: cdacaa9 e317838 +Author: John Stowers +Date: Fri Nov 5 11:40:22 2010 +1300 + + Merge remote branch 'dieterv/setup-fixes-for-merge' + +commit e317838178fba5f0590fb8bd323f49602d564b53 +Author: Dieter Verfaillie +Date: Thu Nov 4 11:16:43 2010 +0100 + + setup.py: ease maintenance burden for tests installation + + setup.py | 23 +++-------------------- + 1 files changed, 3 insertions(+), 20 deletions(-) + +commit cdacaa9572893796e0f3aa3730d0191911cb29ee +Author: John (J5) Palmieri +Date: Wed Nov 3 09:51:09 2010 -0400 + + fix inheritence issues in overrides + + gi/overrides/Gtk.py | 79 + ++++++++++++++++++++++++++------------------------- + 1 files changed, 40 insertions(+), 39 deletions(-) + +commit 3d5955767d81f45e796ab2af0707533375681774 +Author: Dieter Verfaillie +Date: Wed Nov 3 09:38:56 2010 +0100 + + tests: add runtests-windows.py script + + Signed-off-by: Dieter Verfaillie + + tests/runtests-windows.py | 47 + +++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 47 insertions(+), 0 deletions(-) + +commit 8cb3f2e78161639c568110aad6a807dcf59f3ae8 +Author: Dieter Verfaillie +Date: Wed Nov 3 09:35:52 2010 +0100 + + pygobject_postinstall.py: remove pygobject-2.0.pc treatment from + postinstall as pkg-config on windows figures out the correct prefix + at runtime + + Signed-off-by: Dieter Verfaillie + + pygobject_postinstall.py | 26 +++----------------------- + 1 files changed, 3 insertions(+), 23 deletions(-) + +commit 63167574df53eb481cc11b6a097b2bfe7d5747f5 +Author: Dieter Verfaillie +Date: Wed Nov 3 09:34:38 2010 +0100 + + pygobject_postinstall.py: remove shortcut creation + + Signed-off-by: Dieter Verfaillie + + pygobject_postinstall.py | 35 +---------------------------------- + 1 files changed, 1 insertions(+), 34 deletions(-) + +commit f7b12611f94fd8c27fb67a03746c10149ce6e0ef +Author: Dieter Verfaillie +Date: Wed Nov 3 09:31:14 2010 +0100 + + setup.py: formatting cleanup, makes things readable + + Signed-off-by: Dieter Verfaillie + + setup.py | 56 ++++++++++++++++++++++++++------------------------------ + 1 files changed, 26 insertions(+), 30 deletions(-) + +commit a31b4196fbb4638a245430f2fdeafd7534b1d84d +Author: Dieter Verfaillie +Date: Wed Nov 3 09:28:36 2010 +0100 + + setup.py: build and install tests + + Signed-off-by: Dieter Verfaillie + + setup.py | 61 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 61 insertions(+), 0 deletions(-) + +commit 7c3b0c20b83c05833d73c240690dce3daf43fde8 +Author: Dieter Verfaillie +Date: Wed Nov 3 09:26:59 2010 +0100 + + setup.py: install documentation when available on build system + + Signed-off-by: Dieter Verfaillie + + setup.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 78533d851ee1314686f18cfa793613a9cf7d6686 +Author: Dieter Verfaillie +Date: Wed Nov 3 09:25:56 2010 +0100 + + setup.py: install pygobject-codegen script + + Signed-off-by: Dieter Verfaillie + + setup.py | 25 +++++++++++++++++++++++++ + 1 files changed, 25 insertions(+), 0 deletions(-) + +commit ad40688df533dda0b1f7be8ea37c542b8796a26b +Author: Dieter Verfaillie +Date: Wed Nov 3 09:24:45 2010 +0100 + + setup.py: install fixxref.py script + + Signed-off-by: Dieter Verfaillie + + setup.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 21ddfc66e4e18c002a33154eb4ab81170ed71ecc +Author: Dieter Verfaillie +Date: Wed Nov 3 09:23:05 2010 +0100 + + setup.py: rearrange constants + + Signed-off-by: Dieter Verfaillie + + setup.py | 37 ++++++++++++++++++++----------------- + 1 files changed, 20 insertions(+), 17 deletions(-) + +commit 7d353d04892de67265bf693f591f37fd393de639 +Author: Dieter Verfaillie +Date: Wed Nov 3 09:18:11 2010 +0100 + + setup.py: check python version and pkgconig availability before + anything else + + Signed-off-by: Dieter Verfaillie + + setup.py | 18 ++++++++++-------- + 1 files changed, 10 insertions(+), 8 deletions(-) + +commit 286364ed39953e942e24d5911519bcac2f90975a +Author: Dieter Verfaillie +Date: Wed Nov 3 09:05:59 2010 +0100 + + setup.py: simplify sys.platform != 'win32' detection and error + reporting + + Signed-off-by: Dieter Verfaillie + + setup.py | 29 +++++++++-------------------- + 1 files changed, 9 insertions(+), 20 deletions(-) + +commit 3f70f92904c123e6cc40929c0affd3f75d061828 +Author: Dieter Verfaillie +Date: Wed Nov 3 09:02:30 2010 +0100 + + setup.py: rearrange imports + + Signed-off-by: Dieter Verfaillie + + setup.py | 31 ++++++++++++++++++++++--------- + 1 files changed, 22 insertions(+), 9 deletions(-) + +commit 9aa54b65f729c0f3b0e96ab7ff797f87dad6a455 +Author: Dieter Verfaillie +Date: Wed Nov 3 08:58:00 2010 +0100 + + README.win32: update build instructions + + Signed-off-by: Dieter Verfaillie + + README.win32 | 13 +++++-------- + 1 files changed, 5 insertions(+), 8 deletions(-) + +commit 5a33105f690ba84b2e4bb15d73d3467e92fa06e0 +Author: Dieter Verfaillie +Date: Wed Nov 3 07:59:18 2010 +0100 + + dsextras.py: formatting cleanup, makes things readable + + Signed-off-by: Dieter Verfaillie + + dsextras.py | 148 + +++++++++++++++++++++++++++++++++++++---------------------- + 1 files changed, 93 insertions(+), 55 deletions(-) + +commit d03503d0412d173acb383926ab3c2d640dad3e3f +Author: Dieter Verfaillie +Date: Wed Nov 3 07:00:40 2010 +0100 + + dsextras.py: add ggc4 to MSVC compatible struct packing comment + + Signed-off-by: Dieter Verfaillie + + dsextras.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 8c62968e9f8467e24870b8c4f61112676eef4630 +Author: Dieter Verfaillie +Date: Wed Nov 3 06:56:32 2010 +0100 + + dsextras.py: use the pkgc_ functions instead of repeating pgk-config + incantations all over the place + + Signed-off-by: Dieter Verfaillie + + dsextras.py | 15 ++++++--------- + 1 files changed, 6 insertions(+), 9 deletions(-) + +commit b98277afc24886bbda400e0ad360992bffa77b7c +Author: Dieter Verfaillie +Date: Wed Nov 3 06:49:48 2010 +0100 + + dsextras.py: add pkgc_get_version and pkgc_get_defs_dir functions + + Signed-off-by: Dieter Verfaillie + + dsextras.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit a565558652ebc3fa49d7aea40d399b06bbe376c4 +Author: Dieter Verfaillie +Date: Wed Nov 3 06:45:05 2010 +0100 + + dsextras.py: PEP8: Comparisons to singletons like None should always + be done with 'is' or 'is not', never the equality operators. + + Signed-off-by: Dieter Verfaillie + + dsextras.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 4b1ff0c7f9953f925d2178069263cca67ca7db02 +Author: Dieter Verfaillie +Date: Wed Nov 3 06:44:21 2010 +0100 + + dsextras.py: use True/False instead of 1/0 + + Signed-off-by: Dieter Verfaillie + + dsextras.py | 25 +++++++++++++------------ + 1 files changed, 13 insertions(+), 12 deletions(-) + +commit 819a21cea831c3892040390e9446b78a91d1cbbe +Author: Dieter Verfaillie +Date: Wed Nov 3 06:28:04 2010 +0100 + + dsextras.py: rearrange imports + + Signed-off-by: Dieter Verfaillie + + dsextras.py | 58 + +++++++++++++++++++++++++++++++--------------------------- + 1 files changed, 31 insertions(+), 27 deletions(-) + +commit d20edbfdde2819f8d4fee8cb3170c126fcd31d5f +Author: Dieter Verfaillie +Date: Wed Nov 3 06:16:21 2010 +0100 + + Add distutils generated build/dist directories and eclipse + configuration files to .gitignore + + Signed-off-by: Dieter Verfaillie + + .gitignore | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 268d6ed2b0b1d266c612da4453b6117d9e14437e +Author: John (J5) Palmieri +Date: Thu Oct 28 15:32:28 2010 -0400 + + [gi] add tests for calling dir on a dynamic module + + tests/test_gi.py | 24 ++++++++++++++++++++++++ + 1 files changed, 24 insertions(+), 0 deletions(-) + +commit f6386a6e0d225c83cdbe1add4c4d3ea51d3ec2f0 +Author: Deepankar Sharma +Date: Wed Oct 27 18:28:11 2010 -0400 + + [gi] dir() now works for modules + + https://bugzilla.gnome.org/show_bug.cgi?id=625093 + + gi/module.py | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 28ed01c34c503cfb4f14fe7af7912060ca70aba6 +Author: Simón Pena +Date: Mon Sep 20 23:10:14 2010 +0200 + + Don't check the inner type when comparing gpointers + + When using pyg_pointer_richcompare to compare two objects, + don't check their inner types. As we can't compare their private + fields, nor get a proper compare function, we can consider them + gpointers and compare them that way. + + https://bugzilla.gnome.org/show_bug.cgi?id=629552 + + gobject/pygpointer.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1731f89e4b5a20c33976963e12a1f39a21d33fde +Author: John (J5) Palmieri +Date: Thu Oct 28 14:21:12 2010 -0400 + + Release GIL when calling into C functions + + Author: Daniel P. Berrange + + https://bugzilla.gnome.org/show_bug.cgi?id=629042 + + gi/pygi-invoke.c | 10 +++++++++- + 1 files changed, 9 insertions(+), 1 deletions(-) + +commit 783e2e351ec7470bda6b441e51f387dd61543c4b +Author: José Aliste +Date: Fri Oct 15 14:30:10 2010 -0300 + + _gi.Repository : Implement missing info bindings. + + https://bugzilla.gnome.org/show_bug.cgi?id=632185 + + gi/pygi-info.c | 91 + +++++++++++++++++++++++++++++++++++++++++++++++-------- + gi/pygi-info.h | 7 ++++ + 2 files changed, 84 insertions(+), 14 deletions(-) + +commit 2ca897273f52ae38f5e06e72c773a048e199eee5 +Author: John (J5) Palmieri +Date: Thu Oct 28 13:49:15 2010 -0400 + + include Python.h so that PY_VERSION_HEX gets defined + + gi/pygi-foreign-cairo.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 8b28b1d713df33931e255600ab98feda37a8e02a +Author: John (J5) Palmieri +Date: Thu Oct 28 13:47:34 2010 -0400 + + [gi] make overrides work for python 3.x protocols and alias for + python 2.x + + gi/overrides/Gtk.py | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit 3c09710d2f68af9c16ce39fd25656147656a486a +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:24:24 2010 +0200 + + Override Gtk.Widget.translate_coordinates to not return success value + + gi/overrides/Gtk.py | 11 +++++++++++ + 1 files changed, 11 insertions(+), 0 deletions(-) + +commit 9d4443b3de8c327d8645ddde0a7a6dc5b977d7b4 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:22:36 2010 +0200 + + Override Gtk.TreeViewColumn.cell_get_position to not return success + value + + gi/overrides/Gtk.py | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 6679d39ace06294e98f9d6fc911ed6fb27656010 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:21:36 2010 +0200 + + Override get_path_at_pos and get_dest_row_at_pos of Gtk.TreeView to + not return success value + + gi/overrides/Gtk.py | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 80b1b266fa68a5c67106871502017166628f71e4 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:20:38 2010 +0200 + + Override Gtk.TreeSortable.get_sort_column_id to not return success + value + + gi/overrides/Gtk.py | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit 17cd0fb3a2d2ca0c6109c41727ba0b8c42217cd5 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:19:20 2010 +0200 + + Override forward_search and backward_search of Gtk.TextIter to not + return success value + + gi/overrides/Gtk.py | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 95c86fa31da3d2fe84db0e2b5bc2a6dc896c9223 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:18:09 2010 +0200 + + Override Gtk.TextBuffer.get_selection_bounds to not return success + value + + gi/overrides/Gtk.py | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit da6d87460b9392c29d025a7eed9249fb604204bc +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:17:04 2010 +0200 + + Override Gtk.RecentInfo.get_application_info to not return success + value + + gi/overrides/Gtk.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit 0ed2e8772bdc405b0d0c7e0b2803e0e141abcb6a +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:16:21 2010 +0200 + + Override Gtk.IMContext.get_surrounding to not return success value + + gi/overrides/Gtk.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit b85b445f15421209c0b4adf676d7c8218d6437c5 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:15:24 2010 +0200 + + Override get_item_at_pos, get_visible_range, get_dest_item_at_pos + of Gtk.IconView to not return success value + + gi/overrides/Gtk.py | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +commit 684d716192d58c972083e579e909bcd97f8a5025 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:13:47 2010 +0200 + + Override Gtk.Container.get_focus_chain to not return success value + + gi/overrides/Gtk.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit 8ec830c57fafbfe50d9619c6caba3cb95a00d688 +Author: Sebastian Pölsterl +Date: Sat Oct 23 14:12:44 2010 +0200 + + Override Gtk.ComboBox.get_active_iter to not return success value + + gi/overrides/Gtk.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit b483852904468722230903989e3451c7c6a24c0f +Author: John (J5) Palmieri +Date: Tue Oct 12 12:18:33 2010 -0400 + + [gi] make parameter check less strict when dealing with GValue params + + * Some GValue API can store a pointer to a python object for later + use but our parameter checking was too strict to allow this + * Add pyg_type_from_object_strict API which takes a strict boolean and + returns PY_TYPE_OBJECT if no other GType can be found + * Since we don't have enough info to genrically check GValue + parameters + use the less strict type guessing when encountering a GValue param + * Other API stays the same and continues to do strict testing + + https://bugzilla.gnome.org/show_bug.cgi?id=622987 + + gi/pygi-argument.c | 17 +++++--------- + gobject/gobjectmodule.c | 4 +- + gobject/pygobject-private.h | 1 + + gobject/pygobject.h | 2 + + gobject/pygtype.c | 37 ++++++++++++++++++++++++++++--- + tests/test_gi.py | 1 - + tests/test_overrides.py | 50 + +++++++++++++++++++++++++++++++++++++++--- + 7 files changed, 90 insertions(+), 22 deletions(-) + +commit 8c87d622dcc6d76a981edfc5818fe67bb2e114e2 +Author: John Stowers +Date: Fri Oct 22 13:28:31 2010 +1300 + + Shortcut removal is not needed on post-uninstall + + pygobject_postinstall.py | 14 ++------------ + 1 files changed, 2 insertions(+), 12 deletions(-) + +commit a3ed97fe6f80548801739fe6b72771b9eb6d93f7 +Author: John Stowers +Date: Thu Oct 21 13:25:35 2010 +1300 + + Disable shortcut creation in windows installer + + pygobject_postinstall.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a3d6212b0abccef58f05d454c091936776413d98 +Author: John (J5) Palmieri +Date: Thu Oct 7 11:43:27 2010 -0400 + + overrides for all subclasses of dialog + + https://bugzilla.gnome.org/show_bug.cgi?id=631634 + + gi/overrides/Gtk.py | 94 + ++++++++++++++++++++++++++++++++++++++++++++--- + tests/test_overrides.py | 64 +++++++++++++++++++++++++++++++- + 2 files changed, 151 insertions(+), 7 deletions(-) + +commit a87e3ba64b54e6df0b5b96af47c34e3be790b58f +Author: Sebastian Pölsterl +Date: Thu Oct 7 19:37:53 2010 +0200 + + Make TreeModel behave like in GTK-2.x + + Moved stuff from __getitem__ to get_iter. + Added TreePath.__cmp__ + + get_iter_from_string throws ValueError. + iterchildren() does not return None. + + Adjusted tests to new TreeModel and added TestGtk.test_tree_model + method + + Added support for negative row and column indices + + Use rich comparison methods instead of __cmp__ + + Added TreeModel.__bool__/__nonzero__ + + Raise Error if tree path string is empty + + https://bugzilla.gnome.org/show_bug.cgi?id=631547 + + gi/overrides/Gtk.py | 195 + +++++++++++++++++++++++++++++++++++++++++++++++ + tests/test_overrides.py | 160 +++++++++++++++++++++++++++++++++++++-- + 2 files changed, 349 insertions(+), 6 deletions(-) + +commit acfcc29af727fb67d0dfbbcc7cc14963ef21f1ea +Author: John Stowers +Date: Sat Oct 16 18:59:25 2010 +1300 + + Correctly build GIO on windows + + setup.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 33b59fd7437009b6c3ed43412e171d2cc91ee317 +Author: John Stowers +Date: Sat Oct 16 18:17:28 2010 +1300 + + Require Python >= 2.6.0 for Windows build + + setup.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 544e0e4de4f5f97b0584eaf72ae8a081eca28ab6 +Author: John Stowers +Date: Sat Oct 16 17:41:01 2010 +1300 + + Fix depreciation warning in dsextras.py + + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 239ff961778e4e1587404d8a70dfbe8630ab0623 +Author: John Stowers +Date: Sat Oct 16 17:34:50 2010 +1300 + + Fix build on windows + + gi/pygi-foreign.c | 5 ++++- + gi/pygi.h | 5 ++++- + setup.py | 4 ++-- + 3 files changed, 10 insertions(+), 4 deletions(-) + +commit 9a2f81d63012fef23fdde2b4d903bd69601c07c6 +Author: Michael Culbertson +Date: Sat Oct 16 17:08:11 2010 +1300 + + Support for GCC4 in Windows distutils build - bug 626548 + + dsextras.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 27367c8dc3a3a31fdd778505b319cd3f4afb9e27 +Author: John Stowers +Date: Fri Oct 15 09:39:02 2010 +1300 + + Remove obsolete comments in dsextras.py + + dsextras.py | 11 ++--------- + 1 files changed, 2 insertions(+), 9 deletions(-) + +commit b5f383f854fb8f72677828b029589320c59006d1 +Author: John Stowers +Date: Fri Oct 15 09:21:03 2010 +1300 + + Broken dsextras.py pkg-config check error message + + * Fixes bug 631962 + + dsextras.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e1981da105b574e273ae6500fc6d25caf6af6aae +Author: John (J5) Palmieri +Date: Tue Sep 28 15:31:03 2010 -0400 + + add compat functions for the deprecated PyCObject api + + * Moved to using the PyCapsule API for python >= 3 + * PyCObject is removed from Python 3.2 + * It has also been deprecated in 2.7 but since we use the API in + header files + which are consumed by static binding modules, appling this for + python 2.7 + causes crashes unless the modules are recompiled, breaking ABI. + It is safe + to rely on for 2.7 because it will never be removed and there is + talk of + undeprecating it upstream. + * There is no issues with static bindings under python 3 because + they are not + supported yet and most likely never will be. + * Even if PyCObject is brought back in 3.2, PyCapsule is a much + safer API + which adds a poorman's type check when unboxing. + + https://bugzilla.gnome.org/show_bug.cgi?id=630844 + + gi/gimodule.c | 2 +- + gi/pygi.h | 5 ++++- + glib/glibmodule.c | 2 +- + glib/pyglib-python-compat.h | 28 ++++++++++++++++++++++++++++ + glib/pyglib.c | 6 +++--- + glib/pygoptioncontext.c | 2 +- + gobject/gobjectmodule.c | 2 +- + gobject/pygobject.h | 6 ++++++ + gobject/pygtype.c | 10 +++++----- + 9 files changed, 50 insertions(+), 13 deletions(-) + +commit 03d2e2924e27a9d6cae89e5748f70e0a51be91c6 +Author: Damien Caliste +Date: Tue Sep 28 12:44:42 2010 +0200 + + Add __path__ attributes. + + Add an attribute __path__ to DynamicModule and IntrospectionModule, + using the path of the typelib. + + https://bugzilla.gnome.org/show_bug.cgi?id=630807 + + gi/module.py | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 28f9366c9cb382801bad080864f667c867daa3c7 +Author: Sebastian Pölsterl +Date: Sat Oct 9 17:40:40 2010 +0200 + + Override Gtk.TreeSelection.get_selected to not return success value. + + https://bugzilla.gnome.org/show_bug.cgi?id=631765 + + gi/overrides/Gtk.py | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +commit f01a7d9e8222663ce52100e061033f2745a5e7af +Author: Vincent Untz +Date: Thu Oct 7 09:42:24 2010 +0200 + + Make row optional in Gtk.TreeStore/ListStore.append override + + https://bugzilla.gnome.org/show_bug.cgi?id=631548 + + gi/overrides/Gtk.py | 36 ++++++++++++++++++++++-------------- + 1 files changed, 22 insertions(+), 14 deletions(-) + +commit 1e1357f5fa1a034b0b707040d664ac46be6e23f7 +Author: John (J5) Palmieri +Date: Mon Oct 4 12:50:55 2010 -0400 + + Revert "add compat functions for the deprecated PyCObject api" + + This reverts commit f25e763d53e5cdd4de08e90b04aea4b4c4720ac0. + + I ment to commit another patch and ended up comitting both + + gi/gimodule.c | 2 +- + gi/pygi.h | 5 +---- + glib/glibmodule.c | 2 +- + glib/pyglib-python-compat.h | 19 ------------------- + glib/pyglib.c | 6 +++--- + glib/pygoptioncontext.c | 2 +- + gobject/gobjectmodule.c | 2 +- + gobject/pygobject.h | 6 ------ + gobject/pygtype.c | 10 +++++----- + 9 files changed, 13 insertions(+), 41 deletions(-) + +commit 97774cb149c5b03d5ef82a5af3f19e2ce4d79d0b +Author: John (J5) Palmieri +Date: Mon Oct 4 12:43:31 2010 -0400 + + return NULL instead of -1 which fixes crash when introspection is + turned off + + * see https://bugzilla.gnome.org/show_bug.cgi?id=631158 + + gi/pygi.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit f25e763d53e5cdd4de08e90b04aea4b4c4720ac0 +Author: John (J5) Palmieri +Date: Tue Sep 28 15:31:03 2010 -0400 + + add compat functions for the deprecated PyCObject api + + * Moved to using the PyCapsule API for python >= 2.7 + + https://bugzilla.gnome.org/show_bug.cgi?id=630844 + + gi/gimodule.c | 2 +- + gi/pygi.h | 5 ++++- + glib/glibmodule.c | 2 +- + glib/pyglib-python-compat.h | 19 +++++++++++++++++++ + glib/pyglib.c | 6 +++--- + glib/pygoptioncontext.c | 2 +- + gobject/gobjectmodule.c | 2 +- + gobject/pygobject.h | 6 ++++++ + gobject/pygtype.c | 10 +++++----- + 9 files changed, 41 insertions(+), 13 deletions(-) + +commit 80b8ccd450fe4e3ea77b27e58bb63cabc2a2bb2b +Author: John (J5) Palmieri +Date: Tue Sep 28 15:28:16 2010 -0400 + + fix commit 7fe83108 which didn't use the compat functions for + string handling + + glib/glibmodule.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9562842907a9d94f6adae2c1bb20d6b1f189abda +Author: John (J5) Palmieri +Date: Tue Sep 28 13:15:57 2010 -0400 + + Python 3 fixes for dsextras and the python.m4 distribution files + + dsextras.py | 13 +++++++------ + m4/python.m4 | 4 ++-- + 2 files changed, 9 insertions(+), 8 deletions(-) + +commit 98f69957ee9e3037b0a05a037098e4d2133ca256 +Author: John (J5) Palmieri +Date: Mon Sep 27 14:01:31 2010 -0400 + + post release bump to 2.27.0 unstable + + * update hacking to fill in some holes in the release instructions + + HACKING | 6 ++++-- + configure.ac | 2 +- + 2 files changed, 5 insertions(+), 3 deletions(-) + +commit fd38010101411e6bc1ca9314657f418de660fa13 +Author: John (J5) Palmieri +Date: Mon Sep 27 12:03:10 2010 -0400 + + update NEWS for release + + NEWS | 93 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 93 insertions(+), 0 deletions(-) + +commit 7072d56b6cba13da97a052c75d1ae0c2cc417fd1 +Author: Tomeu Vizoso +Date: Sun Sep 26 08:37:31 2010 +0200 + + Pre-release version bump 2.26.0 + + configure.ac | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit a549f429d2ced7a78d5baa5e2f28f6750b4788f2 +Author: John Stowers +Date: Fri Sep 24 22:44:03 2010 +1200 + + Wrap g_get_system_{config,data}_dirs () + + * Also tidy up g_get_{cache,config,data}_dir + to share common code + + glib/glibmodule.c | 68 + +++++++++++++++++++++++++++++++++++++++-------------- + 1 files changed, 50 insertions(+), 18 deletions(-) + +commit 328aca600714bdca89dfdb531c222ee561ede27e +Author: John (J5) Palmieri +Date: Fri Sep 24 12:16:22 2010 -0400 + + fixed make check and make dist + + tests/Makefile.am | 31 ++++++++++++++++++------------- + 1 files changed, 18 insertions(+), 13 deletions(-) + +commit 27023fd56148dd17b5576c1e81e0fe851d9b8727 +Author: John Stowers +Date: Fri Sep 24 21:20:53 2010 +1200 + + Disable GI tests when introspection disabled + + tests/Makefile.am | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 7fe831081cdd2e26f5d948326b9f89ea0694e752 +Author: Tomeu Vizoso +Date: Sat Jul 18 19:35:08 2009 +0200 + + Wrap g_uri_list_extract_uris. Fixes bug #584431 + + glib/glibmodule.c | 38 ++++++++++++++++++++++++++++++++++++++ + gobject/__init__.py | 2 +- + tests/Makefile.am | 3 ++- + tests/test_uris.py | 15 +++++++++++++++ + 4 files changed, 56 insertions(+), 2 deletions(-) + +commit d6721a59c294f2471142b8c32de2f647b7084bca +Author: Paul Bolle +Date: Thu Sep 23 15:38:40 2010 -0400 + + Fix a few uses of TRUE and FALSE in the docs + + docs/reference/pygio-mount.xml | 5 +++-- + docs/reference/pyglib-functions.xml | 18 +++++++++--------- + docs/reference/pyglib-maincontext.xml | 12 ++++++------ + docs/reference/pyglib-mainloop.xml | 6 +++--- + docs/reference/pygobject-functions.xml | 6 +++--- + docs/reference/pygobject.xml | 4 ++-- + 6 files changed, 26 insertions(+), 25 deletions(-) + +commit a08c9fffb4262ae678e17f90bbfb2d5f880cfad0 +Author: Damien Caliste +Date: Tue Sep 21 17:52:14 2010 +0200 + + pygi: always free the invocation_state struct + + In pygi-invoke.c, the invocation_state struct is never freed + in case of success. Thus, always call _free_invocation_state() + before leaving. + Modify _free_invocation_state to avoid double free in case of + caller-allocated GValue, once as a released argument in the + _process routine and another time in the _free as the special + case. So move all argument releasing code from the _process + routine to the _free one. + Modify the tests for the callback routines to return an integer + value as specified in the GIR file. + + Make check is as successful as before (already existing error + related to GVariant is still there). + + https://bugzilla.gnome.org/show_bug.cgi?id=630271 + + gi/pygi-invoke.c | 83 + ++++++++++++++++++++------------------------- + tests/test_everything.py | 4 ++- + 2 files changed, 40 insertions(+), 47 deletions(-) + +commit 9714d765a34e246899f11b6792eea3aecce0b7ec +Author: Tomeu Vizoso +Date: Mon Sep 13 16:36:47 2010 +0200 + + Start implementing something equivalent to g_variant_new + + https://bugzilla.gnome.org/show_bug.cgi?id=629367 + + gi/gimodule.c | 20 +++++++ + gi/overrides/GLib.py | 131 + +++++++++++++++++++++++++++++++++++++++++-- + gi/pygi-foreign-gvariant.c | 2 +- + tests/test_everything.py | 16 ----- + tests/test_overrides.py | 25 ++++++++ + 5 files changed, 170 insertions(+), 24 deletions(-) + +commit fc45abdd9b55ab63556798ab0f04715be79dba08 +Author: John (J5) Palmieri +Date: Thu Sep 23 10:49:36 2010 -0400 + + fixed typo - missing comma in glib.option module + + * https://bugzilla.gnome.org/show_bug.cgi?id=627449 + + glib/option.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 4ed100f3183c6325dd04461484e877bb7d4131b1 +Author: John (J5) Palmieri +Date: Fri Sep 17 12:08:09 2010 -0400 + + add checks so we can compile under python 3 by setting PYTHON=python3 + + * compile for python 3 + * disables gio if compiling under python 3.x + * runs only pertinant tests + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + configure.ac | 32 +++++++++++++++++++++++++++++--- + tests/Makefile.am | 35 ++++++++++++++++++++--------------- + tests/runtests.py | 4 ++++ + 3 files changed, 53 insertions(+), 18 deletions(-) + +commit 269ff8564eeb597dc06c27e293354b7ff7a71a82 +Author: Tomeu Vizoso +Date: Fri Sep 17 15:50:47 2010 +0200 + + Rename static methods as functions + + In recent gobject-introspection releases, static methods have been + removed and placed as functions in the namespace level. In a future + releases it's planned to become static methods again but for now + let's fix the tests. + + tests/test_gi.py | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +commit 2da8da589644d6125101210712defb1272a8abb1 +Author: John (J5) Palmieri +Date: Thu Sep 9 13:52:14 2010 -0400 + + fix a couple of compiler warnings + + https://bugzilla.gnome.org/show_bug.cgi?id=629199 + + gi/pygi-argument.c | 4 ++-- + gi/pygi-struct.c | 2 +- + gobject/gobjectmodule.c | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +commit 6769a4704f0876ac3baacd4da03ff16d9f0906be +Author: John (J5) Palmieri +Date: Thu Sep 9 13:55:17 2010 -0400 + + remove unused code + + * we use richcompare now + + https://bugzilla.gnome.org/show_bug.cgi?id=629198 + + gobject/pygtype.c | 9 --------- + 1 files changed, 0 insertions(+), 9 deletions(-) + +commit 98f54f9d33996baeaa8c8c1240310f5396d03a1d +Author: John (J5) Palmieri +Date: Tue Sep 14 14:10:49 2010 -0400 + + Check the type of the instance object + + * in python 2 methods were added to classes as unbound methods and + they would + check the instance type to make sure it was correct + * in python 3 for perfomance reasons methods are added to classes + as simple + functions which treat the instance as an untyped argument so + no checks + are made. + * this patch adds a type check so that the correct errors are + thrown in + python 3 (python 2 this just adds another layer of redundancy should + something change with type checking in the future) + * since GI handles regular args and the instance arg slightly + differently + we had to split out the interface checks in + _pygi_g_type_info_check_object + in order to not duplicate code + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/pygi-argument.c | 182 + +++++++++++++++++++++++++++------------------------ + gi/pygi-argument.h | 2 + + gi/pygi-invoke.c | 14 ++++ + 3 files changed, 112 insertions(+), 86 deletions(-) + +commit 5d79498d38b147b66ae72c1481e397160491e8d6 +Author: John (J5) Palmieri +Date: Wed Sep 15 10:26:20 2010 -0400 + + include the correct pycairo version + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/pygi-foreign-cairo.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +commit b855562e5c0019cd7e4982fe00c467ede9e3926d +Author: John (J5) Palmieri +Date: Thu Sep 9 22:16:58 2010 -0400 + + Use PyMapping_Keys to determine if an object is a dict (py3k fix) + + * in Py3k PyMapping_Check returns true for sequences such as strings + and lists. Since we need to get the keys anyway, and it returns + NULL if this is not a dict, this is a much better test, even in + Py2 + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/pygi-argument.c | 10 +++------- + 1 files changed, 3 insertions(+), 7 deletions(-) + +commit 0e72e28c6c5502c7db5103cf1299c9f0e6689fdd +Author: John (J5) Palmieri +Date: Thu Sep 9 18:44:11 2010 -0400 + + fix handling of UINT64 and INT64 arguments in py3k + + * decode to the right sized C long + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/pygi-argument.c | 20 ++++++++++++-------- + 1 files changed, 12 insertions(+), 8 deletions(-) + +commit d5666d99a1c0396b7da0cb14f9f4ff8892da7e2e +Author: John (J5) Palmieri +Date: Thu Sep 9 17:35:10 2010 -0400 + + properly handle ulongs properties in py3k + + * If this is a PyLong object pull use AsUnsignedLong + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gobject/pygtype.c | 31 +++++++++++++++++-------------- + 1 files changed, 17 insertions(+), 14 deletions(-) + +commit 3d431c7dd0de97db10cb0c00c39d9c1837bed2f2 +Author: Tomeu Vizoso +Date: Fri Sep 17 12:14:56 2010 +0200 + + Specify encoding of tests/test_gi.py + + tests/test_gi.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit a808bdabb9fa6f4a9b9ce42e1cce05fb37403f0f +Author: John (J5) Palmieri +Date: Thu Sep 9 13:24:30 2010 -0400 + + use actual unicode in the tests on py3k, not the byte representation + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + tests/test_gi.py | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +commit 928f4485041d80d0c36ff2daeae4bcd09bd0bde4 +Author: John (J5) Palmieri +Date: Thu Sep 9 12:45:21 2010 -0400 + + s/METH_KEYWORDS/METH_VARARGS|METH_KEYWORDS/ when defining object + methods + + * in Py3k the METH_KEYWORDS flag by itself is invalid. A method + must be defined + with both the METH_VARARGS and METH_KEYWORDS flags. + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + glib/pygiochannel.c | 30 +++++++++++++++--------------- + glib/pygsource.c | 4 ++-- + gobject/pygobject.c | 2 +- + 3 files changed, 18 insertions(+), 18 deletions(-) + +commit b5ee20afa4399c7689fbec8939fa20b927eeb782 +Author: John (J5) Palmieri +Date: Thu Sep 9 08:04:40 2010 -0400 + + fix subclassing PyLong by calling __new__ correctly + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + glib/pygspawn.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit a499b2f0d622b671bd154544f66b73f1278e66ed +Author: John (J5) Palmieri +Date: Thu Sep 9 07:56:44 2010 -0400 + + minor py3k fixups for python modules + + * add _basestring and _bytes and _callable wrappers + * use items instead of iteritems and range instead of xrange + + fix py3k modules + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/overrides/Gtk.py | 24 ++++++++++++++++-------- + glib/option.py | 16 ++++++++++++---- + 2 files changed, 28 insertions(+), 12 deletions(-) + +commit dec9001d26c97949e7b3578086cb35e98075c047 +Author: John (J5) Palmieri +Date: Thu Sep 9 07:36:04 2010 -0400 + + minor fixes in tests for py3k compat + + * add a _bytes wrapper for API that expects bytes in py3k but str + in py2 + * fix some more exception handling using sys.exc_info()[:2] + * use range instead of xrange, items instead of iteritems since py3k + dropped support for the different ways of accessing iterators + - this is less efficient in py2 but we plan to target py3k as the + primary platform + * use list(dict.items()) since py3k only returns iterables which + are not + indexable + * missed some _long wrapping + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + tests/compathelper.py | 18 ++++++++++++++++++ + tests/test_everything.py | 5 +++-- + tests/test_mainloop.py | 3 ++- + tests/test_option.py | 6 ++++-- + tests/test_overrides.py | 4 ++-- + tests/test_properties.py | 6 +++--- + 6 files changed, 32 insertions(+), 10 deletions(-) + +commit 09a0daeedf49eaf376c1288be5743b57fbc76d51 +Author: Colin Walters +Date: Thu Sep 9 16:25:51 2010 -0400 + + compilation: Fix syntax error + + gi/pygi-info.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 9f7afd6d5afd8c1a5f36bf1295814757b71c8cbc +Author: Tomeu Vizoso +Date: Thu Sep 9 22:17:00 2010 +0200 + + Add missing file + + gi/overrides/GLib.py | 48 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 48 insertions(+), 0 deletions(-) + +commit 306b792ac97a458ddee59fb86d66453495117f3e +Author: Tomeu Vizoso +Date: Thu Jul 22 13:48:51 2010 +0100 + + Add override for GLib.Variant.new_tuple + + * gi/gimodule.c: Add _wrap_pyg_variant_new_tuple + * gi/overrides/GLib.py: Override Variant.new_tuple and + Variant.get_string + * gi/pygi-type.[hc]: split _pygi_type_import_by_name out from + _pygi_type_import_by_gi_info + * gi/types.py: Never override gobject.TYPE_NONE + * tests/test_everything.py: Add tests for GVariant tuples + + https://bugzilla.gnome.org/show_bug.cgi?id=625050 + + gi/gimodule.c | 38 ++++++++++++++++++++++++++++++++++++++ + gi/overrides/Makefile.am | 1 + + gi/pygi-type.c | 15 +++++++++------ + gi/pygi-type.h | 2 ++ + gi/types.py | 1 + + tests/test_everything.py | 9 +++++++++ + 6 files changed, 60 insertions(+), 6 deletions(-) + +commit 22e53aa2ed9cf6173a877b0af6928d5ab8da2f4f +Author: John (J5) Palmieri +Date: Wed Sep 8 13:08:48 2010 -0400 + + fix for changes in the gi test libraries + + tests/test_everything.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 246877074617b0e9c3b2ba2a5395a73e0ed9cd5d +Author: John (J5) Palmieri +Date: Wed Sep 8 13:08:07 2010 -0400 + + Gtk.DialogFlags.NO_SEPARATOR has been removed in Gtk 3.0 + + gi/overrides/Gtk.py | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +commit f92fc48e7e2ec50996e994ccb7d08a61e7374f22 +Author: John (J5) Palmieri +Date: Wed Sep 8 12:35:09 2010 -0400 + + no need to offset arg positions when is_method is true + + * The old GI libraries required we offset arg positions for the + missing + self argument. The new library fixes this so we don't have + to offset + anymore. + + https://bugzilla.gnome.org/show_bug.cgi?id=629087 + + gi/pygi-callbacks.c | 5 +---- + 1 files changed, 1 insertions(+), 4 deletions(-) + +commit 8c517de2d278bdef641c72b8f2919a3924290ec1 +Author: Tomeu Vizoso +Date: Fri Aug 20 14:54:35 2010 +0200 + + gi: Add support for more property types + + https://bugzilla.gnome.org/show_bug.cgi?id=627494 + + gi/pygi-property.c | 156 + +++++++++++++++++++++++++++++++++++----------- + tests/test_everything.py | 34 ++++++++++ + 2 files changed, 154 insertions(+), 36 deletions(-) + +commit 6d183d1fff55d54569ba3e1f90a10284df74fd40 +Author: John (J5) Palmieri +Date: Fri Sep 3 12:04:16 2010 -0400 + + use PyObject_SetAttrString, not PyDict_SetItemString when setting + __gtype__ + + * When registering a gtype wrapper we used to set tp_dict + directly. This works + in python 2 but python 3 seems to handle attributes in a slightly + different + way where the tp_dict and attr get out of sync. By setting the attr + directly we avoid this issue. + * Note that there are many more places where we set __gtype__ + using tp_dict + however for objects which are not instantiated yet we have to + set tp_dict + directly. + * Since this one change fixes a lot of failed tests, for now we + ignore the + other places where we set __gtype__. If we run into more issues + dealing + with __gtype__ we can take a closer look later. + + https://bugzilla.gnome.org/show_bug.cgi?id=627878 + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gobject/gobjectmodule.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b7bf4269682a3335f5e0a52b46fa721af134d09a +Author: Tomeu Vizoso +Date: Wed Sep 1 11:03:40 2010 +0200 + + Rename GArgument to GIArgument + + gi/pygi-argument.c | 52 + ++++++++++++++++++++++---------------------- + gi/pygi-argument.h | 10 ++++---- + gi/pygi-closure.c | 34 ++++++++++++++-------------- + gi/pygi-foreign-cairo.c | 8 +++--- + gi/pygi-foreign-gvariant.c | 4 +- + gi/pygi-foreign-gvariant.h | 4 +- + gi/pygi-foreign.c | 12 +++++----- + gi/pygi-foreign.h | 8 +++--- + gi/pygi-info.c | 8 +++--- + gi/pygi-invoke.c | 28 +++++++++++----------- + gi/pygi-property.c | 4 +- + gi/pygi.h | 16 ++++++------ + 12 files changed, 94 insertions(+), 94 deletions(-) + +commit 7197f85c9be2b03636639ac909ca2c3170653509 +Author: John (J5) Palmieri +Date: Wed Aug 18 10:29:19 2010 -0400 + + fix up tests so they run in py3k + + * add a compat helper that should only be used by tests + * fix long notation to use the compat helper instead + * add parens to print statements + * use compatable try/except pattern + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gobject/propertyhelper.py | 16 +++++++++++----- + tests/compathelper.py | 32 ++++++++++++++++++++++++++++++++ + tests/test_option.py | 7 ++++++- + tests/test_properties.py | 24 ++++++++++++++---------- + tests/test_signal.py | 14 +++++++------- + tests/test_source.py | 4 ++-- + 6 files changed, 72 insertions(+), 25 deletions(-) + +commit 720e614acdbcf734d4bcccc403e639b5a5bcae24 +Author: Colin Walters +Date: Fri Aug 20 10:58:48 2010 -0400 + + tests: Port to new introspection tests + + Everything is renamed "Regress", and both it and GIMarshallingTests + are now in source form, so we compile them. + + The scanner now adds "static methods" to objects, structs, and unions, + so update the test code to use those. + + In the tests, remove broken (inout) cases - the person writing these + tests misunderstood the semantics of (inout). It's not acceptable for + a C API to mutate e.g. a GSList* passed in, or unref an object. + + The invocation code needed to be updated for this - remove some + broken hacks. + + https://bugzilla.gnome.org/show_bug.cgi?id=627878 + + configure.ac | 5 +- + gi/pygi-argument.c | 9 +-- + gi/pygi-invoke.c | 147 + +++++---------------------------------------- + tests/Makefile.am | 42 ++++++++++++- + tests/test_everything.py | 6 +- + tests/test_gi.py | 151 + +++++++++------------------------------------- + 6 files changed, 93 insertions(+), 267 deletions(-) + +commit f6c4d9e58c8f05cb2d82e158c9eb8480308565bd +Author: John (J5) Palmieri +Date: Fri Aug 20 10:43:58 2010 -0400 + + we need to specify tp_hash since we overide tp_richcompare + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gobject/pygenum.c | 1 + + gobject/pygflags.c | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + +commit c03e6b482548aee99362356807c804f8834fad2b +Author: John Ehresman +Date: Thu Apr 15 17:11:30 2010 -0400 + + working enum/flags/pid subclasses of long + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + glib/pygspawn.c | 7 +++-- + gobject/pygenum.c | 61 ++++++++++++++++++++++++------------------ + gobject/pygflags.c | 76 + ++++++++++++++++++++++------------------------------ + 3 files changed, 71 insertions(+), 73 deletions(-) + +commit 0db676fd2296750a46ba0fb069e472da06ecc53a +Author: John (J5) Palmieri +Date: Wed Aug 18 11:03:32 2010 -0400 + + make vfuncs work in py3k + + * methods now export __func__ instead of im_func for getting the + function + out of a method closure + * however classes no longer return unbound methods in py3k and instead + return the actual function + * in python 2 we use im_func when getting the function from the + vfunc closure + * in py3k we simply assign vfunc to the function + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/types.py | 12 ++++++++---- + 1 files changed, 8 insertions(+), 4 deletions(-) + +commit 286dcd0c6455961d818ac7f05f80f82435abc1dc +Author: John (J5) Palmieri +Date: Tue Aug 17 15:43:42 2010 -0400 + + make cairo module compile in py3k + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/Makefile.am | 2 +- + gi/pygi-foreign-cairo.c | 17 +++++++---------- + 2 files changed, 8 insertions(+), 11 deletions(-) + +commit bda58ec34fc443fe1108afc8532bec50f6fd0b44 +Author: John (J5) Palmieri +Date: Tue Aug 17 02:33:45 2010 -0400 + + fix exceptions so they work in python 3.x + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/module.py | 2 +- + gi/types.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 427a3c8053feca35ccd746575760ac8a0ed50a12 +Author: John (J5) Palmieri +Date: Tue Aug 17 02:24:44 2010 -0400 + + make the gi module compile under 3.x + + * include the compat macros + * use GLIB_MODULE_START/END to define module + * add PyInit__gi to the exported symbols + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/Makefile.am | 2 +- + gi/gimodule.c | 24 +++++++++--------------- + 2 files changed, 10 insertions(+), 16 deletions(-) + +commit 1dee5dcd2b1747b4a4af438c0443d7930e4802db +Author: John (J5) Palmieri +Date: Tue Aug 17 02:14:14 2010 -0400 + + fix up testshelper module so it compiles in python 3.x + + * include the compat header + * fix up PyInts to be PYGLIB_Long + * Use PYGLIB_DEFINE_TYPE macros to define module objects + * Use PYGLIB_MODULE_START/END to define modules + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + tests/Makefile.am | 2 +- + tests/testhelpermodule.c | 221 + ++++++---------------------------------------- + 2 files changed, 28 insertions(+), 195 deletions(-) + +commit 1ff83a2ccb7301c8f675913f1c4f6118ea50b9c7 +Author: John (J5) Palmieri +Date: Mon Aug 16 21:14:27 2010 -0400 + + convert to using PYGLIB_DEFINE_TYPE for module objects + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/pygi-boxed.c | 43 ++----------- + gi/pygi-info.c | 171 + ++++++++++++++++++++------------------------------ + gi/pygi-repository.c | 39 ++--------- + gi/pygi-struct.c | 45 ++----------- + 4 files changed, 88 insertions(+), 210 deletions(-) + +commit 1efa2b12913b194d433c17014bc1077271a6ca32 +Author: John (J5) Palmieri +Date: Mon Aug 16 13:51:05 2010 -0400 + + some more p3k PyString and PyInt eradication in GI + + * add the glib dir to the includes list in the build + * make sure we include the compat macros + * add GLIB_PyBytes_FromString to compat macros + * add GLIB_PyNumber_Long to compat macros + * use RichCompare instead of Compare + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/Makefile.am | 2 +- + gi/pygi-argument.c | 96 + ++++++++++++++++++++++++++----------------- + gi/pygi-boxed.c | 1 + + gi/pygi-info.c | 13 ++++-- + gi/pygi-private.h | 23 ++++++++++ + gi/pygi-repository.c | 8 ++- + gi/pygi-struct.c | 1 + + glib/pyglib-python-compat.h | 6 +++ + 8 files changed, 103 insertions(+), 47 deletions(-) + +commit 6b902c66200c1684513a9ef31bdef3f2ff64e4fa +Author: Tomeu Vizoso +Date: Fri Aug 20 09:28:57 2010 +0200 + + pyglib: Fix typo (Leo Singer) + + https://bugzilla.gnome.org/show_bug.cgi?id=627408 + + glib/option.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 3cefffecc1317b6ad77a5ed936bfb990d16bf9d3 +Author: Gustavo Noronha Silva +Date: Thu Aug 19 18:45:05 2010 -0300 + + Add defines for size_t and ssize_t conversion functions + + These missing defines cause the resulting module to have unresolved + symbols, rendering it unusable. + + https://bugzilla.gnome.org/show_bug.cgi?id=627440 + + glib/pyglib-python-compat.h | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit d45c7031876f355e15409f00f3e50e77d18f8f4b +Author: Colin Walters +Date: Thu Aug 19 17:50:35 2010 -0400 + + pyglib: Fix a compiler warning + + glib/pyglib.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 0fe6828ddce187ac1897a1f02ca1c5480796d5b9 +Author: Tomeu Vizoso +Date: Wed Aug 18 20:36:51 2010 +0200 + + Don't force gtk 2.0 + + pygi-convert.sh | 11 +++++++---- + 1 files changed, 7 insertions(+), 4 deletions(-) + +commit ac59c18a4f2bfff47c862b763aaf1d1cf136a4f5 +Author: Steve Frécinaux +Date: Tue Aug 17 14:49:30 2010 +0200 + + Fix some ref leaks in hook_up_vfunc_implementation() + + https://bugzilla.gnome.org/show_bug.cgi?id=627143 + + gi/gimodule.c | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit 18ee0db673c2fa42244ab85950bbf4840edb674b +Author: John (J5) Palmieri +Date: Thu Aug 12 12:16:31 2010 -0400 + + handle strings correctly in gio + + gio/gappinfo.override | 5 +++++ + gio/pygio-utils.c | 42 +++++++++++++++++++++++++++++++++++------- + 2 files changed, 40 insertions(+), 7 deletions(-) + +commit 45ab0c03110c911b47519941dfd753326891b5e0 +Author: John (J5) Palmieri +Date: Wed Aug 11 16:13:59 2010 -0400 + + make giomodule compile under py3k + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gio/giomodule.c | 153 + ++++++++++++++++++++++++++++--------------------------- + 1 files changed, 78 insertions(+), 75 deletions(-) + +commit c52f8ed3ae8cb66a03b5695e980770c3f467f755 +Author: John (J5) Palmieri +Date: Wed Aug 11 16:04:48 2010 -0400 + + for py3k we need to do some more processing to get bytes from a + unicode string + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + gi/pygi-argument.c | 31 +++++++++++++++++++++++++++---- + 1 files changed, 27 insertions(+), 4 deletions(-) + +commit de9eae4dfcce856a42cc5c569a5b9683c28d0eeb +Author: John (J5) Palmieri +Date: Wed Aug 11 15:03:55 2010 -0400 + + use Bytes instead of Unicode when reading io + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + glib/pygiochannel.c | 30 ++++++++++++++++++++++++------ + 1 files changed, 24 insertions(+), 6 deletions(-) + +commit 5824ff98175b749dbcfa72d24b994230b6e05377 +Author: John (J5) Palmieri +Date: Mon Aug 9 15:16:51 2010 -0400 + + prefix compat macros with PYGLIB + + * refactor from John Ehresman py3k branch + * fix up some extranious PyString calls + * remove duplicate macros from pyglib.h that are in + pyglib-python-compat.h + * pygobject.h can't import pyglib-python-compat.h so add codepaths + for both Py3k and legacy code instead of using macros + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + glib/glibmodule.c | 48 +++++----- + glib/pygiochannel.c | 46 +++++----- + glib/pyglib-python-compat.h | 153 +++++++++++++++++++++++------- + glib/pyglib.c | 22 ++-- + glib/pyglib.h | 14 --- + glib/pygoptioncontext.c | 4 +- + glib/pygsource.c | 16 ++-- + glib/pygspawn.c | 32 +++--- + gobject/gobjectmodule.c | 216 + +++++++++++++++++++++--------------------- + gobject/pygboxed.c | 2 +- + gobject/pygenum.c | 84 +++++++++--------- + gobject/pygflags.c | 122 ++++++++++++------------ + gobject/pygobject-private.h | 12 +- + gobject/pygobject.c | 46 +++++----- + gobject/pygobject.h | 23 +++++ + gobject/pygparamspec.c | 24 +++--- + gobject/pygpointer.c | 2 +- + gobject/pygtype.c | 170 +++++++++++++++++----------------- + 18 files changed, 563 insertions(+), 473 deletions(-) + +commit 231e934cc01d061e81bb60d35127a133cd0e1793 +Author: John (J5) Palmieri +Date: Mon Aug 16 10:14:04 2010 +0200 + + Gtk.Button unit tests + + https://bugzilla.gnome.org/show_bug.cgi?id=622606 + + tests/test_overrides.py | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +commit f07cfde377e42686c6b80f56cac62338ee333e61 +Author: Johan Dahlin +Date: Mon Aug 16 10:08:38 2010 +0200 + + [Gtk] Add overrides for Button + + https://bugzilla.gnome.org/show_bug.cgi?id=622606 + + gi/overrides/Gtk.py | 13 +++++++++++++ + 1 files changed, 13 insertions(+), 0 deletions(-) + +commit 65a06a7216163c7e65b32c5b5f3388faa7fda5d6 +Author: Simon van der Linden +Date: Thu Aug 12 16:18:58 2010 +0200 + + Make Cairo an optional dependency + + Add the --enable-cairo configure argument. + + https://bugzilla.gnome.org/show_bug.cgi?id=616732 + + configure.ac | 15 ++++++++++++--- + gi/Makefile.am | 20 ++++++++++++-------- + 2 files changed, 24 insertions(+), 11 deletions(-) + +commit b83507263231d9bf47f6c8450583e3d03f0a3b5b +Author: Tomeu Vizoso +Date: Mon Aug 16 09:55:35 2010 +0200 + + Don't import again PyGObject (John Ralls) + + https://bugzilla.gnome.org/show_bug.cgi?id=626996 + + gi/pygi.h | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 0dc3656070f496431829c6e8441ca17129c569f8 +Author: John (J5) Palmieri +Date: Mon Aug 9 16:11:55 2010 -0400 + + move to using richcompare slot instead of compare + + https://bugzilla.gnome.org/show_bug.cgi?id=615872 + + glib/pygiochannel.c | 18 +++++++--- + glib/pyglib.c | 85 + +++++++++++++++++++++++++++++++++++++++++++++++ + glib/pyglib.h | 3 ++ + glib/pygmaincontext.c | 17 ++++++--- + glib/pygmainloop.c | 17 ++++++--- + glib/pygoptioncontext.c | 18 ++++++---- + glib/pygoptiongroup.c | 22 +++++++----- + gobject/pygboxed.c | 18 +++++++--- + gobject/pygobject.c | 44 +++++++++++++++++------- + gobject/pygparamspec.c | 19 +++++++--- + gobject/pygpointer.c | 17 ++++++--- + gobject/pygtype.c | 26 +++++++++++--- + 12 files changed, 233 insertions(+), 71 deletions(-) + +commit b426e531dc53d4b50e572a2da19733479635e662 +Author: Simon van der Linden +Date: Thu Aug 12 18:09:33 2010 +0200 + + Replace autogen.sh by a newer version + + It pulls automake 1.10 or 1.11. + Greatly inspired from GLib's. + + https://bugzilla.gnome.org/show_bug.cgi?id=625661 + + autogen.sh | 506 + +++++++----------------------------------------------------- + 1 files changed, 58 insertions(+), 448 deletions(-) + +commit 769645e00d6d055a4cd802454dbfc1bbfcbee691 +Author: Simon van der Linden +Date: Thu Aug 12 14:11:55 2010 +0200 + + Fix some warnings + + pyglib.c: In function ‘pyglib_gerror_exception_check’: + pyglib.c:362: warning: format not a string literal and no format + arguments + pyglib.c:371: warning: format not a string literal and no format + arguments + + gio.override: In function 'pygio_notify_allocate_buffer': + gio.override:144:13: warning: format '%d' expects type 'int', but + argument 3 + has type 'gsize' + + https://bugzilla.gnome.org/show_bug.cgi?id=625437 + + gio/gio.override | 2 +- + glib/pyglib.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit e4c4cccb588b258dbcd21702e6cddcfe9ebe4ffc +Author: Simon van der Linden +Date: Thu Aug 12 11:09:37 2010 +0200 + + Fix caller-allocates emergency free. + + In the state, args, args[i], arg_infos[i], and arg_type_infos[i] + must not be + NULL in order to be able caller-allocates. This patch adds those + conditions. + + Moreover, the interface info needs to be freed afterwards. + + https://bugzilla.gnome.org/show_bug.cgi?id=626684 + + gi/pygi-invoke.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +commit 0ab967ca40ddcffc2834d4e656bb2010c6b9bdda +Author: Simon van der Linden +Date: Thu Aug 12 10:46:17 2010 +0200 + + Remove useless checks. + + No need to check for state->arg_infos, state->arg_type_infos, and + state->args_is_auxiliary to be NULL, they are always allocated. + + https://bugzilla.gnome.org/show_bug.cgi?id=626684 + + gi/pygi-invoke.c | 14 +++----------- + 1 files changed, 3 insertions(+), 11 deletions(-) + +commit e17be9cd288fee5d7cb174d9d577eb9279044c67 +Author: Tomeu Vizoso +Date: Tue Aug 10 17:40:16 2010 +0200 + + Call valgrind with G_SLICE=always-malloc G_DEBUG=gc-friendly + + tests/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 8be59c37dd57acc51875c7189ca09d728b729013 +Author: Ignacio Casal Quinteiro +Date: Wed Aug 4 13:43:17 2010 +0200 + + Fix some warnings. + + gi/pygi-argument.c | 2 -- + gi/pygi-invoke.c | 2 +- + gi/pygi-struct.c | 1 - + 3 files changed, 1 insertions(+), 4 deletions(-) + +commit 529eca6054e9a7e2267f1529e317c2373932762f +Author: Simon van der Linden +Date: Fri Jul 30 22:39:40 2010 +0200 + + Add myself as a maintainer + + MAINTAINERS | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit caac75a6ed6f671b37e38a78e71b87906a00ac1b +Author: Tomeu Vizoso +Date: Fri Jul 30 14:14:16 2010 +0200 + + Properly allocate boxed structs that are (caller-allocates) + + * gi/pygi-boxed.[hc]: Refactor out the allocation of boxed structs + * gi/pygi-invoke.c: Don't use g_malloc0 for boxed structs that + are (caller-allocates) + * tests/test_overrides.py: Split the TreeView tests + + https://bugzilla.gnome.org/show_bug.cgi?id=625653 + + gi/pygi-boxed.c | 50 + +++++++++++++++++++++++++++++++---------------- + gi/pygi-boxed.h | 10 +++++--- + gi/pygi-invoke.c | 16 +++++--------- + tests/test_overrides.py | 39 +++++++++++++++++------------------ + 4 files changed, 64 insertions(+), 51 deletions(-) + +commit 99c7322898c00a576c7319ea0a7c808446253133 +Author: Toms Baugis +Date: Fri Jul 30 15:44:21 2010 +0200 + + override gdk.Event to return attribute from the proper event object + + https://bugzilla.gnome.org/show_bug.cgi?id=620593 + + gi/overrides/Gdk.py | 48 + +++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-invoke.c | 4 --- + tests/test_overrides.py | 10 +++++++++ + 3 files changed, 58 insertions(+), 4 deletions(-) + +commit 55814e722c2ae11310f346790c9221e4fad92b50 +Author: John (J5) Palmieri +Date: Fri Jul 30 06:30:48 2010 -0400 + + check if z# needs an int or Py_ssize_t + + https://bugzilla.gnome.org/show_bug.cgi?id=625438 + + gio/gio.override | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 477315465d0a6d84b51e146e86e254873bc564ff +Author: John (J5) Palmieri +Date: Fri Jul 30 06:43:06 2010 -0400 + + make sure we parse parameters to python object vars not glib vars + + * py_flags was already set up but due to a typo &flags was being + passed + instead + + https://bugzilla.gnome.org/show_bug.cgi?id=625438 + + gio/gfile.override | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit faa7d4eece7ddb698725098970c2478a3b45c4d5 +Author: Paul Bolle +Date: Fri Jul 30 10:56:01 2010 +0200 + + Make an example and a demo work out of the box + + cairo-demo.py and gtk-demo.py need the two (kind of) magic lines + regarding pygtk to work out of the box. So add those. + + Signed-off-by: Paul Bolle + + https://bugzilla.gnome.org/show_bug.cgi?id=625638 + + demos/gtk-demo/gtk-demo.py | 2 ++ + examples/cairo-demo.py | 2 ++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +commit c9da5782e6c633d9af43ee85075e9ee65db09780 +Author: John (J5) Palmieri +Date: Fri Jul 9 13:14:42 2010 -0400 + + make sure caller allocated structs are freed when they go out of scope + + * Move struct transfer checks from pygi-arguments to pygi-invoke + * add better warning if an unknown struct is fully transfered + * only free GValues we create in the invoke cleanup. All other + structs + get cleaned up when they go out of scope in python + * Fixes issues with caller allocated treeiters getting freed to early + * this is a fix to crashes in the current test suite when API's + returning + TreeIters were annotated as out caller-allocates so no new tests + are needed + + https://bugzilla.gnome.org/show_bug.cgi?id=623969 + + gi/pygi-argument.c | 13 +++++-------- + gi/pygi-invoke.c | 46 ++++++++++++++++++++++++++++++++++++++++------ + 2 files changed, 45 insertions(+), 14 deletions(-) + +commit e0a85305cd107aae5902e524afd074cd8c329927 +Author: Tomeu Vizoso +Date: Fri Jul 30 10:35:33 2010 +0200 + + Revert "override gdk.Event to return attribute from the proper + event object." + + Pushed by mistake, we still need testcases + + This reverts commit e7bb3954880568884ca66e7751ede689dc2f24f6. + + gi/overrides/Gdk.py | 44 -------------------------------------------- + 1 files changed, 0 insertions(+), 44 deletions(-) + +commit 61ffb8d6d08fcfe638f71ea97ceac3a366e5536d +Author: Paul Bolle +Date: Thu Jul 29 22:55:28 2010 +0200 + + PyGI: properly quit cairo-demo + + Signed-off-by: Paul Bolle + + https://bugzilla.gnome.org/show_bug.cgi?id=625619 + + examples/cairo-demo.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e7bb3954880568884ca66e7751ede689dc2f24f6 +Author: Toms Baugis +Date: Tue Jul 27 21:37:16 2010 +0200 + + override gdk.Event to return attribute from the proper event object. + + https://bugzilla.gnome.org/show_bug.cgi?id=620593 + + gi/overrides/Gdk.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 44 insertions(+), 0 deletions(-) + +commit 0a9f1da052fd33dcef81d0e267fc7972f02c7888 +Author: Simon van der Linden +Date: Wed Jul 28 14:56:00 2010 +0200 + + Clean and improve the test infrastructure + + To run select tests, use for instance: + % make check TEST_NAMES='test_everything test_gi.TestConstant' + + It works with check.gdb and check.valgrind too. + + https://bugzilla.gnome.org/show_bug.cgi?id=625488 + + Makefile.am | 5 --- + tests/Makefile.am | 65 + ++++++++++++++++++++----------------------- + tests/common.py | 47 ------------------------------- + tests/runtests.py | 43 +++++++++++------------------ + tests/test_gcancellable.py | 4 +- + tests/test_gi.py | 3 -- + tests/test_gicon.py | 3 +- + tests/test_gio.py | 3 +- + tests/test_gobject.py | 3 +- + tests/test_gresolver.py | 4 +- + tests/test_gsocket.py | 4 ++- + tests/test_interface.py | 6 +++- + tests/test_mainloop.py | 11 +++----- + tests/test_signal.py | 4 ++- + tests/test_source.py | 4 +- + tests/test_subprocess.py | 5 +--- + tests/test_thread.py | 5 +++- + tests/test_unknown.py | 5 +++- + 18 files changed, 82 insertions(+), 142 deletions(-) + +commit 82f4cb5ebf5d992493b7a2f74cfd5f175e19eb76 +Author: Tomeu Vizoso +Date: Thu Jul 29 12:34:19 2010 +0200 + + Add some more transformations to pygi-convert.sh + + pygi-convert.sh | 37 +++++++++++++++++++++++++++++-------- + 1 files changed, 29 insertions(+), 8 deletions(-) + +commit de519adcd21947a0aef7932cdecb78cef200c85e +Author: Tomeu Vizoso +Date: Wed Jul 28 14:42:36 2010 +0200 + + Adapt to API changes: g_irepository_enumerate_versions + + gi/importer.py | 2 +- + gi/pygi-repository.c | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit 01cd9abb43f93f9a57a5a05b6dc9560614e666e3 +Author: Tomeu Vizoso +Date: Wed Jul 28 12:26:48 2010 +0200 + + Add GValue<->GArgument marshalling for some more types + + gi/pygi-property.c | 37 ++++++++++++++++++++++++++++++++++++- + 1 files changed, 36 insertions(+), 1 deletions(-) + +commit ddffa70c3ee0e837070f390632bc692430f79171 +Author: Tomeu Vizoso +Date: Wed Jul 28 11:10:42 2010 +0200 + + Chain up with the non-introspection implementation for properties + if needed + + gobject/pygobject.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit 045433a1f8167205dc8eae613dcb8835d02c8916 +Author: Tomeu Vizoso +Date: Wed Jul 28 10:59:49 2010 +0200 + + Improve error reporting for missing attributes in introspection + modules + + gi/module.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 6655a79b2f13fe417aefdf6aebab0f2d6162ba00 +Author: Tomeu Vizoso +Date: Tue Jul 27 21:52:49 2010 +0200 + + Implement getting and setting properties using introspection + information. + + This allows us to use information not present in GObject such as + transfer and element types. + + https://bugzilla.gnome.org/show_bug.cgi?id=620808 + + gi/Makefile.am | 2 + + gi/gimodule.c | 2 + + gi/pygi-argument.c | 2 + + gi/pygi-private.h | 1 + + gi/pygi-property.c | 226 + ++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-property.h | 39 ++++++++ + gi/pygi.h | 41 +++++++++ + gobject/pygobject.c | 9 ++ + tests/test_everything.py | 19 ++++ + 9 files changed, 341 insertions(+), 0 deletions(-) + +commit 85f4572b3ffbfa364ebb2e470eab759edc557b36 +Author: Tomeu Vizoso +Date: Tue Jul 27 21:32:41 2010 +0200 + + Readd Gdk.Rectangle override for Gtk-2.0 + + gi/overrides/Gdk.py | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +commit 2082ee35e2a33f52bf1e8ec49cb4a43398e91989 +Author: Tomeu Vizoso +Date: Tue Jul 27 18:25:27 2010 +0200 + + Allow specifying a version when loading a typelib + + * gi/importer.py: Defer loading the typelib until first usage. + * gi/module.py: Load the typelib in IntrospectionModule(). + * gi/overrides/*.py: Adapt to API change. + * gi/pygi-repository.c: Add wrappers for g_irepository_enumerate and + g_irepository_get_version. + + gi/importer.py | 26 +++++---------- + gi/module.py | 58 + +++++++++++++++++++++++------------ + gi/overrides/GIMarshallingTests.py | 2 +- + gi/overrides/Gdk.py | 2 +- + gi/overrides/Gtk.py | 2 +- + gi/pygi-repository.c | 56 + ++++++++++++++++++++++++++++++++++- + 6 files changed, 105 insertions(+), 41 deletions(-) + +commit 6d7ed6c322234c240b1063a1dfaadd17157432a9 +Author: Jonathan Matthew +Date: Tue Jul 13 20:27:28 2010 +1000 + + treat GFreeFunc as equivalent to GDestroyNotify when scanning + callbacks + + https://bugzilla.gnome.org/show_bug.cgi?id=624232 + + gi/pygi-callbacks.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 7e9cbd5601ad548b78d106bac1a1576d33b91c65 +Author: Simon van der Linden +Date: Mon Jul 26 17:00:23 2010 +0200 + + Don't use == to compare doubles, use <= and =>. + + This avoids inequality due to small precisions difference. + + https://bugzilla.gnome.org/show_bug.cgi?id=625326 + + tests/testhelpermodule.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5ca2a41f16f4a5fcc3ab4d00bec46b077c7eb384 +Author: Tomeu Vizoso +Date: Thu Jul 8 11:36:12 2010 +0200 + + Allow passing ints as enum args + + https://bugzilla.gnome.org/show_bug.cgi?id=622584 + + gi/pygi-argument.c | 23 +++++++++++++++++++++-- + tests/test_gi.py | 6 ++++-- + 2 files changed, 25 insertions(+), 4 deletions(-) + +commit 890c3233f8a9f884b045a294bf0122bb3afcd54a +Author: Tomeu Vizoso +Date: Sun Jul 25 17:30:40 2010 +0100 + + Make error message less ambiguous + + https://bugzilla.gnome.org/show_bug.cgi?id=625095 + + gi/pygi-callbacks.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 1162e436273ff8e9e4e24bd8ba74615fd4624753 +Author: John (J5) Palmieri +Date: Thu Jun 24 10:07:12 2010 -0400 + + fix passing in type names as a GType and add gtype unit tests + + * a simple call to pyg_type_from_object covers all the bases + * added unit tests to check for correct GType value passing + * fixed up tree override tests to also check different ways of + passing GTypes + + https://bugzilla.gnome.org/show_bug.cgi?id=622605 + + gi/pygi-argument.c | 8 +------- + tests/test_everything.py | 27 +++++++++++++++++++++++++++ + tests/test_overrides.py | 6 ++---- + 3 files changed, 30 insertions(+), 11 deletions(-) + +commit 8becd32fc042445d62b885bac12dac326b2dc1fa +Author: Tomeu Vizoso +Date: Mon Jul 26 11:54:47 2010 +0200 + + Increase a bit verbosity of tests so people know which test failed + + tests/runtests.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 3b3c63514f311592e6769a373d37a2bde7ea6b38 +Author: Tomeu Vizoso +Date: Thu Jul 15 15:17:53 2010 +0200 + + Actually add the files for GVariant foreign structs + + gi/pygi-foreign-gvariant.c | 63 + ++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-foreign-gvariant.h | 41 ++++++++++++++++++++++++++++ + 2 files changed, 104 insertions(+), 0 deletions(-) + +commit e65275bc57f345c111eb12a6b4476ff1ddc3bc24 +Author: Tomeu Vizoso +Date: Thu Jul 15 13:31:33 2010 +0200 + + Add foreign struct support for GVariant + + * gi/pygi-invoke.c: Wrap foreign structs returned by constructors + * gi/pygi-foreign.c: Register foreign support for GVariant + * gi/pygi-struct.c: properly release foreign structs + * gi/pygi-argument.c, gi/pygi-foreign-cairo.c, gi/pygi.h: Adapt to + API changes + * tests/test_everything.py: Add basic tests for GVariant + + https://bugzilla.gnome.org/show_bug.cgi?id=619501 + + gi/Makefile.am | 2 + + gi/pygi-argument.c | 2 +- + gi/pygi-foreign-cairo.c | 16 +++--- + gi/pygi-foreign.c | 107 + ++++++++++++++++++++++++++++----------------- + gi/pygi-foreign.h | 7 +-- + gi/pygi-invoke.c | 18 ++++---- + gi/pygi-struct.c | 10 ++++- + gi/pygi.h | 9 ++-- + tests/test_everything.py | 8 +++ + 9 files changed, 110 insertions(+), 69 deletions(-) + +commit 3b3bd4da3fbc993fa7f7cfb46ed4e67671c94cc0 +Author: Tomeu Vizoso +Date: Mon Jul 12 11:19:06 2010 +0200 + + Add HACKING to MANIFEST.in + + MANIFEST.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 40bf08ff001b119c7daf709197005ef6480216c5 +Author: Tomeu Vizoso +Date: Mon Jul 12 11:18:04 2010 +0200 + + Add HACKING file with instructions for releasing + + HACKING | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +commit 3b9dffe7cc3820dfb84fd968fc604899601c5dc4 +Author: Tomeu Vizoso +Date: Mon Jul 12 11:09:58 2010 +0200 + + Post release version bump to 2.21.6 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 42a5a0897b38156ae010c396ea254abf502f35de +Author: Tomeu Vizoso +Date: Mon Jul 12 11:00:29 2010 +0200 + + Update NEWS and release PyGObject-2.21.5 + + NEWS | 17 +++++++++++++++++ + 1 files changed, 17 insertions(+), 0 deletions(-) + +commit 5857f25c1c6e25b79e6134558bd7151bc6c30ef7 +Author: Tomeu Vizoso +Date: Mon Jul 12 11:00:20 2010 +0200 + + Pre-release version bump to 2.21.5 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e500adc3ac19ef6f436809e5a8828ac7e8db28f6 +Author: Florian Müllner +Date: Sat Jul 10 22:35:13 2010 +0200 + + Shut up some compiler warnings + + Remove unused variables, make sure variables are properly initialized. + + https://bugzilla.gnome.org/show_bug.cgi?id=624066 + + gi/pygi-callbacks.c | 1 - + gi/pygi-closure.c | 2 +- + gi/pygi-invoke.c | 1 - + 3 files changed, 1 insertions(+), 3 deletions(-) + +commit 2efa18afbcc2fac1c90958535b2f80e6e730ee56 +Author: =?UTF-8?q?Florian=20M=C3=BCllner?= +Date: Mon Jul 12 10:31:42 2010 +0200 + + Adjust to API break in GObject-Introspection + + As of commit 5cb925b20, many type_tags for standard C types have + been removed - namely machine-dependent integer types and derived + types (size_t, time_t). + + Most removals are just synonyms of other types, so their removal + should not have too much impact, with the exception of time_t, + which was translated to a native datetime object before. + + Also remove time_t tests (Tomeu Vizoso). + + https://bugzilla.gnome.org/show_bug.cgi?id=624065 + + configure.ac | 2 +- + gi/importer.py | 7 ++- + gi/pygi-argument.c | 146 + ---------------------------------------------------- + gi/pygi-closure.c | 10 ---- + gi/pygi-info.c | 37 ------------- + tests/test_gi.py | 21 -------- + 6 files changed, 5 insertions(+), 218 deletions(-) + +commit 27a417c71f8c122e46c7472663bb25c17413f103 +Author: John (J5) Palmieri +Date: Thu Jul 8 16:01:25 2010 -0400 + + pass in the demo app so demos can use utility methods like requesting + file paths + + demos/gtk-demo/demos/Entry/entry_buffer.py | 2 +- + demos/gtk-demo/demos/Entry/entry_completion.py | 2 +- + demos/gtk-demo/demos/appwindow.py | 13 +++++++++++-- + demos/gtk-demo/demos/assistant.py | 2 +- + demos/gtk-demo/demos/builder.py | 14 ++++++++++---- + demos/gtk-demo/demos/button_box.py | 2 +- + demos/gtk-demo/demos/clipboard.py | 8 +------- + demos/gtk-demo/demos/colorselector.py | 2 +- + demos/gtk-demo/demos/combobox.py | 8 +++++--- + demos/gtk-demo/demos/drawingarea.py | 2 +- + demos/gtk-demo/demos/test.py | 2 +- + demos/gtk-demo/gtk-demo.py | 6 +++--- + 12 files changed, 37 insertions(+), 26 deletions(-) + +commit e7daae919c2c6ae35d3927f0006252aacd49ea86 +Author: John (J5) Palmieri +Date: Thu Jul 8 15:38:07 2010 -0400 + + demo fixes to keep up with Gtk+ + + * treeiter changes to reflect caller-allocate annotations + * fix some flag handling + * use get_indicies_with_depth instead of get_indices for paths + + demos/gtk-demo/demos/appwindow.py | 10 +++++++--- + demos/gtk-demo/demos/combobox.py | 24 ++++++++++++------------ + demos/gtk-demo/gtk-demo.py | 13 +++++-------- + 3 files changed, 24 insertions(+), 23 deletions(-) + +commit 3d9fd6391710cc33058394d6821e4d4e11f09b22 +Author: John (J5) Palmieri +Date: Thu Jul 8 12:54:43 2010 -0400 + + override test fixes for new GTK+ annotations + + tests/test_overrides.py | 23 +++++++++++++---------- + 1 files changed, 13 insertions(+), 10 deletions(-) + +commit 7a400f8139b70ddfe7c949035e0851689951c647 +Author: Ignacio Casal Quinteiro +Date: Thu Jul 8 12:42:25 2010 +0200 + + Fix warning. + + gi/pygi-argument.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 39fd0a85a3de06b1b877d1125f91036409886373 +Author: John (J5) Palmieri +Date: Wed Jul 7 15:48:36 2010 -0400 + + fix up treeiter usage due to caller-allocates annotations in gtk+ + + * we still don't pass tests because the caller-allocates code path + does not + handle the case where the parameter is followed by a regular + in parameter + + gi/overrides/Gtk.py | 7 +++---- + tests/test_overrides.py | 21 +++++++++++---------- + 2 files changed, 14 insertions(+), 14 deletions(-) + +commit 4d970b75dc5c75c1bec04cb2954c9985b476070c +Author: John (J5) Palmieri +Date: Tue Jul 6 17:50:10 2010 -0400 + + add entry completion demo + + demos/gtk-demo/demos/Entry/entry_completion.py | 87 + ++++++++++++++++++++++++ + 1 files changed, 87 insertions(+), 0 deletions(-) + +commit f3531eaa1bfa4e01651d35cd587384d30a398ba8 +Author: John (J5) Palmieri +Date: Tue Jul 6 17:49:18 2010 -0400 + + string changes + + demos/gtk-demo/demos/Entry/entry_buffer.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit baf1e9bb550c7bf45e2ac0b70ba29c434ef1ccc6 +Author: John (J5) Palmieri +Date: Tue Jul 6 17:27:04 2010 -0400 + + add the Entry demo directory and the entry_buffer demo + + demos/gtk-demo/demos/Entry/entry_buffer.py | 73 + ++++++++++++++++++++++++++++ + 1 files changed, 73 insertions(+), 0 deletions(-) + +commit f2b1d222120f055bec9339cca55c9cc90f538c00 +Author: John (J5) Palmieri +Date: Tue Jul 6 17:26:03 2010 -0400 + + fix loading of demo modules to support sub modules + + demos/gtk-demo/gtk-demo.py | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +commit 4f9390fb1892b13ab2ea00ed66c5000a40f09029 +Author: John (J5) Palmieri +Date: Tue Jul 6 15:56:34 2010 -0400 + + add the ability to have demos in sub catagories + + demos/gtk-demo/gtk-demo.py | 76 + +++++++++++++++++++++++++++++++------------- + 1 files changed, 54 insertions(+), 22 deletions(-) + +commit dc2249a3ecf339008351316217191d0551ccc588 +Author: Jose Aliste +Date: Mon Jul 5 14:36:59 2010 -0400 + + Add __name__ to DynamicModule class. + + Fixes bug #623486. + + gi/module.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 2357bca8d14539894b6bd0acfdc18d30b4bb4db6 +Author: Ignacio Casal Quinteiro +Date: Mon Jul 5 16:11:07 2010 +0200 + + Do not override GdkRectangle. + + This class was lately removed from gtk+ 3, so there is no need + to override + it anymore. + + gi/overrides/Gdk.py | 19 ------------------- + 1 files changed, 0 insertions(+), 19 deletions(-) + +commit daca09dc2c2306d4fa82a68bbdd147d4b170a1e7 +Author: Philip Withnall +Date: Tue Jun 29 16:37:36 2010 +0100 + + Add override for TreeModel implementing __len__() + + Closes: bgo#622882 + + gi/overrides/Gtk.py | 11 +++++++++-- + tests/test_overrides.py | 5 +++++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +commit bb8adb7f02f0c5494df2cb6e535e44d23902e8f5 +Author: Tomeu Vizoso +Date: Tue Jun 29 11:27:13 2010 +0200 + + Update NEWS and release PyGObject-2.21.4 + + NEWS | 27 +++++++++++++++++++++++++-- + 1 files changed, 25 insertions(+), 2 deletions(-) + +commit 2d473ee17be4671244bb4a2a0953a21ccf2a0df6 +Author: Tomeu Vizoso +Date: Tue Jun 29 10:55:03 2010 +0200 + + Remove files from the makefiles + + gi/Makefile.am | 4 +--- + gobject/Makefile.am | 3 +-- + 2 files changed, 2 insertions(+), 5 deletions(-) + +commit 89827314fd183eac07443c8e9d275ca9d4ce59df +Author: Tomeu Vizoso +Date: Tue Jun 29 10:27:39 2010 +0200 + + Build the cairo shim as a python module so the _gi module stops + linking to it + + https://bugzilla.gnome.org/show_bug.cgi?id=623021 + + configure.ac | 2 + + gi/Makefile.am | 38 +++++++++----- + gi/gimodule.c | 8 +--- + gi/pygi-argument.c | 10 +--- + gi/pygi-foreign-cairo.c | 56 ++++++++++++++++----- + gi/pygi-foreign-cairo.h | 55 --------------------- + gi/pygi-foreign.c | 125 + ++++++++++++++++++++++++++++------------------- + gi/pygi-foreign.h | 31 +++++------ + gi/pygi.h | 40 +++++++++++++-- + 9 files changed, 196 insertions(+), 169 deletions(-) + +commit a6a90551311bc64f037cbd442e13f70c30060871 +Author: Tomeu Vizoso +Date: Mon Jun 28 14:20:43 2010 +0200 + + Remove pygi-external.h + + https://bugzilla.gnome.org/show_bug.cgi?id=623021 + + gi/gimodule.c | 8 +++--- + gi/pygi-type.c | 4 +- + gi/pygi-type.h | 2 +- + gi/pygi.h | 54 +++++++++++++++---------------------- + gobject/Makefile.am | 6 ++++ + gobject/pygboxed.c | 2 +- + gobject/pygenum.c | 2 +- + gobject/pygflags.c | 2 +- + gobject/pygi-external.h | 67 + ----------------------------------------------- + gobject/pygobject.c | 2 +- + gobject/pygpointer.c | 2 +- + 11 files changed, 40 insertions(+), 111 deletions(-) + +commit 8b3a3baacb45cb3f9112f7597607602fa89c6634 +Author: Tomeu Vizoso +Date: Fri Jun 25 13:54:57 2010 +0200 + + Revert "correctly handle floating objects in gtk" + + This reverts commit 60fdf4b8f738dd0f5c190bc18ddf010032d3c5ca. + + Conflicts: + + gi/gimodule.c + tests/test_everything.py + + gi/gimodule.c | 13 ------------- + tests/test_everything.py | 3 ++- + 2 files changed, 2 insertions(+), 14 deletions(-) + +commit 0f2a09d7eae63abb71723b7cd8fb290dcba33426 +Author: Tomeu Vizoso +Date: Fri Jun 25 13:49:04 2010 +0200 + + Make valgrind happy again + + * gi/pygi-argument.c, gi/pygi-info.c: Zero two GArgument instances. + * gi/pygi-invoke.c: workaround bgo#622711 and zero invocation_state. + + gi/pygi-argument.c | 1 + + gi/pygi-info.c | 2 ++ + gi/pygi-invoke.c | 8 ++++++-- + 3 files changed, 9 insertions(+), 2 deletions(-) + +commit 63afe55906c8637e913783e65b82b540b81bed65 +Author: John (J5) Palmieri +Date: Thu Jun 24 16:13:37 2010 -0400 + + add drawing area demo + + demos/gtk-demo/demos/drawingarea.py | 249 + +++++++++++++++++++++++++++++++++++ + 1 files changed, 249 insertions(+), 0 deletions(-) + +commit 8bba5f842393a284367cdd15f3d32a8c7745516a +Author: John (J5) Palmieri +Date: Thu Jun 24 14:11:00 2010 -0400 + + sort the demo list + + demos/gtk-demo/gtk-demo.py | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit b9da82742701ed276b01dee39626cd71cbef8556 +Author: John (J5) Palmieri +Date: Thu Jun 24 13:56:18 2010 -0400 + + rename iter to treeiter so we aren't using a python reserved word + + demos/gtk-demo/gtk-demo.py | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit c93935621f2fb1ff5e8c424ae884bd684ea68e50 +Author: John (J5) Palmieri +Date: Thu Jun 24 13:47:54 2010 -0400 + + Fixup for change in buffer API + + * Part of buffer API dealing with TextIter now marked (out + caller-allocates) + + demos/gtk-demo/gtk-demo.py | 10 ++++------ + 1 files changed, 4 insertions(+), 6 deletions(-) + +commit 8d9516a593a515290109401a9db7aa259b5aa35c +Author: John (J5) Palmieri +Date: Wed Jun 23 17:04:33 2010 -0400 + + add ListStore, TreeStore and TreeViewColumn APIs + + * this is enough to support the gtk-demo.py shell + * TreeStore and ListStore allow passing in as an argument list + of either python or GLib types to the constructor as a description + of the columns in the model + * TreeStore and ListStore override the append method, allowing + the application developer to send in a list of column values + for one row in the model. Unlike the append in C which + just returns an iter that you can then add data to, + this append actualy appends data in one step + * TreeViewColumn overrides the constructor to allow the adding + of attributes and a cell renderer when constructing the + column + + https://bugzilla.gnome.org/show_bug.cgi?id=620405 + + gi/overrides/Gtk.py | 59 ++++++++++++++++++++++++++++++++++++++++ + tests/test_overrides.py | 69 + +++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 128 insertions(+), 0 deletions(-) + +commit c305fbeb7bdb44623d5198f4a8f0a374d529fdf4 +Author: Johan Dahlin +Date: Wed Jun 23 14:34:28 2010 -0300 + + [gi] Add -I../gobject to cflags + + Since we're no longer pulling in pygobject cflags, + add this to be able to include pygobject.h + + gi/Makefile.am | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 53a093198851e3ba5abd1f6c3314737decd401d8 +Author: Ignacio Casal Quinteiro +Date: Wed Jun 23 18:09:19 2010 +0200 + + Add unit test for add_actions user data. + + tests/test_overrides.py | 20 +++++++++++++++----- + 1 files changed, 15 insertions(+), 5 deletions(-) + +commit 7f829af620cba768de619dd9f228d5d2ebf7fee4 +Author: Paolo Borelli +Date: Wed Jun 23 18:06:46 2010 +0200 + + Pass user_data param when adding actions + + gi/overrides/Gtk.py | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +commit 8f537ccd62f41ebe0db3853e2ae08080666f598f +Author: John (J5) Palmieri +Date: Wed Jun 23 12:02:04 2010 -0400 + + add an exception type to the try/except block + + * we should always specify what exception types we are expecting + + gi/overrides/Gtk.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit f140a8ebf59347162b67b550bd6f62d2eafad29a +Author: Johan Dahlin +Date: Wed Jun 23 12:31:51 2010 -0300 + + Avoid duplicating required versions + + Avoid duplicating the version of all required packages. + Also remove cyclic dependency of pygobject + + https://bugzilla.gnome.org/show_bug.cgi?id=622503 + + configure.ac | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit e8bd25355fbe7de38a28b7a0583167a2c0ffc31f +Author: John (J5) Palmieri +Date: Tue Jun 22 15:03:08 2010 -0400 + + return PyList instead of PyTuple for array, return empty list for + NULL arrays + + * returns an empty list when a NULL array (empty array) is encountered + * fix tests to check for lists instead of tuples or None + * test the ability to send in both None and empty list for arrays + and lists + + gi/pygi-argument.c | 7 ++-- + tests/test_everything.py | 5 ++- + tests/test_gi.py | 84 + +++++++++++++++++++++++----------------------- + 3 files changed, 49 insertions(+), 47 deletions(-) + +commit f312e6a49505eca07815146cfbdb0e48e5b3b8a8 +Author: Tomeu Vizoso +Date: Wed Jun 23 15:42:29 2010 +0200 + + Fix 'make distcheck' + + * Makefile.am: put the tests dir to the end + * g*/Makefile.am: build the .so when running make check + * tests/Makefile.am: Don't pass the src dir to runtests.py and + remove (hopefully) unneeded cruft. + * tests/common.py: Don't add the src dir to the python path + * tests/runtests.py: Don't pass the src dir to common.py + + Makefile.am | 4 +++- + gi/Makefile.am | 1 + + gio/Makefile.am | 1 + + glib/Makefile.am | 2 +- + gobject/Makefile.am | 1 + + tests/Makefile.am | 17 ++--------------- + tests/common.py | 3 +-- + tests/runtests.py | 12 +++++------- + 8 files changed, 15 insertions(+), 26 deletions(-) + +commit 5f82e7d2909cbbbecbf5dbee2342f516c0d1f371 +Author: Tomeu Vizoso +Date: Wed Jun 23 13:59:14 2010 +0200 + + Allow building pygobject without introspection support by providing + --disable-introspection to configure. + + Makefile.am | 6 +++++- + configure.ac | 15 ++++++++------- + gobject/pygi-external.h | 4 ++-- + tests/Makefile.am | 8 ++++++-- + tests/runtests.py | 21 +++++++-------------- + 5 files changed, 28 insertions(+), 26 deletions(-) + +commit cc3ea77318ee572673d2a044deca9001366b0f08 +Author: Tomeu Vizoso +Date: Wed Jun 23 12:26:51 2010 +0200 + + Make sure that sys.argv is a list and not a sequence. + + Because Python's optparse will try to do things on it that can + only be done with list. + + gi/overrides/Gtk.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 3d72b8248cc534a689dee5679a729b2fba56c528 +Author: Tomeu Vizoso +Date: Wed Jun 23 12:26:02 2010 +0200 + + Force loading the GObject typelib so we have available the wrappers + for base classes such as GInitiallyUnowned. + + gi/__init__.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit c7c94ef349c30597f2f10d90f74718d678ec7add +Author: John (J5) Palmieri +Date: Tue Jun 22 14:45:48 2010 -0400 + + we shouldn't g_array_free NULL pointers + + https://bugzilla.gnome.org/show_bug.cgi?id=622425 + + gi/pygi-info.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit fb1ee243493616d7a7e4f6924c574db39f5a423d +Merge: acf7b43 5f9cb91 +Author: Tomeu Vizoso +Date: Wed Jun 23 12:53:05 2010 +0200 + + Merge branch 'pygi' + +commit 5f9cb91c2b3851056d5e2d7ff1401d4ce2be7c1f +Author: John (J5) Palmieri +Date: Tue Jun 22 15:39:46 2010 -0400 + + remove unneeded TextIter creation in the tests + + tests/test_overrides.py | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +commit 53c355d2cc0894e7f551e9b4eb719b89188a978e +Author: John (J5) Palmieri +Date: Mon Jun 21 11:42:12 2010 -0400 + + add override for TextBuffer + + * TextBuffer.create_tag takes vargs which we can't bind yet so + change it + to except a keyword list of properties + * override the insert* methods so the developer does not have to + enter a length + - lengths are already encapsulated by a string in Python + + https://bugzilla.gnome.org/show_bug.cgi?id=620583 + + gi/overrides/Gtk.py | 51 + +++++++++++++++++++++++++++++++++++++++++++++++ + tests/test_overrides.py | 25 +++++++++++++++++++++++ + 2 files changed, 76 insertions(+), 0 deletions(-) + +commit 1d89a88b212c7411ad28e74eda80ae751de92e50 +Author: John (J5) Palmieri +Date: Tue Jun 22 12:46:39 2010 -0400 + + fix up some build issues + + * configure.ac: moved AM_PROG_CC_C_O below AM_PROG_CC_STDC because + autoconf + was complaining that AM_PROG_CC_STDC can't come after AM_PROC_CC_C_0 + * tests/Makefile.am: fix check-local target to use EXEC_NAME so + targets like + make check.gdb work + + configure.ac | 2 +- + tests/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 4fe0d94c219deb69a2309693202309c53a0e5e69 +Author: John (J5) Palmieri +Date: Tue Jun 22 11:50:30 2010 -0400 + + make the overrides file git friendly by appending to __all__ after + each override + + * modifying the __all__ line for each override would confuse git as + each override needs to get seperate approval before comitting. + Because of + this commits would not always go in in the same order as they + are created. + Also different people working on the same file would start from + different + commit states. This caused conflicts when patches were merged. + * instead of modifying a single hard coded list we now append to + the list + after each override. This creates distinct blocks of changed text + which will not conflict + + gi/overrides/GIMarshallingTests.py | 10 ++++------ + gi/overrides/Gdk.py | 8 ++++---- + gi/overrides/Gtk.py | 7 +++++-- + 3 files changed, 13 insertions(+), 12 deletions(-) + +commit 49321b934603e1ec69fb04082c63902970907d2b +Author: Paolo Borelli +Date: Sun Jun 20 13:27:34 2010 +0200 + + Override Dialog constructor and add_buttons method + + gi/overrides/Gtk.py | 46 + +++++++++++++++++++++++++++++++++++++++++++++- + tests/test_overrides.py | 16 ++++++++++++++++ + 2 files changed, 61 insertions(+), 1 deletions(-) + +commit acf7b43a41ce814f0c57ce609a090826f04771db +Author: Tomeu Vizoso +Date: Mon Jun 21 18:17:38 2010 +0200 + + Post release version bump to 2.21.4 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a7fa8b80406227a06cf18f8675dbc1f471283829 +Author: Tomeu Vizoso +Date: Mon Jun 21 18:10:32 2010 +0200 + + Update NEWS and release PyGObject-2.21.3 + + NEWS | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +commit 79acac7b86ec52cd3681d94d7f116314c3f00167 +Author: Ludovic L'Hours +Date: Tue Jul 21 16:28:34 2009 +0200 + + Proper handling of null-ok in virtual methods + + https://bugzilla.gnome.org/show_bug.cgi?id=589253 + + codegen/codegen.py | 2 ++ + codegen/reversewrapper.py | 18 +++++++++++++++--- + 2 files changed, 17 insertions(+), 3 deletions(-) + +commit 259a4b08f009aa01451caed20dbb6e68b402da2a +Author: Tomeu Vizoso +Date: Mon Jun 21 17:34:54 2010 +0200 + + Add *~ and *.orig to .gitignore + + .gitignore | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 00a85f6a844714d1715e2f67431747d1a4cdacb1 +Author: Tomeu Vizoso +Date: Mon Jun 21 17:33:56 2010 +0200 + + Fall back to use the floating references API in glib if there isn't + a sinkfunc defined. + + * tests/*: Add ref counting tests for floating objects + * gobject/gobjectmodule.c, gobject/pygobject.c: Fall back to + g_object_ref_sink + or g_object_ref if there isn't a sinkfunc defined. Make sure that + pygobject_sink gets called only once per GObject instance. + + https://bugzilla.gnome.org/show_bug.cgi?id=583909 + + gobject/gobjectmodule.c | 2 - + gobject/pygobject.c | 50 +++++++++++++-------- + gobject/pygobject.h | 1 + + tests/Makefile.am | 2 + + tests/test-floating.c | 95 ++++++++++++++++++++++++++++++++++++++++ + tests/test-floating.h | 60 +++++++++++++++++++++++++ + tests/test_gobject.py | 19 ++++++++- + tests/testhelpermodule.c | 109 + ++++++++++++++++++++++++++++++++++++++++++++++ + 8 files changed, 315 insertions(+), 23 deletions(-) + +commit e71238a699ae783fd1a59c8a76e3555d8066cf82 +Author: Tomeu Vizoso +Date: Mon Jun 21 13:06:13 2010 +0200 + + Revert "Drop sinkfuncs." + + This reverts commit 04627488220b4f2a16e11f8982af7866fea9f7eb. + + gobject/gobjectmodule.c | 3 ++- + gobject/pygobject.c | 42 ++++++++++++++++++++++++++++++++++-------- + gobject/pygobject.h | 1 - + 3 files changed, 36 insertions(+), 10 deletions(-) + +commit b2661054d6bde673484eab472e69ca021124528d +Author: Johan Dahlin +Date: Sun Jun 20 11:09:57 2010 -0300 + + Merge back pygi + + For reasons outlined at: + http://mail.gnome.org/archives/python-hackers-list/2010-June/msg00009.html + + Makefile.am | 14 +- + configure.ac | 29 +- + demos/gtk-demo/demos/appwindow.py | 411 +++++ + demos/gtk-demo/demos/assistant.py | 134 ++ + demos/gtk-demo/demos/builder.py | 57 + + demos/gtk-demo/demos/button_box.py | 121 ++ + demos/gtk-demo/demos/clipboard.py | 238 +++ + demos/gtk-demo/demos/colorselector.py | 121 ++ + demos/gtk-demo/demos/combobox.py | 282 ++++ + demos/gtk-demo/demos/data/alphatest.png | Bin 0 -> + 26529 bytes + demos/gtk-demo/demos/data/apple-red.png | Bin 0 -> 3545 bytes + demos/gtk-demo/demos/data/background.jpg | Bin 0 -> + 22219 bytes + demos/gtk-demo/demos/data/demo.ui | 258 ++++ + demos/gtk-demo/demos/data/floppybuddy.gif | Bin 0 -> 5216 bytes + demos/gtk-demo/demos/data/gnome-applets.png | Bin 0 -> 3090 bytes + demos/gtk-demo/demos/data/gnome-calendar.png | Bin 0 -> 2755 bytes + demos/gtk-demo/demos/data/gnome-foot.png | Bin 0 -> 2916 bytes + demos/gtk-demo/demos/data/gnome-fs-directory.png | Bin 0 -> 2044 bytes + demos/gtk-demo/demos/data/gnome-fs-regular.png | Bin 0 -> 1795 bytes + demos/gtk-demo/demos/data/gnome-gimp.png | Bin 0 -> 3410 bytes + demos/gtk-demo/demos/data/gnome-gmush.png | Bin 0 -> 3244 bytes + demos/gtk-demo/demos/data/gnome-gsame.png | Bin 0 -> 4263 bytes + demos/gtk-demo/demos/data/gnu-keys.png | Bin 0 -> 3852 bytes + demos/gtk-demo/demos/data/gtk-logo-rgb.gif | Bin 0 -> 6427 bytes + demos/gtk-demo/demos/test.py | 14 + + demos/gtk-demo/gtk-demo.py | 266 ++++ + examples/Makefile.am | 2 +- + examples/cairo-demo.py | 121 ++ + gi/Makefile.am | 4 +- + gi/demos/gtk-demo/demos/appwindow.py | 411 ----- + gi/demos/gtk-demo/demos/assistant.py | 134 -- + gi/demos/gtk-demo/demos/builder.py | 57 - + gi/demos/gtk-demo/demos/button_box.py | 121 -- + gi/demos/gtk-demo/demos/clipboard.py | 238 --- + gi/demos/gtk-demo/demos/colorselector.py | 121 -- + gi/demos/gtk-demo/demos/combobox.py | 282 ---- + gi/demos/gtk-demo/demos/data/alphatest.png | Bin 26529 -> + 0 bytes + gi/demos/gtk-demo/demos/data/apple-red.png | Bin 3545 -> 0 bytes + gi/demos/gtk-demo/demos/data/background.jpg | Bin 22219 -> + 0 bytes + gi/demos/gtk-demo/demos/data/demo.ui | 258 ---- + gi/demos/gtk-demo/demos/data/floppybuddy.gif | Bin 5216 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnome-applets.png | Bin 3090 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnome-calendar.png | Bin 2755 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnome-foot.png | Bin 2916 -> 0 bytes + .../gtk-demo/demos/data/gnome-fs-directory.png | Bin 2044 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnome-fs-regular.png | Bin 1795 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnome-gimp.png | Bin 3410 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnome-gmush.png | Bin 3244 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnome-gsame.png | Bin 4263 -> 0 bytes + gi/demos/gtk-demo/demos/data/gnu-keys.png | Bin 3852 -> 0 bytes + gi/demos/gtk-demo/demos/data/gtk-logo-rgb.gif | Bin 6427 -> 0 bytes + gi/demos/gtk-demo/demos/test.py | 14 - + gi/demos/gtk-demo/gtk-demo.py | 266 ---- + gi/examples/Makefile.am | 2 - + gi/examples/cairo-demo.py | 121 -- + gi/tests/test_everything.py | 270 ---- + gi/tests/test_gi.py | 1624 + -------------------- + gi/tests/test_overrides.py | 132 -- + pygi-Makefile.am | 28 - + pygi-configure.ac | 60 - + pygi.doap | 34 - + pygobject.doap | 16 +- + tests/Makefile.am | 23 +- + tests/test_everything.py | 270 ++++ + tests/test_gi.py | 1624 + ++++++++++++++++++++ + tests/test_overrides.py | 132 ++ + 66 files changed, 4124 insertions(+), 4186 deletions(-) + +commit 597bd64319d7966045b5b8613ca6fc85668c3f56 +Merge: ec8d148 fa91dfd +Author: Johan Dahlin +Date: Sun Jun 20 10:53:46 2010 -0300 + + Merge branch 'pygi-merge' + +commit fa91dfd3ec79ecd03c9fb59b9363eab4a5b3ff2b +Author: Johan Dahlin +Date: Sun Jun 20 10:53:36 2010 -0300 + + Prepare pygi move + + .gitignore | 40 - + HACKING | 26 - + Makefile.am | 28 - + autogen.sh | 166 -- + configure.ac | 60 - + demos/gtk-demo/demos/appwindow.py | 411 ----- + demos/gtk-demo/demos/assistant.py | 134 -- + demos/gtk-demo/demos/builder.py | 57 - + demos/gtk-demo/demos/button_box.py | 121 -- + demos/gtk-demo/demos/clipboard.py | 238 --- + demos/gtk-demo/demos/colorselector.py | 121 -- + demos/gtk-demo/demos/combobox.py | 282 ---- + demos/gtk-demo/demos/data/alphatest.png | Bin 26529 -> + 0 bytes + demos/gtk-demo/demos/data/apple-red.png | Bin 3545 -> 0 bytes + demos/gtk-demo/demos/data/background.jpg | Bin 22219 -> + 0 bytes + demos/gtk-demo/demos/data/demo.ui | 258 ---- + demos/gtk-demo/demos/data/floppybuddy.gif | Bin 5216 -> 0 bytes + demos/gtk-demo/demos/data/gnome-applets.png | Bin 3090 -> 0 bytes + demos/gtk-demo/demos/data/gnome-calendar.png | Bin 2755 -> 0 bytes + demos/gtk-demo/demos/data/gnome-foot.png | Bin 2916 -> 0 bytes + demos/gtk-demo/demos/data/gnome-fs-directory.png | Bin 2044 -> 0 bytes + demos/gtk-demo/demos/data/gnome-fs-regular.png | Bin 1795 -> 0 bytes + demos/gtk-demo/demos/data/gnome-gimp.png | Bin 3410 -> 0 bytes + demos/gtk-demo/demos/data/gnome-gmush.png | Bin 3244 -> 0 bytes + demos/gtk-demo/demos/data/gnome-gsame.png | Bin 4263 -> 0 bytes + demos/gtk-demo/demos/data/gnu-keys.png | Bin 3852 -> 0 bytes + demos/gtk-demo/demos/data/gtk-logo-rgb.gif | Bin 6427 -> 0 bytes + demos/gtk-demo/demos/test.py | 14 - + demos/gtk-demo/gtk-demo.py | 266 ---- + examples/Makefile.am | 2 - + examples/cairo-demo.py | 121 -- + gi/.gitignore | 40 + + gi/HACKING | 26 + + gi/demos/gtk-demo/demos/appwindow.py | 411 +++++ + gi/demos/gtk-demo/demos/assistant.py | 134 ++ + gi/demos/gtk-demo/demos/builder.py | 57 + + gi/demos/gtk-demo/demos/button_box.py | 121 ++ + gi/demos/gtk-demo/demos/clipboard.py | 238 +++ + gi/demos/gtk-demo/demos/colorselector.py | 121 ++ + gi/demos/gtk-demo/demos/combobox.py | 282 ++++ + gi/demos/gtk-demo/demos/data/alphatest.png | Bin 0 -> + 26529 bytes + gi/demos/gtk-demo/demos/data/apple-red.png | Bin 0 -> 3545 bytes + gi/demos/gtk-demo/demos/data/background.jpg | Bin 0 -> + 22219 bytes + gi/demos/gtk-demo/demos/data/demo.ui | 258 ++++ + gi/demos/gtk-demo/demos/data/floppybuddy.gif | Bin 0 -> 5216 bytes + gi/demos/gtk-demo/demos/data/gnome-applets.png | Bin 0 -> 3090 bytes + gi/demos/gtk-demo/demos/data/gnome-calendar.png | Bin 0 -> 2755 bytes + gi/demos/gtk-demo/demos/data/gnome-foot.png | Bin 0 -> 2916 bytes + .../gtk-demo/demos/data/gnome-fs-directory.png | Bin 0 -> 2044 bytes + gi/demos/gtk-demo/demos/data/gnome-fs-regular.png | Bin 0 -> 1795 bytes + gi/demos/gtk-demo/demos/data/gnome-gimp.png | Bin 0 -> 3410 bytes + gi/demos/gtk-demo/demos/data/gnome-gmush.png | Bin 0 -> 3244 bytes + gi/demos/gtk-demo/demos/data/gnome-gsame.png | Bin 0 -> 4263 bytes + gi/demos/gtk-demo/demos/data/gnu-keys.png | Bin 0 -> 3852 bytes + gi/demos/gtk-demo/demos/data/gtk-logo-rgb.gif | Bin 0 -> 6427 bytes + gi/demos/gtk-demo/demos/test.py | 14 + + gi/demos/gtk-demo/gtk-demo.py | 266 ++++ + gi/examples/Makefile.am | 2 + + gi/examples/cairo-demo.py | 121 ++ + gi/tests/Makefile.am | 22 + + gi/tests/runtests.py | 21 + + gi/tests/test_everything.py | 270 ++++ + gi/tests/test_gi.py | 1624 + ++++++++++++++++++++ + gi/tests/test_overrides.py | 132 ++ + pygi-Makefile.am | 28 + + pygi-configure.ac | 60 + + tests/Makefile.am | 22 - + tests/runtests.py | 21 - + tests/test_everything.py | 270 ---- + tests/test_gi.py | 1624 + -------------------- + tests/test_overrides.py | 132 -- + 71 files changed, 4248 insertions(+), 4414 deletions(-) + +commit ec8d148eccbb3714093f21b595ea77ae4c7c3bce +Author: Johan Dahlin +Date: Sun Jun 20 10:49:55 2010 -0300 + + [giounix] Make it possible to compile on glib 2.20 + + gio/unix.override | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 606018a2c551d890fc2bb987d99683f777598bda +Author: John (J5) Palmieri +Date: Mon Jun 7 16:32:29 2010 -0400 + + Don't free transfer full struct pointers because we can't do it safely + + * Most libraries which are sending back structs as transfer-full + are either annotated incorrectly or should be sending boxed types + * It is much better to throw a warning and leak memory than it is to + call free on an unknown struct pointer. Doing so may cause + a double free + * Specific case is gdk_atom_intern where a GdkAtom is not actually + a pointer + but an integer stuffed into a pointer type + + https://bugzilla.gnome.org/show_bug.cgi?id=620898 + + gi/pygi-argument.c | 9 ++++++++- + gi/pygi-invoke.c | 11 +++++++++-- + 2 files changed, 17 insertions(+), 3 deletions(-) + +commit 433ee2aa029a1482961f478252a06492bd3498e6 +Author: Sjoerd Simons +Date: Tue Jun 15 11:42:28 2010 +0200 + + Release the lock when potentially invoking Python code. + + * gobject/pygobject.c: Release GIL lock when retrieving properties + and when clearing a PyGObject. + + https://bugzilla.gnome.org/show_bug.cgi?id=530935 + + gobject/pygobject.c | 11 ++++++++++- + 1 files changed, 10 insertions(+), 1 deletions(-) + +commit aa1e82c7eb87620bd73e1edb486f5b9e0d49aa96 +Author: John (J5) Palmieri +Date: Mon Jun 14 18:36:57 2010 -0400 + + add combobox example + + demos/gtk-demo/demos/combobox.py | 282 + ++++++++++++++++++++++++++++++++++++++ + 1 files changed, 282 insertions(+), 0 deletions(-) + +commit a8668694da59c2dd959c875f13337e64ca22f7e9 +Author: John (J5) Palmieri +Date: Mon Jun 14 13:43:53 2010 -0400 + + fix leak in the allow None callbacks patch + + gi/pygi-callbacks.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 729072e73d65e7fd5b5197ebe5a8c53a449d0ec0 +Author: John (J5) Palmieri +Date: Mon Jun 7 17:12:09 2010 -0400 + + Allow passing None for callbacks which are annotated allow-none + + * Many callbacks are optional parameters yet we were asserting on + Py_None + * We now check to see if allow_none is set when setting up callbacks, + if it is set and py_function == Py_None, we set the closure to NULL + and return + * pygi-invoke.c now checks to see if the closure == NULL when setting + arguments + * if it is NULL there is no reason to set the the destroy notify + handler + so we skip that too + + https://bugzilla.gnome.org/show_bug.cgi?id=620906 + + gi/pygi-callbacks.c | 7 +++++++ + gi/pygi-invoke.c | 14 +++++++++++--- + tests/test_everything.py | 4 ++++ + 3 files changed, 22 insertions(+), 3 deletions(-) + +commit a3eb5c7de5836c37aa7ae01dbe98996ec2632c17 +Author: Paolo Borelli +Date: Mon Jun 14 19:06:45 2010 +0200 + + Fix to match latest gtk annotations + + demos/gtk-demo/demos/appwindow.py | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +commit 6306dd73cc74aa9202569eac0eaaa5f825c8dc59 +Author: John (J5) Palmieri +Date: Tue Jun 8 15:03:49 2010 -0400 + + fix variable member names in Gdk.Color override + + * override was using r, g, and b for the red, green, blue components + but + the struct specifies red, green, blue so we need to use those names + + https://bugzilla.gnome.org/show_bug.cgi?id=621007 + + gi/overrides/Gdk.py | 10 +++++----- + tests/test_overrides.py | 6 +++--- + 2 files changed, 8 insertions(+), 8 deletions(-) + +commit d182630e1128fef6f1c2aea28ccd8da4bddd2c8f +Author: Tomeu Vizoso +Date: Thu Jun 10 20:23:13 2010 +0200 + + Post release version bump to 2.21.3 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c4e64d5d264593051b9a3131e4985a58e8e76f8b +Author: Tomeu Vizoso +Date: Thu Jun 10 20:21:13 2010 +0200 + + Update NEWS and release PyGObject-2.21.2 + + NEWS | 26 ++++++++++++++++++++++++++ + 1 files changed, 26 insertions(+), 0 deletions(-) + +commit e0fe844d5fe8f7e26316f197444fd4143ed36adf +Author: Tomeu Vizoso +Date: Thu Jun 10 20:09:07 2010 +0200 + + Remove deleted files from the Makefile. + + test_conversion.py + test_enum.py + test_gtype.py + test_subtype.py + + tests/Makefile.am | 4 ---- + 1 files changed, 0 insertions(+), 4 deletions(-) + +commit 495a301cb81c5e914bcef905999265604faa27fc +Author: Tomeu Vizoso +Date: Thu Jun 10 19:39:09 2010 +0200 + + Add myself to the maintainers list in the README + + README | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 04627488220b4f2a16e11f8982af7866fea9f7eb +Author: Tomeu Vizoso +Date: Thu Jun 10 19:24:31 2010 +0200 + + Drop sinkfuncs. + + * use g_object methods to sink floating refs instead of allowing + custom sink functions to be registered + * we now sink inside of pygobject_new_full to handle cases where + a library creates its own gobject via g_object_new and just + needs a python wrapper + - a previous patch had done the sink when creating the gobject, + since it needs to call pygobject_new_full to wrap the object, + this patch handles both cases (e.g. pygobject created object + and externally created gobject) + + https://bugzilla.gnome.org/show_bug.cgi?id=583909 + + gobject/gobjectmodule.c | 3 +-- + gobject/pygobject.c | 42 ++++++++---------------------------------- + gobject/pygobject.h | 1 + + 3 files changed, 10 insertions(+), 36 deletions(-) + +commit 07df124dc06cf506634e95d08397f50a2d07fce2 +Author: Steve Frécinaux +Date: Mon Jun 7 09:47:23 2010 +0200 + + Make the "wrong argument count" exception more explicit. + + Previously we had messages like this one: + TypeError: takes exactly 2 argument(s) (1 given) + + With this patch, they become like this: + TypeError: get_end_iter() takes exactly 2 argument(s) (1 given) + + It makes things much easier to debug when there are several pygi calls + on the same line. + + https://bugzilla.gnome.org/show_bug.cgi?id=620804 + + gi/pygi-invoke.c | 3 ++- + tests/test_everything.py | 6 ++++++ + 2 files changed, 8 insertions(+), 1 deletions(-) + +commit b435319fe830a909cc4d414533b3b66574931e24 +Author: Steve Frécinaux +Date: Mon Jun 7 09:54:06 2010 +0200 + + Use bash explicitely in the pre-commit hook. + + The "builtin" command is not available in all sh flavours, so the + pre-commit hook is going to fail if you use dash or others instead of + bash as your default 'sh' alias. + + https://bugzilla.gnome.org/show_bug.cgi?id=620805 + + pre-commit.hook | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e9ee2916494eb7654004925c1ee1e94f99b14f1a +Author: John (J5) Palmieri +Date: Tue Jun 8 16:55:26 2010 -0400 + + colorselector demo + + demos/gtk-demo/demos/colorselector.py | 121 + +++++++++++++++++++++++++++++++++ + 1 files changed, 121 insertions(+), 0 deletions(-) + +commit ec598128de9e90dccab662ed2f5511c8d659e156 +Author: Tomeu Vizoso +Date: Tue Jun 8 15:48:33 2010 +0200 + + Update PyGObject dependency to 2.21.1 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 87774a17bd607724a56e18c2eb1ac71b04b7079d +Author: Tomeu Vizoso +Date: Tue Jun 8 10:40:39 2010 +0200 + + Add myself to maintainers + + MAINTAINERS | 4 ++++ + pygobject.doap | 7 +++++++ + 2 files changed, 11 insertions(+), 0 deletions(-) + +commit 46c91a11d448e5e11d142d3362aff1483226bca4 +Author: Colin Walters +Date: Wed May 5 13:54:27 2010 -0400 + + Clear error if we failed the import + + Otherwise we leave the exception set which causes bizarre problems + later in unrelated code. + + https://bugzilla.redhat.com/show_bug.cgi?id=569885 + + https://bugzilla.gnome.org/show_bug.cgi?id=617796 + + gobject/pygi-external.h | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit c1c41576d053cc1cdd8366d8cd1e59fff1c3a9c6 +Author: John (J5) Palmieri +Date: Mon Jun 7 17:19:30 2010 -0400 + + fix some typos and add a link to a patch which fixes a FIXME + + demos/gtk-demo/demos/clipboard.py | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit e7fabb5024d94a3166766e5fca740741bc50380a +Author: John (J5) Palmieri +Date: Mon Jun 7 16:21:42 2010 -0400 + + clipboard demo + + demos/gtk-demo/demos/clipboard.py | 235 + +++++++++++++++++++++++++++++++++++++ + 1 files changed, 235 insertions(+), 0 deletions(-) + +commit e0f1dce5ec58d071759f886697501da6eeea549d +Author: John (J5) Palmieri +Date: Sun Jun 6 13:27:46 2010 -0400 + + set is_fully_bound to false + + demos/gtk-demo/demos/button_box.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 986db1c73746d3a8ad7d8d5141c7eed194e7b948 +Author: John (J5) Palmieri +Date: Sat Jun 5 23:53:36 2010 -0400 + + new button box demo + + demos/gtk-demo/demos/button_box.py | 121 + ++++++++++++++++++++++++++++++++++++ + 1 files changed, 121 insertions(+), 0 deletions(-) + +commit e9f5f8a829121e59367bae690442150f144946ad +Author: John (J5) Palmieri +Date: Sat Jun 5 23:26:03 2010 -0400 + + set is_fully_bound to True fro builder example + + demos/gtk-demo/demos/builder.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d9968c3a4dea1d4a73a9376009cf486c80ea3da6 +Author: John (J5) Palmieri +Date: Sat Jun 5 23:24:36 2010 -0400 + + fix up formatting in demos + + demos/gtk-demo/demos/appwindow.py | 16 ++++++++-------- + demos/gtk-demo/demos/assistant.py | 24 ++++++++++++------------ + demos/gtk-demo/demos/builder.py | 2 +- + 3 files changed, 21 insertions(+), 21 deletions(-) + +commit ffca02536bafb55e8c3bce31cd992365207429f6 +Author: John (J5) Palmieri +Date: Sat Jun 5 14:54:47 2010 -0400 + + add the builder demo + + demos/gtk-demo/demos/builder.py | 57 + +++++++++++++++++++++++++++++++++++++++ + 1 files changed, 57 insertions(+), 0 deletions(-) + +commit a96dbafdf562a2ac6bde4df27919d3628689dbdb +Author: John (J5) Palmieri +Date: Fri Jun 4 17:48:24 2010 -0400 + + add assistant demo + + demos/gtk-demo/demos/assistant.py | 134 + +++++++++++++++++++++++++++++++++++++ + 1 files changed, 134 insertions(+), 0 deletions(-) + +commit 7e1b8cf32f33d45603aaec76afb0d14be84ffd94 +Author: John (J5) Palmieri +Date: Fri Jun 4 16:56:46 2010 -0400 + + add formatting rules and copyright notice + + demos/gtk-demo/demos/appwindow.py | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +commit 03b99692b81631d397ab62dcd263341465bcee88 +Author: John (J5) Palmieri +Date: Fri Jun 4 16:26:54 2010 -0400 + + add the gtk-demo app along with a couple of demos + + * note there are still a couple of patches in bugzilla that are + needed for this + to run correctly: + - http://bugzilla-attachments.gnome.org/attachment.cgi?id=162682 + - http://bugzilla-attachments.gnome.org/attachment.cgi?id=162764 + + demos/gtk-demo/demos/appwindow.py | 393 + ++++++++++++++++++++++ + demos/gtk-demo/demos/data/alphatest.png | Bin 0 -> 26529 bytes + demos/gtk-demo/demos/data/apple-red.png | Bin 0 -> 3545 bytes + demos/gtk-demo/demos/data/background.jpg | Bin 0 -> 22219 bytes + demos/gtk-demo/demos/data/demo.ui | 258 ++++++++++++++ + demos/gtk-demo/demos/data/floppybuddy.gif | Bin 0 -> 5216 bytes + demos/gtk-demo/demos/data/gnome-applets.png | Bin 0 -> 3090 bytes + demos/gtk-demo/demos/data/gnome-calendar.png | Bin 0 -> 2755 bytes + demos/gtk-demo/demos/data/gnome-foot.png | Bin 0 -> 2916 bytes + demos/gtk-demo/demos/data/gnome-fs-directory.png | Bin 0 -> 2044 bytes + demos/gtk-demo/demos/data/gnome-fs-regular.png | Bin 0 -> 1795 bytes + demos/gtk-demo/demos/data/gnome-gimp.png | Bin 0 -> 3410 bytes + demos/gtk-demo/demos/data/gnome-gmush.png | Bin 0 -> 3244 bytes + demos/gtk-demo/demos/data/gnome-gsame.png | Bin 0 -> 4263 bytes + demos/gtk-demo/demos/data/gnu-keys.png | Bin 0 -> 3852 bytes + demos/gtk-demo/demos/data/gtk-logo-rgb.gif | Bin 0 -> 6427 bytes + demos/gtk-demo/demos/test.py | 14 + + demos/gtk-demo/gtk-demo.py | 266 +++++++++++++++ + 18 files changed, 931 insertions(+), 0 deletions(-) + +commit b3b1f029d8d16cf9bd74160009808147d07e3b3f +Author: Tomeu Vizoso +Date: Fri Jun 4 11:25:08 2010 +0200 + + Update gobject-introspection dependency to 0.6.14 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 45c4e46ae93bd83a0e3f3550df6c64ce96bbedb4 +Author: Tomeu Vizoso +Date: Fri Jun 4 11:23:41 2010 +0200 + + Post-release version bump to 0.6.1 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 7a94270dac48b67aabc7dbad156cf1180db9cb5e +Author: Tomeu Vizoso +Date: Fri Jun 4 08:29:42 2010 +0200 + + Pre-release version bump 0.6.0 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1e42ee6eb25a07a5201f24ffeac18d298a98477e +Author: John (J5) Palmieri +Date: Fri May 28 10:03:11 2010 -0400 + + support for caller-allocates annotations for structs + + * out caller-allocates parameters expect an already constructed + structure + to be passed in by reference. It is then modified and the caller + uses the + modified value. We support this by using only one level of pointer + indirection. + * Only structs are considered to be caller-allocates parameters + even if + they are marked as such by GI. This is because the GI scanner + isn't smart + enough to correctly guess 100% of the time + * GValues are a special case of a caller-allocates parameter when + cleaning + up (e.g. g_value_unset is called). GValues make no sense in + a scripting + language. Developers should never deal with them. + + https://bugzilla.gnome.org/show_bug.cgi?id=620406 + + gi/pygi-invoke.c | 73 + +++++++++++++++++++++++++++++++++++++++++++-- + tests/test_everything.py | 28 +++++++++++++++++ + 2 files changed, 97 insertions(+), 4 deletions(-) + +commit c3f467e0ae99aa78c2fdb91b973a272d2fe970bd +Author: John (J5) Palmieri +Date: Wed Jun 2 14:14:16 2010 -0400 + + don't import gobject directly in the tests + + * use from gi.repository import GObject + + tests/test_overrides.py | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +commit 46b5133fea4cd5db57a360b3cbe9ee923e27560c +Author: Tomeu Vizoso +Date: Tue Jun 1 14:28:57 2010 +0200 + + Wrap C arrays in structs as GArrays before converting to Python + + https://bugzilla.gnome.org/show_bug.cgi?id=620247 + + gi/pygi-info.c | 11 +++++++++++ + tests/test_gi.py | 17 +++++++++++++++++ + 2 files changed, 28 insertions(+), 0 deletions(-) + +commit 5f0f9a9c9145a129a063b041424c3109a24d9ead +Author: Tomeu Vizoso +Date: Wed May 26 13:20:27 2010 +0200 + + Install pre-commit hook that checks the code changes for style + conformance + + autogen.sh | 7 +++++++ + pre-commit.hook | 39 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 46 insertions(+), 0 deletions(-) + +commit 1319da5b7f483e48a90b0b7489f77236ba26f479 +Author: Tomeu Vizoso +Date: Wed May 26 12:19:17 2010 +0200 + + Apply consistent whitespace formatting with: + + astyle -p -d -c -S -U -M60 + + This won't affect git blame nor git diff if the switch -w is used. + + gi/gimodule.c | 138 ++++---- + gi/pygi-argument.c | 960 + +++++++++++++++++++++++----------------------- + gi/pygi-boxed.c | 108 +++--- + gi/pygi-callbacks.c | 154 ++++---- + gi/pygi-callbacks.h | 8 +- + gi/pygi-closure.c | 270 +++++++------- + gi/pygi-closure.h | 18 +- + gi/pygi-foreign-cairo.c | 36 +- + gi/pygi-foreign-cairo.h | 36 +- + gi/pygi-foreign.c | 54 ++-- + gi/pygi-foreign.h | 10 +- + gi/pygi-info.c | 646 ++++++++++++++++---------------- + gi/pygi-invoke.c | 380 ++++++++++---------- + gi/pygi-repository.c | 114 +++--- + gi/pygi-struct.c | 88 +++--- + gi/pygi-type.c | 32 +- + gi/pygi.h | 20 +- + gi/pygobject-external.h | 14 +- + 18 files changed, 1544 insertions(+), 1542 deletions(-) + +commit 6156f15cb15b4c20e975527227135d49207c520a +Author: Tomeu Vizoso +Date: Tue May 25 14:08:51 2010 +0200 + + Prepend gi.repository to the __module__ attribute of wrapper classes. + + https://bugzilla.gnome.org/show_bug.cgi?id=619597 + + gi/module.py | 4 ++-- + tests/test_gi.py | 4 +++- + 2 files changed, 5 insertions(+), 3 deletions(-) + +commit 097b92983b7a322c58fecb1e691ba6ddf5035548 +Author: Tomeu Vizoso +Date: Tue May 25 14:17:13 2010 +0200 + + Correctly identify at creation time: + + * if the class is defined in python -> hook up vfuncs + * if the class wraps a type from a .typelib -> set atributes + * else (GLocalFile) -> do nothing + + https://bugzilla.gnome.org/show_bug.cgi?id=619604 + + gi/types.py | 15 +++++++++++---- + 1 files changed, 11 insertions(+), 4 deletions(-) + +commit 686e10fcdb108af9758eb025a3447813c3513a93 +Author: Tomeu Vizoso +Date: Thu Apr 29 10:55:13 2010 +0200 + + Dont complain if another base has implemented the method + + https://bugzilla.gnome.org/show_bug.cgi?id=617153 + + gi/types.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 9f34d120845d936b04546a5cea599ec67e9181a7 +Author: John (J5) Palmieri +Date: Mon May 24 16:16:50 2010 -0400 + + fix up Builder override, add new override methods, and add unit tests + + * check for flags when connecting signals now that we get gi + GObject types + * override the add_from_string and add_objects_from string overrides + so + that you don't have to pass in the length of the buffer + * add test that loads objects from strings and connects them to + signals + + gi/overrides/Gtk.py | 19 +++++++++++- + tests/test_overrides.py | 72 + +++++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 86 insertions(+), 5 deletions(-) + +commit 1561d2977691f1cb8684f183a2e274c47960d931 +Author: Tomeu Vizoso +Date: Mon May 24 18:48:10 2010 +0200 + + Improve handling of subclasses without __gtype_name__ + + Gives a better message at type registration. + + https://bugzilla.gnome.org/show_bug.cgi?id=616849 + + gi/gimodule.c | 9 +++++++++ + tests/test_gi.py | 13 ++++++++++++- + 2 files changed, 21 insertions(+), 1 deletions(-) + +commit c9d44d4d46c3da3a445000b1db592baa9c378a92 +Author: Tomeu Vizoso +Date: Fri Apr 30 18:17:50 2010 +0200 + + Add support for GArray args + + https://bugzilla.gnome.org/show_bug.cgi?id=617054 + + gi/pygi-invoke.c | 11 +++++++---- + tests/test_gi.py | 50 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 57 insertions(+), 4 deletions(-) + +commit c171579ee22681e1ee4ad33441c89f1053bdc3d1 +Author: John (J5) Palmieri +Date: Mon May 24 11:48:16 2010 -0400 + + check refcounting of callback userdata in unit tests + + tests/test_everything.py | 18 ++++++++++++++++++ + 1 files changed, 18 insertions(+), 0 deletions(-) + +commit 8eb809468fe3e1f8e4f92bd7f25d96f9cf802cd4 +Author: Tomeu Vizoso +Date: Sat May 22 15:12:37 2010 +0200 + + Add support for out args in callbacks + + This patch refactors argument marshalling for closures in + preparation for more complete support. + + Also fixes a bug in the memory management of user_data args. + + https://bugzilla.gnome.org/show_bug.cgi?id=617780 + + gi/pygi-closure.c | 335 + +++++++++++++++++++++++++++++++++++++++++------------ + tests/test_gi.py | 4 + + 2 files changed, 263 insertions(+), 76 deletions(-) + +commit 0df0c956bb2476392c9d81f0a243a7e84c067166 +Author: Tomeu Vizoso +Date: Sun May 23 10:59:27 2010 +0200 + + If None is passed to an interface which takes an object, convert it to + NULL + + * without this patch PyGI treats the None object as a PyGObject + and ends up + extracting garbage data causing a crash + * None's equivalent in C is NULL so we must provide a special case + where we + marshal the None as NULL + + https://bugzilla.gnome.org/show_bug.cgi?id=617880 + + gi/pygi-argument.c | 5 +++++ + tests/test_everything.py | 6 ++++++ + 2 files changed, 11 insertions(+), 0 deletions(-) + +commit 60fdf4b8f738dd0f5c190bc18ddf010032d3c5ca +Author: John (J5) Palmieri +Date: Sat May 22 14:06:37 2010 +0200 + + correctly handle floating objects in gtk + + * this is a stopgap so we work with older pygobject libraries + * there is a patch at + https://bugzilla.gnome.org/show_bug.cgi?id=583909 + which adds the correct fix to pygobject + * once pygobject accepts the above patch this patch does not need to + be reverted because pygobject_register_sinkfunc becomes a noop + * add tests (Tomeu) + + https://bugzilla.gnome.org/show_bug.cgi?id=619007 + + gi/gimodule.c | 12 ++++++++++++ + tests/test_everything.py | 3 +++ + 2 files changed, 15 insertions(+), 0 deletions(-) + +commit 4b369f8aca980fc6a582094d6648f40fe4af5e9f +Author: John (J5) Palmieri +Date: Sat May 22 13:21:30 2010 +0200 + + Return an empty list when a NULL GList and GSList is returned + + * In GTK a GList * and GSList set to NULL is equivilant to empty + list. All + GTK list methods can take a NULL and treat it as an empty list. e.g. + g_list_length(NULL) returns 0 + * PyGtk consitently returns empty list when a NULL is returned for + GList or + GSList return + * Many PyGtk apps do this: + for i in range(len(obj.get_list())): + ... + * If we were to continue to return None, they would have to add + a check + which is needlessly verbose and isn't very "pythonic" + + https://bugzilla.gnome.org/show_bug.cgi?id=619232 + + gi/pygi-argument.c | 6 ------ + tests/test_everything.py | 4 ++-- + 2 files changed, 2 insertions(+), 8 deletions(-) + +commit 71a2148b00dfdda99e0d961ae39b901608724e59 +Author: Steve Frécinaux +Date: Fri May 21 19:05:03 2010 +0200 + + Fix warning in configure. + + The warning is caused by the use of the construction 'CFLAGS+=' in a + sh version that doesn't understand it (in this case, 'dash'). + + https://bugzilla.gnome.org/show_bug.cgi?id=619311 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit aa0357e468eb91e0f3707346e9b32f312fbf51d3 +Author: Tomeu Vizoso +Date: Thu Apr 29 13:06:15 2010 +0200 + + GTypeInterface cannot be unrefed + + https://bugzilla.gnome.org/show_bug.cgi?id=617159 + + gi/gimodule.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit ab1aaff108d23aabd28c3634edfb67236eb55460 +Author: John (J5) Palmieri +Date: Sat May 22 13:09:48 2010 +0200 + + fix NULL array unit tests and fix crasher when sending None as + an array + + * Unit tests were wrong given the annotation for + test_array_int_null_in and + test_array_int_null_out: + + /** + * test_array_int_null_in: + * @arr: (array length=len) (allow-none): + * @len: length + */ + + -- and -- + + /** + * test_array_int_null_out: + * @arr: (out) (array length=len) (allow-none): + * @len: (out) : length + */ + + The (array length=len) annotation meant we don't pass in or + receive the len argument as this is handled under the hood + (Python's representation of an array, the list type, encapsulates + the length inside the type) + + * Fixing up the tests revealed a latent crasher bug when passing + None to an + interface that accepts an array. The fix was to check for NULL + and set + the length argument to 0 when invoking the bound method. + + https://bugzilla.gnome.org/show_bug.cgi?id=619235 + + gi/pygi-invoke.c | 6 +++++- + tests/test_everything.py | 4 ++-- + 2 files changed, 7 insertions(+), 3 deletions(-) + +commit e928ea9b1df9d87314ff8e93479530e26be9bd87 +Author: John (J5) Palmieri +Date: Fri May 14 14:57:27 2010 -0400 + + don't error out on methods with callbacks as return type + + * Right now we just throw an error which means API's like + gtk_about_dialog_set_url_hook aren't able to be called, + * this allows us to call such APIs while printing a warning, in + most cases + API such as this doesn't need to be used anymore and is a result of + early GTK development + + gi/pygi-argument.c | 14 +++++++++++--- + 1 files changed, 11 insertions(+), 3 deletions(-) + +commit d963007aab123f4e53a944a66a935db2d22907c2 +Author: John (J5) Palmieri +Date: Mon May 17 11:54:34 2010 -0400 + + reset sys.argv to the return value of Gtk.init_check + + * applications which check command line arguments will error out if it + encounters a GTK command line switch such as --g-fatal-warnings. + * The Gtk.init* API reads these switches and returns a new argv with + the GTK + switches stripped out + * In C argv is modified in place but in Python we must set sys.argv + to the + new modified argument list + * fixes https://bugzilla.gnome.org/show_bug.cgi?id=618889 + + gi/overrides/Gtk.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 897420ed97cc4a7b8a806894df5e76ed72617614 +Author: John (J5) Palmieri +Date: Wed May 12 14:25:32 2010 -0400 + + add GtkUIManager and GtkActionGroup overrides + + * fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=618476 + + gi/overrides/Gtk.py | 167 + ++++++++++++++++++++++++++++++++++++++++++++++- + tests/test_overrides.py | 45 +++++++++++++ + 2 files changed, 211 insertions(+), 1 deletions(-) + +commit 865939d29c1e9d69dbe6b9cf89477b5516dbff1f +Author: Zach Goldberg +Date: Thu May 13 01:02:24 2010 -0400 + + Bump version for development to 0.5.2 (hopefully 0.6) + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2674a9546b0246d4a75d71cf1708df77dc0173f9 +Author: Tomeu Vizoso +Date: Wed May 5 15:54:39 2010 +0200 + + Fix overrides.Gdk.Color.__new__ args + + https://bugzilla.gnome.org/show_bug.cgi?id=617757 + + gi/overrides/Gdk.py | 2 +- + tests/Makefile.am | 3 ++- + tests/test_overrides.py | 22 ++++++++++++++++++++++ + 3 files changed, 25 insertions(+), 2 deletions(-) + +commit c20b9f632a35bada1320ccc10fb7d5b2c06b9a88 +Author: John (J5) Palmieri +Date: Thu Apr 29 14:55:33 2010 -0400 + + wrap GObject module so we can go through GI when requesting attrs + + * This gives us the best of both worlds. + - We remain backwards compatable with pygobject by checking for + existing + attrs in the gobject module + - If an attr does not exist we use the GI mechanism to look it up + so that + things like flags look the same whether exported from GObject, Gtk + or any GI managed library + + * add DynamicGObjectModule tests and make tests use the new module + - change import gobject to from gi.repository import GObject + + gi/importer.py | 6 +- + gi/module.py | 30 +++++++++++++++ + tests/test_everything.py | 6 +- + tests/test_gi.py | 93 + +++++++++++++++++++++++++--------------------- + 4 files changed, 87 insertions(+), 48 deletions(-) + +commit 64324a4c629432b2e688299b6edbfd5da4439a2a +Author: John (J5) Palmieri +Date: Fri Apr 30 14:11:55 2010 -0400 + + override Gdk.Drawable to add cairo_create convinience method + + gi/overrides/Gdk.py | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +commit 17fa1289b1e2ed841dd5de09a2ec7c25d401886e +Author: Tomeu Vizoso +Date: Mon May 3 19:13:46 2010 +0200 + + Fix passing callbacks as constructor args + + https://bugzilla.gnome.org/show_bug.cgi?id=617551 + + gi/pygi-callbacks.c | 3 ++- + gi/pygi-callbacks.h | 1 + + gi/pygi-invoke.c | 7 +++++-- + tests/test_everything.py | 21 +++++++++++++++++++++ + 4 files changed, 29 insertions(+), 3 deletions(-) + +commit f9fff978d56ddf2c012b906169ae16abb7fdc2a5 +Author: Tomeu Vizoso +Date: Wed May 5 08:06:03 2010 +0200 + + Avoid freeing garbage + + gi/pygi-invoke.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +commit 5e20c018ae09a936f5ff140df5d1c133c98e98ba +Author: Tomeu Vizoso +Date: Thu Apr 29 13:09:03 2010 +0200 + + Only hookup vfunc implementations for locally-defined methods + + https://bugzilla.gnome.org/show_bug.cgi?id=617160 + + gi/types.py | 10 +++++++++- + tests/test_gi.py | 10 ++++++++++ + 2 files changed, 19 insertions(+), 1 deletions(-) + +commit 3e61e7d4450a2bb133c7f3862e0962a35339ce8d +Author: Tomeu Vizoso +Date: Mon May 3 18:35:13 2010 +0200 + + Fix passing GDestroyNotify + + https://bugzilla.gnome.org/show_bug.cgi?id=617542 + + gi/pygi-invoke.c | 3 ++- + tests/test_everything.py | 10 ++++++++++ + 2 files changed, 12 insertions(+), 1 deletions(-) + +commit 9669acd0fad193013ef3505ae231588307f9834c +Author: Tomeu Vizoso +Date: Mon May 3 12:23:58 2010 +0200 + + Move invocation code to its own file + + https://bugzilla.gnome.org/show_bug.cgi?id=617107 + + gi/Makefile.am | 2 + + gi/pygi-info.c | 884 + --------------------------------------------------- + gi/pygi-invoke.c | 909 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-invoke.h | 37 +++ + gi/pygi-private.h | 1 + + 5 files changed, 949 insertions(+), 884 deletions(-) + +commit 9b923a68dfde06fc2df6321b3f1e53f1c57b3666 +Author: John (J5) Palmieri +Date: Tue Apr 27 19:13:08 2010 -0400 + + Add the Gtk.Builder override + + gi/overrides/Gtk.py | 37 ++++++++++++++++++++++++++++++++++++- + 1 files changed, 36 insertions(+), 1 deletions(-) + +commit 9fc6783406b8263ebd67ceae2730b4e86689b43e +Author: Tomeu Vizoso +Date: Fri Apr 30 15:00:52 2010 +0200 + + Fix GAsyncReadyCallback + + https://bugzilla.gnome.org/show_bug.cgi?id=616236 + + gi/pygi-closure.c | 8 +++++++- + tests/test_everything.py | 16 ++++++++++++++++ + 2 files changed, 23 insertions(+), 1 deletions(-) + +commit 5657ccaaec09e2a3194ea2e9a923724bcc66759e +Author: Tomeu Vizoso +Date: Thu Apr 29 18:32:50 2010 +0200 + + Add override for Gdk.Color + + https://bugzilla.gnome.org/show_bug.cgi?id=617162 + + gi/overrides/Gdk.py | 20 +++++++++++++++++++- + 1 files changed, 19 insertions(+), 1 deletions(-) + +commit 4410abd589a2f64cfbd7bbcb4013fae9e4aa734f +Author: John (J5) Palmieri +Date: Wed Apr 28 13:19:48 2010 -0400 + + make __all__ be a list of strings, fix override mechanism to use + it correctly + + * before we were adding classes to the __all__ module property but + the convention is to use the name of the class + * simplified the check to just check the name against __all__ + instead of trying to get the class and then checking the class + against None as well as in __all__ + * went through all the overrides and made __all__ be a list of strings + + gi/module.py | 9 ++++----- + gi/overrides/GIMarshallingTests.py | 2 +- + gi/overrides/Gdk.py | 2 +- + 3 files changed, 6 insertions(+), 7 deletions(-) + +commit 64fa8f936bad9a90628df446e690d67d947a0a22 +Author: Tomeu Vizoso +Date: Mon Apr 26 11:41:06 2010 +0200 + + One more step at refactoring _wrap_g_function_info_invoke + + https://bugzilla.gnome.org/show_bug.cgi?id=616357 + + gi/pygi-callbacks.c | 22 +- + gi/pygi-callbacks.h | 4 +- + gi/pygi-info.c | 582 + +++++++++++++++++++++++++++++---------------------- + 3 files changed, 346 insertions(+), 262 deletions(-) + +commit 7fc5528273edae5ecdd5d8bdf0e5b898eec7a624 +Author: Zach Goldberg +Date: Tue Apr 20 23:23:38 2010 -0400 + + Step 1 of refactoring _wrap_g_function_info_invoke + + Original patch by David Malcom + + This patch bitrots *REALLY* fast. + + https://bugzilla.gnome.org/show_bug.cgi?id=616357 + + gi/pygi-info.c | 417 + +++++++++++++++++++++++++++++--------------------------- + 1 files changed, 214 insertions(+), 203 deletions(-) + +commit 1d9c6b6d76a3e27f66e6f0cfc7b16c5191e4fc22 +Author: Tomeu Vizoso +Date: Tue Apr 27 10:24:35 2010 +0200 + + Dont force subclasses to implement all virtual methods of their bases + + https://bugzilla.gnome.org/show_bug.cgi?id=616674 + + gi/types.py | 4 ++-- + tests/test_gi.py | 15 +++++++++++++++ + 2 files changed, 17 insertions(+), 2 deletions(-) + +commit 8a0c48f4dd512797e5cf132f8ec6fb6d4d1e7aaa +Author: Zach Goldberg +Date: Sun Apr 25 15:09:08 2010 -0400 + + Correct the reference counting of userdata in closure handling + + Without this we lose references on every call and eventually end up + free'ing objects + while they are still in use. + + https://bugzilla.gnome.org/show_bug.cgi?id=616786 + + gi/pygi-closure.c | 3 +++ + tests/test_everything.py | 13 +++++++++++++ + 2 files changed, 16 insertions(+), 0 deletions(-) + +commit 2b12049306bf57513c43d08017185468bf897a4a +Author: Zach Goldberg +Date: Tue Apr 20 22:57:14 2010 -0400 + + Change SCOPE_TYPE_INVALID handling to be a more verbose error. + + (Previous commit did not include the proper error message. I blame + git-bz) + + https://bugzilla.gnome.org/show_bug.cgi?id=616356 + + gi/pygi-closure.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 8240320d0b67074ce91bdf7aadcf5951c5a8c45a +Author: Zach Goldberg +Date: Tue Apr 20 23:53:57 2010 -0400 + + Force out arguments to be initialized as NULL. Comes with a test. + + This fix was motivated by a real world library which had a transfer + full + utf8 out argument which sometimes was not set. We would leave + the pointer + dangling and try and free it at the end of invoke() and crash. + Library refused + to change their behavior so we're forced to take care of it on + our end. + + https://bugzilla.gnome.org/show_bug.cgi?id=616043 + + gi/pygi-info.c | 1 + + tests/test_gi.py | 3 +++ + 2 files changed, 4 insertions(+), 0 deletions(-) + +commit 10e558ca283cdd06725bb0d24b5071ccbecc7d13 +Author: Zach Goldberg +Date: Tue Apr 20 22:57:14 2010 -0400 + + Change SCOPE_TYPE_INVALID handling to be a warning and not an error + + Be slightly nicer to library maintainers. It really isn't a fatal + condition + if we don't have a proper scope type, better to leave a good code + comment + and a warning than to cause their code to segv. + + https://bugzilla.gnome.org/show_bug.cgi?id=616356 + + gi/pygi-closure.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit d3b5fae9d609dbcd83deb0fa9102b24faf76787c +Author: Zach Goldberg +Date: Tue Apr 20 22:43:20 2010 -0400 + + Refactor implementation of scope call to allow for multiple calls + during lifetime of function invocation. + + https://bugzilla.gnome.org/show_bug.cgi?id=616343 + + gi/pygi-closure.c | 10 +++++----- + gi/pygi-info.c | 9 +++++++-- + tests/test_everything.py | 9 +++++++++ + 3 files changed, 21 insertions(+), 7 deletions(-) + +commit 3ba666b7ab9c393963922c272e7d87bff50a93f9 +Author: Tomeu Vizoso +Date: Sat Jan 2 16:31:55 2010 +0100 + + Add basic support for unions + + https://bugzilla.gnome.org/show_bug.cgi?id=603598 + + gi/module.py | 3 +- + gi/pygi-argument.c | 24 +++---------- + gi/pygi-boxed.c | 18 +++++++++- + gi/pygi-info.c | 94 + +++++++++++++++++++++++++++++++++++++++++++++++----- + gi/pygi-info.h | 1 + + tests/test_gi.py | 56 +++++++++++++++++++++++++++++++ + 6 files changed, 165 insertions(+), 31 deletions(-) + +commit af9e4e086d160fe7fb24758ed81753e784b198a8 +Author: Simon van der Linden +Date: Fri Jan 22 22:16:32 2010 +0100 + + Bump required GLib version to 2.22 + + Since PyGObject now depends on GLib 2.22.4, there is no need to + keep PyGI + backward-compatible. + + configure.ac | 2 +- + gi/pygi-private.h | 20 -------------------- + 2 files changed, 1 insertions(+), 21 deletions(-) + +commit c0f40de5648e2ebc556c449342a0025ffce2e33b +Author: Tomeu Vizoso +Date: Sun Apr 18 11:50:14 2010 -0400 + + Refactor get_* methods in the *Info wrappers + + https://bugzilla.gnome.org/show_bug.cgi?id=616108 + + gi/pygi-info.c | 360 + ++++++++++++++++++++++++++------------------------------ + 1 files changed, 168 insertions(+), 192 deletions(-) + +commit 24bb89f1310dc2fc8ee6ddaf945342ebf80055cd +Author: Tomeu Vizoso +Date: Tue Apr 20 15:12:47 2010 +0200 + + Print any error messages raised inside _pygi_closure_handle + + https://bugzilla.gnome.org/show_bug.cgi?id=616279 + + gi/pygi-closure.c | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +commit d1ba23cdd05686ea721425f233371d573a2e9cce +Author: Tomeu Vizoso +Date: Thu Apr 22 19:57:17 2010 +0200 + + Rename variable with a very generic name + + gi/module.py | 28 ++++++++++++++-------------- + 1 files changed, 14 insertions(+), 14 deletions(-) + +commit 391640b30ede50af3667b1019edb72bd79f2c68c +Author: Tomeu Vizoso +Date: Thu Apr 22 19:53:06 2010 +0200 + + Add support for enums without GType + + https://bugzilla.gnome.org/show_bug.cgi?id=616520 + + gi/module.py | 6 +++++- + gi/pygi-argument.c | 22 +++++++++++++++++++++- + gi/types.py | 14 ++++++++++++++ + tests/test_gi.py | 30 ++++++++++++++++++++++++++++-- + 4 files changed, 68 insertions(+), 4 deletions(-) + +commit 89704f60ddae0c81f1383d86491ef2785590a353 +Author: Zach Goldberg +Date: Tue Apr 20 22:20:42 2010 -0400 + + Bump version during development to 0.5.1 + + This follows what is, according to Colin Walters, + standard versioning practice. During development the + version in your config is the *next* version you will release, + not the version after. Thus after a release you make a new commit + bumping to the next development version. + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e203dc7c8f524c16aa52e15758dc3a2b09fbac75 +Author: John Ehresman +Date: Tue Apr 20 20:40:02 2010 -0400 + + Added missing , to keyword list of gio.GFile.set_attribute + + gio/gresolver.override | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 0b222f01ac9ceea1d127083623ad532ecc75bf7e +Author: John Ehresman +Date: Tue Apr 20 20:37:12 2010 -0400 + + Fix arg conversion in gio.GFile.set_attribute + + gio/gfile.override | 232 + ++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 227 insertions(+), 5 deletions(-) + +commit a579ccc8bea90937bf970be3d461e2b650b0c7d6 +Author: John Ehresman +Date: Tue Apr 20 20:01:53 2010 -0400 + + Set constants under python 2.5 or before + + gobject/gobjectmodule.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +commit 11fa39a861abf679e01b5f0da97be93ae0adf0f0 +Author: José Alburquerque +Date: Sun Apr 18 20:22:21 2010 -0400 + + Doc Extractor: Use replacements that make sense for &...; + expressions. + + * codegen/docextract_to_xml.py: Use # and   respectively + for + # (#) and  . These are interpreted correctly in XML + and will + not make the parsing crash. + + codegen/docextract_to_xml.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 8dbc2cb016acef7b364804cd9bc8f0b1da37e84b +Author: Zach Goldberg +Date: Sun Apr 18 14:32:06 2010 -0400 + + Bump version for release 0.5.0 + + HACKING | 7 +++++++ + configure.ac | 4 ++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +commit 3293c91d90c5c497b45e42a527d7f79f7435823e +Author: Tomeu Vizoso +Date: Sun Apr 18 14:28:13 2010 -0400 + + One more missing file... + + examples/Makefile.am | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 1dc575af19fe985cc3fa3ec0cf18aeab1f43c16d +Author: Tomeu Vizoso +Date: Sun Apr 18 14:18:44 2010 -0400 + + Add more stuff to the tarballs + + Makefile.am | 8 +++++++- + configure.ac | 1 + + 2 files changed, 8 insertions(+), 1 deletions(-) + +commit 8a9bb04755057e934b7f46c917af6ef281a2fedd +Author: Tomeu Vizoso +Date: Sun Apr 18 13:48:45 2010 -0400 + + Add one more missing file to tarballs + + gi/overrides/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 979e01852fc7f830ee91093accdc387fa535075f +Author: Tomeu Vizoso +Date: Sun Apr 18 13:45:29 2010 -0400 + + Add missing file to tarballs + + tests/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 8b70faa7a9a32b9ea8862f28a503e38f496cfd89 +Author: Tomeu Vizoso +Date: Sun Apr 18 13:11:11 2010 -0400 + + Implement vfuncs. + + https://bugzilla.gnome.org/show_bug.cgi?id=602736 + + gi/gimodule.c | 89 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-argument.c | 1 + + gi/pygi-callbacks.c | 3 +- + gi/pygi-closure.c | 4 +- + gi/pygi-closure.h | 2 +- + gi/pygi-info.c | 86 + ++++++++++++++++++++++++++++++++++++++++++++++++- + gi/pygi-info.h | 1 + + gi/types.py | 44 +++++++++++++++++-------- + tests/test_gi.py | 18 ++++++++++ + 9 files changed, 227 insertions(+), 21 deletions(-) + +commit e239faacb4798fe2d166233ca1a19a843a6225e3 +Author: Zach Goldberg +Date: Sun Apr 18 11:59:06 2010 -0400 + + Fix a typo in pygi-callbacks.c header + + gi/pygi-callbacks.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 79aa416ae8632b123da61d79fb820d9e2704209c +Author: Zach Goldberg +Date: Sat Apr 17 12:00:05 2010 -0400 + + Implement nullable argument support, including tests + + https://bugzilla.gnome.org/show_bug.cgi?id=616035 + + gi/pygi-argument.c | 43 + +++++++++++++++++++++++++++++++++++++------ + gi/pygi-argument.h | 3 ++- + gi/pygi-info.c | 19 +++++++++++++------ + tests/test_everything.py | 28 ++++++++++++++++++++++++++++ + 4 files changed, 80 insertions(+), 13 deletions(-) + +commit 7d533b8893bc4a8a82fd9708278fa1dce5d3551e +Author: Zach Goldberg +Date: Sat Apr 17 12:56:19 2010 -0400 + + Move some tests from test_gi to test_everything + + tests/test_everything.py | 60 + ++++++++++++++++++++++++++++++++++++++++++++ + tests/test_gi.py | 62 + +--------------------------------------------- + 2 files changed, 61 insertions(+), 61 deletions(-) + +commit a90298cc9e6c0f336f887a71d80b1efd07ec2811 +Author: Tomeu Vizoso +Date: Sun Apr 18 10:44:35 2010 -0400 + + Update to latest version of the pygi-convert.sh script + + pygi-convert.sh | 193 + +++++++++++++++++++++++++++++++++++++++---------------- + 1 files changed, 137 insertions(+), 56 deletions(-) + +commit 34a39318c674737c6d64f2430456daef86ba1626 +Author: Colin Walters +Date: Sun Apr 18 10:40:44 2010 -0400 + + Add Tomeu's prototype script for converting pygtk to pygi + + pygi-convert.sh | 71 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 71 insertions(+), 0 deletions(-) + +commit a3afdb5fd33de0bf11d63857a245a8f5edec242c +Author: Olav Vitters +Date: Sun Apr 18 13:01:58 2010 +0200 + + Fix doap file + + pygi.doap | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 0de73d0bba79f92af22f43693f3575c596712416 +Author: Zach Goldberg +Date: Sat Apr 17 16:01:31 2010 -0400 + + Add Zach Goldberg as a pygi maintainer + + pygi.doap | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit a0e22e36e8cf0c1e0da3c0ec48c821fdb5a07ccd +Author: Tomeu Vizoso +Date: Sat Apr 17 11:47:54 2010 -0400 + + Require PyCairo - Add myself to maintainers + configure.ac | 7 +------ + 1 files changed, 1 insertions(+), 6 deletions(-) - MAINTAINERS | 4 ++++ - pygobject.doap | 7 +++++++ - 2 files changed, 11 insertions(+), 0 deletions(-) +commit 2778f8a1bf6379a46beec6546c8efcb0fec2d7ad +Author: Tomeu Vizoso +Date: Sat Apr 17 11:40:14 2010 -0400 -commit 46c91a11d448e5e11d142d3362aff1483226bca4 -Author: Colin Walters -Date: Wed May 5 13:54:27 2010 -0400 + Add examples/cairo-demo.py - Clear error if we failed the import + examples/cairo-demo.py | 121 + ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 121 insertions(+), 0 deletions(-) - Otherwise we leave the exception set which causes bizarre problems - later in unrelated code. +commit 610dd1eec87fab5c8c3badb4d104cba74477c745 +Author: Zach Goldberg +Date: Sat Apr 17 09:17:14 2010 -0400 - https://bugzilla.redhat.com/show_bug.cgi?id=569885 + Implementation callback support with scoping and basic argument + support. - https://bugzilla.gnome.org/show_bug.cgi?id=617796 + This patch was originally written by + Zach Goldberg with modifications and + review by Simon van der Linden and + Colin Walters . - gobject/pygi-external.h | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) + This impementation enforces the assumption that any one function + signature can only have one (callback, userdata, destronotify) tuple. + This allows us to move callback creation into the actual function + invoke pipeline and also to keep just one destroy notify callback + around, vastly simplifying the code. -commit e203dc7c8f524c16aa52e15758dc3a2b09fbac75 -Author: John Ehresman -Date: Tue Apr 20 20:40:02 2010 -0400 + https://bugzilla.gnome.org/show_bug.cgi?id=603095 - Added missing , to keyword list of gio.GFile.set_attribute + configure.ac | 2 + + gi/Makefile.am | 4 + + gi/pygi-argument.c | 12 ++- + gi/pygi-callbacks.c | 216 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-callbacks.h | 47 +++++++++++ + gi/pygi-closure.c | 205 + ++++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-closure.h | 57 ++++++++++++++ + gi/pygi-info.c | 49 +++++++++++- + gi/pygi-private.h | 2 + + tests/test_gi.py | 64 +++++++++++++++- + 10 files changed, 648 insertions(+), 10 deletions(-) - gio/gresolver.override | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) +commit a34cb9f0038a6c89e5e6c5f7761d48a5a833044f +Author: Tomeu Vizoso +Date: Sat Apr 17 10:54:45 2010 -0400 -commit 0b222f01ac9ceea1d127083623ad532ecc75bf7e -Author: John Ehresman -Date: Tue Apr 20 20:37:12 2010 -0400 + Add support for foreign structs - Fix arg conversion in gio.GFile.set_attribute + https://bugzilla.gnome.org/show_bug.cgi?id=603712 - gio/gfile.override | 232 - ++++++++++++++++++++++++++++++++++++++++++++++++++- - 1 files changed, 227 insertions(+), 5 deletions(-) + configure.ac | 6 ++ + gi/Makefile.am | 10 +++- + gi/gimodule.c | 7 +++ + gi/pygi-argument.c | 27 +++++++++- + gi/pygi-foreign-cairo.c | 103 ++++++++++++++++++++++++++++++++++++++ + gi/pygi-foreign-cairo.h | 55 ++++++++++++++++++++ + gi/pygi-foreign.c | 123 + ++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-foreign.h | 52 +++++++++++++++++++ + gi/pygi-private.h | 1 + + tests/test_everything.py | 48 ++++++++++++++++++ + 10 files changed, 428 insertions(+), 4 deletions(-) -commit a579ccc8bea90937bf970be3d461e2b650b0c7d6 -Author: John Ehresman -Date: Tue Apr 20 20:01:53 2010 -0400 +commit e73b6f6fe8b5f23a2a390ae0a6bbced593ded155 +Author: Tomeu Vizoso +Date: Fri Apr 16 14:35:13 2010 -0400 - Set constants under python 2.5 or before + Allow creating structs with pointers - gobject/gobjectmodule.c | 8 ++++++++ - 1 files changed, 8 insertions(+), 0 deletions(-) + https://bugzilla.gnome.org/show_bug.cgi?id=603537 -commit 11fa39a861abf679e01b5f0da97be93ae0adf0f0 -Author: José Alburquerque -Date: Sun Apr 18 20:22:21 2010 -0400 + gi/pygi-struct.c | 6 ------ + tests/test_gi.py | 3 ++- + 2 files changed, 2 insertions(+), 7 deletions(-) - Doc Extractor: Use replacements that make sense for &...; - expressions. +commit fc9ff02e53aacf9e77625c70985e99813544912a +Author: Tomeu Vizoso +Date: Fri Apr 16 10:40:40 2010 -0400 - * codegen/docextract_to_xml.py: Use # and   respectively - for - # (#) and  . These are interpreted correctly in XML - and will - not make the parsing crash. + Add gdb and valgrind variants for the tests - codegen/docextract_to_xml.py | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) + HACKING | 19 +++++++++++++++++++ + Makefile.am | 12 ++++++++++++ + tests/Makefile.am | 14 +++++++++++++- + 3 files changed, 44 insertions(+), 1 deletions(-) commit 695ac7bc5c60371a32538d690c7a15509f3c9637 Author: John Stowers @@ -306,6 +9282,56 @@ Date: Thu Apr 15 22:48:28 2010 +1200 glib/pygiochannel.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) +commit c5f6af4844c74354abc508d17969d9d45153acf2 +Author: Tomeu Vizoso +Date: Thu Apr 15 14:25:59 2010 -0400 + + Add metadata to the .doap file + + pygi.doap | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 81796cb77cbe6b9598a652bd63c047af93e747ee +Author: John (J5) Palmieri +Date: Wed Apr 14 12:01:43 2010 -0400 + + override that wasn't checked in - fixes some test cases + + gi/overrides/GIMarshallingTests.py | 69 + ++++++++++++++++++++++++++++++++++++ + 1 files changed, 69 insertions(+), 0 deletions(-) + +commit de5d2ea1584b01af809346316c7fbd4955a9db1d +Author: Colin Walters +Date: Wed Apr 14 10:06:07 2010 -0400 + + [Makefile.am] Clean up CFLAGS handling, don't override all: target + + First, we should move the CFLAGS into AM_CFLAGS, otherwise the + per-target CFLAGS forces Automake to prefix object files, which + is unnecessary since we only have one target. + + More importantly, avoid overriding the all: target here; that's + owned by Automake. Use all-local instead to append things to + the end of the normal build. + + gi/Makefile.am | 15 +++++++++------ + 1 files changed, 9 insertions(+), 6 deletions(-) + +commit 5a47e96e3f580c973e6880dafa747f54c144c760 +Author: Tomeu Vizoso +Date: Tue Apr 13 19:15:49 2010 -0400 + + Use GIMarshallingTests (old TestGI) in gobject-introspection + + gi/overrides/TestGI.py | 69 -- + tests/Makefile.am | 40 - + tests/libtestgi.c | 2924 + ------------------------------------------------ + tests/libtestgi.h | 628 ----------- + tests/test_gi.py | 832 +++++++------- + 5 files changed, 416 insertions(+), 4077 deletions(-) + commit 681832c3cd040433a488a400693b68f213bf7078 Author: José Alburquerque Date: Tue Apr 13 13:33:12 2010 -0400 @@ -459,6 +9485,15 @@ Date: Sun Apr 11 15:45:09 2010 -0400 codegen/docextract_to_xml.py | 87 ++++++-- 2 files changed, 414 insertions(+), 112 deletions(-) +commit 9fef1acb42cd900d4a814a7378f60bc189121785 +Author: Tomeu Vizoso +Date: Fri Apr 9 13:47:03 2010 +0200 + + Always create the .so link + + gi/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + commit e9f7fd414e94595e40eb1ba0fc471ca69136d82f Author: Paul Bolle Date: Thu Apr 8 11:52:25 2010 +0200 @@ -489,6 +9524,32 @@ Date: Mon Apr 5 18:10:42 2010 +0200 ---------------------------------------------- 4 files changed, 0 insertions(+), 718 deletions(-) +commit ef0ceb266a45715ece58642fb0042e3376416755 +Author: Simon van der Linden +Date: Wed Feb 3 20:33:03 2010 +0100 + + Add modelines and copyright information to overrides modules + + gi/overrides/Gdk.py | 21 +++++++++++++++++++++ + gi/overrides/Gtk.py | 21 +++++++++++++++++++++ + gi/overrides/TestGI.py | 20 ++++++++++++++++++++ + 3 files changed, 62 insertions(+), 0 deletions(-) + +commit 5106523a4b8378997a1e6cb0488398aa73e7d9d5 +Author: Simon van der Linden +Date: Wed Feb 3 20:29:55 2010 +0100 + + Fix and complete overrides tests + + Those tests were missing in the last commit + + https://bugzilla.gnome.org/show_bug.cgi?id=602830 + + gi/overrides/TestGI.py | 49 + ++++++++++++++++++++++++++++++++++++++++++++++++ + tests/test_gi.py | 8 ++++++- + 2 files changed, 56 insertions(+), 1 deletions(-) + commit 23fc0f615d87994acafd9d39e92dd92b587fc2eb Author: Simon van der Linden Date: Thu Jan 21 17:30:51 2010 +0100 @@ -503,6 +9564,59 @@ Date: Thu Jan 21 17:30:51 2010 +0100 gobject/pygpointer.c | 6 +----- 4 files changed, 3 insertions(+), 16 deletions(-) +commit aefac8c5f64bf059dd6652f8a843d17b34fa0854 +Author: Simon van der Linden +Date: Fri Jan 22 22:22:37 2010 +0100 + + Remove support for pointers to basic types as input-only argument + and return value + + There is no reason for an API to use such things, and + g_function_info_invoke + broke such features. + + https://bugzilla.gnome.org/show_bug.cgi?id=607759 + + gi/pygi-argument.c | 586 ++++------------------------------------------ + gi/pygi-argument.h | 1 - + gi/pygi-info.c | 8 +- + tests/libtestgi.c | 660 + ---------------------------------------------------- + tests/libtestgi.h | 86 ------- + tests/test_gi.py | 144 ------------ + 6 files changed, 47 insertions(+), 1438 deletions(-) + +commit eaf7cb8ebb7e34f9493ac83b2f04af4dcf45f40f +Author: Simon van der Linden +Date: Fri Jan 22 13:41:21 2010 +0100 + + Restore the overrides support + + Add a ModuleProxy in front of the DynamicModule when an overrides + module is + present. There is no need for an overrides module to be a class; + it can just be a module. + + Add an override decorator to override the wrapper of a registered + type. + + Adapt Gdk and Gtk accordingly. + + Add tests. + + https://bugzilla.gnome.org/show_bug.cgi?id=602830 + + gi/importer.py | 40 +++++++------------- + gi/module.py | 43 ++++++++++++++------- + gi/overrides/Gdk.py | 42 +++++++++++++------- + gi/overrides/Gtk.py | 16 +++---- + gi/types.py | 6 +++ + tests/libtestgi.c | 105 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + tests/libtestgi.h | 49 ++++++++++++++++++++++++ + tests/test_gi.py | 36 +++++++++++++++++ + 8 files changed, 273 insertions(+), 64 deletions(-) + commit 289d641775d1ea52d2a5379126b70b7fcee46683 Author: Tomeu Vizoso Date: Sun Jan 10 21:01:59 2010 +0100 @@ -514,6 +9628,49 @@ Date: Sun Jan 10 21:01:59 2010 +0100 gio/gcancellable.override | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) +commit b11cf2595987c1f0fc4ffd834f07c98b92aa2355 +Author: Simon van der Linden +Date: Fri Jan 8 21:10:28 2010 +0100 + + Initialize struct fields to 0 when allocating + + gi/pygi-struct.c | 2 +- + tests/test_gi.py | 5 +++++ + 2 files changed, 6 insertions(+), 1 deletions(-) + +commit b4189be2b2d3c350fdf33e27309bee5a72e4f72a +Author: Simon van der Linden +Date: Fri Jan 8 20:33:44 2010 +0100 + + Don't set a default constructor for structures. + + Update tests accordingly. + + The reason for this change is that setting __new__ in the metaclass + doesn't let + one overrides it afterwards, in a subclass (in my experience, at + least, even + though it seems weird). + + https://bugzilla.gnome.org/show_bug.cgi?id=603536 + + gi/types.py | 35 +++++++---------------------------- + tests/libtestgi.c | 33 --------------------------------- + tests/libtestgi.h | 7 ------- + tests/test_gi.py | 21 ++++++++++----------- + 4 files changed, 17 insertions(+), 79 deletions(-) + +commit 4db68b958ea11bd2c3a88067cae03fd6bdd1d24b +Author: Simon van der Linden +Date: Tue Jan 5 13:36:44 2010 +0100 + + Suppress compilation warnings + + gi/pygi-argument.c | 3 ++- + gi/pygi-boxed.c | 2 -- + gi/pygobject-external.h | 2 +- + 3 files changed, 3 insertions(+), 4 deletions(-) + commit 4e2efa91d101bf755739e1cca8eee41eb0ad20fd Author: Gian Mario Tagliaretti Date: Mon Jan 4 08:35:14 2010 +0100 @@ -525,6 +9682,20 @@ Date: Mon Jan 4 08:35:14 2010 +0100 Makefile.am | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-) +commit 8ddcbca0e98e0b0c082170a2b2b6cfcbd7864b40 +Author: Simon van der Linden +Date: Fri Dec 11 22:24:30 2009 +0100 + + sys.path must be modified after pygtk is imported + + Otherwise, sys.path is overridden by pygtk and gi.repository is + loaded from the + system's default site-package directory. + + tests/runtests.py | 1 - + tests/test_gi.py | 3 +++ + 2 files changed, 3 insertions(+), 1 deletions(-) + commit 284a1e1c0143c95d3007cf58e6c248b5d11fb4d1 Author: Gian Mario Tagliaretti Date: Sun Jan 3 11:02:57 2010 +0100 @@ -1123,6 +10294,36 @@ Date: Fri Aug 14 15:10:26 2009 +0200 gobject/pygtype.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) +commit 828d0f042b59ea0319f33a23803c179af34ef2f1 +Author: Tomeu Vizoso +Date: Tue Dec 22 18:05:47 2009 +0100 + + Add Gtk.keysyms to overrides + + gi/overrides/Gtk.py | 2 + + gi/overrides/Makefile.am | 1 + + gi/overrides/keysyms.py | 1499 + ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 1502 insertions(+), 0 deletions(-) + +commit 24fa1224ff00b9da177e0bfaa1e14e1b899e4976 +Author: Tomeu Vizoso +Date: Wed Nov 25 10:33:56 2009 +0100 + + The array field 'length' starts to count from the C arg list, so + need to decrement when it's a method + + https://bugzilla.gnome.org/show_bug.cgi?id=602640 + + gi/pygi-argument.c | 11 ++++++++- + gi/pygi-argument.h | 3 +- + gi/pygi-info.c | 14 ++++++++++- + tests/libtestgi.c | 60 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + tests/libtestgi.h | 4 +++ + tests/test_gi.py | 15 +++++++++++++ + 6 files changed, 103 insertions(+), 4 deletions(-) + commit 867536c6734e606d045760837ed22583da06566e Author: Gian Mario Tagliaretti Date: Fri Dec 18 10:50:09 2009 +0100 @@ -1185,6 +10386,33 @@ Date: Thu Dec 17 02:24:45 2009 +0100 gio/gio-types.defs | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) +commit e955b931b07113c7432f7a85f882f69f12d263ad +Author: Anderson Lizardo +Date: Mon Nov 30 22:01:25 2009 +0100 + + Depend on GLib 2.20 rather than 2.22 + + Backport g_array_get_element_size. + + https://bugzilla.gnome.org/show_bug.cgi?id=603411 + + configure.ac | 2 +- + gi/pygi-private.h | 19 +++++++++++++++++++ + 2 files changed, 20 insertions(+), 1 deletions(-) + +commit 542fdf6da4ad8f2d28d0d50152bd93cb4d8ee39a +Author: Tomeu Vizoso +Date: Sat Nov 28 18:48:19 2009 +0000 + + Use the limit constants from glib and interpret G_MAXUINT32 as + PyLong_FromLongLong + + https://bugzilla.gnome.org/show_bug.cgi?id=602384 + + gi/pygi-argument.c | 14 +++++++------- + tests/test_gi.py | 18 +++++++++--------- + 2 files changed, 16 insertions(+), 16 deletions(-) + commit 38e89942d29f2a1dba47ab4a8d5edc84322707cd Author: Simon van der Linden Date: Mon Nov 30 00:10:56 2009 +0100 @@ -1196,6 +10424,90 @@ Date: Mon Nov 30 00:10:56 2009 +0100 gobject/generate-constants.c | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) +commit cfa7d005487e17e8f7c1ceb14282d3a5baadb736 +Author: Simon van der Linden +Date: Sat Nov 28 00:22:21 2009 +0100 + + Remove global checks for pointers and move them in type cases that + need them + + gi/pygi-argument.c | 516 + ++++++++++++++++++++++++++++++++++++++++++---------- + gi/pygi-info.c | 333 +++++++++++++++++---------------- + 2 files changed, 596 insertions(+), 253 deletions(-) + +commit d1ae73f3cf7cebdb74c9ec56b08928a2a53b9de6 +Author: Johan Dahlin +Date: Mon Nov 23 15:58:17 2009 -0200 + + Pythonify. Avoid ; and () around if statements + + https://bugzilla.gnome.org/show_bug.cgi?id=602830 + + gi/types.py | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +commit a8660621679c629fc81320a8ddf5bf2c7ee1f177 +Author: Johan Dahlin +Date: Tue Nov 24 10:36:18 2009 -0200 + + Remove trailing whitespace + + https://bugzilla.gnome.org/show_bug.cgi?id=602830 + + gi/module.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 66c34805223af9e63c7d61f21a3dbd7505a8f256 +Author: Tomeu Vizoso +Date: Mon Nov 30 10:03:34 2009 +0000 + + Set a default constructor for boxed structs that don't have one + + https://bugzilla.gnome.org/show_bug.cgi?id=602735 + + gi/Makefile.am | 2 + + gi/gimodule.c | 1 + + gi/module.py | 2 +- + gi/pygi-argument.c | 14 ++++- + gi/pygi-boxed.c | 184 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-boxed.h | 40 +++++++++++ + gi/pygi-info.c | 2 +- + gi/pygi-private.h | 1 + + gi/pygi.h | 6 ++ + gi/types.py | 18 ----- + tests/libtestgi.c | 72 ++++++++++---------- + tests/libtestgi.h | 18 +++--- + tests/test_gi.py | 47 ++++++++------ + 13 files changed, 321 insertions(+), 86 deletions(-) + +commit e7e2fccae36c28c7e9f288fcd4c90a001140e307 +Author: Tomeu Vizoso +Date: Mon Nov 30 10:53:57 2009 +0000 + + Revert "Use the limit constants from glib and interpret G_MAXUINT32 + as PyLong_FromLongLong" + + This reverts commit 05a2ed55f3e5d2620de8b3b6b0d99e928ef3b041. + + gi/pygi-argument.c | 14 +++++++------- + tests/test_gi.py | 18 +++++++++--------- + 2 files changed, 16 insertions(+), 16 deletions(-) + +commit 05a2ed55f3e5d2620de8b3b6b0d99e928ef3b041 +Author: Tomeu Vizoso +Date: Sat Nov 28 18:48:19 2009 +0000 + + Use the limit constants from glib and interpret G_MAXUINT32 as + PyLong_FromLongLong + + https://bugzilla.gnome.org/show_bug.cgi?id=602384 + + gi/pygi-argument.c | 14 +++++++------- + tests/test_gi.py | 18 +++++++++--------- + 2 files changed, 16 insertions(+), 16 deletions(-) + commit e24d155dd7b4a5b9c25c054137d1370c369d3192 Author: Tomeu Vizoso Date: Sat Nov 28 18:45:54 2009 +0000 @@ -1222,10 +10534,94 @@ Date: Sat Nov 28 18:47:26 2009 +0100 Wrap new API added in GIO 2.22 - gio/gio-types.defs | 138 ++++ - gio/gio.defs | 2012 - +++++++++++++++++++++++++++++++++++++++++++++++++++- - 2 files changed, 2144 insertions(+), 6 deletions(-) + gio/gio-types.defs | 138 +++ + gio/gio.defs | 2444 + +++++++++++++++++++++++++++++++++++++++++++++++----- + 2 files changed, 2360 insertions(+), 222 deletions(-) + +commit 96f6c638709636d7e2ddf560b877879691da3314 +Author: Tomeu Vizoso +Date: Sat Nov 28 11:03:51 2009 +0000 + + A few tests about interfaces + + https://bugzilla.gnome.org/show_bug.cgi?id=601181 + + tests/libtestgi.c | 23 +++++++++++++++++++++++ + tests/libtestgi.h | 16 ++++++++++++++++ + tests/test_gi.py | 21 +++++++++++++++++++++ + 3 files changed, 60 insertions(+), 0 deletions(-) + +commit 076ba3156c13375a75983cef7a409c8c8afea119 +Author: Simon van der Linden +Date: Thu Nov 26 23:50:54 2009 +0100 + + Fix members initialization in metaclasses + + In metaclasses, the test for the name of the class was wrong, since it + prevented one to create a subclass with the same name (especially + annoying for + overrides). Now, if a GType is available from the info, the fact + that it + doesn't have any wrapper yet means that the metaclass is creating + the base + class, which will be registerd just after its creation. This is + true for + objects, and for structures registered as boxed or pointer too. + + This patch includes a test for basic subclassing in Python. It + notably tests + that methods don't get overridden by the metaclass. + + gi/types.py | 5 +++-- + tests/test_gi.py | 19 +++++++++++++++++++ + 2 files changed, 22 insertions(+), 2 deletions(-) + +commit ac80e64c9f7d257865aa820753e52d56cf2871c8 +Author: Tomeu Vizoso +Date: Fri Nov 27 12:06:59 2009 +0000 + + Structs in arrays are not marshalled correctly + + https://bugzilla.gnome.org/show_bug.cgi?id=602709 + + gi/pygi-argument.c | 29 ++++++++++++++++++++++++----- + tests/libtestgi.c | 23 ++++++++++++++++++++++- + tests/libtestgi.h | 7 +++++-- + tests/test_gi.py | 8 ++++++++ + 4 files changed, 59 insertions(+), 8 deletions(-) + +commit 4a373b8ad6ec137e911b92a3e745e0fd76541292 +Author: Simon van der Linden +Date: Wed Nov 25 16:53:55 2009 +0100 + + Use the right variable when looking up in sys.modules + + gi/importer.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit fc3dca018e85aee34ade79d104ebd8cdd1dd5968 +Author: Tomeu Vizoso +Date: Tue Nov 24 15:52:47 2009 +0100 + + Accept 0 as a valid value for flag and enum arguments + + https://bugzilla.gnome.org/show_bug.cgi?id=602638 + + gi/pygi-argument.c | 19 ++++++++++++++++++- + tests/libtestgi.c | 6 ++++++ + tests/libtestgi.h | 1 + + tests/test_gi.py | 1 + + 4 files changed, 26 insertions(+), 1 deletions(-) + +commit 33081c29a1c2fdec2b8bfe17ae0a72b8db7a8d84 +Author: Tomeu Vizoso +Date: Tue Nov 24 13:10:11 2009 +0100 + + Add stuff to .gitignore + + .gitignore | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) commit 5c010fe673d9bd01c27c8d7d312064665275888c Author: Simon van der Linden @@ -1252,6 +10648,52 @@ Date: Mon Nov 23 22:39:12 2009 +0100 tests/test_girepository.py | 386 ------------ 16 files changed, 1 insertions(+), 3174 deletions(-) +commit a644edf0515c26ed027522891ccf02aceac764e8 +Author: Johan Dahlin +Date: Mon Nov 23 15:32:16 2009 -0200 + + Create overridden modules in two passes + + This patch splits overridden module creation into two passes. The + first pass + creates the auto-generated module normally before the overridden + module is + attempted to be imported. The second pass imports the overridden + module and + replaces the auto-generated module with the overridden. This is + necessary + for the overridden modules to be able to access the auto-generated + ones. + + gi/importer.py | 34 +++++++++++++++++++++------------- + 1 files changed, 21 insertions(+), 13 deletions(-) + +commit fad89e12a744b57e6348968f351d25d167de8248 +Author: Tomeu Vizoso +Date: Sun Nov 22 17:56:20 2009 +0100 + + Add support for Any arguments + + https://bugzilla.gnome.org/show_bug.cgi?id=601253 + + gi/pygi-argument.c | 20 ++++++++++++-------- + tests/libtestgi.c | 5 +++++ + tests/libtestgi.h | 5 +++++ + tests/test_gi.py | 5 +++++ + 4 files changed, 27 insertions(+), 8 deletions(-) + +commit 1dc62a998dd8d2a0a397f8309011a8d79cb56034 +Author: Tomeu Vizoso +Date: Sun Nov 22 17:25:04 2009 +0100 + + Register interfaces + + https://bugzilla.gnome.org/show_bug.cgi?id=601181 + + gi/gimodule.c | 33 +++++++++++++++++++++++++++++++++ + gi/types.py | 5 ++++- + 2 files changed, 37 insertions(+), 1 deletions(-) + commit d67d5afb5115c1d8294415b2e1a82af2c737ba17 Author: Paul Pogonyshev Date: Sun Nov 22 18:23:02 2009 +0200 @@ -1273,6 +10715,49 @@ Date: Sun Nov 22 18:22:23 2009 +0200 tests/test_properties.py | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) +commit 6ccf58afcf58e118903ced0135f0fe69b00e09ad +Author: Tomeu Vizoso +Date: Mon Oct 26 18:06:06 2009 +0000 + + Treat GI_INFO_TYPE_INTERFACE same as GI_INFO_TYPE_OBJECT + + gi/pygi-argument.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit e6f730d6e1431e36bd5f6b503a1038617f8d1e7d +Author: Simon van der Linden +Date: Sat Nov 14 21:42:43 2009 +0100 + + Import pygtk properly to avoid failure on some setups + + tests/test_gi.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit e604a89e9dc1a79687ef5fb94af7a2182be07dfb +Author: Alex Dedul +Date: Sat Nov 14 21:39:15 2009 +0100 + + Search for python-config-${VERSION} when python${VERSION}-config is + not found + + On Gentoo, notably, the config tool is named python-config-${VERSION}, + while on + Fedora and Ubuntu, it is named python${VERSION}-config. + + Signed-off-by: Simon van der Linden + + configure.ac | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +commit 4a887cfabb326cb99dc65073d592c03f59e2f141 +Author: Simon van der Linden +Date: Sat Nov 14 21:36:19 2009 +0100 + + Fix silent rules setup + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + commit 602afea88c338a38327cd84e08703c5daa384ec6 Author: Paul Pogonyshev Date: Tue Nov 10 22:32:33 2009 +0200 @@ -1287,6 +10772,20 @@ Date: Tue Nov 10 22:32:33 2009 +0200 glib/glibmodule.c | 16 ++++++++++++++ 2 files changed, 23 insertions(+), 29 deletions(-) +commit 734755912fff11332dc0e96317b7d6b7c4014e6a +Author: Simon van der Linden +Date: Mon Nov 9 22:44:12 2009 +0100 + + Remove PyGObject patches since they've been merged to master + + ...pytype-aware-of-the-interface-enum-flags-.patch | 78 -------- + patches/0002-Fix-girpository-build-setup.patch | 186 + ------------------ + ...capabilities-to-import-wrappers-from-pygi.patch | 200 + -------------------- + ...ances-by-calling-tp_alloc-rather-than-PyO.patch | 29 --- + 4 files changed, 0 insertions(+), 493 deletions(-) + commit 6a69288941e65312fe82649ec72d2f21b2dc618f Author: Simon van der Linden Date: Sat Nov 7 23:42:07 2009 +0100 @@ -1327,6 +10826,92 @@ Date: Sat Nov 7 16:43:35 2009 +0100 gobject/pygpointer.c | 11 ++++++++ 5 files changed, 105 insertions(+), 0 deletions(-) +commit fdfbc90dbc9e305646b62d73de506b5e0e99cc91 +Author: Simon van der Linden +Date: Sun Nov 8 20:03:58 2009 +0100 + + Update PyGObject patches + + A file, pygi-external.h, was missing in patch #3. + + ...capabilities-to-import-wrappers-from-pygi.patch | 74 + ++++++++++++++++++-- + ...ances-by-calling-tp_alloc-rather-than-PyO.patch | 2 +- + 2 files changed, 69 insertions(+), 7 deletions(-) + +commit 8f53ca8a72f9958711765281dd5c5bdfb7042d7d +Author: Tomeu Vizoso +Date: Sun Nov 8 16:52:18 2009 +0100 + + Add myself to pygi.doap + + pygi.doap | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 6f50d5102aec9288e1851f12e9d232b9c141d524 +Author: Simon van der Linden +Date: Sun Nov 8 15:40:51 2009 +0100 + + Add a doap file + + pygi.doap | 17 +++++++++++++++++ + 1 files changed, 17 insertions(+), 0 deletions(-) + +commit ce673b9027868e6add4eeb438bc707eb40bfd046 +Author: Simon van der Linden +Date: Sun Nov 8 13:06:54 2009 +0100 + + Add PyGObject patches + + ...pytype-aware-of-the-interface-enum-flags-.patch | 78 ++++++++ + patches/0002-Fix-girpository-build-setup.patch | 186 + ++++++++++++++++++++ + ...capabilities-to-import-wrappers-from-pygi.patch | 138 +++++++++++++++ + ...ances-by-calling-tp_alloc-rather-than-PyO.patch | 29 +++ + 4 files changed, 431 insertions(+), 0 deletions(-) + +commit b24fd9633cabe1d95cde173a04e9a49833b06a26 +Author: Simon van der Linden +Date: Sun Nov 8 12:35:08 2009 +0100 + + Initial import + + .gitignore | 33 + + Makefile.am | 10 + + autogen.sh | 159 +++ + configure.ac | 53 + + gi/Makefile.am | 50 + + gi/__init__.py | 24 + + gi/gimodule.c | 144 ++ + gi/importer.py | 89 ++ + gi/module.py | 167 +++ + gi/overrides/Gdk.py | 21 + + gi/overrides/Gtk.py | 13 + + gi/overrides/Makefile.am | 10 + + gi/pygi-argument.c | 1976 ++++++++++++++++++++++++++ + gi/pygi-argument.h | 65 + + gi/pygi-info.c | 2093 ++++++++++++++++++++++++++++ + gi/pygi-info.h | 64 + + gi/pygi-private.h | 55 + + gi/pygi-repository.c | 238 ++++ + gi/pygi-repository.h | 39 + + gi/pygi-struct.c | 175 +++ + gi/pygi-struct.h | 40 + + gi/pygi-type.c | 96 ++ + gi/pygi-type.h | 43 + + gi/pygi.h | 99 ++ + gi/pygobject-external.h | 83 ++ + gi/repository/Makefile.am | 8 + + gi/repository/__init__.py | 30 + + gi/types.py | 163 +++ + tests/Makefile.am | 48 + + tests/libtestgi.c | 3397 + +++++++++++++++++++++++++++++++++++++++++++++ + tests/libtestgi.h | 643 +++++++++ + tests/runtests.py | 22 + + tests/test_gi.py | 1416 +++++++++++++++++++ + 33 files changed, 11566 insertions(+), 0 deletions(-) + commit bfd3100a580b8bea9db25b8bb7443fb8c3dbe1cc Author: Simon van der Linden Date: Sat Nov 7 13:23:53 2009 +0100 diff --git a/MANIFEST.in b/MANIFEST.in index 002138a..3781c83 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include ChangeLog AUTHORS COPYING NEWS README +include ChangeLog AUTHORS COPYING NEWS README HACKING include MANIFEST.in include gobject/pygobject.h gobject/pygobject-private.h include pygtk.py pygobject-2.0.pc.in diff --git a/Makefile.am b/Makefile.am index f68b338..b9b9ed3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,13 @@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = 1.7 -SUBDIRS = docs codegen glib gobject gio examples tests +SUBDIRS = docs codegen glib gobject gio examples + +if ENABLE_INTROSPECTION +SUBDIRS += gi +endif + +SUBDIRS += tests PLATFORM_VERSION = 2.0 @@ -21,6 +27,33 @@ EXTRA_DIST = \ m4/jhflags.m4 \ m4/python.m4 +MAINTAINERCLEANFILES = \ + $(srcdir)/INSTALL \ + $(srcdir)/aclocal.m4 \ + $(srcdir)/autoscan.log \ + $(srcdir)/compile \ + $(srcdir)/config.guess \ + $(srcdir)/config.h.in \ + $(srcdir)/config.sub \ + $(srcdir)/configure.scan \ + $(srcdir)/depcomp \ + $(srcdir)/install-sh \ + $(srcdir)/ltmain.sh \ + $(srcdir)/missing \ + $(srcdir)/mkinstalldirs \ + $(srcdir)/omf.make \ + $(srcdir)/xmldocs.make \ + $(srcdir)/gtk-doc.make \ + $(srcdir)/ChangeLog \ + $(srcdir)/py-compile \ + $(srcdir)/m4/libtool.m4 \ + $(srcdir)/m4/ltoptions.m4 \ + $(srcdir)/m4/ltsugar.m4 \ + $(srcdir)/m4/ltversion.m4 \ + $(srcdir)/m4/lt~obsolete.m4 \ + `find "$(srcdir)" -type f -name Makefile.in -print` \ + `find "$(srcdir)" -type f -name "*.pyc" -print` + BUILT_EXTRA_DIST = \ ChangeLog @@ -118,3 +151,12 @@ dist-hook: $(BUILT_EXTRA_DIST) for f in $$files; do \ if test -f $$f; then d=.; else d=$(srcdir); fi; \ rm -f $(distdir)/$$f && cp $$d/$$f $(distdir) || exit 1; done + +check.gdb: + cd tests && $(MAKE) check.gdb + +check.valgrind: + cd tests && $(MAKE) check.valgrind + + +-include $(top_srcdir)/git.mk diff --git a/Makefile.in b/Makefile.in index 000c547..e20eeca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,7 +35,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@PLATFORM_WIN32_TRUE@am__append_1 = -no-undefined +@ENABLE_INTROSPECTION_TRUE@am__append_1 = gi +@PLATFORM_WIN32_TRUE@am__append_2 = -no-undefined subdir = . DIST_COMMON = README $(am__configure_deps) $(pkgpyexec_PYTHON) \ $(pyexec_PYTHON) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ @@ -86,6 +87,12 @@ am__installdirs = "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" \ "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" \ "$(DESTDIR)$(pkgconfigdir)" LTLIBRARIES = $(pkgpyexec_LTLIBRARIES) $(pyexec_LTLIBRARIES) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -104,7 +111,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = docs codegen glib gobject gio examples gi tests DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -144,6 +151,7 @@ distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = -I m4 AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -174,6 +182,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ @@ -185,6 +196,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_PC = @LIBFFI_PC@ @@ -194,7 +207,9 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -207,10 +222,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ @@ -233,6 +253,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -265,7 +286,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -289,7 +309,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.7 -SUBDIRS = docs codegen glib gobject gio examples tests +SUBDIRS = docs codegen glib gobject gio examples $(am__append_1) tests PLATFORM_VERSION = 2.0 CLEANFILES = EXTRA_DIST = \ @@ -307,6 +327,33 @@ EXTRA_DIST = \ m4/jhflags.m4 \ m4/python.m4 +MAINTAINERCLEANFILES = \ + $(srcdir)/INSTALL \ + $(srcdir)/aclocal.m4 \ + $(srcdir)/autoscan.log \ + $(srcdir)/compile \ + $(srcdir)/config.guess \ + $(srcdir)/config.h.in \ + $(srcdir)/config.sub \ + $(srcdir)/configure.scan \ + $(srcdir)/depcomp \ + $(srcdir)/install-sh \ + $(srcdir)/ltmain.sh \ + $(srcdir)/missing \ + $(srcdir)/mkinstalldirs \ + $(srcdir)/omf.make \ + $(srcdir)/xmldocs.make \ + $(srcdir)/gtk-doc.make \ + $(srcdir)/ChangeLog \ + $(srcdir)/py-compile \ + $(srcdir)/m4/libtool.m4 \ + $(srcdir)/m4/ltoptions.m4 \ + $(srcdir)/m4/ltsugar.m4 \ + $(srcdir)/m4/ltversion.m4 \ + $(srcdir)/m4/lt~obsolete.m4 \ + `find "$(srcdir)" -type f -name Makefile.in -print` \ + `find "$(srcdir)" -type f -name "*.pyc" -print` + BUILT_EXTRA_DIST = \ ChangeLog @@ -323,7 +370,7 @@ pyexec_PYTHON = pygtk.py pyexec_LTLIBRARIES = # linker flags -common_ldflags = -module -avoid-version $(am__append_1) +common_ldflags = -module -avoid-version $(am__append_2) EGG_NAME = $(PACKAGE)-$(PACKAGE_VERSION)-py$(PYTHON_VERSION)-$(PLATFORM).egg all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -331,19 +378,19 @@ all: config.h .SUFFIXES: am--refresh: @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -358,9 +405,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -373,7 +420,7 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -905,6 +952,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-pkgpyexecLTLIBRARIES \ @@ -1077,6 +1125,14 @@ dist-hook: $(BUILT_EXTRA_DIST) if test -f $$f; then d=.; else d=$(srcdir); fi; \ rm -f $(distdir)/$$f && cp $$d/$$f $(distdir) || exit 1; done +check.gdb: + cd tests && $(MAKE) check.gdb + +check.valgrind: + cd tests && $(MAKE) check.valgrind + +-include $(top_srcdir)/git.mk + # 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. .NOEXPORT: diff --git a/NEWS b/NEWS index cee8732..eeae929 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,630 @@ -2.21.3 21-Jan-2010 +2.28.6 11-Jun-1011 + - closure: avoid double free crash (Ignacio Casal Quinteiro) + - [gi] backport of "GVariant has a GType" fe386a (John (J5) Palmieri) + - [gi] fixes to backport commit 6b5a65 - in older glib GVariants are still structs (John (J5) Palmieri) + - GVariantType is a boxed struct (Tomeu Vizoso) + - Use _gi.Struct to wrap fundamentals (Tomeu Vizoso) + - Added __eq__ method for Gdk.Color and Gdk.RGBA (Jason Siefken) + - Remove useless import (Ignacio Casal Quinteiro) + - Revert "[gi] Removed hack to avoid using GLib.Variant.new_variant." (Ignacio Casal Quinteiro) + - closure: Check the out arg is not null. Fixes bug #651812 (Ignacio Casal Quinteiro) + - Fix GC-related crash during PyGObject deallocation (Daniel Drake) + - Fix symbol names to be locale independent (Martin Pitt) + - Updated DOAP file (Sebastian Pölsterl) + +2.28.4 18-Apr-2011 + - Version bump to 2.24.4 (Sebastian Pölsterl) + - [gi] Don't create variant twice (Sebastian Pölsterl) + - pygi-convert.sh: Make sure the uppercase GObject module is imported instead of the lowercase (Sebastian Pölsterl) + - [gi] Removed hack to avoid using GLib.Variant.new_variant. (Sebastian Pölsterl) + - [gi] Added additional test case for GVariant handling (Sebastian Pölsterl) + - [gi] Added support for GVariant arguments (Sebastian Pölsterl) + - Fix ABI break in old static bindings. (Steve Frécinaux) + - fetch size from an enum type (Mike Gorse) + - dsextras.py: ensure eol characters are preserved when writing template files (so \n does not become \r\n) (Dieter Verfaillie) + +2.28.3 23-Mar-2011 + - fix a typo when converting objects to strings gvalues (John (J5) Palmieri) + +2.28.2 22-Mar-2011 + - fix static ABI for setting string gvalues from python objects (John (J + - Fix GSchema tests for separate build tree (Martin Pitt) + - GIO tests: Fix remaining test case for separate build tree (Martin Pit + - GIO tests: Fix for separate build tree (Martin Pitt) + +2.28.1 21-Mar-2011 + - pygi-convert.sh remove gobject tests, GObject works now (John Stowers) + - pygi-convert.sh add GObject.xxx and webkit (John Stowers) + - [gi] marshal raw closures (John (J5) Palmieri) + - Revert "Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES" (Martin Pit + - setup.py: fix user_access_control option (Dieter Verfaillie) + - [gi-overrides] fix marshalling pygobjects in treemodels (John (J5) Pal + - [gi] Respect the MessageType for Gtk.MessageDialog (Martin Pitt) + - [gi] Do not require signature for D-BUS methods without arguments (Mar + - [gi-demos] add pickers demo (John (J5) Palmieri) + - [gi-demos] add menu demo (John (J5) Palmieri) + - [gi-overrides] TreeViewColumn.set_cell_data_func func_data can be None + - [gi-demos] dont try and run demos that represent directories (John Sto + - [gi-overrides] fix exception block so it works in Python 2.5 (John (J5 + +2.28.0 08-Mar-2011 (stable) + - [gi-demos] some python 3 compat fixes (John (J5) Palmieri) + - [gi-demos] catch the correct error class (John (J5) Palmieri) + - Try not to sink objects returned by C functions. (Steve Frécinaux) + - Do not leak python references when using the gobject.property() helper. (Steve Frécinaux) + - [gi] fix try except blocks so they work in Python 2.5 (John (J5) Palmieri) + - handle uchar as bytes, not strings in python 3 (John (J5) Palmieri) + - [gi-overrides] handle unichar gvalues when setting treemodels (John (J5) Palmieri) + - [gi-overrides] special case python 2 keywords that crept in (John (J5) Palmieri) + - check for the py3 _thread module in configure.ac if thread is not found (John (J5) Palmieri) + - [gi-demos] add iconview demo (John (J5) Palmieri) + - [gi] wrap the keyword argument in a dict so we don't break Python 2.5 (John (J5) Palmieri) + - [gi-demos] add the combobox with string ids section to the demos (John (J5) Palmieri) + - [gi-overrides] add an override for Gdk.RGBA (John (J5) Palmieri) + - [gi-demos] fix up search-entry to reflect annotations fixed in Gtk+ master (John (J5) Palmieri) + - [gi-demos] add search entry demo (John (J5) Palmieri) + - [gi] wrap map in a list for Python 3 compat (John (J5) Palmieri) + - [gi-demos] fix up the validation combobox (John (J5) Palmieri) + - add overridesdir variable in the .pc file for 3rd party overrides (John (J5) Palmieri) + - [gi] remove unref for closures since they are floating objects that get sunk (John (J5) Palmieri) + - setup.py: Set bdist_wininst user-access-control property (Dieter Verfaillie) + - Fix uninitialized variable in gi.require_version() (Martin Pitt) + - Run tests with LC_MESSAGES="C" (Martin Pitt) + - [gi-overrides] override Gtk.stock_lookup to not return success (John (J5) Palmieri) + +2.27.91 28-Feb-2011 (2.28 pre-release) + - [gi-tests] use Gdk.test_simulate_button instead of emitting event ourselves (John (J5) Palmieri) + - [gi-tests] tests for EventButton override. (Laszlo Pandy) + - Skip interfaces when checking for conflicts in the MRO (Tomeu Vizoso) + - [gi-overrides] Add event methods to all event union members (John (J5) Palmieri) + - [gi] check to see if object is a member of a union when validating paramaters (John (J5) Palmieri) + - [gi] Remove DyanmicModule.load() to _load() to prevent overriding GI attrs. (Laszlo Pandy) + - Test case with John's fix for crash with C arrays and a GError is set. (Laszlo Pandy) + - [gi-overrides] fix setting rows in treeview to accept None as a value (John (J5) Palmieri) + - [gi] Add value_name for enum and flags from introspection "c:identifier" (if attr is available). (Laszlo Pandy) + - Don't force loading of DynamicModule until set in sys.modules (Laszlo Pandy) + - Fix flags with multiple names for the same value. (Laszlo Pandy) + - [gi-demos] add liststore demo (John (J5) Palmieri) + - [gi-demos] run through the demos and remove the FIXMEs that have been fixed (John (J5) Palmieri) + - Load typelibs at import time, add gi.require_version() (Tomeu Vizoso) + - use GValue support to marshal GtkTreeModel values correctly (John (J5) Palmieri) + - [gi] pass raw GValues instead of trying to marshal them (John (J5) Palmieri) + - [gi-demos] add icon view edit and drag-and-drop demo (John (J5) Palmieri) + - [gi] Register GType for non-GType enums and flags at runtime. (Laszlo Pandy) + - [gi-demos] add info bars demo (John (J5) Palmieri) + - tests/runtests.py: Add missing "import sys" (Martin Pitt) + - [gi] Add Pythonic gdbus method invocation (Martin Pitt) + - Skip GError out parameters in Python closure. (Laszlo Pandy) + - [gi-demos] added rotate text demo (John (J5) Palmieri) + - [gi-demos] add images demo (John (J5) Palmieri) + - [gi-demos] add pixbuf demo (John (J5) Palmieri) + - [gi-demos] remove fixmes from print demo, fixed in pango (John (J5) Palmieri) + - [gi-demos] add printing demo (John (J5) Palmieri) + - [gi-overrides] add cursor overrides (John (J5) Palmieri) + - [gi-demos] add the links demo (John (J5) Palmieri) + - [gi-demos] add expander demo (John (J5) Palmieri) + - [gi-overrides] use pop instead of del and add extra tests for Gtk.Table kwargs (John (J5) Palmieri) + - [tests] Separate processes for GI and static binding tests. (Laszlo Pandy) + - [GI] Remove implicit loading of gi module preserve the code path for static bindings. (Laszlo Pandy) + - [gi-demos] add dialogs demo (John (J5) Palmieri) + - [gi-overrides] fix typo in GtkTable constructor (John (J5) Palmieri) + - [gi-demos] keep popup menu from destroying itself by holding a ref in app class (John (J5) Palmieri) + - [gi-overrides] add a Gtk.Menu override for the popup method (John (J5) Palmieri) + - [gi-demos] fix the about dialog in appwindow demo (John (J5) Palmieri) + - [gi-demos] fix clipboard demo so DnD works (John (J5) Palmieri) + - [gi-demos] fix clipboard demo to reflect new API (John (J5) Palmieri) + - [gi-demo] Fix color dialog demo to run with new draw, style and color apis (John (J5) Palmieri) + - [gi-demos] fix most of the combobox app (John (J5) Palmieri) + - Use PyGI type conversion (to fix foreign types) for signal callbacks. (Laszlo Pandy) + - [gi-demos] fix drawingarea app to use the new draw api (John (J5) Palmieri) + - [gi-overrides] for Gtk 3 alias Gdk.Rectangle to cairo.RectangleInt (John (J5) Palmieri) + - [gi-overrides] let user set the proper property names in Gtk.Table (John (J5) Palmieri) + - [gi-demos] get appwindow demo working again (John (J5) Palmieri) + - [gi-demos] fixed use of tree_iter_get (John (J5) Palmieri) + +2.27.90 11-Feb-2011 (2.28 pre-release) + - fix build to correctly use python-config (John (J5) Palmieri) + - Run gio tests separately when enabled (Martin Pitt) + - Revert "Remove gio static bindings" (Martin Pitt) + - Decrease the refcount for GInitiallyUnowned constructors. (Steve Frécinaux) + - Ensure the sink functions are only ran once. (Steve Frécinaux) + - Revert "Fix wrong refcount when calling introspected widget constructors" (Steve Frécinaux) + - Revert "Fix reference leaks for GInitiallyUnowned objects" (Steve Frécinaux) + - Run test suite under dbus-launch (Martin Pitt) + - Fix test_gdbus.py to be Python3 friendly (Martin Pitt) + - [gi] Provide comfortable GSettings API (Martin Pitt) + - Fix vfunc search bug when using GInterfaces and a do_* method. (Laszlo Pandy) + - [GI] Add tests for Gtk.Widget.drag_* methods. (Laszlo Pandy) + - [python 3] use the right syntaxis to raise exceptions (Ignacio Casal Quinteiro) + - [gi] return PYGLIB_MODULE_ERROR_RETURN on error and use pygobject_init (Ignacio Casal Quinteiro) + - [gi] return PYGLIB_MODULE_ERROR_RETURN on error (Ignacio Casal Quinteiro) + - Fix wrong refcount when calling introspected widget constructors (Steve Frécinaux) + - Gdk.Window: Map the standard constructor to the *new* constructor (Simon Schampijer) + - Ship tests/org.gnome.test.gschema.xml in dist tarballs (Martin Pitt) + - [gi] Add GSettings tests (Martin Pitt) + - [gi] Provide GtkTextBuffer.insert_with_tags_by_name() (Martin Pitt) + - [gi] Support tag names in GtkTextBuffer.insert_with_tags() (Martin Pitt) + - Add MAINTAINERCLEANFILES (Ignacio Casal Quinteiro) + - Remove .gitignore files and use git.mk (Ignacio Casal Quinteiro) + - pygi-convert.sh: Convert Pango.TabAlign.* (Martin Pitt) + - pygi-convert.sh: Drop window -> get_window() conversion (Martin Pitt) + - pygi-convert.sh: Don't convert self.window assignments (Martin Pitt) + - Fix leaked python reference in python-defined subclasses (Steve Frécinaux) + - Add some tests for the number of python refs held at creation time (Steve Frécinaux) + - Factor out parameter marshalling from construction functions. (Steve Frécinaux) + - [gi] in python 3 an array of uint8 can be bytes but not string (John (J5) Palmieri) + - [gi] fix Gio.FileEnumerator to reflect the Python 3 iter protocol (John (J5) Palmieri) + - [gi] python 3 fixes (John (J5) Palmieri) + - [gi] fix try/except blocks using depricated raise format (John (J5) Palmieri) + - [gi] Add docstring to GLib.Variant constructor (Martin Pitt) + - [gi] update gdbus test cases for previous GVariant change (Martin Pitt) + - [gi] Accept only a single object in GLib.Variant constructor (Martin Pitt) + - Speed up _setup_native_vfuncs() (Laszlo Pandy) + - Speed up class creation: rewrite _setup_vfuncs() to be much more efficient. (Laszlo Pandy) + - pygi-convert.sh: Convert gtk.UI_MANAGER_* (Sebastian Pölsterl) + - pygi-convert.sh: Convert gdk.GRAB_* (Sebastian Pölsterl) + - [gi] set the gtype GValue correctly (Ignacio Casal Quinteiro) + - [gi] use the right argument type for callback (Ignacio Casal Quinteiro) + - [gi] Add test cases for GDBus client operations (Martin Pitt) + - [gi] Add Variant construction/unpack support for boxed Variants (Martin Pitt) + - Merge branch 'windows-setup-fixes' (Dieter Verfaillie) + - pygi-convert.sh: GdkPixbuf methods (Thomas Hindoe Paaboel Andersen) + - pygi-convert.sh: Gdk.COLORSPACE_RGB (Thomas Hindoe Paaboel Andersen) + - [gi] Support nested objects and empty sequences in GLib.Variant building (Martin Pitt) + - Uncomment test_gi.TestInterfaceClash (Tomeu Vizoso) + - Fix reference leaks for GInitiallyUnowned objects (Steve Frécinaux) + - Add tests for refcount of a GObject owned by a library (Steve Frécinaux) + - Add a test to check for regular object reference count (Steve Frécinaux) + - [gi] Update TreeView.enable_model_drag_{source,dest} to current GTK (Martin Pitt) + - Fix a typo in a private symbol name. (Steve Frécinaux) + - pygi-convert.sh: Convert glib.source_remove() (Martin Pitt) + - Fix typo in previous commit to actually convert glib.GError (Martin Pitt) + - pygi-convert.sh: Move some glib bits which are better handled by gobject (Martin Pitt) + - Modify override for Gtk.Adjustment to allow position or keyword arguments in __init__(). (Laszlo Pandy) + - [gi] Fix small typo in previous commit (Martin Pitt) + - [gi] Add pythonic iterator and indexing for string GVariants (Martin Pitt) + - Construct structs using default API constructor (Tomeu Vizoso) + - pygi-convert.sh: Migrate Gdk.Cursor constructor, and some cursor names (Martin Pitt) + - pygi-convert.sh: Handle .window attributes (Martin Pitt) + - Also deal with foreign boxed structs (Tomeu Vizoso) + - [gi] Convert GErrors to GObject.GError exceptions, and throw them upon returning from calling the C function. (Laszlo Pandy) + - pygi-convert.sh: Don't convert glib -> GLib for now (Martin Pitt) + - Link libregress.so to GIO_LIBS again (Tomeu Vizoso) + - Fix attributes 2BUTTON_PRESS and 3BUTTON_PRESS of Gdk.EventType. (Laszlo Pandy) + - [gi] Fixed typo in exception (Sebastian Pölsterl) + - [gi] Enable handling of Gdk.EventType.2BUTTON_PRESS and 3BUTTON_PRESS (Sebastian Pölsterl) + - Revert "Fix Pango FontDescription override" (Martin Pitt) + - Python iterator interface support for GFileEnumerator. (Tony Young) + - Remove gio static bindings (Tomeu Vizoso) + - [gi] set length when marshalling guint8 erases (Ignacio Casal Quinteiro) + - Convert Gdk.Pixbuf to GdkPixbuf.Pixbuf (Sebastian Pölsterl) + - Disable calls to PyGILState_* when threads are disabled (Arnaud Charlet) + - pygi-convert.sh: Do not comment out set_cell_data_func() calls; these should be ported properly (Martin Pitt) + - pygi-convert.sh: Fix match for adding missing imports (Martin Pitt) + - pygi-convert.sh: Fix Gtk.Label handling to be idempotent (Martin Pitt) + - Remove trailing whitespace from gi/overrides/Gtk.py (Laszlo Pandy) + - Fix Pango FontDescription override (Martin Pitt) + - tests: Respect existing $GI_TYPELIB_PATH (Martin Pitt) + - Merge branch 'value' (Sebastian Pölsterl) + - GTK overrides: Do type conversion to column types of ListStore and TreeStore in set_value (Sebastian Pölsterl) + - Always register a new GType when a GObject class is subclassed (Steve Frécinaux) + - Raise required versions of GLib and GObject-Introspection (Simon van der Linden) + - pygi-convert.sh: Handle keysyms (Martin Pitt) + - GLib overrides: Add test case for array variant building (Martin Pitt) + - Remove cairo.RectangleInt from the foreign module (Tomeu Vizoso) + - Dont try to guess the transfer if its a boxed (Tomeu Vizoso) + - The tags can be Empty not None. (Ignacio Casal Quinteiro) + - Add Pythonic iterators and indexing to GVariant (Martin Pitt) + - Add GLib.Variant.unpack() (Martin Pitt) + - Add override for gtk_text_buffer_insert_with_tags (Ignacio Casal Quinteiro) + - Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES (Simon van der Linden) + - Kill JD_CHECK_PYTHON_HEADERS (Simon van der Linden) + - Revert "Override Gtk.Box.pack_start and pack_end to set default values to be compliant with pygtk" (Sebastian Pölsterl) + - Revert "Override Gtk.CellLayout.pack_start and pack_end to add default values to be compliant with pygtk" (Sebastian Pölsterl) + - Revert "Override Gtk.TreeViewColumn.pack_start, pack_end and set_cell_data_func to add default values to be compliant with pygtk" (Sebastian Pölsterl) + - pygi-convert.sh: Handle gtk.combo_box_new_text() (Martin Pitt) + - Override TreeSortable.set_sort_func and set_default_sort_func to add default values to be pygtk compliant (Sebastian Pölsterl) + - Override Gtk.TreeViewColumn.pack_start, pack_end and set_cell_data_func to add default values to be compliant with pygtk (Sebastian Pölsterl) + - Override Gtk.CellLayout.pack_start and pack_end to add default values to be compliant with pygtk (Sebastian Pölsterl) + - Override Gtk.Paned pack1 and pack2 to add default values to be compliant with pygtk (Sebastian Pölsterl) + - Override Gtk.Box.pack_start and pack_end to set default values to be compliant with pygtk (Sebastian Pölsterl) + - Handle GObject subclasses in the property helper. (Steve Frécinaux) + - Fix handling of unicode for GtkTreeModels (Martin Pitt) + - In IntrospectionModule and DynamicModule classes, make all instance attributes start with an underscore. (Laszlo Pandy) + - Amend previous enum wrapping commit to remove redundant setting of __info__ attribute. (Laszlo Pandy) + - pygi-convert.sh: Handle GdkPixbuf.InterpType (Martin Pitt) + - Fix wrapping of enums: Create new Python type for each non-gtype enum. (Laszlo Pandy) + - Use g_vfunc_info_invoke for chaining up in vfuncs (Tomeu Vizoso) + - Move pyglib_{main_context, option_context, option_group}_new into _PyGLib_API (Simon van der Linden) + - pygi-convert.sh: Handle Gdk.DragAction (Martin Pitt) + - pygi-convert.sh: Generalize Gtk.Settings migration (Martin Pitt) + - pygi-convert.sh: Don't change the name of "glib" submodules (Martin Pitt) + - Plug another memory leak (Paolo Borelli) + - Plug a small memory leak. (Paolo Borelli) + - Override Table.attach() to behave like pygtk (Paolo Borelli) + - pygi-convert.sh: Convert Pango.WrapMode (Martin Pitt) + - pygi-convert.sh: Don't change the name of "gtk" submodules (Martin Pitt) + - Fix the __dir__() methods on DynamicModule and IntrospectionModule (Laszlo Pandy) + - pygi-convert.sh: handle ReliefStyle (Paolo Borelli) + - setup.py: fix the provides keyword argument (Dieter Verfaillie) + - setup.py: use the same spaces-less format for all setup() parameters (Dieter Verfaillie) + - Add a __repr__() method to DynamicModule. (Laszlo Pandy) + - Go back to using getattr() in DynamicModule.__getattr__ (Tomeu Vizoso) + - Change __dir__() to report all the attributes that __getattr__ supports (Laszlo Pandy) + - Bump the minimum gio dependency (Emilio Pozuelo Monfort) + - Add test for incorrect attributes in Gdk.Event (Tomeu Vizoso) + - Don't call getattr again in gi.overrides.Gdk.Event.__getattr__ (Simon van der Linden) + - Release allocated array of arguments when handling closures (Mike Gorse) + - Release GIValueInfo when checking an enum argument (Mike Gorse) + - Respect different type lengths when assigning out-argument pointers. (Eitan Isaacson) + - Fix stupid name clash (Tomeu Vizoso) + - Add /usr/share to XDG_DATA_DIRS when running the tests (Tomeu Vizoso) + - Comment out tests that require SRV lookups (Tomeu Vizoso) + - Use suppresion file when running valgrind (Tomeu Vizoso) + - Fix warnings. (Ignacio Casal Quinteiro) + - Allow comparing Gtk.TreePath to None (Jesse van den Kieboom) + - handle unicode objects in properties (John (J5) Palmieri) + - dsextras.py: check if gcc is there when platform is win32 and compiler is mingw32 (Dieter Verfaillie) + - dsextras.py: be consistent in how distutils imports are done (Dieter Verfaillie) + - dsextras.py: add have_gcc() function (Dieter Verfaillie) + - dsextras.py: use distutils.spawn.find_executable for have_pkgconfig() (Dieter Verfaillie) + - setup.py: fix another case of use True/False instead of 1/0 (Dieter Verfaillie) + - pygi-convert.sh: improve GtkSourceView conversion (Paolo Borelli) + - pygi-convert.sh: Gtk.DialogFlags conversion (Paolo Borelli) + - Doc Extractor: Print the gtk-doc blocks sorted by function name. (José Alburquerque) + - pygi-convert.sh: add more Gtk conversions and sort (Paolo Borelli) + - pygi-convert.sh: convert Atk (Paolo Borelli) + - pygi-convert.sh: convert a few more Gio types (Paolo Borelli) + - pygi-convert.sh: more GLib conversion (Paolo Borelli) + - pygi-convert.sh: remove two cases handled by overrides (Paolo Borelli) + - Override Gtk.ScrolledWindow constructor (Paolo Borelli) + - pygi-convert.sh: Fix 'find' syntax (Paolo Borelli) + - pygi-convert.sh: start handling Gio and GLib (Paolo Borelli) + - pygi-convert.sh: convert Gdk.ScrollDirection. (Paolo Borelli) + - Override Pango.Layout constructor. (Paolo Borelli) + - Remove Pango.FontDescription() conversion. (Paolo Borelli) + - Override GtkAction and GtkRadioAction constructors. (Paolo Borelli) + - Override Adjustment constructor to behave like pygtk (Dmitrijs Ledkovs) + - add secondary_text apis to MessageDialog (John (J5) Palmieri) + - [gi] get rid of some debug prints and fix error messages (John (J5) Palmieri) + - Fix demo for override changes. (Paolo Borelli) + - Override Pango.FontDescription. (Paolo Borelli) + - Stop checking that all vfuncs are implemented (Tomeu Vizoso) + - Fix usage of TreeIter api that is now an override. (Paolo Borelli) + - Fix Gtk.Label(label="Foo") (Paolo Borelli) + - Fix typo when raising an exception (Paolo Borelli) + - pygi-convert.sh: Added more conversions (Sebastian Pölsterl) + - Override LinkButton constructor to make 'uri' mandatory (Paolo Borelli) + - Container should be iterable. (Dmitry Morozov) + - No need to import Gdk (Paolo Borelli) + - Remove semicolumns (Paolo Borelli) + - [gi] make sure Gtk.Button override passes all keywords to parent constructor (John (J5) Palmieri) + - Fix cut&paste error in the Label override (Paolo Borelli) + - pygi-convert.sh: handle TextWindowType (Paolo Borelli) + - Override Label constructor to behave like pygtk (Paolo Borelli) + - Override GtkTable constructor to behave like pygtk (Paolo Borelli) + - pygi-convert.sh: convert MovementStep (Paolo Borelli) + - Update Gdk overrides to work with latest Gtk+ 3 (Paolo Borelli) + - Gtk: add an override for Gtk.main_quit (Johan Dahlin) + - [gi] handle subtypes when inserting into tree models (John (J5) Palmieri) + - Override TreeSelection.select_path and TreeView.scroll_to_cell (Paolo Borelli) + - Override TreePath.__new__ (Paolo Borelli) + - Override Container to behave like a sequence (Paolo Borelli) + - refactor Jonathan Matthew recurse vfunc patch so it applys and clean up a bit (John (J5) Palmieri) + - Recurse up through base classes when setting up vfuncs (Jonathan Matthew) + - add a profiling torture test for when we fix up invoke (John (J5) Palmieri) + - moved dynamic and base modules outside of gtk-2.0 directory (John (J5) Palmieri) + - add test for inout argument count (John (J5) Palmieri) + - [gi] add check for UNICHAR (John (J5) Palmieri) + - Support gunichar (Paolo Borelli) + - pygi-convert.sh: gtk.accel_map -> Gtk.AccelMap._ (Paolo Borelli) + - pygi-convert.sh: handle "from gtk import gdk" (Paolo Borelli) + - pygi-convert.sh: add some Pango special cases (Paolo Borelli) + - Override TextIter (begins|ends|toggles)_tag() (Paolo Borelli) + - Override TextBuffer.set_text() to make length optional (Paolo Borelli) + - Override TextBuffer.create_mark() (Paolo Borelli) + - Fix TextBuffer.get_selection_bounds() override (Paolo Borelli) + - [gi] fix ActionGroup constructor to allow other keyword properties to be set (John (J5) Palmieri) + - [gi] require the name parameter when creatin a Gtk.ActionGroup (John (J5) Palmieri) + - Override UIManager.insert_action_group (Paolo Borelli) + - Override TreeModel.get() to return a tuple (Paolo Borelli) + - Make TreeSelection.get_selected_rows compatible with PyGtk (Paolo Borelli) + - [gi] switch to using sequences/tuples when marshalling cairo_rectangle_int_t (John (J5) Palmieri) + - [gi] overrides for treeview Drag and Drop (John (J5) Palmieri) + - [gi] when encountering guint8 arrays treat them as byte arrays (John (J5) Palmieri) + - pygi-convert.sh: Add pynotify -> Notify (Martin Pitt) + - pygi-convert.sh: Remove sugar specifics, and allow command line file list (Martin Pitt) + - pygi-convert.sh: Cover Message and Buttons types (Martin Pitt) + - [gi] fix actiongroup test since actions are hashed (John (J5) Palmieri) + - [gi] when converting to UTF-8 accept Python Unicode objects as input (Python 2) (John (J5) Palmieri) + - Correct a bug in the freeing of memory in pygi-invoke.c. (Damien Caliste) + - update news for release (John (J5) Palmieri) + - Implement richcompare for GIBaseInfo (Jonathan Matthew) + - [gi] add the rectangle_int_t forign cairo type (John (J5) Palmieri) + - add a foreign type for cairo_rectangle_int_t and allow it to be caller-allocated (John (J5) Palmieri) + - [gi] add overrides to Gtk.Editable (John (J5) Palmieri) + - [gi] handle virtual invokers (John (J5) Palmieri) + - add overrides for the insert* apis of list_store and tree_store (John (J5) Palmieri) + - fix dialogs overrides which were relying on broken inheritance behavior (John (J5) Palmieri) + - Add a overrides registry so we can refrence overrides inside the module (John (J5) Palmieri) + - Merge remote branch 'dieterv/setup-fixes-for-merge' (John Stowers) + - setup.py: ease maintenance burden for tests installation (Dieter Verfaillie) + - fix inheritence issues in overrides (John (J5) Palmieri) + - tests: add runtests-windows.py script (Dieter Verfaillie) + - pygobject_postinstall.py: remove pygobject-2.0.pc treatment from postinstall as pkg-config on windows figures out the correct prefix at runtime (Dieter Verfaillie) + - pygobject_postinstall.py: remove shortcut creation (Dieter Verfaillie) + - setup.py: formatting cleanup, makes things readable (Dieter Verfaillie) + - setup.py: build and install tests (Dieter Verfaillie) + - setup.py: install documentation when available on build system (Dieter Verfaillie) + - setup.py: install pygobject-codegen script (Dieter Verfaillie) + - setup.py: install fixxref.py script (Dieter Verfaillie) + - setup.py: rearrange constants (Dieter Verfaillie) + - setup.py: check python version and pkgconig availability before anything else (Dieter Verfaillie) + - setup.py: simplify sys.platform != 'win32' detection and error reporting (Dieter Verfaillie) + - setup.py: rearrange imports (Dieter Verfaillie) + - README.win32: update build instructions (Dieter Verfaillie) + - dsextras.py: formatting cleanup, makes things readable (Dieter Verfaillie) + - dsextras.py: add ggc4 to MSVC compatible struct packing comment (Dieter Verfaillie) + - dsextras.py: use the pkgc_ functions instead of repeating pgk-config incantations all over the place (Dieter Verfaillie) + - dsextras.py: add pkgc_get_version and pkgc_get_defs_dir functions (Dieter Verfaillie) + - dsextras.py: PEP8: Comparisons to singletons like None should always be done with 'is' or 'is not', never the equality operators. (Dieter Verfaillie) + - dsextras.py: use True/False instead of 1/0 (Dieter Verfaillie) + - dsextras.py: rearrange imports (Dieter Verfaillie) + - Add distutils generated build/dist directories and eclipse configuration files to .gitignore (Dieter Verfaillie) + - [gi] add tests for calling dir on a dynamic module (John (J5) Palmieri) + - [gi] dir() now works for modules (Deepankar Sharma) + - Don't check the inner type when comparing gpointers (Simón Pena) + - Release GIL when calling into C functions (John (J5) Palmieri) + - _gi.Repository : Implement missing info bindings. (José Aliste) + - include Python.h so that PY_VERSION_HEX gets defined (John (J5) Palmieri) + - [gi] make overrides work for python 3.x protocols and alias for python 2.x (John (J5) Palmieri) + - Override Gtk.Widget.translate_coordinates to not return success value (Sebastian Pölsterl) + - Override Gtk.TreeViewColumn.cell_get_position to not return success value (Sebastian Pölsterl) + - Override get_path_at_pos and get_dest_row_at_pos of Gtk.TreeView to not return success value (Sebastian Pölsterl) + - Override Gtk.TreeSortable.get_sort_column_id to not return success value (Sebastian Pölsterl) + - Override forward_search and backward_search of Gtk.TextIter to not return success value (Sebastian Pölsterl) + - Override Gtk.TextBuffer.get_selection_bounds to not return success value (Sebastian Pölsterl) + - Override Gtk.RecentInfo.get_application_info to not return success value (Sebastian Pölsterl) + - Override Gtk.IMContext.get_surrounding to not return success value (Sebastian Pölsterl) + - Override get_item_at_pos, get_visible_range, get_dest_item_at_pos of Gtk.IconView to not return success value (Sebastian Pölsterl) + - Override Gtk.Container.get_focus_chain to not return success value (Sebastian Pölsterl) + - Override Gtk.ComboBox.get_active_iter to not return success value (Sebastian Pölsterl) + - [gi] make parameter check less strict when dealing with GValue params (John (J5) Palmieri) + - Shortcut removal is not needed on post-uninstall (John Stowers) + - Disable shortcut creation in windows installer (John Stowers) + - overrides for all subclasses of dialog (John (J5) Palmieri) + - Make TreeModel behave like in GTK-2.x (Sebastian Pölsterl) + - Correctly build GIO on windows (John Stowers) + - Require Python >= 2.6.0 for Windows build (John Stowers) + - Fix depreciation warning in dsextras.py (John Stowers) + - Fix build on windows (John Stowers) + - Support for GCC4 in Windows distutils build - bug 626548 (Michael Culbertson) + - Remove obsolete comments in dsextras.py (John Stowers) + - Broken dsextras.py pkg-config check error message (John Stowers) + - add compat functions for the deprecated PyCObject api (John (J5) Palmieri) + - Add __path__ attributes. (Damien Caliste) + - Override Gtk.TreeSelection.get_selected to not return success value. (Sebastian Pölsterl) + - Make row optional in Gtk.TreeStore/ListStore.append override (Vincent Untz) + - Revert "add compat functions for the deprecated PyCObject api" (John (J5) Palmieri) + - return NULL instead of -1 which fixes crash when introspection is turned off (John (J5) Palmieri) + - add compat functions for the deprecated PyCObject api (John (J5) Palmieri) + - fix commit 7fe83108 which didn't use the compat functions for string handling (John (J5) Palmieri) + - Python 3 fixes for dsextras and the python.m4 distribution files (John (J5) Palmieri) + +2.27.0 10-Nov-2010 + - Implement richcompare for GIBaseInfo (Jonathan Matthew) + - [gi] add the rectangle_int_t forign cairo type (John (J5) Palmieri) + - add a foreign type for cairo_rectangle_int_t and allow it to be caller-allocated (John (J5) Palmieri) + - [gi] add overrides to Gtk.Editable (John (J5) Palmieri) + - [gi] handle virtual invokers (John (J5) Palmieri) + - add overrides for the insert* apis of list_store and tree_store (John (J5) Palmieri) + - fix dialogs overrides which were relying on broken inheritance behavior (John (J5) Palmieri) + - Add a overrides registry so we can refrence overrides inside the module (John (J5) Palmieri) + - Merge remote branch 'dieterv/setup-fixes-for-merge' (John Stowers) + - setup.py: ease maintenance burden for tests installation (Dieter Verfaillie) + - fix inheritence issues in overrides (John (J5) Palmieri) + - tests: add runtests-windows.py script (Dieter Verfaillie) + - pygobject_postinstall.py: remove pygobject-2.0.pc treatment from postinstall as pkg-config on windows figures out the correct prefix at runtime (Dieter Verfaillie) + - pygobject_postinstall.py: remove shortcut creation (Dieter Verfaillie) + - setup.py: formatting cleanup, makes things readable (Dieter Verfaillie) + - setup.py: build and install tests (Dieter Verfaillie) + - setup.py: install documentation when available on build system (Dieter Verfaillie) + - setup.py: install pygobject-codegen script (Dieter Verfaillie) + - setup.py: install fixxref.py script (Dieter Verfaillie) + - setup.py: rearrange constants (Dieter Verfaillie) + - setup.py: check python version and pkgconig availability before anything else (Dieter Verfaillie) + - setup.py: simplify sys.platform != 'win32' detection and error reporting (Dieter Verfaillie) + - setup.py: rearrange imports (Dieter Verfaillie) + - README.win32: update build instructions (Dieter Verfaillie) + - dsextras.py: formatting cleanup, makes things readable (Dieter Verfaillie) + - dsextras.py: add ggc4 to MSVC compatible struct packing comment (Dieter Verfaillie) + - dsextras.py: use the pkgc_ functions instead of repeating pgk-config incantations all over the place (Dieter Verfaillie) + - dsextras.py: add pkgc_get_version and pkgc_get_defs_dir functions (Dieter Verfaillie) + - dsextras.py: PEP8: Comparisons to singletons like None should always be done with 'is' or 'is not', never the equality operators. (Dieter Verfaillie) + - dsextras.py: use True/False instead of 1/0 (Dieter Verfaillie) + - dsextras.py: rearrange imports (Dieter Verfaillie) + - Add distutils generated build/dist directories and eclipse configuration files to .gitignore (Dieter Verfaillie) + - [gi] add tests for calling dir on a dynamic module (John (J5) Palmieri) + - [gi] dir() now works for modules (Deepankar Sharma) + - Don't check the inner type when comparing gpointers (Simón Pena) + - Release GIL when calling into C functions (John (J5) Palmieri) + - _gi.Repository : Implement missing info bindings. (José Aliste) + - include Python.h so that PY_VERSION_HEX gets defined (John (J5) Palmieri) + - [gi] make overrides work for python 3.x protocols and alias for python 2.x (John (J5) Palmieri) + - Override Gtk.Widget.translate_coordinates to not return success value (Sebastian Pölsterl) + - Override Gtk.TreeViewColumn.cell_get_position to not return success value (Sebastian Pölsterl) + - Override get_path_at_pos and get_dest_row_at_pos of Gtk.TreeView to not return success value (Sebastian Pölsterl) + - Override Gtk.TreeSortable.get_sort_column_id to not return success value (Sebastian Pölsterl) + - Override forward_search and backward_search of Gtk.TextIter to not return success value (Sebastian Pölsterl) + - Override Gtk.TextBuffer.get_selection_bounds to not return success value (Sebastian Pölsterl) + - Override Gtk.RecentInfo.get_application_info to not return success value (Sebastian Pölsterl) + - Override Gtk.IMContext.get_surrounding to not return success value (Sebastian Pölsterl) + - Override get_item_at_pos, get_visible_range, get_dest_item_at_pos of Gtk.IconView to not return success value (Sebastian Pölsterl) + - Override Gtk.Container.get_focus_chain to not return success value (Sebastian Pölsterl) + - Override Gtk.ComboBox.get_active_iter to not return success value (Sebastian Pölsterl) + - [gi] make parameter check less strict when dealing with GValue params (John (J5) Palmieri) + - Shortcut removal is not needed on post-uninstall (John Stowers) + - Disable shortcut creation in windows installer (John Stowers) + - overrides for all subclasses of dialog (John (J5) Palmieri) + - Make TreeModel behave like in GTK-2.x (Sebastian Pölsterl) + - Correctly build GIO on windows (John Stowers) + - Require Python >= 2.6.0 for Windows build (John Stowers) + - Fix depreciation warning in dsextras.py (John Stowers) + - Fix build on windows (John Stowers) + - Support for GCC4 in Windows distutils build - bug 626548 (Michael Culbertson) + - Remove obsolete comments in dsextras.py (John Stowers) + - Broken dsextras.py pkg-config check error message (John Stowers) + - add compat functions for the deprecated PyCObject api (John (J5) Palmieri) + - Add __path__ attributes. (Damien Caliste) + - Override Gtk.TreeSelection.get_selected to not return success value. (Sebastian Pölsterl) + - Make row optional in Gtk.TreeStore/ListStore.append override (Vincent Untz) + - Revert "add compat functions for the deprecated PyCObject api" (John (J5) Palmieri) + - return NULL instead of -1 which fixes crash when introspection is turned off (John (J5) Palmieri) + - add compat functions for the deprecated PyCObject api (John (J5) Palmieri) + - fix commit 7fe83108 which didn't use the compat functions for string handling (John (J5) Palmieri) + - Python 3 fixes for dsextras and the python.m4 distribution files (John (J5) Palmieri) + +2.26.0 24-Sep-2010 + - Wrap g_get_system_{config,data}_dirs () (John Strowers) + - fixed make check and make dist (John (J5) Palmieri) + - Disable GI tests when introspection disabled (John Stowers) + - Wrap g_uri_list_extract_uris. Fixes bug #584431 (Tomeu Vizoso) + - Fix a few uses of TRUE and FALSE in the docs (Paul Bolle) + - pygi: always free the invocation_state struct (Damien Caliste) + - Start implementing something equivalent to g_variant_new (Tomeu Vizoso) + - fixed typo - missing comma in glib.option module (John (J5) Palmieri) + - add checks so we can compile under python 3 by setting PYTHON=python3 (John (J5) Palmieri) + - Rename static methods as functions (Tomeu Vizoso) + - fix a couple of compiler warnings (John (J5) Palmieri) + - remove unused code (John (J5) Palmieri) + - Check the type of the instance object (John (J5) Palmieri) + - include the correct pycairo version (John (J5) Palmieri) + - Use PyMapping_Keys to determine if an object is a dict (py3k fix) (John (J5) Palmieri) + - fix handling of UINT64 and INT64 arguments in py3k (John (J5) Palmieri) + - properly handle ulongs properties in py3k (John (J5) Palmieri) + - Specify encoding of tests/test_gi.py (Tomeu Vizoso) + - use actual unicode in the tests on py3k, not the byte representation (John (J5) Palmieri) + - s/METH_KEYWORDS/METH_VARARGS|METH_KEYWORDS/ when defining object methods (John (J5) Palmieri) + - fix subclassing PyLong by calling __new__ correctly (John (J5) Palmieri) + - minor py3k fixups for python modules (John (J5) Palmieri) + - minor fixes in tests for py3k compat (John (J5) Palmieri) + - compilation: Fix syntax error (Colin Walters) + - Add missing file (Tomeu Vizoso) + - Add override for GLib.Variant.new_tuple (Tomeu Vizoso) + - fix for changes in the gi test libraries (John (J5) Palmieri) + - Gtk.DialogFlags.NO_SEPARATOR has been removed in Gtk 3.0 (John (J5) Palmieri) + - no need to offset arg positions when is_method is true (John (J5) Palmieri) + - gi: Add support for more property types (Tomeu Vizoso) + - use PyObject_SetAttrString, not PyDict_SetItemString when setting __gtype__ (John (J5) Palmieri) + - Rename GArgument to GIArgument (Tomeu Vizoso) + - fix up tests so they run in py3k (John (J5) Palmieri) + - tests: Port to new introspection tests (Colin Walters) + - we need to specify tp_hash since we overide tp_richcompare (John (J5) Palmieri) + - working enum/flags/pid subclasses of long (John Ehresman) + - make vfuncs work in py3k (John (J5) Palmieri) + - make cairo module compile in py3k (John (J5) Palmieri) + - fix exceptions so they work in python 3.x (John (J5) Palmieri) + - make the gi module compile under 3.x (John (J5) Palmieri) + - fix up testshelper module so it compiles in python 3.x (John (J5) Palmieri) + - convert to using PYGLIB_DEFINE_TYPE for module objects (John (J5) Palmieri) + - some more p3k PyString and PyInt eradication in GI (John (J5) Palmieri) + - pyglib: Fix typo (Leo Singer) (Tomeu Vizoso) + - Add defines for size_t and ssize_t conversion functions (Gustavo Noronha Silva) + - pyglib: Fix a compiler warning (Colin Walters) + - Don't force gtk 2.0 (Tomeu Vizoso) + - Fix some ref leaks in hook_up_vfunc_implementation() (Steve Frécinaux) + - handle strings correctly in gio (John (J5) Palmieri) + - make giomodule compile under py3k (John (J5) Palmieri) + - for py3k we need to do some more processing to get bytes from a unicode string (John (J5) Palmieri) + - use Bytes instead of Unicode when reading io (John (J5) Palmieri) + - prefix compat macros with PYGLIB (John (J5) Palmieri) + - Gtk.Button unit tests (John (J5) Palmieri) + - [Gtk] Add overrides for Button (Johan Dahlin) + - Make Cairo an optional dependency (Simon van der Linden) + - Don't import again PyGObject (John Ralls) (Tomeu Vizoso) + - move to using richcompare slot instead of compare (John (J5) Palmieri) + - Replace autogen.sh by a newer version (Simon van der Linden) + - Fix some warnings (Simon van der Linden) + - Fix caller-allocates emergency free. (Simon van der Linden) + - Remove useless checks. (Simon van der Linden) + - Call valgrind with G_SLICE=always-malloc G_DEBUG=gc-friendly (Tomeu Vizoso) + - Fix some warnings. (Ignacio Casal Quinteiro) + - Add myself as a maintainer (Simon van der Linden) + - Properly allocate boxed structs that are (caller-allocates) (Tomeu Vizoso) + - override gdk.Event to return attribute from the proper event object (Toms Baugis) + - check if z# needs an int or Py_ssize_t (John (J5) Palmieri) + - make sure we parse parameters to python object vars not glib vars (John (J5) Palmieri) + - Make an example and a demo work out of the box (Paul Bolle) + - make sure caller allocated structs are freed when they go out of scope (John (J5) Palmieri) + - Revert "override gdk.Event to return attribute from the proper event object." (Tomeu Vizoso) + - PyGI: properly quit cairo-demo (Paul Bolle) + - override gdk.Event to return attribute from the proper event object. (Toms Baugis) + - Clean and improve the test infrastructure (Simon van der Linden) + - Add some more transformations to pygi-convert.sh (Tomeu Vizoso) + - Adapt to API changes: g_irepository_enumerate_versions (Tomeu Vizoso) + - Add GValue<->GArgument marshalling for some more types (Tomeu Vizoso) + - Chain up with the non-introspection implementation for properties if needed (Tomeu Vizoso) + - Improve error reporting for missing attributes in introspection modules (Tomeu Vizoso) + - Implement getting and setting properties using introspection information. (Tomeu Vizoso) + - Readd Gdk.Rectangle override for Gtk-2.0 (Tomeu Vizoso) + - Allow specifying a version when loading a typelib (Tomeu Vizoso) + - treat GFreeFunc as equivalent to GDestroyNotify when scanning callbacks (Jonathan Matthew) + - Don't use == to compare doubles, use <= and =>. (Simon van der Linden) + - Allow passing ints as enum args (Tomeu Vizoso) + - Make error message less ambiguous (Tomeu Vizoso) + - fix passing in type names as a GType and add gtype unit tests (John (J5) Palmieri) + - Increase a bit verbosity of tests so people know which test failed (Tomeu Vizoso) + - Actually add the files for GVariant foreign structs (Tomeu Vizoso) + - Add foreign struct support for GVariant (Tomeu Vizoso) + +2.21.5 12-Jul-2010 + - Shut up some compiler warnings (Florian Müllner) + - Adjust to API break in GObject-Introspection (Florian Müllner) + - pass in the demo app so demos can use utility methods like requesting file paths (John (J5) Palmieri) + - demo fixes to keep up with Gtk+ (John (J5) Palmieri) + - override test fixes for new GTK+ annotations (John (J5) Palmieri) + - Fix warning. (Ignacio Casal Quinteiro) + - fix up treeiter usage due to caller-allocates annotations in gtk+ (John (J5) Palmieri) + - add entry completion demo (John (J5) Palmieri) + - string changes (John (J5) Palmieri) + - add the Entry demo directory and the entry_buffer demo (John (J5) Palmieri) + - fix loading of demo modules to support sub modules (John (J5) Palmieri) + - add the ability to have demos in sub catagories (John (J5) Palmieri) + - Add __name__ to DynamicModule class. (Jose Aliste) + - Do not override GdkRectangle. (Ignacio Casal Quinteiro) + - Add override for TreeModel implementing __len__() (Philip Withnall) + +2.21.4 29-Jun-2010 + - Build the cairo shim as a python module so the _gi module stops linking to it (Tomeu Vizoso) + - add drawing area demo (John (J5) Palmieri) + - sort the demo list (John (J5) Palmieri) + - rename iter to treeiter so we aren't using a python reserved word (John (J5) Palmieri) + - Fixup for change in buffer API (John (J5) Palmieri) + - add ListStore, TreeStore and TreeViewColumn APIs (John (J5) Palmieri) + - Add unit test for add_actions user data. (Ignacio Casal Quinteiro) + - Pass user_data param when adding actions (Paolo Borelli) + - add an exception type to the try/except block (John (J5) Palmieri) + - return PyList instead of PyTuple for array, return empty list for NULL arrays (John (J5) Palmieri) + - Fix 'make distcheck' (Tomeu Vizoso) + - Allow building pygobject without introspection support by providing --disable-introspection to configure. (Tomeu Vizoso) + - Make sure that sys.argv is a list and not a sequence. (Tomeu Vizoso) + - Force loading the GObject typelib so we have available the wrappers for base classes such as GInitiallyUnowned. (Tomeu Vizoso) + - we shouldn't g_array_free NULL pointers (John (J5) Palmieri) + - remove unneeded TextIter creation in the tests (John (J5) Palmieri) + - add override for TextBuffer (John (J5) Palmieri) + - fix up some build issues (John (J5) Palmieri) + - make the overrides file git friendly by appending to __all__ after each override (John (J5) Palmieri) + - Override Dialog constructor and add_buttons method (Paolo Borelli) + - Merge PyGI (Johan Dahlin) + +2.21.3 21-Jun-2010 - Proper handling of null-ok in virtual methods (Ludovic L'Hours) - Fall back to use the floating references API in glib if there isn't a sinkfunc defined. (Tomeu Vizoso) - Revert "Drop sinkfuncs." (Tomeu Vizoso) - [giounix] Make it possible to compile on glib 2.20 (Johan Dahlin) - Release the lock when potentially invoking Python code. (Sjoerd Simons) -2.21.2 10-Jan-2010 +2.21.2 10-Jun-2010 - Drop sinkfuncs. (Tomeu Vizoso) - Clear error if we failed the import (Colin Walters) - Added missing , to keyword list of gio.GFile.set_attribute (John Ehresman) diff --git a/PKG-INFO b/PKG-INFO index f029d09..bfad894 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyGObject -Version: 2.21.3 +Version: 2.28.6 Summary: Python bindings for GObject Home-page: http://www.pygtk.org/ Author: James Henstridge @@ -8,7 +8,7 @@ Author-email: james@daa.com.au Maintainer: Johan Dahlin Maintainer-email: johan@gnome.org License: GNU LGPL -Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.21/pygobject-2.21.3.tar.gz +Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.gz Description: Python bindings for GLib, GObject and GIO Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable diff --git a/README.win32 b/README.win32 index 548a3c8..5819c8d 100644 --- a/README.win32 +++ b/README.win32 @@ -4,21 +4,18 @@ Windows Setuptools Build Instructions 1. Install gtk+ bundle from gtk.org (to C:\GTK for example) 2. Install Python2.6 3. Install MinGW and MSYS - 4. Add C:\GTK\bin to path (from windows) - 5. Add the following to your msys environment variables + 4. Add the following to your msys environment variables (open and append to C:\msys\1.0\etc\profile) or set for the session - $ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/c/GTK/lib/pkgconfig:/c/Python26/Lib/pkgconfig - $ export PATH=$PATH:/c/Python26:/c/Python26/bin + $ export PATH=/c/GTK/bin:/c/Python26:/c/Python26/Scripts:$PATH + $ export PKG_CONFIG_PATH=/c/GTK/lib/pkgconfig:/c/Python26/Lib/pkgconfig:$PKG_CONFIG_PATH - 6. In msys shell, build with + 5. In msys shell, build with - $ python setup.py build --compiler=mingw32 --enable-threading \ - --yes-i-know-its-not-supported bdist_wininst + $ python setup.py build --compiler=mingw32 --enable-threading bdist_wininst --user-access-control=auto Tested with * gtk+-bundle_2.20.0-20100406_win32.zip * MinGW-5.16.exe * MSYS-1.0.11.exe * python-2.6.5.exe - diff --git a/aclocal.m4 b/aclocal.m4 index 784a482..9508e3e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,193 +13,586 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, -[m4_warning([this file was generated for autoconf 2.63. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. 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'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])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 -*- +# Configure paths for GLIB +# Owen Taylor 1997-2001 -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject, +dnl gthread, or gio is specified in MODULES, pass to pkg-config +dnl +AC_DEFUN([AM_PATH_GLIB_2_0], +[dnl +dnl Get the cflags and libraries from pkg-config +dnl +AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], + , enable_glibtest=yes) -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. + pkg_config_args=glib-2.0 + for module in . $4 + do + case "$module" in + gmodule) + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gmodule-no-export) + pkg_config_args="$pkg_config_args gmodule-no-export-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" + ;; + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + gio*) + pkg_config_args="$pkg_config_args $module-2.0" + ;; + esac + done -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) + PKG_PROG_PKG_CONFIG([0.16]) -# AM_CONDITIONAL -*- Autoconf -*- + no_glib="" -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. + if test "x$PKG_CONFIG" = x ; then + no_glib=yes + PKG_CONFIG=no + fi -# serial 9 + min_glib_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi -# serial 10 + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" +dnl +dnl Now check if the installed GLIB is sufficiently new. (Also sanity +dnl checks the results of pkg-config to some extent) +dnl + rm -f conf.glibtest + AC_TRY_RUN([ +#include +#include +#include +int +main () +{ + unsigned int major, minor, micro; + char *tmp_version; -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl + fclose (fopen ("conf.glibtest", "w")); -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + AC_SUBST(GLIB_GENMARSHAL) + AC_SUBST(GOBJECT_QUERY) + AC_SUBST(GLIB_MKENUMS) + rm -f conf.glibtest +]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# 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)?$]) +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`], + [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 "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$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]) + ]) +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 .]) + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])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, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + + +# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# This was merged into AC_PROG_CC in Autoconf. + +AU_DEFUN([AM_PROG_CC_STDC], +[AC_PROG_CC +AC_DIAGNOSE([obsolete], [$0: + your code should no longer depend upon `am_cv_prog_cc_stdc', but upon + `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when + you adjust the code. You can also remove the above call to + AC_PROG_CC if you already called it elsewhere.]) +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc +]) +AU_DEFUN([fp_PROG_CC_STDC]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub @@ -578,1013 +971,712 @@ if test x"${install_sh}" != xset; then fi AC_SUBST(install_sh)]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# 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, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006 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_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +# serial 2 -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# --------------------------------------------------------------------------- -# Adds support for distributing Python modules and packages. To -# install modules, copy them to $(pythondir), using the python_PYTHON -# automake variable. To install a package with the same name as the -# automake package, install to $(pkgpythondir), or use the -# pkgpython_PYTHON automake variable. -# -# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as -# locations to install python extension modules (shared libraries). -# Another macro is required to find the appropriate flags to compile -# extension modules. -# -# If your package is configured with a different prefix to python, -# users will have to add the install directory to the PYTHONPATH -# environment variable, or create a .pth file (see the python -# documentation for details). -# -# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will -# cause an error if the version of python installed on the system -# doesn't meet the requirement. MINIMUM-VERSION should consist of -# numbers and dots only. -AC_DEFUN([AM_PATH_PYTHON], - [ - dnl Find a Python interpreter. Python versions prior to 2.0 are not - dnl supported. (2.0 was released on October 16, 2000). - m4_define_default([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl -python2.1 python2.0]) - - m4_if([$1],[],[ - dnl No version check is needed. - # Find any Python interpreter. - if test -z "$PYTHON"; then - AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) - fi - am_display_PYTHON=python - ], [ - dnl A version check is needed. - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - AC_MSG_CHECKING([whether $PYTHON version >= $1]) - AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR(too old)]) - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - AC_CACHE_CHECK([for a Python interpreter with version >= $1], - [am_cv_pathless_PYTHON],[ - for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do - test "$am_cv_pathless_PYTHON" = none && break - AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) - done]) - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - ]) - - if test "$PYTHON" = :; then - dnl Run any user-specified action, or abort. - m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) - else - - dnl Query Python for its version number. Getting [:3] seems to be - dnl the best way to do this; it's what "site.py" does in the standard - dnl library. - - AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) - AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) - - dnl Use the values of $prefix and $exec_prefix for the corresponding - dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made - dnl distinct variables so they can be overridden if need be. However, - dnl general consensus is that you shouldn't need this ability. - - AC_SUBST([PYTHON_PREFIX], ['${prefix}']) - AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) - - dnl At times (like when building shared libraries) you may want - dnl to know which OS platform Python thinks this is. - - AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) - AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) - - - dnl Set up 4 directories: - - dnl pythondir -- where to install python scripts. This is the - dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior - dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON script directory], - [am_cv_python_pythondir], - [if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; - esac - ]) - AC_SUBST([pythondir], [$am_cv_python_pythondir]) - - dnl pkgpythondir -- $PACKAGE directory under pythondir. Was - dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is - dnl more consistent with the rest of automake. - - AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) +# serial 5 - dnl pyexecdir -- directory for installing python extension modules - dnl (shared libraries) - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], - [am_cv_python_pyexecdir], - [if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || - echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; - esac - ]) - AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) - dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) +# Check to see how 'make' treats includes. -*- Autoconf -*- - AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. - dnl Run any user-specified action. - $2 - fi +# serial 4 +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf ]) - -# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# --------------------------------------------------------------------------- -# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. -# Run ACTION-IF-FALSE otherwise. -# This test uses sys.hexversion instead of the string equivalent (first -# word of sys.version), in order to cope with versions such as 2.2c1. -# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). -AC_DEFUN([AM_PYTHON_CHECK_VERSION], - [prog="import sys -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -# map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] -minverhex = 0 -# xrange is not present in Python 3.0 and range returns an iterator -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, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) +# serial 6 -# Check to make sure that the build environment is sane. -*- Autoconf -*- +# 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])]) +]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; -esac +# serial 6 -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - test "$[2]" = conftest.file - ) -then - # Ok. - : +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) fi -AC_MSG_RESULT(yes)]) +]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 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_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# --------------------------------------------------------------------------- +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. +# +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. +# +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). +# +# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. +AC_DEFUN([AM_PATH_PYTHON], + [ + dnl Find a Python interpreter. Python versions prior to 2.0 are not + dnl supported. (2.0 was released on October 16, 2000). + m4_define_default([_AM_PYTHON_INTERPRETER_LIST], + [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl +python2.1 python2.0]) + + m4_if([$1],[],[ + dnl No version check is needed. + # Find any Python interpreter. + if test -z "$PYTHON"; then + AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) + fi + am_display_PYTHON=python + ], [ + dnl A version check is needed. + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + AC_MSG_CHECKING([whether $PYTHON version >= $1]) + AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR(too old)]) + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + AC_CACHE_CHECK([for a Python interpreter with version >= $1], + [am_cv_pathless_PYTHON],[ + for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do + test "$am_cv_pathless_PYTHON" = none && break + AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) + done]) + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + ]) + + if test "$PYTHON" = :; then + dnl Run any user-specified action, or abort. + m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) + else -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. -# AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], + [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) + AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) -# Check how to create a tarball. -*- Autoconf -*- + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. + AC_SUBST([PYTHON_PREFIX], ['${prefix}']) + AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) -# serial 2 + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac + AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], + [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) + AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir + dnl Set up 4 directories: -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behavior + dnl is more consistent with lispdir.m4 for example. + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON script directory], + [am_cv_python_pythondir], + [if test "x$prefix" = xNONE + then + am_py_prefix=$ac_default_prefix + else + am_py_prefix=$prefix + fi + am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) + am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) + AC_SUBST([pythondir], [$am_cv_python_pythondir]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# 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. + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl -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 + AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) -# 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. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure 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_ifval([$2], [$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], + [am_cv_python_pyexecdir], + [if test "x$exec_prefix" = xNONE + then + am_py_exec_prefix=$am_py_prefix + else + am_py_exec_prefix=$exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || + echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) + am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) + AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) -# _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`], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG + AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) -# _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 + dnl Run any user-specified action. + $2 + fi +]) -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl -pkg_failed=no -AC_MSG_CHECKING([for $1]) +# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. +# This test uses sys.hexversion instead of the string equivalent (first +# word of sys.version), in order to cope with versions such as 2.2c1. +# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). +AC_DEFUN([AM_PYTHON_CHECK_VERSION], + [prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +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])]) -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD +# Check to make sure that the build environment is sane. -*- Autoconf -*- - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -$$1_PKG_ERRORS +# serial 5 -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[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. +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then -_PKG_TEXT + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi -To get pkg-config, see .])], - [$4]) + test "$[2]" = conftest.file + ) +then + # Ok. + : else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MODULES - -# Configure paths for GLIB -# Owen Taylor 1997-2001 + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) -dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject, -dnl gthread, or gio is specified in MODULES, pass to pkg-config -dnl -AC_DEFUN([AM_PATH_GLIB_2_0], -[dnl -dnl Get the cflags and libraries from pkg-config -dnl -AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], - , enable_glibtest=yes) +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. - pkg_config_args=glib-2.0 - for module in . $4 - do - case "$module" in - gmodule) - pkg_config_args="$pkg_config_args gmodule-2.0" - ;; - gmodule-no-export) - pkg_config_args="$pkg_config_args gmodule-no-export-2.0" - ;; - gobject) - pkg_config_args="$pkg_config_args gobject-2.0" - ;; - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - gio*) - pkg_config_args="$pkg_config_args $module-2.0" - ;; - esac - done +# serial 1 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) - PKG_PROG_PKG_CONFIG([0.16]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. - no_glib="" +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) - if test "x$PKG_CONFIG" = x ; then - no_glib=yes - PKG_CONFIG=no - fi +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. - min_glib_version=ifelse([$1], ,2.0.0,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) +# serial 2 - if test x$PKG_CONFIG != xno ; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" - enable_glibtest=no - fi +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) - if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then - : - else - no_glib=yes - fi - fi +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - if test x"$no_glib" = x ; then - GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` - GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` - GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` +# Check how to create a tarball. -*- Autoconf -*- - GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` - GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` - glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" -dnl -dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of pkg-config to some extent) -dnl - rm -f conf.glibtest - AC_TRY_RUN([ -#include -#include -#include +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -int -main () -{ - int major, minor, micro; - char *tmp_version; +# serial 2 - fclose (fopen ("conf.glibtest", "w")); +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$PKG_CONFIG" = "no" ; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://www.freedesktop.org/software/pkgconfig/" - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - GLIB_GENMARSHAL="" - GOBJECT_QUERY="" - GLIB_MKENUMS="" - ifelse([$3], , :, [$3]) + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - AC_SUBST(GLIB_GENMARSHAL) - AC_SUBST(GOBJECT_QUERY) - AC_SUBST(GLIB_MKENUMS) - rm -f conf.glibtest -]) +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR m4_include([m4/as-ac-expand.m4]) m4_include([m4/jhflags.m4]) diff --git a/codegen/Makefile.am b/codegen/Makefile.am index cdb1e99..f9886eb 100644 --- a/codegen/Makefile.am +++ b/codegen/Makefile.am @@ -29,3 +29,5 @@ codegen_PYTHON = \ reversewrapper.py EXTRA_DIST = $(codegen_SCRIPTS) README.defs pygobject-codegen-$(PLATFORM_VERSION).in + +-include $(top_srcdir)/git.mk diff --git a/codegen/Makefile.in b/codegen/Makefile.in index c9193fc..12a8cf9 100644 --- a/codegen/Makefile.in +++ b/codegen/Makefile.in @@ -73,6 +73,12 @@ am__base_list = \ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(codegendir)" \ "$(DESTDIR)$(codegendir)" SCRIPTS = $(bin_SCRIPTS) $(codegen_SCRIPTS) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = py_compile = $(top_srcdir)/py-compile @@ -80,6 +86,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -110,6 +117,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ @@ -121,6 +131,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_PC = @LIBFFI_PC@ @@ -130,7 +142,9 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -143,10 +157,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ @@ -169,6 +188,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -201,7 +221,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -253,7 +272,7 @@ EXTRA_DIST = $(codegen_SCRIPTS) README.defs pygobject-codegen-$(PLATFORM_VERSION all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -262,9 +281,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu codegen/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign codegen/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu codegen/Makefile + $(AUTOMAKE) --foreign codegen/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -278,9 +297,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): pygobject-codegen-2.0: $(top_builddir)/config.status $(srcdir)/pygobject-codegen-2.0.in @@ -550,6 +569,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-codegenPYTHON \ uninstall-codegenPYTHON uninstall-codegenSCRIPTS +-include $(top_srcdir)/git.mk + # 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. .NOEXPORT: diff --git a/codegen/argtypes.py b/codegen/argtypes.py index b35f6ef..46e868e 100644 --- a/codegen/argtypes.py +++ b/codegen/argtypes.py @@ -79,14 +79,14 @@ class ArgType: def write_param(self, ptype, pname, pdflt, pnull, info): """Add code to the WrapperInfo instance to handle parameter.""" - raise RuntimeError, "write_param not implemented for %s" % \ - self.__class__.__name__ + raise RuntimeError("write_param not implemented for %s" + % self.__class__.__name__) def write_return(self, ptype, ownsreturn, info): """Adds a variable named ret of the return type to info.varlist, and add any required code to info.codeafter to convert the return value to a python object.""" - raise RuntimeError, "write_return not implemented for %s" % \ - self.__class__.__name__ + raise RuntimeError("write_return not implemented for %s" + % self.__class__.__name__) class NoneArg(ArgType): def write_return(self, ptype, ownsreturn, info): diff --git a/codegen/definitions.py b/codegen/definitions.py index aca5adb..bfb6faf 100644 --- a/codegen/definitions.py +++ b/codegen/definitions.py @@ -71,15 +71,15 @@ class Definition(object): def __init__(self, *args): """Create a new defs object of this type. The arguments are the components of the definition""" - raise RuntimeError, "this is an abstract class" + raise RuntimeError("this is an abstract class") def merge(self, old): """Merge in customisations from older version of definition""" - raise RuntimeError, "this is an abstract class" + raise RuntimeError("this is an abstract class") def write_defs(self, fp=sys.stdout): """write out this definition in defs file format""" - raise RuntimeError, "this is an abstract class" + raise RuntimeError("this is an abstract class") def guess_return_value_ownership(self): "return 1 if caller owns return value" @@ -407,7 +407,7 @@ class MethodDef(MethodDefBase): for item in ('c_name', 'of_object'): if self.__dict__[item] == None: self.write_defs(sys.stderr) - raise RuntimeError, "definition missing required %s" % (item,) + raise RuntimeError("definition missing required %s" % (item,)) def write_defs(self, fp=sys.stdout): fp.write('(define-method ' + self.name + '\n') @@ -491,7 +491,7 @@ class FunctionDef(Definition): for item in ('c_name',): if self.__dict__[item] == None: self.write_defs(sys.stderr) - raise RuntimeError, "definition missing required %s" % (item,) + raise RuntimeError("definition missing required %s" % (item,)) _method_write_defs = MethodDef.__dict__['write_defs'] @@ -513,8 +513,8 @@ class FunctionDef(Definition): else: param.merge(old_param) return param - raise RuntimeError, "could not find %s in old_parameters %r" % ( - param.pname, [p.pname for p in old.params]) + raise RuntimeError("could not find %s in old_parameters %r" % ( + param.pname, [p.pname for p in old.params])) try: self.params = map(merge_param, self.params) except RuntimeError: diff --git a/codegen/docextract_to_xml.py b/codegen/docextract_to_xml.py index 7ac1053..f41c839 100755 --- a/codegen/docextract_to_xml.py +++ b/codegen/docextract_to_xml.py @@ -89,7 +89,7 @@ if __name__ == '__main__': print "" - for name, value in docs.items(): + for name, value in sorted(docs.items()): # Get the type of comment block ('function', 'signal' or # 'property') (the value is a GtkDoc). block_type = value.get_type() diff --git a/config.h.in b/config.h.in index 061e620..5ac6e15 100644 --- a/config.h.in +++ b/config.h.in @@ -1,7 +1,7 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Use PyGI to create wrappers for introspection-enabled types */ -#undef ENABLE_PYGI +/* Use introspection information */ +#undef ENABLE_INTROSPECTION /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -61,6 +61,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff --git a/configure b/configure index b53dedf..927e918 100755 --- a/configure +++ b/configure @@ -1,20 +1,24 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for pygobject 2.21.3. +# Generated by GNU Autoconf 2.68 for pygobject 2.28.6. # # Report bugs to . # +# # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -22,23 +26,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -46,7 +42,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -57,7 +59,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -80,13 +82,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -96,15 +91,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -116,12 +112,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -133,7 +133,265 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -147,8 +405,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -168,564 +430,129 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit } -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -if as_func_ret_success; then - : +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi else - exitcode=1 - echo as_func_ret_success failed. + as_ln_s='cp -p' fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - exitcode=1 - echo positional parameters were not saved. + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi +as_executable_p=$as_test_x -test \$exitcode = 0) || { (exit 1); exit 1; } +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +SHELL=${CONFIG_SHELL-/bin/sh} - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -740,14 +567,14 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='pygobject' PACKAGE_TARNAME='pygobject' -PACKAGE_VERSION='2.21.3' -PACKAGE_STRING='pygobject 2.21.3' +PACKAGE_VERSION='2.28.6' +PACKAGE_STRING='pygobject 2.28.6' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject' +PACKAGE_URL='' ac_unique_file="gobject/gobjectmodule.c" # Factoring default headers for most tests. @@ -790,6 +617,17 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +INTROSPECTION_COMPILER +INTROSPECTION_SCANNER +ENABLE_CAIRO_FALSE +ENABLE_CAIRO_TRUE +ENABLE_INTROSPECTION_FALSE +ENABLE_INTROSPECTION_TRUE +PYCAIRO_LIBS +PYCAIRO_CFLAGS +GI_DATADIR +GI_LIBS +GI_CFLAGS BUILD_GIOUNIX_FALSE BUILD_GIOUNIX_TRUE GIOUNIX_LIBS @@ -811,6 +649,8 @@ GOBJECT_QUERY GLIB_GENMARSHAL GLIB_LIBS GLIB_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH PKG_CONFIG THREADING_CFLAGS ENABLE_DOCS_FALSE @@ -833,8 +673,9 @@ OTOOL LIPO NMEDIT DSYMUTIL -lt_ECHO +MANIFEST_TOOL RANLIB +ac_ct_AR AR LN_S NM @@ -877,6 +718,9 @@ build_os build_vendor build_cpu build +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE am__untar am__tar AMTAR @@ -900,6 +744,8 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +AM_BACKSLASH +AM_DEFAULT_VERBOSITY PYGOBJECT_MICRO_VERSION PYGOBJECT_MINOR_VERSION PYGOBJECT_MAJOR_VERSION @@ -934,6 +780,7 @@ bindir program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -944,18 +791,22 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules +enable_maintainer_mode enable_static enable_shared with_pic enable_fast_install enable_dependency_tracking with_gnu_ld +with_sysroot enable_libtool_lock enable_thread enable_docs enable_glibtest with_ffi -enable_pygi +enable_cairo +enable_introspection ' ac_precious_vars='build_alias host_alias @@ -967,12 +818,18 @@ LIBS CPPFLAGS CPP PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR FFI_CFLAGS FFI_LIBS GIO_CFLAGS GIO_LIBS GIOUNIX_CFLAGS -GIOUNIX_LIBS' +GIOUNIX_LIBS +GI_CFLAGS +GI_LIBS +PYCAIRO_CFLAGS +PYCAIRO_LIBS' # Initialize some variables set by options. @@ -1035,8 +892,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1081,8 +939,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1108,8 +965,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1313,8 +1169,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1330,8 +1185,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1361,17 +1215,17 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1380,7 +1234,7 @@ Try \`$0 --help' for more information." >&2 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1388,15 +1242,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1419,8 +1271,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1434,8 +1285,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1450,11 +1301,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1493,13 +1342,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1525,7 +1372,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 2.21.3 to adapt to many kinds of systems. +\`configure' configures pygobject 2.28.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1539,7 +1386,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1595,7 +1442,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pygobject 2.21.3:";; + short | recursive ) echo "Configuration of pygobject 2.28.6:";; esac cat <<\_ACEOF @@ -1603,6 +1450,10 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] @@ -1613,8 +1464,9 @@ Optional Features: --disable-thread Disable pygobject threading support --enable-docs Enable documentation building --disable-glibtest do not try to compile and run a test GLIB program - --enable-pygi Use PyGI to create wrappers for - introspection-enabled types + --enable-cairo Enable Cairo bindings using introspection + information + --enable-introspection Use introspection information Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1622,6 +1474,8 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --without-ffi Disable libffi support Some influential environment variables: @@ -1630,10 +1484,14 @@ Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path FFI_CFLAGS C compiler flags for FFI, overriding pkg-config FFI_LIBS linker flags for FFI, overriding pkg-config GIO_CFLAGS C compiler flags for GIO, overriding pkg-config @@ -1642,6 +1500,12 @@ Some influential environment variables: C compiler flags for GIOUNIX, overriding pkg-config GIOUNIX_LIBS linker flags for GIOUNIX, overriding pkg-config + GI_CFLAGS C compiler flags for GI, overriding pkg-config + GI_LIBS linker flags for GI, overriding pkg-config + PYCAIRO_CFLAGS + C compiler flags for PYCAIRO, overriding pkg-config + PYCAIRO_LIBS + linker flags for PYCAIRO, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1709,22 +1573,286 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pygobject configure 2.21.3 -generated by GNU Autoconf 2.63 +pygobject configure 2.28.6 +generated by GNU Autoconf 2.68 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +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_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +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_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +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_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { 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_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func 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 2.21.3, which was -generated by GNU Autoconf 2.63. Invocation command line was +It was created by pygobject $as_me 2.28.6, which was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -1760,8 +1888,8 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS } >&5 @@ -1798,9 +1926,9 @@ do ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1816,13 +1944,13 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1834,11 +1962,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1847,13 +1973,13 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -1872,11 +1998,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1889,11 +2013,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -1907,11 +2029,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -1925,46 +2045,53 @@ _ASBOX exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h + # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -1975,19 +2102,23 @@ fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; @@ -1995,7 +2126,7 @@ $as_echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -2010,11 +2141,11 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; @@ -2024,17 +2155,17 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac @@ -2046,43 +2177,20 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi - - - - - - - - - - - - - - - - - - - - - - - - +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2096,30 +2204,35 @@ ACLOCAL_AMFLAGS="-I m4 -I ." -cat >>confdefs.h <<\_ACEOF -#define PYGOBJECT_MAJOR_VERSION 2 -_ACEOF -PYGOBJECT_MAJOR_VERSION=2 +$as_echo "#define PYGOBJECT_MAJOR_VERSION 2" >>confdefs.h +PYGOBJECT_MAJOR_VERSION=2 -cat >>confdefs.h <<\_ACEOF -#define PYGOBJECT_MINOR_VERSION 21 -_ACEOF -PYGOBJECT_MINOR_VERSION=21 +$as_echo "#define PYGOBJECT_MINOR_VERSION 28" >>confdefs.h +PYGOBJECT_MINOR_VERSION=28 -cat >>confdefs.h <<\_ACEOF -#define PYGOBJECT_MICRO_VERSION 3 -_ACEOF -PYGOBJECT_MICRO_VERSION=3 +$as_echo "#define PYGOBJECT_MICRO_VERSION 6" >>confdefs.h +PYGOBJECT_MICRO_VERSION=6 ac_config_headers="$ac_config_headers config.h" +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +AM_BACKSLASH='\' am__api_version='1.11' @@ -2140,9 +2253,7 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2168,10 +2279,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2179,11 +2290,11 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2220,7 +2331,7 @@ case $as_dir/ in ;; esac -done + done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir @@ -2236,7 +2347,7 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2247,7 +2358,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 @@ -2258,15 +2369,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 -$as_echo "$as_me: error: unsafe absolute working directory name" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 -$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -2288,11 +2395,8 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file @@ -2301,13 +2405,10 @@ then # Ok. : else - { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -$as_echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" @@ -2335,7 +2436,7 @@ if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= - { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi @@ -2356,9 +2457,9 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2369,24 +2470,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2396,9 +2497,9 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2409,24 +2510,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2435,7 +2536,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -2448,10 +2549,10 @@ fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2459,7 +2560,7 @@ for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do + for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( @@ -2471,11 +2572,12 @@ do esac done done -done + done IFS=$as_save_IFS fi + test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else @@ -2483,11 +2585,10 @@ fi # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" @@ -2500,9 +2601,9 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2513,24 +2614,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2538,11 +2639,11 @@ fi test -n "$AWK" && break done -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2550,7 +2651,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -2560,11 +2661,11 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2584,9 +2685,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2602,7 +2701,7 @@ fi # Define the identity of the package. PACKAGE='pygobject' - VERSION='2.21.3' + VERSION='2.28.6' cat >>confdefs.h <<_ACEOF @@ -2643,39 +2742,54 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -2691,28 +2805,24 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -2728,7 +2838,7 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking for some Win32 platform" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for some Win32 platform" >&5 $as_echo_n "checking for some Win32 platform... " >&6; } case "$host" in *-*-mingw*|*-*-cygwin*) @@ -2738,7 +2848,7 @@ case "$host" in platform_win32=no ;; esac -{ $as_echo "$as_me:$LINENO: result: $platform_win32" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $platform_win32" >&5 $as_echo "$platform_win32" >&6; } if test "$platform_win32" = "yes"; then PLATFORM_WIN32_TRUE= @@ -2749,7 +2859,7 @@ else fi -{ $as_echo "$as_me:$LINENO: checking for native Win32" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for native Win32" >&5 $as_echo_n "checking for native Win32... " >&6; } case "$host" in *-*-mingw*) @@ -2759,7 +2869,7 @@ case "$host" in os_win32=no ;; esac -{ $as_echo "$as_me:$LINENO: result: $os_win32" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $os_win32" >&5 $as_echo "$os_win32" >&6; } if test "$os_win32" = "yes"; then OS_WIN32_TRUE= @@ -2771,7 +2881,7 @@ fi # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then +if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -2807,13 +2917,13 @@ fi enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AS+set}" = set; then +if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then @@ -2824,24 +2934,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then - { $as_echo "$as_me:$LINENO: result: $AS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2851,9 +2961,9 @@ if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AS+set}" = set; then +if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then @@ -2864,24 +2974,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2890,7 +3000,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -2903,9 +3013,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then @@ -2916,24 +3026,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2943,9 +3053,9 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then @@ -2956,24 +3066,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2982,7 +3092,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -2995,9 +3105,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -3008,24 +3118,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3035,9 +3145,9 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -3048,24 +3158,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3074,7 +3184,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -3109,14 +3219,14 @@ test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -macro_version='2.2.6b' -macro_revision='1.3017' +macro_version='2.4' +macro_revision='1.3293' @@ -3132,6 +3242,75 @@ macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -3144,7 +3323,7 @@ am__doit: .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= @@ -3172,12 +3351,12 @@ if test "$am__include" = "#"; then fi -{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then +if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi @@ -3202,9 +3381,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3215,24 +3394,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3242,9 +3421,9 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3255,24 +3434,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3281,7 +3460,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -3295,9 +3474,9 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3308,24 +3487,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3335,9 +3514,9 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3349,18 +3528,18 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -3379,10 +3558,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3394,9 +3573,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3407,24 +3586,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3438,9 +3617,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3451,24 +3630,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3481,7 +3660,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -3492,57 +3671,37 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3558,8 +3717,8 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -3575,17 +3734,17 @@ do done rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" +if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3602,7 +3761,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3621,84 +3780,41 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" +if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3713,32 +3829,83 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +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_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { 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 + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3750,17 +3917,17 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3773,31 +3940,23 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3811,37 +3970,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -3850,20 +3988,16 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3874,35 +4008,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3913,36 +4023,12 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3953,42 +4039,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -4005,18 +4066,14 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4073,32 +4130,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -4109,17 +4143,19 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4129,9 +4165,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4239,7 +4275,7 @@ else fi fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type @@ -4254,9 +4290,9 @@ else fi -{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -4264,7 +4300,7 @@ else ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - $as_unset ac_script || ac_script= + { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4273,7 +4309,7 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue @@ -4293,7 +4329,7 @@ case `"$ac_path_SED" --version 2>&1` in $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" @@ -4308,19 +4344,17 @@ esac $ac_path_SED_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -4338,9 +4372,9 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4351,7 +4385,7 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue @@ -4371,7 +4405,7 @@ case `"$ac_path_GREP" --version 2>&1` in $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" @@ -4386,26 +4420,24 @@ esac $ac_path_GREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4419,7 +4451,7 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue @@ -4439,7 +4471,7 @@ case `"$ac_path_EGREP" --version 2>&1` in $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" @@ -4454,12 +4486,10 @@ esac $ac_path_EGREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4467,14 +4497,14 @@ fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -4488,7 +4518,7 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue @@ -4508,7 +4538,7 @@ case `"$ac_path_FGREP" --version 2>&1` in $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" @@ -4523,12 +4553,10 @@ esac $ac_path_FGREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -4536,7 +4564,7 @@ fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -4562,7 +4590,7 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then +if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no @@ -4571,7 +4599,7 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) @@ -4601,13 +4629,13 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -4638,18 +4666,16 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - { $as_echo "$as_me:$LINENO: result: $LD" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -4662,7 +4688,7 @@ case `$LD -v 2>&1 &5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -4674,9 +4700,9 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test "${lt_cv_path_NM+set}" = set; then +if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -4723,20 +4749,23 @@ else : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -4747,24 +4776,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4774,13 +4803,13 @@ fi fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -4791,24 +4820,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4821,7 +4850,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -4829,6 +4858,15 @@ esac fi fi + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -4841,44 +4879,44 @@ test -z "$NM" && NM=nm -{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4851: $ac_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4854: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4857: output\"" >&5) + (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 @@ -4911,6 +4949,11 @@ else lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -4975,8 +5018,8 @@ else # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -4996,10 +5039,10 @@ else fi if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:$LINENO: result: none" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -5013,27 +5056,27 @@ max_cmd_len=$lt_cv_sys_max_cmd_len : ${MV="mv -f"} : ${RM="rm -f"} -{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes -{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } -{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes -{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } @@ -5068,14 +5111,88 @@ esac -{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then +if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in @@ -5084,6 +5201,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -5104,9 +5226,9 @@ esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -5117,24 +5239,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -5144,9 +5266,9 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -5157,24 +5279,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -5183,7 +5305,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -5200,9 +5322,9 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then +if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -5244,16 +5366,18 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -5283,6 +5407,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -5291,11 +5419,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -5317,7 +5445,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -5325,86 +5453,250 @@ 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 - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $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 +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; 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_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + 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 + DLLTOOL=$ac_ct_DLLTOOL fi - ;; +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; +test -z "$DLLTOOL" && DLLTOOL=dlltool -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; - pc) - lt_cv_deplibs_check_method=pass_all + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -5414,11 +5706,13 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -5429,36 +5723,40 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$AR" && break + done fi -if test -z "$ac_cv_prog_AR"; then +if test -z "$AR"; then ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -5469,48 +5767,108 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + + test -n "$ac_ct_AR" && break +done + if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 AR=$ac_ct_AR fi -else - AR="$ac_cv_prog_AR" fi -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi @@ -5521,9 +5879,9 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -5534,24 +5892,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -5561,9 +5919,9 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -5574,24 +5932,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -5600,7 +5958,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -5620,9 +5978,9 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -5633,24 +5991,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -5660,9 +6018,9 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -5673,24 +6031,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -5699,7 +6057,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -5733,6 +6091,18 @@ if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + @@ -5777,9 +6147,9 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then +if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5840,8 +6210,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -5877,6 +6247,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -5895,18 +6266,18 @@ void nm_test_func(void){} int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -5918,6 +6289,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -5929,7 +6312,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT_DLSYM_CONST struct { const char *name; void *address; } @@ -5955,19 +6338,19 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -5997,13 +6380,24 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:$LINENO: result: failed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else - { $as_echo "$as_me:$LINENO: result: ok" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + @@ -6026,8 +6420,45 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then +if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi @@ -6039,11 +6470,11 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" @@ -6057,12 +6488,12 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6060 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) @@ -6096,11 +6527,11 @@ x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in @@ -6149,9 +6580,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then +if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -6160,11 +6591,7 @@ 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 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6175,38 +6602,13 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_cc_needs_belf=no + lt_cv_cc_needs_belf=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6214,7 +6616,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf @@ -6224,11 +6626,11 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in @@ -6246,7 +6648,124 @@ sparc*-*solaris*) ;; esac -need_locks="$enable_libtool_lock" +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $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 +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; 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_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + 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 + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + case $host_os in @@ -6254,9 +6773,9 @@ need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then +if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -6267,24 +6786,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6294,9 +6813,9 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -6307,24 +6826,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6333,7 +6852,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -6346,9 +6865,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -6359,24 +6878,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6386,9 +6905,9 @@ if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -6399,24 +6918,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6425,7 +6944,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -6438,9 +6957,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -6451,24 +6970,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6478,9 +6997,9 @@ if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -6491,24 +7010,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6517,7 +7036,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -6530,9 +7049,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then +if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -6543,24 +7062,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6570,9 +7089,9 @@ if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -6583,24 +7102,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6609,7 +7128,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -6622,9 +7141,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then +if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -6635,24 +7154,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6662,9 +7181,9 @@ if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -6675,24 +7194,24 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6701,7 +7220,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -6737,9 +7256,9 @@ fi - { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then +if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -6764,22 +7283,18 @@ else rm -f conftest.* fi fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then +if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6790,43 +7305,50 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_ld_exported_symbols_list=no + lt_cv_ld_exported_symbols_list=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -6854,7 +7376,7 @@ $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -6867,14 +7389,14 @@ 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:$LINENO: checking how to run the C preprocessor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -6889,11 +7411,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -6902,78 +7420,34 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : break fi @@ -6985,7 +7459,7 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -6996,11 +7470,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -7009,87 +7479,40 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -7099,16 +7522,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -7123,48 +7542,23 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no + ac_cv_header_stdc=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -7174,18 +7568,14 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -7195,14 +7585,10 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -7229,118 +7615,33 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : -( exit $ac_status ) -ac_cv_header_stdc=no +else + ac_cv_header_stdc=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7350,62 +7651,13 @@ fi done - for ac_header in dlfcn.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_DLFCN_H 1 _ACEOF fi @@ -7414,6 +7666,8 @@ done + + # Set options @@ -7423,7 +7677,7 @@ done # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then +if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -7456,7 +7710,7 @@ fi # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then +if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default @@ -7472,7 +7726,7 @@ test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then +if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -7534,6 +7788,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' + test -z "$LN_S" && LN_S="ln -s" @@ -7553,9 +7808,9 @@ if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -7568,7 +7823,7 @@ else fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir @@ -7583,19 +7838,6 @@ _ACEOF - - - - - - - - - - - - - case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -7603,27 +7845,10 @@ aix3*) # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' + export COLLECT_NAMES + fi + ;; +esac # Global variables: ofile=libtool @@ -7653,7 +7878,7 @@ for cc_temp in $compiler""; do *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -7661,9 +7886,9 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -7714,10 +7939,10 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -7727,9 +7952,9 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:$LINENO: checking for file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -7780,10 +8005,10 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -7862,11 +8087,16 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac - { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -7882,15 +8112,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7885: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7889: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -7899,7 +8129,7 @@ else $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then @@ -7919,8 +8149,6 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -7968,6 +8196,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -8010,6 +8244,13 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8051,7 +8292,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -8072,7 +8313,13 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8084,25 +8331,25 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_wl='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' + lt_prog_compiler_wl='-Wl,' ;; esac ;; @@ -8134,7 +8381,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -8191,21 +8438,25 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then +if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -8221,15 +8472,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8224: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8228: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -8238,7 +8489,7 @@ else $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then @@ -8258,13 +8509,18 @@ fi + + + + + # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then +if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -8277,7 +8533,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -8290,7 +8546,7 @@ else LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then @@ -8305,9 +8561,9 @@ fi - { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -8326,16 +8582,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8329: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8333: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -8352,7 +8608,7 @@ else $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } @@ -8360,9 +8616,9 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -8381,16 +8637,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8384: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8388: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -8407,7 +8663,7 @@ else $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } @@ -8416,7 +8672,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* @@ -8424,10 +8680,10 @@ $as_echo_n "checking if we can lock with hard links... " >&6; } touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi @@ -8440,7 +8696,7 @@ fi - { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= @@ -8503,7 +8759,33 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie esac ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -8521,6 +8803,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -8536,11 +8819,12 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -8576,10 +8860,12 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -8597,6 +8883,11 @@ _LT_EOF fi ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -8612,7 +8903,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -8622,15 +8913,16 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -8641,13 +8933,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -8663,17 +8959,17 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -8687,8 +8983,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -8706,8 +9002,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -8753,8 +9049,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -8794,8 +9090,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -8882,11 +9180,13 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -8897,54 +9197,34 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -8953,11 +9233,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi else # Determine the default libpath from the value encoded in an # empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -8968,59 +9250,44 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9052,20 +9319,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac ;; darwin* | rhapsody*) @@ -9075,7 +9385,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -9083,7 +9397,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -9126,7 +9440,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -9134,7 +9448,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -9149,8 +9463,8 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -9168,16 +9482,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -9189,7 +9503,46 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; esac fi @@ -9217,52 +9570,39 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat >conftest.$ac_ext <<_ACEOF -int foo(void) {} + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + lt_cv_irix_exported_symbol=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9324,17 +9664,17 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9344,13 +9684,13 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -9363,9 +9703,9 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -9514,7 +9854,7 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ fi fi -{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no @@ -9551,46 +9891,52 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi @@ -9753,7 +10099,7 @@ esac - { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then @@ -9761,16 +10107,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -9783,7 +10136,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -9803,7 +10156,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -9891,7 +10250,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -9922,8 +10281,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -9944,36 +10304,83 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -10060,6 +10467,19 @@ gnu*) hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -10102,8 +10522,10 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) @@ -10161,7 +10583,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -10170,16 +10592,17 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10189,44 +10612,20 @@ main () ; return 0; } -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then - shlibpath_overrides_runpath=yes -fi - -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -10238,8 +10637,9 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ # 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;/^$/d' | tr '\n' ' '` + 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="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -10439,62 +10839,659 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi +fi +fi +fi +fi +fi + ;; + esac + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" +#if HAVE_DLFCN_H +#include +#endif +#include +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" +#if HAVE_DLFCN_H +#include +#endif +#include +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi @@ -10512,71 +11509,34 @@ fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $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; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac fi @@ -10584,2240 +11544,2873 @@ fi - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dl_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dl_dlopen=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi ;; - *) - { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 -$as_echo_n "checking for shl_load... " >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } -#ifdef __STDC__ -# include -#else -# include -#endif -#undef shl_load -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_shl_load || defined __stub___shl_load -choke me -#endif -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_shl_load=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +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 - ac_cv_func_shl_load=no -fi +CC="$lt_save_CC" -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -$as_echo "$ac_cv_func_shl_load" >&6; } -if test "x$ac_cv_func_shl_load" = x""yes; then - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dld_shl_load=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dld_shl_load=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 -$as_echo_n "checking for dlopen... " >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef dlopen -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_dlopen || defined __stub___dlopen -choke me -#endif -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_dlopen=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -$as_echo "$ac_cv_func_dlopen" >&6; } -if test "x$ac_cv_func_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dl_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dl_dlopen=no -fi + ac_config_commands="$ac_config_commands libtool" -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_svld_dlopen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_svld_dlopen=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Only expand once: -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dld_dld_link=yes + +: ${CONFIG_LT=./config.lt} +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 +$as_echo "$as_me: creating $CONFIG_LT" >&6;} +as_write_fail=0 +cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi - ac_cv_lib_dld_dld_link=no + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi -fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 fi - - +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' -fi - +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE -fi +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - ;; - esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status - { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - $as_echo_n "(cached) " >&6 +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11187 "configure" -#include "confdefs.h" + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -#if HAVE_DLFCN_H -#include -#endif -#include +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits - return status; -} -_LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' fi +else + as_ln_s='cp -p' fi -rm -fr conftest* +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11283 "configure" -#include "confdefs.h" + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x -#if HAVE_DLFCN_H -#include -#endif +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -#include +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +exec 6>&1 +## --------------------------------- ## +## Main body of "$CONFIG_LT" script. ## +## --------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x "$CONFIG_LT" -void fnord() { int i=42;} -int main () +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec 5>>config.log { - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac +Usage: $0 [OPTIONS] - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files +Report bugs to ." +lt_cl_version="\ +pygobject config.lt 2.28.6 +configured by $0, generated by GNU Autoconf 2.68. +Copyright (C) 2010 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." +while test $# != 0 +do + case $1 in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + -*) as_fn_error $? "unrecognized option: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + *) as_fn_error $? "unrecognized argument: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + esac + shift +done +if $lt_cl_silent; then + exec 6>/dev/null +fi +_LTEOF +cat >>"$CONFIG_LT" <<_LTEOF +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' -striplib= -old_striplib= -{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST fi + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' +_LTEOF +cat >>"$CONFIG_LT" <<\_LTEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} - - - - - # Report which library types will actually be built - { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST fi - ;; - esac - { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -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 +# The names of the tagged configurations supported by this script. +available_tags="" -CC="$lt_save_CC" +# ### BEGIN LIBTOOL CONFIG +# Whether or not to build static libraries. +build_old_libs=$enable_static +# Assembler program. +AS=$lt_AS +# DLL creation program. +DLLTOOL=$lt_DLLTOOL +# Object dumper program. +OBJDUMP=$lt_OBJDUMP +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared +# What type of objects to build. +pic_mode=$pic_mode +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL +# An echo program that protects backslashes. +ECHO=$lt_ECHO +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os - ac_config_commands="$ac_config_commands libtool" +# A sed program that does not truncate output. +SED=$lt_SED +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" +# A grep program that handles long lines. +GREP=$lt_GREP +# An ERE matcher. +EGREP=$lt_EGREP -# Only expand once: +# A literal string matcher. +FGREP=$lt_FGREP +# A BSD- or MS-compatible name lister. +NM=$lt_NM -: ${CONFIG_LT=./config.lt} -{ $as_echo "$as_me:$LINENO: creating $CONFIG_LT" >&5 -$as_echo "$as_me: creating $CONFIG_LT" >&6;} -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. +# Whether we need soft or hard links. +LN_S=$lt_LN_S -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len -cat >>"$CONFIG_LT" <<\_LTEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +# Object file suffix (normally "o"). +objext=$ac_objext -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac +# Executable file suffix (normally ""). +exeext=$exeext -fi +# whether the shell understands "unset". +lt_unset=$lt_unset +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS +# The archiver. +AR=$lt_AR - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +# A symbol stripping program. +STRIP=$lt_STRIP -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction +# A C compiler. +LTCC=$lt_CC -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS -# CDPATH. -$as_unset CDPATH +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { { $as_echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -$as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot +# The name of the directory that contains temporary libtool files. +objdir=$objdir -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi +# Must we lock files when doing compilation? +need_locks=$lt_need_locks -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 +# Old archive suffix (normally "a"). +libext=$libext -exec 6>&1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -Usage: $0 [OPTIONS] +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix -Report bugs to ." +# Do we need a version for libraries? +need_version=$need_version -lt_cl_version="\ -pygobject config.lt 2.21.3 -configured by $0, generated by GNU Autoconf 2.63. +# Library versioning type. +version_type=$version_type -Copyright (C) 2008 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec -while test $# != 0 -do - case $1 in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec - -*) { { $as_echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -$as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) { { $as_echo "$as_me:$LINENO: error: unrecognized argument: $1 -Try \`$0 --help' for more information." >&5 -$as_echo "$as_me: error: unrecognized argument: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - esac - shift -done +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec -if $lt_cl_silent; then - exec 6>/dev/null -fi -_LTEOF +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode -cat >>"$CONFIG_LT" <<_LTEOF +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -# Quote evaled strings. -for var in SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -deplibs_check_method \ -file_magic_cmd \ -AR \ -AR_FLAGS \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ -lt_prog_compiler_pic \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ -hardcode_libdir_separator \ -fix_srcfile_path \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac +# Whether dlopen is supported. +dlopen_support=$enable_dlopen -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' +# The linker used to build libraries. +LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds -_LTEOF +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds -cat >>"$CONFIG_LT" <<\_LTEOF -{ $as_echo "$as_me:$LINENO: creating $ofile" >&5 -$as_echo "$as_me: creating $ofile" >&6;} +# A language specific compiler. +CC=$lt_compiler +# Is the compiler the GNU compiler? +with_gcc=$GCC - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool 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. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o -# The names of the tagged configurations supported by this script. -available_tags="" +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc -# ### BEGIN LIBTOOL CONFIG +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes -# Whether or not to build static libraries. -build_old_libs=$enable_static +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec -# Assembler program. -AS=$AS +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec -# DLL creation program. -DLLTOOL=$DLLTOOL +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object -# Object dumper program. -OBJDUMP=$OBJDUMP +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds -# What type of objects to build. -pic_mode=$pic_mode +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag -# A sed program that does not truncate output. -SED=$lt_SED +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld -# A grep program that handles long lines. -GREP=$lt_GREP +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator -# An ERE matcher. -EGREP=$lt_EGREP +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct -# A literal string matcher. -FGREP=$lt_FGREP +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute -# A BSD- or MS-compatible name lister. -NM=$lt_NM +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L -# Whether we need soft or hard links. -LN_S=$lt_LN_S +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic -# Object file suffix (normally "o"). -objext=$ac_objext +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath -# Executable file suffix (normally ""). -exeext=$exeext +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs -# whether the shell understands "unset". -lt_unset=$lt_unset +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds -# Command to use when deplibs_check_method == "file_magic". -file_magic_cmd=$lt_file_magic_cmd +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec -# A symbol stripping program. -STRIP=$lt_STRIP +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds +# ### END LIBTOOL CONFIG -# A C compiler. -LTCC=$lt_CC +_LT_EOF -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +ltmain="$ac_aux_dir/ltmain.sh" -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" -# The name of the directory that contains temporary libtool files. -objdir=$objdir -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +as_fn_exit 0 +_LTEOF +chmod +x "$CONFIG_LT" -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec 5>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec 5>>config.log +$lt_cl_success || as_fn_exit 1 -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 +$as_echo_n "checking for library containing strerror... " >&6; } +if ${ac_cv_search_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Must we lock files when doing compilation? -need_locks=$lt_need_locks +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} +_ACEOF +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_strerror=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_strerror+:} false; then : + break +fi +done +if ${ac_cv_search_strerror+:} false; then : -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL +else + ac_cv_search_strerror=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 +$as_echo "$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT +fi -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO +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 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $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 -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 -# Old archive suffix (normally "a"). -libext=$libext +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $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 -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $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 -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Do we need a version for libraries? -need_version=$need_version -# Library versioning type. -version_type=$version_type + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $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 -# Shared library runtime path variable. -runpath_var=$runpath_var +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Shared library path variable. -shlibpath_var=$shlibpath_var -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $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 -# Format of library name prefix. -libname_spec=$lt_libname_spec +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $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 -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds + test -n "$ac_ct_CC" && break +done -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi +fi -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs +fi -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } -# Whether dlopen is supported. -dlopen_support=$enable_dlopen +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&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_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +int +main () +{ +#ifndef __GNUC__ + choke me +#endif -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# The linker used to build libraries. -LD=$lt_LD +int +main () +{ -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# A language specific compiler. -CC=$lt_compiler +int +main () +{ -# Is the compiler the GNU compiler? -with_gcc=$GCC + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl +int +main () +{ -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec +fi -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec +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 -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object +depcc="$CC" am_compiler_list= -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld +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 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $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 -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $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 -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $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 -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $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 -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $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 -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $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 -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# ### END LIBTOOL CONFIG -_LT_EOF + test -n "$ac_ct_CC" && break +done - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi fi -_LT_EOF - ;; - esac +fi -ltmain="$ac_aux_dir/ltmain.sh" +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&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_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () +int +main () { - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} +#ifndef __GNUC__ + choke me +#endif -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" + ; + return 0; } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () +int +main () { - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} + ; + return 0; } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# func_lo2o object -func_lo2o () +int +main () { - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo + ; + return 0; } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# func_len string -# STRING may not start with a hyphen. -func_len () +int +main () { - func_len_result=${#1} -} -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" else - func_dirname_result="$func_dirname_result${2}" + CFLAGS="-g" fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; { - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` + return p[i]; } - -# func_arith arithmetic-term... -func_arith () +static char *f (char * (*g) (char **, int), char **p, ...) { - func_arith_result=`expr "$@"` + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; } -# func_len string -# STRING may not start with a hyphen. -func_len () +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () { - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; } +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC -_LT_EOF +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" +fi -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" +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 -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} +depcc="$CC" am_compiler_list= -_LT_EOF - ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi -{ (exit 0); exit 0; } -_LTEOF -chmod +x "$CONFIG_LT" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec 5>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec 5>>config.log - $lt_cl_success || { (exit 1); exit 1; } + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi + + +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc + if test "x$CC" != xcc; then - { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 + { $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:$LINENO: checking whether cc understands -c and -o together" >&5 + { $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 { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12833,63 +14426,63 @@ _ACEOF # 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 +if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - test -f conftest2.$ac_objext && { (case "(($ac_try" in + $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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $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 + { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + $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 + if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - test -f conftest2.$ac_objext && { (case "(($ac_try" in + $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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +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:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then # cc works too. : @@ -12906,15 +14499,13 @@ rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -cat >>confdefs.h <<\_ACEOF -#define NO_MINUS_C_MINUS_O 1 -_ACEOF +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi @@ -12934,19 +14525,20 @@ fi +# check that we have the minimum version of python necisary to build if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. - { $as_echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.3.5" >&5 -$as_echo_n "checking whether $PYTHON version >= 2.3.5... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.5.2" >&5 +$as_echo_n "checking whether $PYTHON version >= 2.5.2... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '2.3.5'.split('.'))) + [0, 0, 0] +minver = list(map(int, '2.5.2'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] @@ -12955,22 +14547,19 @@ sys.exit(sys.hexversion < minverhex)" ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + (exit $ac_status); }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { { $as_echo "$as_me:$LINENO: error: too old" >&5 -$as_echo "$as_me: error: too old" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "too old" "$LINENO" 5 fi - am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. - { $as_echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.3.5" >&5 -$as_echo_n "checking for a Python interpreter with version >= 2.3.5... " >&6; } -if test "${am_cv_pathless_PYTHON+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.5.2" >&5 +$as_echo_n "checking for a Python interpreter with version >= 2.5.2... " >&6; } +if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else @@ -12980,7 +14569,7 @@ else # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '2.3.5'.split('.'))) + [0, 0, 0] +minver = list(map(int, '2.5.2'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] @@ -12989,13 +14578,12 @@ sys.exit(sys.hexversion < minverhex)" ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + (exit $ac_status); }; then : break fi - done fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then @@ -13003,9 +14591,9 @@ $as_echo "$am_cv_pathless_PYTHON" >&6; } else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON+set}" = set; then +if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -13018,14 +14606,14 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -13033,10 +14621,10 @@ esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then - { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -13047,20 +14635,18 @@ fi if test "$PYTHON" = :; then - { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 -$as_echo "$as_me: error: no suitable Python interpreter found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if test "${am_cv_python_version+set}" = set; then +if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version @@ -13072,29 +14658,29 @@ $as_echo "$am_cv_python_version" >&6; } - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if test "${am_cv_python_platform+set}" = set; then +if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if test "${am_cv_python_pythondir+set}" = set; then +if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX'))" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir @@ -13103,15 +14689,15 @@ $as_echo "$am_cv_python_pythondir" >&6; } pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if test "${am_cv_python_pyexecdir+set}" = set; then +if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX'))" 2>/dev/null || echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir @@ -13125,6 +14711,51 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } +# check if we are building for python 3 +prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.0'.split('.'))) + [0, 0, 0] +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 + ($PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + build_py3k=true +else + build_py3k=false +fi + +# if building for python 3 make sure we have the minimum version supported +if test $build_py3k = true ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PYTHON >= 3.1" >&5 +$as_echo_n "checking for $PYTHON >= 3.1... " >&6; } + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.1'.split('.'))) + [0, 0, 0] +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 + ($PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + as_fn_error $? "too old" "$LINENO" 5 +fi +fi + @@ -13135,9 +14766,9 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON+set}" = set; then +if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -13150,14 +14781,14 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -13165,10 +14796,10 @@ esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then - { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -13182,20 +14813,18 @@ test -n "$PYTHON" || PYTHON=":" if test "$PYTHON" = :; then - { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 -$as_echo "$as_me: error: no suitable Python interpreter found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if test "${am_cv_python_version+set}" = set; then +if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version @@ -13207,23 +14836,23 @@ $as_echo "$am_cv_python_version" >&6; } - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if test "${am_cv_python_platform+set}" = set; then +if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if test "${am_cv_python_pythondir+set}" = set; then +if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE @@ -13250,7 +14879,7 @@ else esac fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir @@ -13259,9 +14888,9 @@ $as_echo "$am_cv_python_pythondir" >&6; } pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if test "${am_cv_python_pyexecdir+set}" = set; then +if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE @@ -13288,7 +14917,7 @@ else esac fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir @@ -13302,12 +14931,13 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } -{ $as_echo "$as_me:$LINENO: checking for headers required to compile python extensions" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for headers required to compile python extensions" >&5 $as_echo_n "checking for headers required to compile python extensions... " >&6; } py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` -if test -x "$PYTHON-config"; then -PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` +PYTHON_CONFIG=`which $PYTHON`-config +if test -x "$PYTHON_CONFIG"; then +PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` else PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" if test "$py_prefix" != "$py_exec_prefix"; then @@ -13315,66 +14945,30 @@ if test "$py_prefix" != "$py_exec_prefix"; then fi fi -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - { $as_echo "$as_me:$LINENO: result: found" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { $as_echo "$as_me:$LINENO: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } -{ { $as_echo "$as_me:$LINENO: error: could not find Python headers" >&5 -$as_echo "$as_me: error: could not find Python headers" >&2;} - { (exit 1); exit 1; }; } +as_fn_error $? "could not find Python headers" "$LINENO" 5 fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" -{ $as_echo "$as_me:$LINENO: checking for PySignal_SetWakeupFd in Python.h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PySignal_SetWakeupFd in Python.h" >&5 $as_echo_n "checking for PySignal_SetWakeupFd in Python.h... " >&6; } -py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` -if test -x "$PYTHON-config"; then -PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` -else -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -fi old_CPPFLAGS=$CPPFLAGS CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -13385,40 +14979,17 @@ PySignal_SetWakeupFd(0); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : setwakeupfd_ok=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - setwakeupfd_ok=no + setwakeupfd_ok=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $setwakeupfd_ok" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $setwakeupfd_ok" >&5 $as_echo "$setwakeupfd_ok" >&6; } if test "x$setwakeupfd_ok" != xno; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_PYSIGNAL_SETWAKEUPFD 1 -_ACEOF +$as_echo "#define HAVE_PYSIGNAL_SETWAKEUPFD 1" >>confdefs.h fi CPPFLAGS=$old_CPPFLAGS @@ -13427,7 +14998,7 @@ PLATFORM=`$PYTHON -c "import sys; from distutils import util; sys.stdout.write(u # Check whether --enable-thread was given. -if test "${enable_thread+set}" = set; then +if test "${enable_thread+set}" = set; then : enableval=$enable_thread; else enable_thread=yes @@ -13435,7 +15006,7 @@ fi # Check whether --enable-docs was given. -if test "${enable_docs+set}" = set; then +if test "${enable_docs+set}" = set; then : enableval=$enable_docs; enable_docs=$enableval else enable_docs=no @@ -13444,9 +15015,9 @@ fi if test "${enable_docs}" != no; then # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XSLTPROC+set}" = set; then +if ${ac_cv_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in @@ -13459,14 +15030,14 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -13474,10 +15045,10 @@ esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then - { $as_echo "$as_me:$LINENO: result: $XSLTPROC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -13499,9 +15070,9 @@ fi py_mod_var=`echo thread'_' | sed 'y%./+-%__p_%'` -{ $as_echo "$as_me:$LINENO: checking for python module thread" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python module thread" >&5 $as_echo_n "checking for python module thread... " >&6; } -if { as_var=py_cv_mod_$py_mod_var; eval "test \"\${$as_var+set}\" = set"; }; then +if eval \${py_cv_mod_$py_mod_var+:} false; then : $as_echo_n "(cached) " >&6 else @@ -13525,26 +15096,64 @@ fi py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` if test "x$py_val" != xno; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $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; } + enable_thread=check_for_py3_module +fi + +if test "x$enable_thread" = xcheck_for_py3_module; then + +py_mod_var=`echo _thread'_' | sed 'y%./+-%__p_%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python module _thread" >&5 +$as_echo_n "checking for python module _thread... " >&6; } +if eval \${py_cv_mod_$py_mod_var+:} false; then : + $as_echo_n "(cached) " >&6 +else + +prog=" +import sys +try: + import _thread +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)" +if $PYTHON -c "$prog" 1>&5 2>&5 + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi + +fi + +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_thread=no fi +fi -{ $as_echo "$as_me:$LINENO: checking whether to enable threading in pygobject" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable threading in pygobject" >&5 $as_echo_n "checking whether to enable threading in pygobject... " >&6; } if test "x$enable_thread" != xno; then extra_mods=gthread THREADING_CFLAGS= - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else extra_mods= THREADING_CFLAGS="-DDISABLE_THREADING" - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -13553,7 +15162,7 @@ CPPFLAGS="${CPPFLAGS} $THREADING_CFLAGS" export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` # Check whether --enable-glibtest was given. -if test "${enable_glibtest+set}" = set; then +if test "${enable_glibtest+set}" = set; then : enableval=$enable_glibtest; else enable_glibtest=yes @@ -13584,13 +15193,17 @@ fi + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -13603,14 +15216,14 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -13618,10 +15231,10 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -13631,9 +15244,9 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in @@ -13646,14 +15259,14 @@ 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 + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -13661,10 +15274,10 @@ esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -13673,7 +15286,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $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 @@ -13686,17 +15299,16 @@ fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.16 - { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi - fi no_glib="" @@ -13706,8 +15318,8 @@ fi PKG_CONFIG=no fi - min_glib_version=2.22.4 - { $as_echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 + min_glib_version=2.24.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5 $as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } if test x$PKG_CONFIG != xno ; then @@ -13743,14 +15355,10 @@ $as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" rm -f conf.glibtest - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -13760,14 +15368,14 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { - int major, minor, micro; + unsigned int major, minor, micro; char *tmp_version; fclose (fopen ("conf.glibtest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } @@ -13806,9 +15414,9 @@ main () } else { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); @@ -13825,52 +15433,25 @@ main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : -( exit $ac_status ) -no_glib=yes +else + no_glib=yes fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then - { $as_echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 $as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } : else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." @@ -13884,11 +15465,7 @@ $as_echo "no" >&6; } ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -13902,27 +15479,7 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" @@ -13933,16 +15490,11 @@ $as_echo "$ac_try_echo") >&5 echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -13952,9 +15504,7 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" - { { $as_echo "$as_me:$LINENO: error: maybe you want the pygobject-2-4 branch?" >&5 -$as_echo "$as_me: error: maybe you want the pygobject-2-4 branch?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "maybe you want the pygobject-2-4 branch?" "$LINENO" 5 fi @@ -14001,11 +15551,11 @@ pygobject_CODEGEN_DEFINES="" exec_prefix=$exec_prefix_save -{ $as_echo "$as_me:$LINENO: checking for ffi" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffi" >&5 $as_echo_n "checking for ffi... " >&6; } # Check whether --with-ffi was given. -if test "${with_ffi+set}" = set; then +if test "${with_ffi+set}" = set; then : withval=$with_ffi; with_libffi=$withval else with_libffi=auto @@ -14016,18 +15566,18 @@ if test x"$with_libffi" = xno ; then else pkg_failed=no -{ $as_echo "$as_me:$LINENO: checking for FFI" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFI" >&5 $as_echo_n "checking for FFI... " >&6; } if test -n "$FFI_CFLAGS"; then pkg_cv_FFI_CFLAGS="$FFI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libffi >= 3.0\"") >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi >= 3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libffi >= 3.0") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then pkg_cv_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi >= 3.0" 2>/dev/null` else pkg_failed=yes @@ -14039,11 +15589,11 @@ if test -n "$FFI_LIBS"; then pkg_cv_FFI_LIBS="$FFI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libffi >= 3.0\"") >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi >= 3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libffi >= 3.0") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then pkg_cv_FFI_LIBS=`$PKG_CONFIG --libs "libffi >= 3.0" 2>/dev/null` else pkg_failed=yes @@ -14055,6 +15605,8 @@ fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14069,77 +15621,272 @@ fi # Put the nasty error message in config.log where it belongs echo "$FFI_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - have_libffi=no + have_libffi=no elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } have_libffi=no else - FFI_CFLAGS=$pkg_cv_FFI_CFLAGS - FFI_LIBS=$pkg_cv_FFI_LIBS - { $as_echo "$as_me:$LINENO: result: yes" >&5 + FFI_CFLAGS=$pkg_cv_FFI_CFLAGS + FFI_LIBS=$pkg_cv_FFI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_libffi=yes +fi +fi +if test x"$with_libffi" = xyes && test x"$have_libffi" = xno ; then + as_fn_error $? "ffi requested, but not found" "$LINENO" 5 +fi +if test x"$have_libffi" = xyes; then + +$as_echo "#define HAVE_FFI_H 1" >>confdefs.h + + LIBFFI_PC=libffi +fi + if test "$have_libffi" = "yes"; then + HAVE_LIBFFI_TRUE= + HAVE_LIBFFI_FALSE='#' +else + HAVE_LIBFFI_TRUE='#' + HAVE_LIBFFI_FALSE= +fi + + + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO" >&5 +$as_echo_n "checking for GIO... " >&6; } + +if test -n "$GIO_CFLAGS"; then + pkg_cv_GIO_CFLAGS="$GIO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.24.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.24.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= 2.24.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GIO_LIBS"; then + pkg_cv_GIO_LIBS="$GIO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.24.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.24.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= 2.24.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gio-2.0 >= 2.24.0" 2>&1` + else + GIO_PKG_ERRORS=`$PKG_CONFIG --print-errors "gio-2.0 >= 2.24.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GIO_PKG_ERRORS" >&5 + + have_gio=false +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_gio=false +else + GIO_CFLAGS=$pkg_cv_GIO_CFLAGS + GIO_LIBS=$pkg_cv_GIO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_gio=true +fi + + + +# Do not build GIO if the python version >= 3.0 +# We use GI to access GIO in python 3 + if test $have_gio = true -a $build_py3k = false; then + BUILD_GIO_TRUE= + BUILD_GIO_FALSE='#' +else + BUILD_GIO_TRUE='#' + BUILD_GIO_FALSE= +fi + + +if test -n "$export_dynamic"; then + GIO_LIBS=`echo $GIO_LIBS | sed -e "s/$export_dynamic//"` +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIOUNIX" >&5 +$as_echo_n "checking for GIOUNIX... " >&6; } + +if test -n "$GIOUNIX_CFLAGS"; then + pkg_cv_GIOUNIX_CFLAGS="$GIOUNIX_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.22.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.22.4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIOUNIX_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 >= 2.22.4" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GIOUNIX_LIBS"; then + pkg_cv_GIOUNIX_LIBS="$GIOUNIX_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.22.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.22.4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIOUNIX_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 >= 2.22.4" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GIOUNIX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gio-unix-2.0 >= 2.22.4" 2>&1` + else + GIOUNIX_PKG_ERRORS=`$PKG_CONFIG --print-errors "gio-unix-2.0 >= 2.22.4" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GIOUNIX_PKG_ERRORS" >&5 + + have_giounix=false +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_giounix=false +else + GIOUNIX_CFLAGS=$pkg_cv_GIOUNIX_CFLAGS + GIOUNIX_LIBS=$pkg_cv_GIOUNIX_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - have_libffi=yes -fi -fi -if test x"$with_libffi" = xyes && test x"$have_libffi" = xno ; then - { { $as_echo "$as_me:$LINENO: error: ffi requested, but not found" >&5 -$as_echo "$as_me: error: ffi requested, but not found" >&2;} - { (exit 1); exit 1; }; } + have_giounix=true fi -if test x"$have_libffi" = xyes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_FFI_H 1 -_ACEOF - LIBFFI_PC=libffi + if test $have_giounix = true -a $build_py3k = false; then + BUILD_GIOUNIX_TRUE= + BUILD_GIOUNIX_FALSE='#' +else + BUILD_GIOUNIX_TRUE='#' + BUILD_GIOUNIX_FALSE= fi -{ $as_echo "$as_me:$LINENO: result: $have_libffi" >&5 -$as_echo "$have_libffi" >&6; } - if test "$have_libffi" = "yes"; then - HAVE_LIBFFI_TRUE= - HAVE_LIBFFI_FALSE='#' + +if test -n "$export_dynamic"; then + GIOUNIX_LIBS=`echo $GIOUNIX_LIBS | sed -e "s/$export_dynamic//"` +fi + +# Check whether --enable-cairo was given. +if test "${enable_cairo+set}" = set; then : + enableval=$enable_cairo; enable_cairo=$enableval else - HAVE_LIBFFI_TRUE='#' - HAVE_LIBFFI_FALSE= + enable_cairo=yes fi +# Check whether --enable-introspection was given. +if test "${enable_introspection+set}" = set; then : + enableval=$enable_introspection; enable_introspection=$enableval +else + enable_introspection=yes +fi +if test "$enable_introspection" != no; then +$as_echo "#define ENABLE_INTROSPECTION 1" >>confdefs.h pkg_failed=no -{ $as_echo "$as_me:$LINENO: checking for GIO" >&5 -$as_echo_n "checking for GIO... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GI" >&5 +$as_echo_n "checking for GI... " >&6; } -if test -n "$GIO_CFLAGS"; then - pkg_cv_GIO_CFLAGS="$GIO_CFLAGS" +if test -n "$GI_CFLAGS"; then + pkg_cv_GI_CFLAGS="$GI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.22.4\"") >&5 - ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.22.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 + \""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 + ") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= 2.22.4" 2>/dev/null` + $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.24.0 + gobject-introspection-1.0 >= 0.10.2 + " 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$GIO_LIBS"; then - pkg_cv_GIO_LIBS="$GIO_LIBS" +if test -n "$GI_LIBS"; then + pkg_cv_GI_LIBS="$GI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.22.4\"") >&5 - ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.22.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 + \""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 + ") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= 2.22.4" 2>/dev/null` + $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.24.0 + gobject-introspection-1.0 >= 0.10.2 + " 2>/dev/null` else pkg_failed=yes fi @@ -14150,6 +15897,8 @@ fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14157,70 +15906,95 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gio-2.0 >= 2.22.4" 2>&1` + GI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 + " 2>&1` else - GIO_PKG_ERRORS=`$PKG_CONFIG --print-errors "gio-2.0 >= 2.22.4" 2>&1` + GI_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 + " 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$GIO_PKG_ERRORS" >&5 + echo "$GI_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (glib-2.0 >= 2.24.0 + gobject-introspection-1.0 >= 0.10.2 + ) were not met: + +$GI_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GI_CFLAGS +and GI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - have_gio=false elif test $pkg_failed = untried; then - have_gio=false -else - GIO_CFLAGS=$pkg_cv_GIO_CFLAGS - GIO_LIBS=$pkg_cv_GIO_LIBS - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - have_gio=true -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "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. +Alternatively, you may set the environment variables GI_CFLAGS +and GI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } - if $have_gio; then - BUILD_GIO_TRUE= - BUILD_GIO_FALSE='#' else - BUILD_GIO_TRUE='#' - BUILD_GIO_FALSE= -fi + GI_CFLAGS=$pkg_cv_GI_CFLAGS + GI_LIBS=$pkg_cv_GI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -if test -n "$export_dynamic"; then - GIO_LIBS=`echo $GIO_LIBS | sed -e "s/$export_dynamic//"` fi + GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0) + + + if test "$enable_cairo" != no; then pkg_failed=no -{ $as_echo "$as_me:$LINENO: checking for GIOUNIX" >&5 -$as_echo_n "checking for GIOUNIX... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYCAIRO" >&5 +$as_echo_n "checking for PYCAIRO... " >&6; } -if test -n "$GIOUNIX_CFLAGS"; then - pkg_cv_GIOUNIX_CFLAGS="$GIOUNIX_CFLAGS" +if test -n "$PYCAIRO_CFLAGS"; then + pkg_cv_PYCAIRO_CFLAGS="$PYCAIRO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.22.4\"") >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.22.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pycairo >= 1.2.0 + \""; } >&5 + ($PKG_CONFIG --exists --print-errors "pycairo >= 1.2.0 + ") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_GIOUNIX_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 >= 2.22.4" 2>/dev/null` + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PYCAIRO_CFLAGS=`$PKG_CONFIG --cflags "pycairo >= 1.2.0 + " 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$GIOUNIX_LIBS"; then - pkg_cv_GIOUNIX_LIBS="$GIOUNIX_LIBS" +if test -n "$PYCAIRO_LIBS"; then + pkg_cv_PYCAIRO_LIBS="$PYCAIRO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.22.4\"") >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.22.4") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pycairo >= 1.2.0 + \""; } >&5 + ($PKG_CONFIG --exists --print-errors "pycairo >= 1.2.0 + ") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_GIOUNIX_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 >= 2.22.4" 2>/dev/null` + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PYCAIRO_LIBS=`$PKG_CONFIG --libs "pycairo >= 1.2.0 + " 2>/dev/null` else pkg_failed=yes fi @@ -14231,6 +16005,8 @@ fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14238,53 +16014,74 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GIOUNIX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gio-unix-2.0 >= 2.22.4" 2>&1` + PYCAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "pycairo >= 1.2.0 + " 2>&1` else - GIOUNIX_PKG_ERRORS=`$PKG_CONFIG --print-errors "gio-unix-2.0 >= 2.22.4" 2>&1` + PYCAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors "pycairo >= 1.2.0 + " 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$GIOUNIX_PKG_ERRORS" >&5 + echo "$PYCAIRO_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (pycairo >= 1.2.0 + ) were not met: + +$PYCAIRO_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables PYCAIRO_CFLAGS +and PYCAIRO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - have_giounix=false elif test $pkg_failed = untried; then - have_giounix=false -else - GIOUNIX_CFLAGS=$pkg_cv_GIOUNIX_CFLAGS - GIOUNIX_LIBS=$pkg_cv_GIOUNIX_LIBS - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - have_giounix=true -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "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. +Alternatively, you may set the environment variables PYCAIRO_CFLAGS +and PYCAIRO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } - if $have_giounix; then - BUILD_GIOUNIX_TRUE= - BUILD_GIOUNIX_FALSE='#' else - BUILD_GIOUNIX_TRUE='#' - BUILD_GIOUNIX_FALSE= -fi + PYCAIRO_CFLAGS=$pkg_cv_PYCAIRO_CFLAGS + PYCAIRO_LIBS=$pkg_cv_PYCAIRO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -if test -n "$export_dynamic"; then - GIOUNIX_LIBS=`echo $GIOUNIX_LIBS | sed -e "s/$export_dynamic//"` +fi + fi +fi + if test "$enable_introspection" = "yes"; then + ENABLE_INTROSPECTION_TRUE= + ENABLE_INTROSPECTION_FALSE='#' +else + ENABLE_INTROSPECTION_TRUE='#' + ENABLE_INTROSPECTION_FALSE= fi -# Check whether --enable-pygi was given. -if test "${enable_pygi+set}" = set; then - enableval=$enable_pygi; enable_pygi=$enableval + if test "$enable_cairo" = "yes"; then + ENABLE_CAIRO_TRUE= + ENABLE_CAIRO_FALSE='#' else - enable_pygi=no + ENABLE_CAIRO_TRUE='#' + ENABLE_CAIRO_FALSE= fi -if test "$enable_pygi" != no; then -cat >>confdefs.h <<\_ACEOF -#define ENABLE_PYGI 1 -_ACEOF +INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` +INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + + -fi if test "x$GCC" = "xyes"; then @@ -14294,13 +16091,9 @@ case " $CFLAGS " in *) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall" - { $as_echo "$as_me:$LINENO: checking whether $CC understands -Wall" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -Wall" >&5 $as_echo_n "checking whether $CC understands -Wall... " >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -14311,34 +16104,13 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : jh_has_option=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jh_has_option=no + jh_has_option=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $jh_has_option" >&5 + { $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" @@ -14352,13 +16124,9 @@ case " $CFLAGS " in *) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-strict-aliasing" - { $as_echo "$as_me:$LINENO: checking whether $CC understands -fno-strict-aliasing" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -fno-strict-aliasing" >&5 $as_echo_n "checking whether $CC understands -fno-strict-aliasing... " >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -14369,34 +16137,13 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : jh_has_option=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jh_has_option=no + jh_has_option=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $jh_has_option" >&5 + { $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" @@ -14415,13 +16162,9 @@ case " $CFLAGS " in *) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -std=c9x" - { $as_echo "$as_me:$LINENO: checking whether $CC understands -std=c9x" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -std=c9x" >&5 $as_echo_n "checking whether $CC understands -std=c9x... " >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -14432,34 +16175,13 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : jh_has_option=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jh_has_option=no + jh_has_option=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $jh_has_option" >&5 + { $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" @@ -14471,7 +16193,7 @@ esac fi -ac_config_files="$ac_config_files Makefile pygobject-2.0.pc pygobject-2.0-uninstalled.pc codegen/Makefile codegen/pygobject-codegen-2.0 docs/Makefile docs/reference/entities.docbook docs/xsl/fixxref.py glib/Makefile gobject/Makefile gio/Makefile examples/Makefile tests/Makefile PKG-INFO" +ac_config_files="$ac_config_files Makefile pygobject-2.0.pc pygobject-2.0-uninstalled.pc codegen/Makefile codegen/pygobject-codegen-2.0 docs/Makefile docs/reference/entities.docbook docs/xsl/fixxref.py gi/Makefile gi/repository/Makefile gi/overrides/Makefile glib/Makefile gobject/Makefile gio/Makefile examples/Makefile tests/Makefile PKG-INFO" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -14500,13 +16222,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -14514,8 +16236,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -14537,12 +16259,23 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -14556,14 +16289,15 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -14578,70 +16312,67 @@ else am__EXEEXT_FALSE= fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${PLATFORM_WIN32_TRUE}" && test -z "${PLATFORM_WIN32_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"PLATFORM_WIN32\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"PLATFORM_WIN32\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"PLATFORM_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_WIN32_TRUE}" && test -z "${OS_WIN32_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"OS_WIN32\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"OS_WIN32\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"OS_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DOCS_TRUE}" && test -z "${ENABLE_DOCS_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"ENABLE_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"ENABLE_DOCS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBFFI_TRUE}" && test -z "${HAVE_LIBFFI_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LIBFFI\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"HAVE_LIBFFI\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"HAVE_LIBFFI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_GIO_TRUE}" && test -z "${BUILD_GIO_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_GIO\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"BUILD_GIO\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"BUILD_GIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_GIOUNIX_TRUE}" && test -z "${BUILD_GIOUNIX_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_GIOUNIX\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"BUILD_GIOUNIX\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "conditional \"BUILD_GIOUNIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_INTROSPECTION_TRUE}" && test -z "${ENABLE_INTROSPECTION_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_INTROSPECTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_CAIRO_TRUE}" && test -z "${ENABLE_CAIRO_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_CAIRO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -14651,17 +16382,18 @@ cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -14669,23 +16401,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -14693,7 +16417,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -14704,7 +16434,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -14727,13 +16457,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -14743,15 +16466,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -14763,12 +16487,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -14780,7 +16508,89 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -14794,8 +16604,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -14815,76 +16629,25 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi +esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -14913,8 +16676,56 @@ fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -14933,10 +16744,10 @@ else if test -d "$1"; then test -d "$1/."; else - case $1 in + case $1 in #( -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -14951,13 +16762,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # 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 2.21.3, which was -generated by GNU Autoconf 2.63. Invocation command line was +This file was extended by pygobject $as_me 2.28.6, which was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -14989,13 +16806,15 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -15014,16 +16833,17 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _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 2.21.3 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +pygobject config.status 2.28.6 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -15041,11 +16861,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -15059,27 +16884,29 @@ do ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -15087,11 +16914,10 @@ Try \`$0 --help' for more information." >&2 ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -15142,133 +16968,157 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +SED \ GREP \ EGREP \ FGREP \ @@ -15280,8 +17130,12 @@ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -15291,14 +17145,14 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ lt_prog_compiler_pic \ +lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -15314,7 +17168,6 @@ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -15322,12 +17175,13 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -15349,14 +17203,15 @@ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -15364,12 +17219,6 @@ sys_lib_dlsearch_path_spec; do esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -15410,6 +17259,9 @@ do "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/reference/entities.docbook") CONFIG_FILES="$CONFIG_FILES docs/reference/entities.docbook" ;; "docs/xsl/fixxref.py") CONFIG_FILES="$CONFIG_FILES docs/xsl/fixxref.py" ;; + "gi/Makefile") CONFIG_FILES="$CONFIG_FILES gi/Makefile" ;; + "gi/repository/Makefile") CONFIG_FILES="$CONFIG_FILES gi/repository/Makefile" ;; + "gi/overrides/Makefile") CONFIG_FILES="$CONFIG_FILES gi/overrides/Makefile" ;; "glib/Makefile") CONFIG_FILES="$CONFIG_FILES glib/Makefile" ;; "gobject/Makefile") CONFIG_FILES="$CONFIG_FILES gobject/Makefile" ;; "gio/Makefile") CONFIG_FILES="$CONFIG_FILES gio/Makefile" ;; @@ -15417,9 +17269,7 @@ do "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "PKG-INFO") CONFIG_FILES="$CONFIG_FILES PKG-INFO" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -15442,26 +17292,24 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -15469,7 +17317,13 @@ $debug || if test -n "$CONFIG_FILES"; then -ac_cr=' ' +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' @@ -15477,7 +17331,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -15486,24 +17340,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -15511,7 +17359,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -15525,7 +17373,7 @@ s/'"$ac_delim"'$// t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -15539,7 +17387,7 @@ s/.\{148\}// t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -15559,7 +17407,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -15591,23 +17439,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -15619,7 +17473,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -15631,13 +17485,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -15722,9 +17574,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -15737,9 +17587,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -15758,7 +17606,7 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -15767,12 +17615,10 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -15783,7 +17629,7 @@ $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -15795,10 +17641,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -15826,47 +17670,7 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -15923,7 +17727,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - ac_sed_dataroot=' /datarootdir/ { p @@ -15933,12 +17736,11 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' +/@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -15948,7 +17750,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -15976,27 +17778,24 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -16005,27 +17804,21 @@ $as_echo "$as_me: error: could not create $ac_file" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -16063,7 +17856,7 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -16158,47 +17951,7 @@ $as_echo X"$file" | q } s/.*/./; q'` - { as_dir=$dirpart/$fdir - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done @@ -16226,7 +17979,8 @@ $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -16262,13 +18016,13 @@ available_tags="" build_old_libs=$enable_static # Assembler program. -AS=$AS +AS=$lt_AS # DLL creation program. -DLLTOOL=$DLLTOOL +DLLTOOL=$lt_DLLTOOL # Object dumper program. -OBJDUMP=$OBJDUMP +OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version @@ -16283,6 +18037,12 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + # The host system. host_alias=$host_alias host=$host @@ -16332,20 +18092,36 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == "file_magic". +# Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + # The archiver. AR=$lt_AR + +# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + # A symbol stripping program. STRIP=$lt_STRIP @@ -16354,6 +18130,9 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -16372,14 +18151,14 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# The name of the directory that contains temporary libtool files. -objdir=$objdir +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO +# The name of the directory that contains temporary libtool files. +objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD @@ -16387,6 +18166,9 @@ MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -16443,6 +18225,9 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -16482,6 +18267,10 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -16494,12 +18283,12 @@ with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -16586,9 +18375,6 @@ inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -16604,6 +18390,9 @@ include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -16636,212 +18425,169 @@ ltmain="$ac_aux_dir/ltmain.sh" # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - -_LT_EOF - ;; - esac - - - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -16851,15 +18597,12 @@ _LT_EOF done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -16880,14 +18623,15 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo echo "libffi support: $have_libffi" +echo "introspection support: $enable_introspection" echo diff --git a/configure.ac b/configure.ac index 4146420..1b923b4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,21 +1,32 @@ -*- mode: m4 -*- AC_PREREQ(2.52) +# The version of python used is determined by the executable pointed to by +# the PYTHON environment variable. For instance if your system installs +# Python 3 as python3 to configure to compile pygobject under Python 3 +# you would do this: +# $> PYTHON=python3 ./configure +m4_define(python_min_ver, 2.5.2) +m4_define(python3_min_ver, 3.1) + dnl the pygobject version number m4_define(pygobject_major_version, 2) -m4_define(pygobject_minor_version, 21) -m4_define(pygobject_micro_version, 3) +m4_define(pygobject_minor_version, 28) +m4_define(pygobject_micro_version, 6) m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version) dnl versions of packages we require ... -m4_define(glib_required_version, 2.22.4) -m4_define(gio_required_version, 2.22.4) +m4_define(introspection_required_version, 0.10.2) +m4_define(pycairo_required_version, 1.2.0) +m4_define(glib_required_version, 2.24.0) +m4_define(gio_required_version, 2.24.0) m4_define(giounix_required_version, 2.22.4) AC_INIT(pygobject, pygobject_version, [http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject]) AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .") AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([gobject/gobjectmodule.c]) AC_DEFINE(PYGOBJECT_MAJOR_VERSION, pygobject_major_version, [pygobject major version]) AC_SUBST(PYGOBJECT_MAJOR_VERSION, pygobject_major_version) @@ -24,10 +35,10 @@ AC_SUBST(PYGOBJECT_MINOR_VERSION, pygobject_minor_version) AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version]) AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version) -AC_CONFIG_SRCDIR([gobject/gobjectmodule.c]) AM_CONFIG_HEADER(config.h) - -AM_INIT_AUTOMAKE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) +AM_INIT_AUTOMAKE(foreign) +AM_MAINTAINER_MODE dnl put the ACLOCAL flags in the makefile ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" @@ -68,20 +79,31 @@ m4_define([_LT_AC_TAGCONFIG],[]) AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL dnl when using libtool 2.x create libtool early, because it's used in configure -m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) +m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) +AC_ISC_POSIX +AC_PROG_CC +AM_PROG_CC_STDC AM_PROG_CC_C_O -JD_PATH_PYTHON(2.3.5) +# check that we have the minimum version of python necisary to build +JD_PATH_PYTHON(python_min_ver) -JD_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) +# check if we are building for python 3 +JD_PYTHON_CHECK_VERSION([$PYTHON], [3.0], + build_py3k=true, + build_py3k=false) -AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h]) -py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` -if test -x "$PYTHON-config"; then -PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` -else -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" +# if building for python 3 make sure we have the minimum version supported +if test $build_py3k = true ; then + AC_MSG_CHECKING([for $PYTHON >=] python3_min_ver) + JD_PYTHON_CHECK_VERSION([$PYTHON], python3_min_ver, + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR(too old)]) fi + +AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) + +AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h]) old_CPPFLAGS=$CPPFLAGS CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES" AC_TRY_COMPILE([#include ], @@ -124,7 +146,11 @@ fi AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs != xno) -AM_CHECK_PYMOD(thread,,,enable_thread=no) +AM_CHECK_PYMOD(thread,,,enable_thread=check_for_py3_module) +if test "x$enable_thread" = xcheck_for_py3_module; then + dnl Python 3 uses the _thread module so check for that + AM_CHECK_PYMOD(_thread,,,enable_thread=no) +fi AC_MSG_CHECKING(whether to enable threading in pygobject) if test "x$enable_thread" != xno; then @@ -173,7 +199,6 @@ if test x"$have_libffi" = xyes; then AC_DEFINE(HAVE_FFI_H,1,[Have libffi include files]) LIBFFI_PC=libffi fi -AC_MSG_RESULT([$have_libffi]) AM_CONDITIONAL(HAVE_LIBFFI, test "$have_libffi" = "yes") AC_SUBST(FFI_CFLAGS) AC_SUBST(FFI_LIBS) @@ -184,7 +209,11 @@ PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version, have_gio=true, have_gio=false) AC_SUBST(GIO_CFLAGS) AC_SUBST(GIO_LIBS) -AM_CONDITIONAL(BUILD_GIO, $have_gio) + +# Do not build GIO if the python version >= 3.0 +# We use GI to access GIO in python 3 +AM_CONDITIONAL(BUILD_GIO, test $have_gio = true -a $build_py3k = false) + if test -n "$export_dynamic"; then GIO_LIBS=`echo $GIO_LIBS | sed -e "s/$export_dynamic//"` fi @@ -194,18 +223,44 @@ PKG_CHECK_MODULES(GIOUNIX, gio-unix-2.0 >= giounix_required_version, have_giounix=true, have_giounix=false) AC_SUBST(GIOUNIX_CFLAGS) AC_SUBST(GIOUNIX_LIBS) -AM_CONDITIONAL(BUILD_GIOUNIX, $have_giounix) +AM_CONDITIONAL(BUILD_GIOUNIX, test $have_giounix = true -a $build_py3k = false) if test -n "$export_dynamic"; then GIOUNIX_LIBS=`echo $GIOUNIX_LIBS | sed -e "s/$export_dynamic//"` fi -AC_ARG_ENABLE(pygi, - AC_HELP_STRING([--enable-pygi], [Use PyGI to create wrappers for introspection-enabled types]), - enable_pygi=$enableval, - enable_pygi=no) -if test "$enable_pygi" != no; then - AC_DEFINE(ENABLE_PYGI,1,Use PyGI to create wrappers for introspection-enabled types) +AC_ARG_ENABLE(cairo, + AC_HELP_STRING([--enable-cairo], [Enable Cairo bindings using introspection information]), + enable_cairo=$enableval, + enable_cairo=yes) + +AC_ARG_ENABLE(introspection, + AC_HELP_STRING([--enable-introspection], [Use introspection information]), + enable_introspection=$enableval, + enable_introspection=yes) +if test "$enable_introspection" != no; then + AC_DEFINE(ENABLE_INTROSPECTION,1,Use introspection information) + PKG_CHECK_MODULES(GI, + glib-2.0 >= glib_required_version + gobject-introspection-1.0 >= introspection_required_version + ) + + GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0) + AC_SUBST(GI_DATADIR) + + if test "$enable_cairo" != no; then + PKG_CHECK_MODULES(PYCAIRO, + pycairo >= pycairo_required_version + ) + fi fi +AM_CONDITIONAL(ENABLE_INTROSPECTION, test "$enable_introspection" = "yes") +AM_CONDITIONAL(ENABLE_CAIRO, test "$enable_cairo" = "yes") + +INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` +INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + +AC_SUBST(INTROSPECTION_SCANNER) +AC_SUBST(INTROSPECTION_COMPILER) dnl add required cflags ... if test "x$GCC" = "xyes"; then @@ -231,6 +286,9 @@ AC_CONFIG_FILES( docs/Makefile docs/reference/entities.docbook docs/xsl/fixxref.py + gi/Makefile + gi/repository/Makefile + gi/overrides/Makefile glib/Makefile gobject/Makefile gio/Makefile @@ -241,4 +299,5 @@ AC_OUTPUT echo echo "libffi support: $have_libffi" +echo "introspection support: $enable_introspection" echo diff --git a/docs/Makefile.am b/docs/Makefile.am index 391eec8..418df8a 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -193,3 +193,5 @@ $(HTML_FILES): $(XML_FILES) $(XSL_FILES) # pdfxmltex pygobject-ref.fo >output output gio.AppInfo

gio.AppInfo

gio.AppInfo — Information about an installed application and methods to launch it (with file arguments).

Synopsis

class gio.AppInfo(gobject.GInterface):
+gio.AppInfo

gio.AppInfo

gio.AppInfo — Information about an installed application and methods to launch it (with file arguments).

Synopsis

class gio.AppInfo(gobject.GInterface):
     gio.AppInfo(commandline, application_name=None, flags=gio.APP_INFO_CREATE_NONE)
def add_supports_type(content_type)
def can_delete()
def can_remove_supports_type()
def delete()
def dup()
def equal(appinfo2)
def get_commandline()
def get_description()
def get_executable()
def get_icon()
def get_id()
def get_name()
def launch(files, launch_context)
def launch_uris(uris, launch_context)
def remove_supports_type(content_type)
def set_as_default_for_extension(extension)
def set_as_default_for_type(content_type)
def should_show()
def supports_files()
def supports_uris()
 Functions
  
-    def gio.app_info_get_all()
def gio.app_info_get_all_for_type(content_type)
def gio.app_info_get_default_for_type(content_type, must_support_uris)
def gio.app_info_get_default_for_uri_scheme(uri_scheme)
def gio.app_info_reset_type_association(content_type)

Known Implementation

+

Known Implementation

gio.AppInfo is implemented by gio.DesktopAppInfo -

Description

+

Description

gio.AppInfo and gio.AppLaunchContext are used for describing and launching applications installed on the system. @@ -43,7 +43,7 @@

Creates a new gio.AppInfo from the given information. -

Methods

gio.AppInfo.add_supports_type

    def add_supports_type(content_type)

content_type :

A string.

+

Methods

gio.AppInfo.add_supports_type

    def add_supports_type(content_type)

content_type :

A string.

The add_supports_type() method adds a content type to the application information to indicate the application is capable of opening files with the given content type. @@ -166,7 +166,7 @@

The supports_uris() method checks if the application accepts uris as arguments. -

Functions

gio.app_info_get_all

    def app_info_get_all()

Returns :

A list of gio.AppInfos. +

Functions

gio.app_info_get_all

    def app_info_get_all()

Returns :

A list of gio.AppInfos.

The app_info_get_all() function gets a list of all of the applications currently registered on this system. diff --git a/docs/html/class-gioapplaunchcontext.html b/docs/html/class-gioapplaunchcontext.html index 32c735f..2d1d3df 100644 --- a/docs/html/class-gioapplaunchcontext.html +++ b/docs/html/class-gioapplaunchcontext.html @@ -1,7 +1,7 @@ -gio.AppLaunchContext

gio.AppLaunchContext

gio.AppLaunchContext — Application launch context.

Synopsis

class gio.AppLaunchContext(gobject.GObject):
-    gio.AppLaunchContext()
def get_display(info, files)
def get_startup_notify_id(info, files)
def launch_failed(startup_notify_id)

Ancestry

+-- gobject.GObject
+gio.AppLaunchContext

gio.AppLaunchContext

gio.AppLaunchContext — Application launch context.

Synopsis

class gio.AppLaunchContext(gobject.GObject):
+    gio.AppLaunchContext()
def get_display(info, files)
def get_startup_notify_id(info, files)
def launch_failed(startup_notify_id)

Description

+

Description

The gio.AppLaunchContext is used for integrating the launch with the launching application. This is used to handle for instance startup notification and launching the new application on the same screen as the launching window. @@ -11,7 +11,7 @@ Creates a new application launch context. This is not normally used, instead you instantiate a subclass of this, such as gtk.gdk.AppLaunchContext. -

Methods

gio.AppLaunchContext.get_display

    def get_display(info, files)

info :

a +

Methods

gio.AppLaunchContext.get_display

    def get_display(info, files)

info :

a gio.AppInfo

files :

a list of gio.File diff --git a/docs/html/class-gioasyncresult.html b/docs/html/class-gioasyncresult.html index 39f491f..ea06247 100644 --- a/docs/html/class-gioasyncresult.html +++ b/docs/html/class-gioasyncresult.html @@ -1,13 +1,13 @@ -gio.AsyncResult

gio.AsyncResult

gio.AsyncResult — Asynchronous Function Results.

Synopsis

class gio.AsyncResult(gobject.GInterface):
-    def get_source_object()

Ancestry

+-- gobject.GInterface
+gio.AsyncResult

gio.AsyncResult

gio.AsyncResult — Asynchronous Function Results.

Synopsis

class gio.AsyncResult(gobject.GInterface):
+    def get_source_object()

Prerequisites

+

Prerequisites

gio.AsyncResult is required by gobject.GObject. -

Known Implementation

+

Known Implementation

gio.AsyncResult is implemented by gio.SimpleAsyncResult. -

Description

+

Description

gio.AsyncResult provides a base class for implementing asynchronous function results.

@@ -37,7 +37,7 @@ separate thread, if GThread has been initialized, but otherwise they are sent to the Main Event Loop and processed in an idle function. So, if you truly need asynchronous operations, make sure to initialize GThread. -

Methods

gio.AsyncResult.get_source_object

    def get_source_object()

Returns :

the source object for the res. +

Methods

gio.AsyncResult.get_source_object

    def get_source_object()

Returns :

the source object for the res.

The get_source_object() method gets the source object from a gio.AsyncResult diff --git a/docs/html/class-giobufferedinputstream.html b/docs/html/class-giobufferedinputstream.html index 2f2f5d6..7fc25b4 100644 --- a/docs/html/class-giobufferedinputstream.html +++ b/docs/html/class-giobufferedinputstream.html @@ -1,12 +1,12 @@ -gio.BufferedInputStream

gio.BufferedInputStream

gio.BufferedInputStream — Buffered Input Stream

Synopsis

class gio.BufferedInputStream(gio.FilterInputStream):
+gio.BufferedInputStream

gio.BufferedInputStream

gio.BufferedInputStream — Buffered Input Stream

Synopsis

class gio.BufferedInputStream(gio.FilterInputStream):
     gio.BufferedInputStream(base_stream)
def fill(count, cancellable=None)
def fill_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def fill_finish(result)
def get_available()
def get_buffer_size()
def read_byte(cancellable=None)
def set_buffer_size(size)
 Functions
  
-    def gio.buffered_input_stream_new_sized(size)

gio.BufferedInputStream Properties

"buffer-size"Read - Write - ConstructThe size of the backend buffer. Allowed values: >= 1. Default value: 4096.

Description

+

gio.BufferedInputStream Properties

"buffer-size"Read - Write - ConstructThe size of the backend buffer. Allowed values: >= 1. Default value: 4096.

Description

gio.BufferedInputStream implements gio.FilterInputStream and provides for buffered reads. @@ -33,7 +33,7 @@

Creates a new gio.InputStream from the given base_stream, with a buffer set to the default size (4 kilobytes). -

Methods

gio.BufferedInputStream.fill

    def fill(count, cancellable=None)

count :

the number of bytes that will be read from the stream. +

Methods

gio.BufferedInputStream.fill

    def fill(count, cancellable=None)

count :

the number of bytes that will be read from the stream.

cancellable :

optional gio.Cancellable object, None to ignore. @@ -123,7 +123,7 @@ The set_buffer_size() method sets the size of the internal buffer of stream to size, or to the size of the contents of the buffer. The buffer can never be resized smaller than its current contents. -

Functions

gio.buffered_input_stream_new_sized

    def buffered_input_stream_new_sized(size)

size :

the requested buffer size. +

Functions

gio.buffered_input_stream_new_sized

    def buffered_input_stream_new_sized(size)

size :

the requested buffer size.

Returns :

A new gio.InputStream.

diff --git a/docs/html/class-giobufferedoutputstream.html b/docs/html/class-giobufferedoutputstream.html index 400e153..a77139f 100644 --- a/docs/html/class-giobufferedoutputstream.html +++ b/docs/html/class-giobufferedoutputstream.html @@ -1,12 +1,12 @@ -gio.BufferedOutputStream

gio.BufferedOutputStream

gio.BufferedOutputStream — Buffered Output Stream

Synopsis

class gio.BufferedOutputStream(gio.FilterOutputStream):
+gio.BufferedOutputStream

gio.BufferedOutputStream

gio.BufferedOutputStream — Buffered Output Stream

Synopsis

class gio.BufferedOutputStream(gio.FilterOutputStream):
     gio.BufferedOutputStream(base_stream)
def get_auto_grow()
def get_buffer_size()
def set_auto_grow(auto_grow)
def set_buffer_size(size)
 Functions
  
-    def gio.buffered_output_stream_new_sized(size)

gio.BufferedOutputStream Properties

"auto-grow"Read - WriteWhether the buffer should automatically grow. Default value: False.
"buffer-size"Read - Write - ConstructThe size of the backend buffer. Allowed values: >= 1. Default value: 4096.

Description

+

gio.BufferedOutputStream Properties

"auto-grow"Read - WriteWhether the buffer should automatically grow. Default value: False.
"buffer-size"Read - Write - ConstructThe size of the backend buffer. Allowed values: >= 1. Default value: 4096.

Description

gio.BufferedOutputStream implements gio.FilterOutputStream and provides for buffered writes. @@ -32,7 +32,7 @@ for the given base_stream.

Creates a new buffered output stream for a base stream. -

Methods

gio.BufferedOutputStream.get_auto_grow

    def get_auto_grow()

Returns :

True if the stream's +

Methods

gio.BufferedOutputStream.get_auto_grow

    def get_auto_grow()

Returns :

True if the stream's buffer automatically grows, False otherwise.

The get_auto_grow() method checks if the @@ -51,7 +51,7 @@

The set_buffer_size() method sets the size of the internal buffer to size. -

Functions

gio.buffered_output_stream_new_sized

    def buffered_output_stream_new_sized(size)

size :

the requested buffer size. +

Functions

gio.buffered_output_stream_new_sized

    def buffered_output_stream_new_sized(size)

size :

the requested buffer size.

Returns :

A new gio.OutputStream with an internal buffer set to size.. diff --git a/docs/html/class-giocancellable.html b/docs/html/class-giocancellable.html index 67de087..54c8bf5 100644 --- a/docs/html/class-giocancellable.html +++ b/docs/html/class-giocancellable.html @@ -1,10 +1,10 @@ -gio.Cancellable

gio.Cancellable

gio.Cancellable — Thread-safe Operation Cancellation Stack.

Synopsis

class gio.Cancellable(gobject.GObject):
+gio.Cancellable

gio.Cancellable

gio.Cancellable — Thread-safe Operation Cancellation Stack.

Synopsis

class gio.Cancellable(gobject.GObject):
     gio.Cancellable()
def cancel()
def get_fd()
def is_cancelled()
def pop_current()
def push_current()
def reset()
def set_error_if_cancelled()
 Functions
  
-    def gio.cancellable_get_current()

Description

+

Description

The gio.Cancellable is a thread-safe operation cancellation stack used throughout GIO to allow for cancellation of synchronous and asynchronous operations. @@ -19,7 +19,7 @@

One gio.Cancellable can be used in multiple consecutive operations, but not in multiple concurrent operations. -

Methods

gio.Cancellable.cancel

    def cancel()

+

Methods

gio.Cancellable.cancel

    def cancel()

The cancel() method will set cancellable to cancelled, and will emit the "cancelled" signal. (However, see the warning about race conditions in the documentation for that signal if you are planning to connect to it.) @@ -55,7 +55,7 @@ False if it was not.

The set_error_if_cancelled() method, if the cancellable is cancelled, sets the error to notify that the operation was cancelled. -

Functions

gio.cancellable_get_current

    def cancellable_get_current()

Returns :

A gio.Cancellable +

Functions

gio.cancellable_get_current

    def cancellable_get_current()

Returns :

A gio.Cancellable from the top of the stack, or None if the stack is empty.

The cancellable_get_current() function gets the top cancellable from the stack.

diff --git a/docs/html/class-giodatainputstream.html b/docs/html/class-giodatainputstream.html index c88c2cb..67fb819 100644 --- a/docs/html/class-giodatainputstream.html +++ b/docs/html/class-giodatainputstream.html @@ -1,10 +1,10 @@ -gio.DataInputStream

gio.DataInputStream

gio.DataInputStream — Data Input Stream

Synopsis

class gio.DataInputStream(gio.BufferedInputStream):
-    gio.DataInputStream(base_stream)
def get_byte_order()
def get_newline_type()
def read_byte(cancellable=None)
def read_int16(cancellable=None)
def read_int32(cancellable=None)
def read_int64(cancellable=None)
def read_line(cancellable=None)
def read_line_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_line_finish(result)
def read_uint16(cancellable=None)
def read_uint32(cancellable=None)
def read_uint64(cancellable=None)
def read_until(stop_chars, cancellable=None)
def read_until_async(stop_chars, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_until_finish(result)
def set_byte_order(order)
def set_newline_type(type)

Ancestry

+-- gobject.GObject
+gio.DataInputStream

gio.DataInputStream

gio.DataInputStream — Data Input Stream

Synopsis

class gio.DataInputStream(gio.BufferedInputStream):
+    gio.DataInputStream(base_stream)
def get_byte_order()
def get_newline_type()
def read_byte(cancellable=None)
def read_int16(cancellable=None)
def read_int32(cancellable=None)
def read_int64(cancellable=None)
def read_line(cancellable=None)
def read_line_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_line_finish(result)
def read_uint16(cancellable=None)
def read_uint32(cancellable=None)
def read_uint64(cancellable=None)
def read_until(stop_chars, cancellable=None)
def read_until_async(stop_chars, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_until_finish(result)
def set_byte_order(order)
def set_newline_type(type)

gio.DataInputStream Properties

"byte-order"Read - WriteThe byte order. Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.
"newline-type"Read - WriteThe accepted types of line ending. Default value: gio.DATA_STREAM_NEWLINE_TYPE_LF.

Description

+

gio.DataInputStream Properties

"byte-order"Read - WriteThe byte order. Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.
"newline-type"Read - WriteThe accepted types of line ending. Default value: gio.DATA_STREAM_NEWLINE_TYPE_LF.

Description

gio.DataInputStream implements gio.InputStream and includes functions for reading structured data directly from a binary input stream. @@ -15,7 +15,7 @@

Creates a new gio.DataInputStream from the given base_stream. -

Methods

gio.DataInputStream.get_byte_order

    def get_byte_order()

Returns :

the stream's current +

Methods

gio.DataInputStream.get_byte_order

    def get_byte_order()

Returns :

the stream's current Gio Data Stream Byte Order Constants.

The get_byte_order() method gets the byte diff --git a/docs/html/class-giodataoutputstream.html b/docs/html/class-giodataoutputstream.html index f6f9980..a681efe 100644 --- a/docs/html/class-giodataoutputstream.html +++ b/docs/html/class-giodataoutputstream.html @@ -1,12 +1,12 @@ -gio.DataOutputStream

gio.DataOutputStream

gio.DataOutputStream — Data Output Stream

Synopsis

class gio.DataOutputStream(gio.BufferedOutputStream):
-    gio.DataOutputStream(base_stream)
def get_byte_order()
def put_byte(cancellable=None)
def put_int16(cancellable=None)
def put_int32(cancellable=None)
def put_int64(cancellable=None)
def put_string(cancellable=None)
def put_uint16(cancellable=None)
def put_uint32(cancellable=None)
def put_uint64(cancellable=None)
def set_byte_order(order)

Ancestry

+-- gobject.GObject
+gio.DataOutputStream

gio.DataOutputStream

gio.DataOutputStream — Data Output Stream

Synopsis

class gio.DataOutputStream(gio.BufferedOutputStream):
+    gio.DataOutputStream(base_stream)
def get_byte_order()
def put_byte(cancellable=None)
def put_int16(cancellable=None)
def put_int32(cancellable=None)
def put_int64(cancellable=None)
def put_string(cancellable=None)
def put_uint16(cancellable=None)
def put_uint32(cancellable=None)
def put_uint64(cancellable=None)
def set_byte_order(order)

gio.DataOutputStream Properties

"byte-order"Read - WriteDetermines the byte ordering that is used when writing multi-byte entities (such as integers) to the stream. - Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.

Description

+ Default value: gio.DATA_STREAM_BYTE_ORDER_BIG_ENDIAN.

Description

gio.DataOutputStream implements gio.InputStream and includes functions for writing data directly to an output stream. @@ -17,7 +17,7 @@

Creates a new gio.DataOutputStream from the given base_stream. -

Methods

gio.DataOutputStream.get_byte_order

    def get_byte_order()

Returns :

the stream's current +

Methods

gio.DataOutputStream.get_byte_order

    def get_byte_order()

Returns :

the stream's current Gio Data Stream Byte Order Constants.

The get_byte_order() method gets the byte diff --git a/docs/html/class-giodrive.html b/docs/html/class-giodrive.html index dba9dcf..be54893 100644 --- a/docs/html/class-giodrive.html +++ b/docs/html/class-giodrive.html @@ -1,10 +1,10 @@ -gio.Drive

gio.Drive

gio.Drive — Virtual File System drive management.

Synopsis

class gio.Drive(gobject.GInterface):
-    def can_eject()
def can_poll_for_media()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def enumerate_identifiers()
def get_icon()
def get_identifier()
def get_name()
def get_volumes()
def has_media()
def has_volumes()
def is_media_check_automatic()
def is_media_removable()
def poll_for_media(callback, cancellable=None, user_data=None)
def poll_for_media_finish(result)

Ancestry

+-- gobject.GInterface
+gio.Drive

gio.Drive

gio.Drive — Virtual File System drive management.

Synopsis

class gio.Drive(gobject.GInterface):
+    def can_eject()
def can_poll_for_media()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def enumerate_identifiers()
def get_icon()
def get_identifier()
def get_name()
def get_volumes()
def has_media()
def has_volumes()
def is_media_check_automatic()
def is_media_removable()
def poll_for_media(callback, cancellable=None, user_data=None)
def poll_for_media_finish(result)

Ancestry

+-- gobject.GInterface
   +-- gio.Drive
-

Prerequisites

+

Prerequisites

gio.Drive requires gobject.GObject -

Description

+

Description

gio.Drive - this represent a piece of hardware connected to the machine. Its generally only created for removable hardware or hardware with removable media. @@ -24,7 +24,7 @@ For porting from GnomeVFS note that there is no equivalent of gio.Drive in that API. -

Methods

gio.Drive.can_eject

    def can_eject()

Returns :

True if the drive can be ejected, +

Methods

gio.Drive.can_eject

    def can_eject()

Returns :

True if the drive can be ejected, False otherwise.

The can_eject() method checks if a drive can be ejected. diff --git a/docs/html/class-gioemblem.html b/docs/html/class-gioemblem.html index 0834b0f..451f288 100644 --- a/docs/html/class-gioemblem.html +++ b/docs/html/class-gioemblem.html @@ -1,14 +1,14 @@ -gio.Emblem

gio.Emblem

gio.Emblem — An object for emblems.

Synopsis

class gio.Emblem(gobject.GObject, gio.Icon):
+gio.Emblem

gio.Emblem

gio.Emblem — An object for emblems.

Synopsis

class gio.Emblem(gobject.GObject, gio.Icon):
     gio.Emblem(icon, origin=gio.EMBLEM_ORIGIN_UNKNOWN)
def get_icon()
def get_origin()
 Functions
  
-    def gio.emblem_new_with_origin(icon, origin)

Ancestry

+-- gobject.GObject
+    def gio.emblem_new_with_origin(icon, origin)

Ancestry

+-- gobject.GObject
   +-- gio.Emblem
-

Implemented Interfaces

+

Implemented Interfaces

gio.Emblem implements gio.Icon -

gio.Emblem Properties

"icon"Read - Write - Construct OnlyThe actual icon of the emblem.
"origin"Read - Write - Construct OnlyTells which origin the emblem is derived from.

Description

+

gio.Emblem Properties

"icon"Read - Write - Construct OnlyThe actual icon of the emblem.
"origin"Read - Write - Construct OnlyTells which origin the emblem is derived from.

Description

The gio.Emblem class is an implementation of gio.Icon that supports having an emblem, which is an icon with additional properties. @@ -27,14 +27,14 @@ Parameter origin is available since PyGObject 2.20.

Creates a new gio.Emblem for icon. -

Methods

gio.Emblem.get_icon

    def get_icon()

Returns :

a +

Methods

gio.Emblem.get_icon

    def get_icon()

Returns :

a gio.Icon.

The get_icon() method gives back the icon from emblem.

gio.Emblem.get_origin

    def get_origin()

Returns :

the origin of the emblem.

The get_origin() method gets the origin of the emblem. -

Functions

gio.emblem_new_with_origin

    def emblem_new_with_origin(icon, origin)

origin :

a Gio Emblem Origin Constants +

Functions

gio.emblem_new_with_origin

    def emblem_new_with_origin(icon, origin)

origin :

a Gio Emblem Origin Constants defining the emblem's origin.

Returns :

A gio.Emblem.

Note

diff --git a/docs/html/class-gioemblemedicon.html b/docs/html/class-gioemblemedicon.html index 5c474f5..12b7277 100644 --- a/docs/html/class-gioemblemedicon.html +++ b/docs/html/class-gioemblemedicon.html @@ -1,11 +1,11 @@ -gio.EmblemedIcon

gio.EmblemedIcon

gio.EmblemedIcon — Icon with emblems.

Synopsis

class gio.EmblemedIcon(gobject.GObject, gio.Icon):
-    gio.EmblemedIcon(icon, emblem)
def add_emblem(emblem)
def get_icon()

Ancestry

+-- gobject.GObject
+gio.EmblemedIcon

gio.EmblemedIcon

gio.EmblemedIcon — Icon with emblems.

Synopsis

class gio.EmblemedIcon(gobject.GObject, gio.Icon):
+    gio.EmblemedIcon(icon, emblem)
def add_emblem(emblem)
def get_icon()

Implemented Interfaces

+

Implemented Interfaces

gio.EmblemedIcon implements gio.Icon -

Description

+

Description

The gio.EmblemedIcon class is an implementation of gio.Icon that supports adding an emblem to an icon. Adding multiple emblems to an icon is ensured via @@ -25,7 +25,7 @@

Creates a new gio.Icon for icon with the emblem emblem. -

Methods

gio.EmblemedIcon.add_emblem

    def add_emblem(emblem)

emblem :

a +

Methods

gio.EmblemedIcon.add_emblem

    def add_emblem(emblem)

emblem :

a gio.Emblem

The add_emblem() method adds emblem to the diff --git a/docs/html/class-giofile.html b/docs/html/class-giofile.html index f18df5e..9f40126 100644 --- a/docs/html/class-giofile.html +++ b/docs/html/class-giofile.html @@ -1,12 +1,12 @@ -gio.File

gio.File

gio.File — File and Directory Handling.

Synopsis

class gio.File(gobject.GInterface):
+gio.File

gio.File

gio.File — File and Directory Handling.

Synopsis

class gio.File(gobject.GInterface):
     gio.File(commandline, path=None, uri=None)
def append_to(flags=gio.FILE_CREATE_NONE, cancellable=None)
def append_to_async(callback, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def append_to_finish(result)
def copy(destination, progress_callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)
def copy_async(destination, callback, progress_callback=None, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None, progress_callback_data=None)
def copy_attributes(destination, flags=gio.FILE_COPY_NONE, cancellable=None)
def copy_finish(result)
def create(flags=gio.FILE_CREATE_NONE, cancellable=None)
def create_async(callback, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def create_finish(result)
def delete(cancellable=None)
def dup()
def eject_mountable(callback, flags=gio.FILE_CREATE_NONE, cancellable=None, user_data=None)
def eject_mountable_finish(result)
def enumerate_children(attributes, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def enumerate_children_async(attributes, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def enumerate_children_finish(result)
def equal(file2)
def find_enclosing_mount(cancellable)
def find_enclosing_mount_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def find_enclosing_mount_finish(result)
def get_basename()
def get_child(name)
def get_child_for_display_name(display_name)
def get_parent()
def get_parse_name()
def get_path()
def get_relative_path(descendant)
def get_uri()
def get_uri_scheme()
def has_prefix(prefix)
def has_uri_scheme(uri_scheme)
def is_native()
def load_contents(cancellable)
def load_contents_async(callback, cancellable=None, user_data=None)
def load_contents_finish(result)
def make_directory(cancellable=None)
def make_directory_with_parents(cancellable=None)
def make_symbolic_link(symlink_value, cancellable)
def monitor(flags=gio.FILE_MONITOR_NONE, cancellable=None)
def monitor_directory(flags, cancellable=None)
def monitor_file(flags, cancellable=None)
def mount_enclosing_volume(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)
def mount_enclosing_volume_finish(result)
def mount_mountable(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)
def mount_mountable_finish(result)
def move(destination, progress_callback, flags=gio.FILE_COPY_NONE, cancellable=None, user_data=None)
def query_default_handler(cancellable)
def query_exists(cancellable)
def query_file_type(flags, cancellable)
def query_filesystem_info(attributes, cancellable)
def query_filesystem_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_filesystem_info_finish(result)
def query_info(attributes, flags, cancellable)
def query_info_async(attributes, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)
def query_settable_attributes(cancellable=None)
def query_writable_namespace(cancellable=None)
def read(cancellable=None)
def read_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_finish(result=None)
def replace(etag, make_backup, flags=gio.FILE_CREATE_NONE, cancellable=None)
def replace_async(callback, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def replace_contents(contents, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, cancellable=None)
def replace_contents_async(contents, callback, etag=None, make_backup=True, flags=gio.FILE_CREATE_NONE, cancellable=None, user_data=None)
def replace_contents_finish(result=None)
def replace_finish(result=None)
def resolve_relative_path(relative_path)
def set_attribute(attribute, type, value_p, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_byte_string(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_int32(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_int64(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_string(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_uint32(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attribute_uint64(attribute, value, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_attributes_async(info, callback, flags=gio.FILE_QUERY_INFO_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def set_attributes_finish(result)
def set_attributes_from_info(info, flags=gio.FILE_QUERY_INFO_NONE, cancellable=None)
def set_dispay_name(display_name, cancellable=None)
def set_display_name_async(display_name, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def set_display_name_finish(result)
def trash(cancellable=None)
def unmount_mountable(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def unmount_mountable_finish(cancellable=None)
 Functions
-    def gio.file_parse_name(parse_name)

Ancestry

+-- gobject.GInterface
+    def gio.file_parse_name(parse_name)

Ancestry

+-- gobject.GInterface
   +-- gio.File
-

Prerequisites

+

Prerequisites

gio.File is implemented by gobject.GObject -

Description

+

Description

gio.File is a high level abstraction for manipulating files on a virtual file system. gio.Files are lightweight, @@ -91,7 +91,7 @@

Creates a new gio.File either from a commandline, a path or an uri. -

Methods

gio.File.append_to

    def append_to(flags=gio.FILE_CREATE_NONE, cancellable=None)

flags :

a set of +

Methods

gio.File.append_to

    def append_to(flags=gio.FILE_CREATE_NONE, cancellable=None)

flags :

a set of Gio File Create Flags Constants

cancellable :

optional gio.Cancellable @@ -1425,7 +1425,7 @@ URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] The unmount_mountable_finish() method finishes an asynchronous copy operation started with gio.File.unmount_mountable(). -

Functions

gio.file_parse_name

    def file_parse_name(parse_name)

parse_name :

a file name or path to be parsed. +

Functions

gio.file_parse_name

    def file_parse_name(parse_name)

parse_name :

a file name or path to be parsed.

Returns :

a new gio.File.

The parse_name() function constructs a diff --git a/docs/html/class-giofileattributeinfo.html b/docs/html/class-giofileattributeinfo.html index d46cd57..8e69c3a 100644 --- a/docs/html/class-giofileattributeinfo.html +++ b/docs/html/class-giofileattributeinfo.html @@ -1,7 +1,7 @@ -gio.FileAttributeInfo

gio.FileAttributeInfo

gio.FileAttributeInfo — Information about a specific attribute.

Synopsis

class gio.FileAttributeInfo(__builtin__.object):
-

Ancestry

+-- __builtin__.object
+gio.FileAttributeInfo

gio.FileAttributeInfo

gio.FileAttributeInfo — Information about a specific attribute.

Synopsis

class gio.FileAttributeInfo(__builtin__.object):
+

Ancestry

+-- __builtin__.object
   +-- gio.FileAttributeInfo
-

Description

+

Description

The gio.FileAttributeInfo contains information about a specific attribute.

gio.FileAttributeInfo Attributes

"name"ReadThe name of the attribute.
"type"Readthe diff --git a/docs/html/class-giofileenumerator.html b/docs/html/class-giofileenumerator.html index 8d276df..d50118e 100644 --- a/docs/html/class-giofileenumerator.html +++ b/docs/html/class-giofileenumerator.html @@ -1,7 +1,7 @@ -gio.FileEnumerator

gio.FileEnumerator

gio.FileEnumerator — Enumerated Files Routines.

Synopsis

class gio.FileEnumerator(gobject.GObject):
-    def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def get_container()
def has_pending()
def is_closed()
def next_file(cancellable=None)
def next_files_async(num_files, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def next_files_finish(result)
def set_pending(pending)

Ancestry

+-- gobject.GObject
+gio.FileEnumerator

gio.FileEnumerator

gio.FileEnumerator — Enumerated Files Routines.

Synopsis

class gio.FileEnumerator(gobject.GObject):
+    def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def get_container()
def has_pending()
def is_closed()
def next_file(cancellable=None)
def next_files_async(num_files, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def next_files_finish(result)
def set_pending(pending)

gio.FileEnumerator Properties

"container"Write - Construct onlyThe container that is being enumerated.

Description

+

gio.FileEnumerator Properties

"container"Write - Construct onlyThe container that is being enumerated.

Description

The gio.FileEnumerator allows you to operate on a set of gio.Files @@ -27,7 +27,7 @@ close_async. Once a gio.FileEnumerator is closed, no further actions may be performed on it. -

Methods

gio.FileEnumerator.close

    def close(cancellable=None)

cancellable :

Optional +

Methods

gio.FileEnumerator.close

    def close(cancellable=None)

cancellable :

Optional gio.Cancellable object, None to ignore.

Returns :

True on success or diff --git a/docs/html/class-giofileicon.html b/docs/html/class-giofileicon.html index e5cdaa6..72c0dba 100644 --- a/docs/html/class-giofileicon.html +++ b/docs/html/class-giofileicon.html @@ -1,7 +1,7 @@ -gio.FileIcon

gio.FileIcon

gio.FileIcon — Icons pointing to an image file.

Synopsis

class gio.FileIcon(gobject.GObject, gio.Icon, gio.LoadableIcon):
-    gio.FileIcon(file)
def get_file()

Ancestry

+-- gobject.GObject
+gio.FileIcon

gio.FileIcon

gio.FileIcon — Icons pointing to an image file.

Synopsis

class gio.FileIcon(gobject.GObject, gio.Icon, gio.LoadableIcon):
+    gio.FileIcon(file)
def get_file()

Ancestry

+-- gobject.GObject
   +-- gio.FileIcon
-

Description

+

Description

The gio.FileIcon specifies an icon by pointing to an image file to be used as icon.

Constructor

    gio.FileIcon(file)

file :

a @@ -11,7 +11,7 @@ for the given file, or None on error.

Creates a new icon for a file. -

Methods

gio.FileIcon.get_file

    def get_file()

Returns :

a +

Methods

gio.FileIcon.get_file

    def get_file()

Returns :

a gio.File or None.

diff --git a/docs/html/class-giofileinfo.html b/docs/html/class-giofileinfo.html index 49d5d7b..d82427c 100644 --- a/docs/html/class-giofileinfo.html +++ b/docs/html/class-giofileinfo.html @@ -1,7 +1,7 @@ -gio.FileInfo

gio.FileInfo

gio.FileInfo — File Information and Attributes

Synopsis

class gio.FileInfo(gobject.GObject):
-    gio.FileInfo()
def clear_status()
def copy_into()
def dup()
def get_attribute_as_string(attribute)
def get_attribute_boolean(attribute)
def get_attribute_byte_string(attribute)
def get_attribute_data(attribute)
def get_attribute_int32(attribute)
def get_attribute_int64(attribute)
def get_attribute_object(attribute)
def get_attribute_status(attribute)
def get_attribute_string(attribute)
def get_attribute_type(attribute)
def get_attribute_uint32(attribute)
def get_attribute_uint64(attribute)
def get_content_type()
def get_display_name()
def get_edit_name()
def get_etag()
def get_file_type()
def get_icon()
def get_is_backup()
def get_is_hidden()
def get_is_symlink()
def get_modification_time()
def get_name()
def get_size()
def get_sort_order()
def get_symlink_target()
def has_attribute(attribute)
def list_attributes(name_space)
def remove_attribute(attribute)
def set_attribute(attribute, type, value_p)
def set_attribute_boolean(attribute, attr_value)
def set_attribute_byte_string(attribute, attr_value)
def set_attribute_data(attribute, attr_value)
def set_attribute_int32(attribute, attr_value)
def set_attribute_int64(attribute, attr_value)
def set_attribute_mask(mask)
def set_attribute_object(attribute, attr_value)
def set_attribute_status(attribute, attr_value)
def set_attribute_string(attribute, attr_value)
def set_attribute_uint32(attribute)
def set_attribute_uint64(attribute)
def set_content_type(content_type)
def set_display_name(display_name)
def set_edit_name(edit_name)
def set_file_type(type)
def set_icon(icon)
def set_is_hidden(is_hidden)
def set_is_symlink(is_symlink)
def set_modification_time(mtime)
def set_name(name)
def set_size(size)
def set_sort_order(sort_order)
def set_symlink_tarset(symlink_target)
def unset_attribute_mask()

Ancestry

+-- gobject.GObject
+gio.FileInfo

gio.FileInfo

gio.FileInfo — File Information and Attributes

Synopsis

class gio.FileInfo(gobject.GObject):
+    gio.FileInfo()
def clear_status()
def copy_into()
def dup()
def get_attribute_as_string(attribute)
def get_attribute_boolean(attribute)
def get_attribute_byte_string(attribute)
def get_attribute_data(attribute)
def get_attribute_int32(attribute)
def get_attribute_int64(attribute)
def get_attribute_object(attribute)
def get_attribute_status(attribute)
def get_attribute_string(attribute)
def get_attribute_type(attribute)
def get_attribute_uint32(attribute)
def get_attribute_uint64(attribute)
def get_content_type()
def get_display_name()
def get_edit_name()
def get_etag()
def get_file_type()
def get_icon()
def get_is_backup()
def get_is_hidden()
def get_is_symlink()
def get_modification_time()
def get_name()
def get_size()
def get_sort_order()
def get_symlink_target()
def has_attribute(attribute)
def list_attributes(name_space)
def remove_attribute(attribute)
def set_attribute(attribute, type, value_p)
def set_attribute_boolean(attribute, attr_value)
def set_attribute_byte_string(attribute, attr_value)
def set_attribute_data(attribute, attr_value)
def set_attribute_int32(attribute, attr_value)
def set_attribute_int64(attribute, attr_value)
def set_attribute_mask(mask)
def set_attribute_object(attribute, attr_value)
def set_attribute_status(attribute, attr_value)
def set_attribute_string(attribute, attr_value)
def set_attribute_uint32(attribute)
def set_attribute_uint64(attribute)
def set_content_type(content_type)
def set_display_name(display_name)
def set_edit_name(edit_name)
def set_file_type(type)
def set_icon(icon)
def set_is_hidden(is_hidden)
def set_is_symlink(is_symlink)
def set_modification_time(mtime)
def set_name(name)
def set_size(size)
def set_sort_order(sort_order)
def set_symlink_tarset(symlink_target)
def unset_attribute_mask()

Ancestry

+-- gobject.GObject
   +-- gio.FileInfo
-

Description

+

Description

Functionality for manipulating basic metadata for files. gio.FileInfo implements methods for getting information that all files should contain, @@ -39,4 +39,4 @@ gio.FileInfo

Creates a new gio.FileInfo -

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

+

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

diff --git a/docs/html/class-giofileinputstream.html b/docs/html/class-giofileinputstream.html index e9fe926..a4aedc7 100644 --- a/docs/html/class-giofileinputstream.html +++ b/docs/html/class-giofileinputstream.html @@ -1,12 +1,12 @@ -gio.FileInputStream

gio.FileInputStream

gio.FileInputStream — Base class for implementing streaming input

Synopsis

class gio.FileInputStream(gio.InputStream):
-    def query_info(attributes, cancellable=None)
def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)

Ancestry

+-- gobject.GObject
+gio.FileInputStream

gio.FileInputStream

gio.FileInputStream — Base class for implementing streaming input

Synopsis

class gio.FileInputStream(gio.InputStream):
+    def query_info(attributes, cancellable=None)
def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)

Implemented Interfaces

+

Implemented Interfaces

gio.FileInputStream implements gio.Seekable -

Description

+

Description

gio.FileInputStream provides input streams that take their content from a file.

@@ -21,7 +21,7 @@ gio.Seekable.can_seek(). To position a file input stream, use gio.Seekable.seek(). -

Methods

gio.FileInputStream.query_info

    def query_info(attributes, cancellable=None)

attributes :

a file attribute query string. +

Methods

gio.FileInputStream.query_info

    def query_info(attributes, cancellable=None)

attributes :

a file attribute query string.

cancellable :

optional gio.Cancellable object, None to ignore. diff --git a/docs/html/class-giofilemonitor.html b/docs/html/class-giofilemonitor.html index 523cc9e..187d822 100644 --- a/docs/html/class-giofilemonitor.html +++ b/docs/html/class-giofilemonitor.html @@ -1,12 +1,12 @@ -gio.FileMonitor

gio.FileMonitor

gio.FileMonitor — File Monitor

Synopsis

class gio.FileMonitor(gobject.GObject):
-    def cancel()
def emit_event(child, other_file, event_type)
def is_cancelled()
def set_rate_limit(limit_msecs)

Ancestry

+-- gobject.GObject
+gio.FileMonitor

gio.FileMonitor

gio.FileMonitor — File Monitor

Synopsis

class gio.FileMonitor(gobject.GObject):
+    def cancel()
def emit_event(child, other_file, event_type)
def is_cancelled()
def set_rate_limit(limit_msecs)

gio.FileMonitor Properties

"cancelled"Read Whether the monitor has been cancelled. Default value: False.
"rate-limit"Read/Write The limit of the monitor to watch for changes, in milliseconds. Allowed values: >= 0. Default value: 800. -

gio.FileMonitor Signal Prototypes

gobject.GObject Signal Prototypes

"changed"

def callback(filemonitor, file, other_file, event_type, user_param1, ...)

Description

+

gio.FileMonitor Signal Prototypes

gobject.GObject Signal Prototypes

"changed"

def callback(filemonitor, file, other_file, event_type, user_param1, ...)

Description

The gio.FileMonitor monitors a file or directory for changes.

@@ -18,4 +18,4 @@

To get informed about changes to the file or directory you are monitoring, connect to the "changed" signal. -

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

+

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

diff --git a/docs/html/class-giofileoutputstream.html b/docs/html/class-giofileoutputstream.html index 7ef0ad5..f69c100 100644 --- a/docs/html/class-giofileoutputstream.html +++ b/docs/html/class-giofileoutputstream.html @@ -1,12 +1,12 @@ -gio.FileOutputStream

gio.FileOutputStream

gio.FileOutputStream — Base class for implementing streaming input

Synopsis

class gio.FileOutputStream(gio.OutputStream):
-    def get_etag()
def query_info(attributes, cancellable=None)
def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)

Ancestry

+-- gobject.GObject
+gio.FileOutputStream

gio.FileOutputStream

gio.FileOutputStream — Base class for implementing streaming input

Synopsis

class gio.FileOutputStream(gio.OutputStream):
+    def get_etag()
def query_info(attributes, cancellable=None)
def query_info_async(attributes, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def query_info_finish(result)

Implemented Interfaces

+

Implemented Interfaces

gio.FileOutputStream implements gio.Seekable -

Description

+

Description

gio.FileOutputStream provides output streams that write their content to a file.

@@ -26,7 +26,7 @@ gio.FileOutputStream.can_truncate(). To truncate a file output stream, use gio.Seekable.truncate(). -

Methods

gio.FileOutputStream.get_etag

    def get_etag()

Returns :

the entity tag for the stream. +

Methods

gio.FileOutputStream.get_etag

    def get_etag()

Returns :

the entity tag for the stream.

The get_etag() method gets the entity tag for the file when it has been written. This must be called after the diff --git a/docs/html/class-giofilterinputstream.html b/docs/html/class-giofilterinputstream.html index ebdfb0d..0cfcee6 100644 --- a/docs/html/class-giofilterinputstream.html +++ b/docs/html/class-giofilterinputstream.html @@ -1,11 +1,11 @@ -gio.FilterInputStream

gio.FilterInputStream

gio.FilterInputStream — Filter Input Stream

Synopsis

class gio.FilterInputStream(gio.InputStream):
-    def get_base_stream()
def get_close_base_stream()
def set_close_base_stream(close_base)

Ancestry

+-- gobject.GObject
+gio.FilterInputStream

gio.FilterInputStream

gio.FilterInputStream — Filter Input Stream

Synopsis

class gio.FilterInputStream(gio.InputStream):
+    def get_base_stream()
def get_close_base_stream()
def set_close_base_stream(close_base)

gio.FilterInputStream Properties

"base-stream"Read - Write - Construct onlyThe underlying base stream on which the io ops will be done.
"close-base-stream"Read - Write - Construct onlyIf the base stream should be closed when the filter stream is closed. - Default value: True.

Description

+ Default value: True.

Description

Filter Input Stream. -

Methods

gio.FilterInputStream.get_base_stream

    def get_base_stream()

Returns :

A +

Methods

gio.FilterInputStream.get_base_stream

    def get_base_stream()

Returns :

A gio.InputStream

The get_base_stream() method gets the base diff --git a/docs/html/class-giofilteroutputstream.html b/docs/html/class-giofilteroutputstream.html index 8653c9e..e8781a5 100644 --- a/docs/html/class-giofilteroutputstream.html +++ b/docs/html/class-giofilteroutputstream.html @@ -1,11 +1,11 @@ -gio.FilterOutputStream

gio.FilterOutputStream

gio.FilterOutputStream — Filter Output Stream

Synopsis

class gio.FilterOutputStream(gio.OutputStream):
-    def get_base_stream()
def get_close_base_stream()
def set_close_base_stream(close_base)

Ancestry

+-- gobject.GObject
+gio.FilterOutputStream

gio.FilterOutputStream

gio.FilterOutputStream — Filter Output Stream

Synopsis

class gio.FilterOutputStream(gio.OutputStream):
+    def get_base_stream()
def get_close_base_stream()
def set_close_base_stream(close_base)

gio.FilterOutputStream Properties

"base-stream"Read - Write - Construct onlyThe underlying base stream on which the io ops will be done.
"close-base-stream"Read - Write - Construct onlyIf the base stream should be closed when the filter stream is closed. - Default value: True.

Description

+ Default value: True.

Description

Filter Output Stream. -

Methods

gio.FilterOutputStream.get_base_stream

    def get_base_stream()

Returns :

A +

Methods

gio.FilterOutputStream.get_base_stream

    def get_base_stream()

Returns :

A gio.OutputStream

The get_base_stream() method gets the base diff --git a/docs/html/class-gioicon.html b/docs/html/class-gioicon.html index aed7157..4a15c7e 100644 --- a/docs/html/class-gioicon.html +++ b/docs/html/class-gioicon.html @@ -1,19 +1,19 @@ -gio.Icon

gio.Icon

gio.Icon — Interface for icons.

Synopsis

class gio.Icon(gobject.GInterface):
+gio.Icon

gio.Icon

gio.Icon — Interface for icons.

Synopsis

class gio.Icon(gobject.GInterface):
     def equal(icon2)
def to_string()
 Functions
  
-    def gio.icon_new_from_string()

Ancestry

+-- gobject.GInterface
   +-- gio.Icon
-

Known Derived Interfaces

+

Known Derived Interfaces

gio.Icon is required by gio.LoadableIcon. -

Known Implementation

+

Known Implementation

gio.Icon is implemented by gio.ThemedIcon, gio.FileIcon, gio.Emblem, gio.EmblemedIcon. -

Description

+

Description

gio.Icon is a very minimal interface for icons. It provides functions for checking the equality of two icons, hashing of icons and serializing an icon to and from strings. @@ -39,7 +39,7 @@ implementations you need to ensure that each GType is registered with the type system prior to calling gio.icon_new_from_string(). -

Methods

gio.Icon.equal

    def equal(icon2)

icon2 :

the second +

Methods

gio.Icon.equal

    def equal(icon2)

icon2 :

the second gio.Icon

The equal() method checks if two icons are equal. @@ -63,7 +63,7 @@

If icon is a gio.ThemedIcon with exactly one name, the encoding is simply the name (such as network-server). -

Functions

gio.icon_new_from_string

    def icon_new_from_string(str)

str :

A string obtained via +

Functions

gio.icon_new_from_string

    def icon_new_from_string(str)

str :

A string obtained via gio.Icon.to_string().

Returns :

An object implementing the gio.Icon diff --git a/docs/html/class-gioinputstream.html b/docs/html/class-gioinputstream.html index bb06b9b..7a4ee27 100644 --- a/docs/html/class-gioinputstream.html +++ b/docs/html/class-gioinputstream.html @@ -1,7 +1,7 @@ -gio.InputStream

gio.InputStream

gio.InputStream — Base class for implementing streaming input

Synopsis

class gio.InputStream(gobject.GObject):
-    def clear_pending()
def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def has_pending()
def is_closed()
def read(count=-1, cancellable=None)
def read_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_finish(result)
def read_part(count=-1, cancellable=None)
def set_pending()
def skip(count, cancellable=None)
def skip_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def skip_finish(result)

Ancestry

+-- gobject.GObject
+gio.InputStream

gio.InputStream

gio.InputStream — Base class for implementing streaming input

Synopsis

class gio.InputStream(gobject.GObject):
+    def clear_pending()
def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def has_pending()
def is_closed()
def read(count=-1, cancellable=None)
def read_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def read_finish(result)
def read_part(count=-1, cancellable=None)
def set_pending()
def skip(count, cancellable=None)
def skip_async(count, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def skip_finish(result)

Description

+

Description

gio.InputStream has functions to read from a stream ( gio.InputStream.read() @@ -16,7 +16,7 @@ gio.OutputStream.splice().

All of these functions have async variants too. -

Methods

gio.InputStream.clear_pending

    def clear_pending()

+

Methods

gio.InputStream.clear_pending

    def clear_pending()

The clear_pending() method clears the pending flag on stream.

gio.InputStream.close

    def close(cancellable=None)

cancellable :

optional gio.Cancellable diff --git a/docs/html/class-gioloadableicon.html b/docs/html/class-gioloadableicon.html index b894302..8f84331 100644 --- a/docs/html/class-gioloadableicon.html +++ b/docs/html/class-gioloadableicon.html @@ -1,18 +1,18 @@ -gio.LoadableIcon

gio.LoadableIcon

gio.LoadableIcon — Interface for icons.

Synopsis

class gio.LoadableIcon(gobject.GInterface):
-    def load(size=0, cancellable=None)
def load_async(callback, size=0, cancellable=None, user_data=None)
def load_finish(res)

Ancestry

+-- gobject.GInterface
+gio.LoadableIcon

gio.LoadableIcon

gio.LoadableIcon — Interface for icons.

Synopsis

class gio.LoadableIcon(gobject.GInterface):
+    def load(size=0, cancellable=None)
def load_async(callback, size=0, cancellable=None, user_data=None)
def load_finish(res)

Prerequisites

+

Prerequisites

gio.LoadableIcon requires gio.Icon. and gobject.GObject -

Known Implementation

+

Known Implementation

gio.LoadableIcon is implemented by gio.FileIcon -

Description

+

Description

gio.LoadableIcon extends the gio.Icon interface and adds the ability to load icons from streams. -

Methods

gio.LoadableIcon.load

    def load(size=0, cancellable=None)

size :

an integer +

Methods

gio.LoadableIcon.load

    def load(size=0, cancellable=None)

size :

an integer

cancellable :

optional gio.Cancellable object, None to ignore. diff --git a/docs/html/class-giomemoryinputstream.html b/docs/html/class-giomemoryinputstream.html index b9276a9..5068dea 100644 --- a/docs/html/class-giomemoryinputstream.html +++ b/docs/html/class-giomemoryinputstream.html @@ -1,15 +1,15 @@ -gio.MemoryInputStream

gio.MemoryInputStream

gio.MemoryInputStream — Base class for implementing streaming input

Synopsis

class gio.MemoryInputStream(gio.InputStream):
+gio.MemoryInputStream

gio.MemoryInputStream

gio.MemoryInputStream — Base class for implementing streaming input

Synopsis

class gio.MemoryInputStream(gio.InputStream):
     gio.MemoryInputStream()
def add_data(data)
 Functions
  
-    def gio.memory_input_stream_new_from_data(data)

Implemented Interfaces

+

Implemented Interfaces

gio.MemoryInputStream implements gio.Seekable -

Description

+

Description

gio.MemoryInputStream is a class for using arbitrary memory chunks as input for GIO streaming input operations.

Constructor

    gio.MemoryInputStream(icon)

Returns :

a new @@ -17,11 +17,11 @@

Creates an empty gio.MemoryInputStream. -

Methods

gio.MemoryInputStream.add_data

    def add_data(data)

data :

input data. +

Methods

gio.MemoryInputStream.add_data

    def add_data(data)

data :

input data.

The add_data() method appends data to data that can be read from the input stream -

Functions

gio.memory_input_stream_new_from_data

    def memory_input_stream_new_from_data(data)

data :

input data. +

Functions

gio.memory_input_stream_new_from_data

    def memory_input_stream_new_from_data(data)

data :

input data.

Returns :

A new gio.MemoryInputStream read from data diff --git a/docs/html/class-giomemoryoutputstream.html b/docs/html/class-giomemoryoutputstream.html index cebe8e3..115bba7 100644 --- a/docs/html/class-giomemoryoutputstream.html +++ b/docs/html/class-giomemoryoutputstream.html @@ -1,12 +1,12 @@ -gio.MemoryOutputStream

gio.MemoryOutputStream

gio.MemoryOutputStream — Streaming output operations on memory chunks

Synopsis

class gio.MemoryOutputStream(gio.OutputStream):
-    gio.MemoryOutputStream()
def get_contents()
def get_data_size()
def get_size()

Ancestry

+-- gobject.GObject
+gio.MemoryOutputStream

gio.MemoryOutputStream

gio.MemoryOutputStream — Streaming output operations on memory chunks

Synopsis

class gio.MemoryOutputStream(gio.OutputStream):
+    gio.MemoryOutputStream()
def get_contents()
def get_data_size()
def get_size()

Implemented Interfaces

+

Implemented Interfaces

gio.MemoryOutputStream implements gio.Seekable -

Description

+

Description

gio.MemoryOutputStream is a class for using arbitrary memory chunks as output for GIO streaming output operations.

Constructor

    gio.MemoryOutputStream()

Returns :

a new @@ -14,7 +14,7 @@

Creates a new gio.MemoryOutputStream. -

Methods

gio.MemoryOutputStream.get_contents

    def get_contents()

Returns :

the stream's data +

Methods

gio.MemoryOutputStream.get_contents

    def get_contents()

Returns :

the stream's data

The get_contents() method gets any loaded data from the ostream. diff --git a/docs/html/class-giomount.html b/docs/html/class-giomount.html index 5486311..574ebfd 100644 --- a/docs/html/class-giomount.html +++ b/docs/html/class-giomount.html @@ -1,10 +1,10 @@ -gio.Mount

gio.Mount

gio.Mount — Mount management

Synopsis

class gio.Mount(gobject.GInterface):
-    def can_eject()
def can_unmount()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def get_drive()
def get_icon()
def get_name()
def get_root()
def get_uuid()
def get_volume()
def guess_content_type(callback, force_rescan, cancellable=None, user_data=None)
def guess_content_type_finish(result)
def guess_content_type_sync(force_rescan, cancellable=None)
def is_shadowed()
def remount(callback, flags=gio.MOUNT_UNMOUNT_NONE, mount_operation=None, cancellable=None, user_data=None)
def remount_finish(result)
def shadow()
def unmount(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def unmount_finish(result)
def unshadow()

Ancestry

+-- gobject.GInterface
+gio.Mount

gio.Mount

gio.Mount — Mount management

Synopsis

class gio.Mount(gobject.GInterface):
+    def can_eject()
def can_unmount()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def get_drive()
def get_icon()
def get_name()
def get_root()
def get_uuid()
def get_volume()
def guess_content_type(callback, force_rescan, cancellable=None, user_data=None)
def guess_content_type_finish(result)
def guess_content_type_sync(force_rescan, cancellable=None)
def is_shadowed()
def remount(callback, flags=gio.MOUNT_UNMOUNT_NONE, mount_operation=None, cancellable=None, user_data=None)
def remount_finish(result)
def shadow()
def unmount(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def unmount_finish(result)
def unshadow()

Ancestry

+-- gobject.GInterface
   +-- gio.Mount
-

Prerequisites

+

Prerequisites

gio.Mount requires gobject.GObject -

gio.Mount Signal Prototypes

gobject.GObject Signal Prototypes

"aborted"

def callback(mount, user_param1, ...)

"changed"

def callback(mount, user_param1, ...)

"unmounted"

def callback(mount, user_param1, ...)

Description

+

gio.Mount Signal Prototypes

gobject.GObject Signal Prototypes

"aborted"

def callback(mount, user_param1, ...)

"changed"

def callback(mount, user_param1, ...)

"unmounted"

def callback(mount, user_param1, ...)

Description

The gio.Mount interface represents user-visible mounts. Note, when porting from GnomeVFS, gio.Mount @@ -28,7 +28,7 @@ with the GMount and the GAsyncReady data to see if the operation was completed successfully. If an error is present when g_mount_unmount_finish() is called, then it will be filled with any error information. -

Methods

gio.Mount.can_eject

    def can_eject()

Returns :

True if the mount can be ejected, +

Methods

gio.Mount.can_eject

    def can_eject()

Returns :

True if the mount can be ejected, False otherwise.

The can_eject() method checks if a mount can be ejected. @@ -108,7 +108,7 @@

The guess_content_type_finish() method finishes guessing content types of mount. If any errors occured during the operation, error will be set to - contain the errors and FALSE will be returned. In particular, you may get an + contain the errors and False will be returned. In particular, you may get an gio.ERROR_NOT_SUPPORTED if the mount does not support content guessing.

gio.Mount.guess_content_type_sync

    def guess_content_type_sync(force_rescan, cancellable=None)

force_rescan :

Whether to force a rescan of the content. Otherwise a cached result will be used if available.

cancellable :

Optional @@ -221,7 +221,7 @@ gio.Mount.is_shadowed() for more information. The caller will need to emit the "changed" signal on mount manually. -

Signals

The "aborted" gio.Mount Signal

    def callback(mount, user_param1, ...)

mount :

the mount

user_param1 :

the first user parameter (if any) specified +

Signals

The "aborted" gio.Mount Signal

    def callback(mount, user_param1, ...)

mount :

the mount

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Emitted by the backend when e.g. a device becomes unavailable while a diff --git a/docs/html/class-giomountoperation.html b/docs/html/class-giomountoperation.html index 19cc014..fddc13b 100644 --- a/docs/html/class-giomountoperation.html +++ b/docs/html/class-giomountoperation.html @@ -1,5 +1,5 @@ -gio.MountOperation

gio.MountOperation

gio.MountOperation — Authentication methods for mountable locations.

Synopsis

class gio.MountOperation(gobject.GObject):
-    gio.MountOperation()
def get_anonymous()
def get_choice()
def get_domain()
def get_password()
def get_password_save()
def get_username()
def replay(result)
def set_anonymous(anonymous)
def set_choice(choice)
def set_domain(domain)
def set_password(password)
def set_password_save(save)
def set_username(username)

Ancestry

+-- gobject.GObject
+gio.MountOperation

gio.MountOperation

gio.MountOperation — Authentication methods for mountable locations.

Synopsis

class gio.MountOperation(gobject.GObject):
+    gio.MountOperation()
def get_anonymous()
def get_choice()
def get_domain()
def get_password()
def get_password_save()
def get_username()
def replay(result)
def set_anonymous(anonymous)
def set_choice(choice)
def set_domain(domain)
def set_password(password)
def set_password_save(save)
def set_username(username)

gio.MountOperation Properties

"anonymous"Read/Write Whether to use an anonymous user when authenticating. @@ -19,7 +19,7 @@
"username"Read/Write The user name that is used for authentication when carrying out the mount operation. Default value: None -

gio.MountOperation Signal Prototypes

gobject.GObject Signal Prototypes

"aborted"

def callback(mountoperation, user_param1, ...)

"ask-password"

def callback(mountoperation, message, default_user, default_domain, flags, user_param1, ...)

"ask-question"

def callback(mountoperation, message, choices, user_param1, ...)

"reply"

def callback(mountoperation, result, user_param1, ...)

Description

+

gio.MountOperation Signal Prototypes

gobject.GObject Signal Prototypes

"aborted"

def callback(mountoperation, user_param1, ...)

"ask-password"

def callback(mountoperation, message, default_user, default_domain, flags, user_param1, ...)

"ask-question"

def callback(mountoperation, message, choices, user_param1, ...)

"reply"

def callback(mountoperation, result, user_param1, ...)

Description

The gio.MountOperation provides a mechanism for authenticating mountable operations, such as loop mounting files, hard drive partitions or server locations. @@ -37,7 +37,7 @@ gio.MountOperation.

Creates a new mount operation. -

Methods

gio.MountOperation.get_anonymous

    def get_anonymous()

Returns :

True if mount operation is anonymous. +

Methods

gio.MountOperation.get_anonymous

    def get_anonymous()

Returns :

True if mount operation is anonymous.

The get_anonymous() method check to see whether the mount operation is being used for an anonymous user @@ -92,7 +92,7 @@

The set_anonymous() method sets the user name within op to username. -

Signals

The "aborted" gio.MountOperation Signal

    def callback(mountoperation, user_param1, ...)

mountoperation :

the mountoperation

user_param1 :

the first user parameter (if any) specified +

Signals

The "aborted" gio.MountOperation Signal

    def callback(mountoperation, user_param1, ...)

mountoperation :

the mountoperation

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress. diff --git a/docs/html/class-giooutputstream.html b/docs/html/class-giooutputstream.html index 10b06d9..d4df1ab 100644 --- a/docs/html/class-giooutputstream.html +++ b/docs/html/class-giooutputstream.html @@ -1,7 +1,7 @@ -gio.OutputStream

gio.OutputStream

gio.OutputStream — Base class for implementing streaming input

Synopsis

class gio.OutputStream(gobject.GObject):
-    def clear_pending()
def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def flush(cancellable=None)
def flush_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def flush_finish(result)
def has_pending()
def is_closed()
def set_pending()
def splice(cancellable=None, flags=gio.OUTPUT_STREAM_SPLICE_NONE)
def splice_async(source, callback, flags=gio.OUTPUT_STREAM_SPLICE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def splice_finish(result)
def write(buffer, cancellable=None)
def write_async(buffer, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def write_finish(result)

Ancestry

+-- gobject.GObject
+gio.OutputStream

gio.OutputStream

gio.OutputStream — Base class for implementing streaming input

Synopsis

class gio.OutputStream(gobject.GObject):
+    def clear_pending()
def close(cancellable=None)
def close_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def close_finish(result)
def flush(cancellable=None)
def flush_async(callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def flush_finish(result)
def has_pending()
def is_closed()
def set_pending()
def splice(cancellable=None, flags=gio.OUTPUT_STREAM_SPLICE_NONE)
def splice_async(source, callback, flags=gio.OUTPUT_STREAM_SPLICE_NONE, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def splice_finish(result)
def write(buffer, cancellable=None)
def write_async(buffer, callback, io_priority=glib.PRIORITY_DEFAULT, cancellable=None, user_data=None)
def write_finish(result)

Description

+

Description

gio.OutputStream has functions to write from a stream ( gio.OutputStream.write() @@ -16,4 +16,4 @@ gio.OutputStream.splice().

All of these functions have async variants too. -

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

+

Methods

Unfinished section, you may want to see the relevant C API docs for methods descriptions.

diff --git a/docs/html/class-gioseekable.html b/docs/html/class-gioseekable.html index 8e98b67..e7fdf1b 100644 --- a/docs/html/class-gioseekable.html +++ b/docs/html/class-gioseekable.html @@ -1,19 +1,19 @@ -gio.Seekable

gio.Seekable

gio.Seekable — Stream seeking interface.

Synopsis

class gio.Seekable(gobject.GInterface):
-    def tell()
def can_seek()
def seek(offset, type=0, cancellable=None)
def can_truncate()
def truncate(offset, cancellable=None)

Ancestry

+-- gobject.GInterface
+gio.Seekable

gio.Seekable

gio.Seekable — Stream seeking interface.

Synopsis

class gio.Seekable(gobject.GInterface):
+    def tell()
def can_seek()
def seek(offset, type=0, cancellable=None)
def can_truncate()
def truncate(offset, cancellable=None)

Known Implementation

+

Description

+

Description

gio.Seekable is implemented by streams (implementations of gio.InputStream or gio.OutputStream) that support seeking. -

Methods

gio.Seekable.tell

    def tell()

Returns :

+

Methods

gio.Seekable.tell

    def tell()

Returns :

the offset from the beginning of the buffer

Tells the current position within the stream. diff --git a/docs/html/class-giosimpleasyncresult.html b/docs/html/class-giosimpleasyncresult.html index a9a07fe..6119618 100644 --- a/docs/html/class-giosimpleasyncresult.html +++ b/docs/html/class-giosimpleasyncresult.html @@ -1,10 +1,10 @@ -gio.SimpleAsyncResult

gio.SimpleAsyncResult

gio.SimpleAsyncResult — Simple asynchronous results implementation.

Synopsis

class gio.SimpleAsyncResult(gobject.GObject):
-    def complete()
def complete_in_idle()
def get_op_res_gboolean()
def get_op_res_gssize()
def propagate_error()
def set_handle_cancellation(handle_cancellation)
def set_op_res_gboolean(op_res)
def set_op_res_gssize(op_res)

Ancestry

+-- gobject.GObject
+gio.SimpleAsyncResult

gio.SimpleAsyncResult

gio.SimpleAsyncResult — Simple asynchronous results implementation.

Synopsis

class gio.SimpleAsyncResult(gobject.GObject):
+    def complete()
def complete_in_idle()
def get_op_res_gboolean()
def get_op_res_gssize()
def propagate_error()
def set_handle_cancellation(handle_cancellation)
def set_op_res_gboolean(op_res)
def set_op_res_gssize(op_res)

Implemented Interface

+

Implemented Interface

gio.SimpleAsyncResult implements gio.AsyncResult. -

Description

+

Description

Implements gio.AsyncResult for simple cases. Most of the time, this will be all an application needs, and will be used transparently Because of this, GSimpleAsyncResult is used throughout GIO for handling asynchronous functions. @@ -49,7 +49,7 @@ gio.SimpleAsyncResult.get_op_res_gboolean() and gio.SimpleAsyncResult.get_op_res_gssize() are provided, getting the operation's result as a gboolean and gssize, respectively. -

Methods

gio.SimpleAsyncResult.complete

    def complete()

+

Methods

gio.SimpleAsyncResult.complete

    def complete()

The complete() method completes an asynchronous I/O job. Must be called in the main thread, as it invokes the callback that should be called in the main thread. If you are in a different thread use diff --git a/docs/html/class-giothemedicon.html b/docs/html/class-giothemedicon.html index 6c2991d..83d24de 100644 --- a/docs/html/class-giothemedicon.html +++ b/docs/html/class-giothemedicon.html @@ -1,5 +1,5 @@ -gio.ThemedIcon

gio.ThemedIcon

gio.ThemedIcon — Icon theming support.

Synopsis

class gio.ThemedIcon(gobject.GObject):
-    gio.ThemedIcon()
def append_name()
def get_names()
def prepend_name()

Ancestry

+-- gobject.GObject
+gio.ThemedIcon

gio.ThemedIcon

gio.ThemedIcon — Icon theming support.

Synopsis

class gio.ThemedIcon(gobject.GObject):
+    gio.ThemedIcon()
def append_name()
def get_names()
def prepend_name()

gio.ThemedIcon Properties

"name"Write/Contruct Only The icon name. Default value: None @@ -9,7 +9,7 @@ Whether to use the default fallbacks found by shortening the icon name at '-' characters. If the "names" array has more than one element, ignores any past the first. -

Description

+

Description

gio.ThemedIcon is an implementation of gio.Icon that supports icon themes. GThemedIcon contains a list of all of the icons present in an icon @@ -27,7 +27,7 @@ Creates a new themed icon from icon name, if instead of an icon name you provide a list of icon names, the gio.ThemedIcon will be constructed using the items in the list. -

Methods

gio.ThemedIcon.append_name

    def append_name()

name :

name of icon to append to list of icons from within icon. +

Methods

gio.ThemedIcon.append_name

    def append_name()

name :

name of icon to append to list of icons from within icon.

The append_name() method appends a name to the list of icons from within icon. diff --git a/docs/html/class-giounixinputstream.html b/docs/html/class-giounixinputstream.html index dce3d2f..4059661 100644 --- a/docs/html/class-giounixinputstream.html +++ b/docs/html/class-giounixinputstream.html @@ -1,9 +1,9 @@ -gio.unix.InputStream

gio.unix.InputStream

gio.unix.InputStream — Streaming input operations for UNIX file descriptors.

Synopsis

class gio.unix.InputStream(gio.InputStream):
-    gio.unix.InputStream(fd, close_fd)
def get_close_fd()
def get_fd()
def set_close_fd(close_fd)

Ancestry

+-- gobject.GObject
+gio.unix.InputStream

gio.unix.InputStream

gio.unix.InputStream — Streaming input operations for UNIX file descriptors.

Synopsis

class gio.unix.InputStream(gio.InputStream):
+    gio.unix.InputStream(fd, close_fd)
def get_close_fd()
def get_fd()
def set_close_fd(close_fd)

gio.unix.InputStream Properties

"close-fd"Read - WriteWhether to close the file descriptor when the stream is closed. - Default value: True.
"fd"Read - Write - Construct onlyThe file descriptor that the stream reads from. Default value: -1.

Description

+ Default value: True.

"fd"Read - Write - Construct onlyThe file descriptor that the stream reads from. Default value: -1.

Description

gio.unix.InputStream implements gio.InputStream for reading from a UNIX file descriptor, including asynchronous operations. @@ -22,7 +22,7 @@ from the given fd.

If close_fd is True, the file descriptor will be closed when the stream is closed. -

Methods

gio.unix.InputStream.get_close_fd

    def get_close_fd()

Returns :

True if the file descriptor is closed when done. +

Methods

gio.unix.InputStream.get_close_fd

    def get_close_fd()

Returns :

True if the file descriptor is closed when done.

The get_close_fd() method returns whether the file descriptor of stream will be closed when the stream is closed. diff --git a/docs/html/class-giounixoutputstream.html b/docs/html/class-giounixoutputstream.html index 4093d8f..8b9b647 100644 --- a/docs/html/class-giounixoutputstream.html +++ b/docs/html/class-giounixoutputstream.html @@ -1,9 +1,9 @@ -gio.unix.OutputStream

gio.unix.OutputStream

gio.unix.OutputStream — Streaming output operations for UNIX file descriptors.

Synopsis

class gio.unix.OutputStream(gio.OutputStream):
-    gio.unix.OutputStream(fd, close_fd)
def get_close_fd()
def get_fd()
def set_close_fd(close_fd)

Ancestry

+-- gobject.GObject
+gio.unix.OutputStream

gio.unix.OutputStream

gio.unix.OutputStream — Streaming output operations for UNIX file descriptors.

Synopsis

class gio.unix.OutputStream(gio.OutputStream):
+    gio.unix.OutputStream(fd, close_fd)
def get_close_fd()
def get_fd()
def set_close_fd(close_fd)

gio.unix.OutputStream Properties

"close-fd"Read - WriteWhether to close the file descriptor when the stream is closed. - Default value: True.
"fd"Read - Write - Construct onlyThe file descriptor that the stream writes to. Default value: -1.

Description

+ Default value: True.

"fd"Read - Write - Construct onlyThe file descriptor that the stream writes to. Default value: -1.

Description

gio.unix.OutputStream implements gio.OutputStream for writing to a UNIX file descriptor, including asynchronous operations. @@ -22,7 +22,7 @@ from the given fd.

If close_fd is True, the file descriptor will be closed when the stream is closed. -

Methods

gio.unix.OutputStream.get_close_fd

    def get_close_fd()

Returns :

True if the file descriptor is closed when done. +

Methods

gio.unix.OutputStream.get_close_fd

    def get_close_fd()

Returns :

True if the file descriptor is closed when done.

The get_close_fd() method returns whether the file descriptor of stream will be closed when the stream is closed. diff --git a/docs/html/class-giovolume.html b/docs/html/class-giovolume.html index 957cbad..ff6512a 100644 --- a/docs/html/class-giovolume.html +++ b/docs/html/class-giovolume.html @@ -1,10 +1,10 @@ -gio.Volume

gio.Volume

gio.Volume — Volume management.

Synopsis

class gio.Volume(gobject.GInterface):
-    def can_eject()
def can_mount()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def enumerate_identifiers()
def get_activation_root()
def get_drive()
def get_icon()
def get_identifier()
def get_mount()
def get_name()
def get_uuid()
def mount(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)
def mount_finish(result)
def should_automount()

Ancestry

+-- gobject.GInterface
+gio.Volume

gio.Volume

gio.Volume — Volume management.

Synopsis

class gio.Volume(gobject.GInterface):
+    def can_eject()
def can_mount()
def eject(callback, flags=gio.MOUNT_UNMOUNT_NONE, cancellable=None, user_data=None)
def eject_finish(result)
def enumerate_identifiers()
def get_activation_root()
def get_drive()
def get_icon()
def get_identifier()
def get_mount()
def get_name()
def get_uuid()
def mount(mount_operation, callback, flags=gio.MOUNT_MOUNT_NONE, cancellable=None, user_data=None)
def mount_finish(result)
def should_automount()

Ancestry

+-- gobject.GInterface
   +-- gio.Volume
-

Prerequisites

+

Prerequisites

gio.Volume requires gobject.GObject -

gio.Volume Signal Prototypes

gobject.GObject Signal Prototypes

"changed"

def callback(volume, user_param1, ...)

"removed"

def callback(volume, user_param1, ...)

Description

+

gio.Volume Signal Prototypes

gobject.GObject Signal Prototypes

"changed"

def callback(volume, user_param1, ...)

"removed"

def callback(volume, user_param1, ...)

Description

The gio.Volume interface represents user-visible objects that can be mounted. Note, when porting from GnomeVFS, gio.Volume @@ -39,7 +39,7 @@ "hal-udi", "label", etc. Use gio.Volume.get_identifier() to obtain an identifier for a volume. -

Methods

gio.Volume.can_eject

    def can_eject()

Returns :

True if the volume can be ejected, +

Methods

gio.Volume.can_eject

    def can_eject()

Returns :

True if the volume can be ejected, False otherwise.

The can_eject() method checks if a volume can be ejected. @@ -162,7 +162,7 @@ volume_activation_root.has_prefix(mount_root) || volume_activation_root.equal(mo

The should_automount() method returns whether the volume should be automatically mounted. -

Signals

The "changed" gio.Volume Signal

    def callback(volume, user_param1, ...)

volume :

the volume

user_param1 :

the first user parameter (if any) specified +

Signals

The "changed" gio.Volume Signal

    def callback(volume, user_param1, ...)

volume :

the volume

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Emitted when the volume has been changed. diff --git a/docs/html/class-giovolumemonitor.html b/docs/html/class-giovolumemonitor.html index 697d14f..bd59ccc 100644 --- a/docs/html/class-giovolumemonitor.html +++ b/docs/html/class-giovolumemonitor.html @@ -1,13 +1,13 @@ -gio.VolumeMonitor

gio.VolumeMonitor

gio.VolumeMonitor — Volume Monitor.

Synopsis

class gio.VolumeMonitor(gobject.GObject):
+gio.VolumeMonitor

gio.VolumeMonitor

gio.VolumeMonitor — Volume Monitor.

Synopsis

class gio.VolumeMonitor(gobject.GObject):
     def get_connected_drives()
def get_mount_for_uuid(uuid)
def get_mounts()
def get_volume_for_uuid(uuid)
def get_volumes()
 Functions
-    def gio.volume_monitor_adopt_orphan_mount()
def gio.volume_monitor_get()

gio.VolumeMonitor Signal Prototypes

gobject.GObject Signal Prototypes

"drive-changed"

def callback(volume_monitor, drive, user_param1, ...)

"drive-connected"

def callback(volume_monitor, drive, user_param1, ...)

"drive-disconnected"

def callback(volume_monitor, drive, user_param1, ...)

"drive-eject-button"

def callback(volume_monitor, drive, user_param1, ...)

"mount-added"

def callback(volume_monitor, mount, user_param1, ...)

"mount-changed"

def callback(volume_monitor, mount, user_param1, ...)

"mount-pre-unmount"

def callback(volume_monitor, mount, user_param1, ...)

"mount-removed"

def callback(volume_monitor, mount, user_param1, ...)

"volume-added"

def callback(volume_monitor, volume, user_param1, ...)

"volume-changed"

def callback(volume_monitor, volume, user_param1, ...)

"volume-removed"

def callback(volume_monitor, volume, user_param1, ...)

Description

+

gio.VolumeMonitor Signal Prototypes

gobject.GObject Signal Prototypes

"drive-changed"

def callback(volume_monitor, drive, user_param1, ...)

"drive-connected"

def callback(volume_monitor, drive, user_param1, ...)

"drive-disconnected"

def callback(volume_monitor, drive, user_param1, ...)

"drive-eject-button"

def callback(volume_monitor, drive, user_param1, ...)

"mount-added"

def callback(volume_monitor, mount, user_param1, ...)

"mount-changed"

def callback(volume_monitor, mount, user_param1, ...)

"mount-pre-unmount"

def callback(volume_monitor, mount, user_param1, ...)

"mount-removed"

def callback(volume_monitor, mount, user_param1, ...)

"volume-added"

def callback(volume_monitor, volume, user_param1, ...)

"volume-changed"

def callback(volume_monitor, volume, user_param1, ...)

"volume-removed"

def callback(volume_monitor, volume, user_param1, ...)

Description

The gio.VolumeMonitor is for listing the user interesting devices and volumes on the computer. In other words, what a file selector or file manager would show in a sidebar. -

Methods

gio.VolumeMonitor.get_connected_drives

    def get_connected_drives()

Returns :

a list of connected +

Methods

gio.VolumeMonitor.get_connected_drives

    def get_connected_drives()

Returns :

a list of connected gio.Drive objects.

The get_connected_drives() method gets a list @@ -40,7 +40,7 @@ objects.

The get_volumes() method gets a list of the volumes on the system. -

Functions

gio.volume_monitor_adopt_orphan_mount

    def volume_monitor_adopt_orphan_mount()

Returns :

The gio.Volume +

Functions

gio.volume_monitor_adopt_orphan_mount

    def volume_monitor_adopt_orphan_mount()

Returns :

The gio.Volume object that is the parent for mount or None if no wants to adopt the gio.Mount.

Warning

This method will be deprecated starting from GIO 2.20

@@ -88,7 +88,7 @@

The volume_monitor_get() function gets the volume monitor used by gio. -

Signals

The "drive-changed" gio.Volume Signal

    def callback(volume_monitor, drive, user_param1, ...)

volume_monitor :

the volume monitor

drive :

the drive that changed

user_param1 :

the first user parameter (if any) specified +

Signals

The "drive-changed" gio.Volume Signal

    def callback(volume_monitor, drive, user_param1, ...)

volume_monitor :

the volume monitor

drive :

the drive that changed

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Emitted when a drive changes. diff --git a/docs/html/class-glibmaincontext.html b/docs/html/class-glibmaincontext.html index 071c992..9f815f6 100644 --- a/docs/html/class-glibmaincontext.html +++ b/docs/html/class-glibmaincontext.html @@ -1,7 +1,7 @@ -glib.MainContext

glib.MainContext

glib.MainContext — an object representing a set of event sources to be handled -in a glib.MainLoop.

Synopsis

class glib.MainContext:
-    glib.MainContext()
def iteration(may_block)
def pending()

Ancestry

+-- glib.MainContext
-

Description

A glib.MainContext +glib.MainContext

glib.MainContext

glib.MainContext — an object representing a set of event sources to be handled +in a glib.MainLoop.

Synopsis

class glib.MainContext:
+    glib.MainContext()
def iteration(may_block)
def pending()

Ancestry

+-- glib.MainContext
+

Description

A glib.MainContext represents a set of event sources that can be run in a single thread. File descriptors (plain files, pipes or sockets) and timeouts are the standard event sources for GTK and PyGTK though @@ -13,17 +13,17 @@ events from lower priority sources. Single iterations of a iteration() method.

Constructor

    glib.MainContext()

Returns :

a new glib.MainContext object.

Creates a new glib.MainContext -object.

Methods

glib.MainContext.iteration

    def iteration()

may_block :

if TRUE the call may block - waiting for an event.

Returns :

TRUE if events were +object.

Methods

glib.MainContext.iteration

    def iteration()

may_block :

if True the call may block + waiting for an event.

Returns :

True if events were dispatched.

The iteration() method runs a single iteration. This involves:

  • checking to see if any associated event sources are ready to be processed;
  • then if no events sources are ready and -may_block is TRUE, waiting for a +may_block is True, waiting for a source to become ready;
  • and finally, dispatching the highest priority events sources that are ready

Note that even when may_block is -TRUE, it is still possible for -iteration() to return FALSE, +True, it is still possible for +iteration() to return False, since the the wait may be interrupted for other reasons than an event source -becoming ready.

glib.MainContext.pending

    def pending()

Returns :

TRUE if events are +becoming ready.

glib.MainContext.pending

    def pending()

Returns :

True if events are pending.

The pending() method checks if any associated sources have pending events.

diff --git a/docs/html/class-glibmainloop.html b/docs/html/class-glibmainloop.html index d0894dc..f5ba208 100644 --- a/docs/html/class-glibmainloop.html +++ b/docs/html/class-glibmainloop.html @@ -1,7 +1,7 @@ -glib.MainLoop

glib.MainLoop

glib.MainLoop — an object representing the main event loop of a PyGTK - application.

Synopsis

class glib.MainLoop:
-    glib.MainLoop(context=None, is_running=0)
def get_context()
def is_running()
def quit()
def run()

Ancestry

+-- glib.MainLoop
-

Description

glib.MainLoop +glib.MainLoop

glib.MainLoop

glib.MainLoop — an object representing the main event loop of a PyGTK + application.

Synopsis

class glib.MainLoop:
+    glib.MainLoop(context=None, is_running=0)
def get_context()
def is_running()
def quit()
def run()

Ancestry

+-- glib.MainLoop
+

Description

glib.MainLoop represents a main event loop. A glib.MainLoop is created with the glib.MainLoop() constructor. After adding the initial event sources, the run() @@ -19,15 +19,15 @@ functions, e.g. the gtk.events_pending() functions.

Constructor

    glib.MainLoop(context=None, is_running=None)

context :

a glib.MainContext or None to use the default - context.

is_running :

if TRUE indicates that the + context.

is_running :

if True indicates that the loop is running. This is not very important since calling the run() - method will set this to TRUE + method will set this to True anyway.

Returns :

a new glib.MainLoop object.

Creates a new glib.MainLoop -object.

Methods

glib.MainLoop.get_context

    def get_context()

Returns :

the glib.MainContext +object.

Methods

glib.MainLoop.get_context

    def get_context()

Returns :

the glib.MainContext the mainloop is associated with

The get_context() method returns the glib.MainContext -that the mainloop was created with.

glib.MainLoop.is_running

    def is_running()

Returns :

TRUE if the mainloop is +that the mainloop was created with.

glib.MainLoop.is_running

    def is_running()

Returns :

True if the mainloop is currently being run.

The is_running() method checks to see if the mainloop is currently being run via the run() method.

glib.MainLoop.quit

    def quit()

The quit() method stops the mainloop diff --git a/docs/html/class-gobject.html b/docs/html/class-gobject.html index 4c1e07c..1a71df7 100644 --- a/docs/html/class-gobject.html +++ b/docs/html/class-gobject.html @@ -1,6 +1,6 @@ -gobject.GObject

gobject.GObject

gobject.GObject — the base class

Synopsis

class gobject.GObject:
-    def get_property(property_name)
def get_properties(first_property_name, ...)
def set_property(property_name, value)
def set_properties(property_name=value, ...)
def freeze_notify()
def notify(property_name)
def thaw_notify()
def get_data(key)
def set_data(key, data)
def connect(detailed_signal, handler)
def connect_after(detailed_signal, handler)
def connect_object(detailed_signal, handler)
def connect_object_after(detailed_signal, handler)
def disconnect(handler_id)
def handler_disconnect(handler_id)
def handler_is_connected(handler_id)
def handler_block(handler_id)
def handler_unblock(handler_id)
def handler_block_by_func(callable)
def handler_unblock_by_func(callable)
def emit(detailed_signal)
def stop_emission(detailed_signal)
def emit_stop_by_name(detailed_signal)
def chain()

Ancestry

+-- gobject.GObject
-

Attributes

"props"Read/Write +gobject.GObject

gobject.GObject

gobject.GObject — the base class

Synopsis

class gobject.GObject:
+    def get_property(property_name)
def get_properties(first_property_name, ...)
def set_property(property_name, value)
def set_properties(property_name=value, ...)
def freeze_notify()
def notify(property_name)
def thaw_notify()
def get_data(key)
def set_data(key, data)
def connect(detailed_signal, handler)
def connect_after(detailed_signal, handler)
def connect_object(detailed_signal, handler)
def connect_object_after(detailed_signal, handler)
def disconnect(handler_id)
def handler_disconnect(handler_id)
def handler_is_connected(handler_id)
def handler_block(handler_id)
def handler_unblock(handler_id)
def handler_block_by_func(callable)
def handler_unblock_by_func(callable)
def emit(detailed_signal)
def stop_emission(detailed_signal)
def emit_stop_by_name(detailed_signal)
def chain()

Ancestry

+-- gobject.GObject
+

Attributes

"props"Read/Write

This attribute gives full access to GObject properties as simple attributes. It can be used to iterate over all the object properties, and can be used both on class or instance objects.

@@ -17,12 +17,12 @@ button_label = button.get_property(label_pspec.name)
"__doc__"ReadThe documentation for the object type. Uses "__gdoc__" if no specific documentation set.
"__gdoc__"ReadThe generated documentation for the underlying GObject - type.
"__gtype__"ReadThe underlying GObject type.
"__grefcount__"ReadThe reference count for the underlying GObject.

gobject.GObject Signal Prototypes

"notify"

def callback(gobject, property_spec, user_param1, ...)

Description

The gobject.GObject + type.

"__gtype__"ReadThe underlying GObject type.
"__grefcount__"ReadThe reference count for the underlying GObject.

gobject.GObject Signal Prototypes

"notify"

def callback(gobject, property_spec, user_param1, ...)

Description

The gobject.GObject class is the base class providing the common attributes and methods for the PyGTK classes. The gobject.GObject class is not a user interface widget class.

The gobject.GObject class provides the signal management methods, the object property access - methods and the object data management methods.

Methods

gobject.GObject.get_property

    def get_property(property_name)

property_name :

a string containing the property name for the + methods and the object data management methods.

Methods

gobject.GObject.get_property

    def get_property(property_name)

property_name :

a string containing the property name for the GObject

Returns :

a Python object containing the value of the property

The get_property() method returns the value of the property specified by property_name or @@ -130,9 +130,9 @@ list of signal handlers for the object.

handler_disconnect() method removes the signal handler with the specified handler_id from the list of signal handlers for the object.

gobject.GObject.handler_is_connected

    def handler_is_connected(handler_id)

handler_id :

an integer handler -identifier

Returns :

TRUE if the signal handler +identifier

Returns :

True if the signal handler is connected to the object.

The handler_is_connected() method -returns TRUE if the signal handler with the specified +returns True if the signal handler with the specified handler_id is connected to the object.

gobject.GObject.handler_block

    def handler_block(handler_id)

handler_id :

an integer handler identifier

The handler_block() method blocks the signal handler with the specified handler_id from @@ -161,7 +161,7 @@ still to be run will not be invoked.

emit_stop_by_name() method stops the current emission of the signal specified by detailed_signal. Any signal handlers in the list -still to be run will not be invoked.

gobject.GObject.chain

    def chain(...)

... :

additional parameters

Returns :

a Python object

The chain() method does something.

Signals

The GObject "notify" Signal

    def callback(gobject, property_spec, user_param1, ...)

gobject :

the gobject that received the +still to be run will not be invoked.

gobject.GObject.chain

    def chain(...)

... :

additional parameters

Returns :

a Python object

The chain() method does something.

Signals

The GObject "notify" Signal

    def callback(gobject, property_spec, user_param1, ...)

gobject :

the gobject that received the signal

property_spec :

the gobject.GParamSpec of the property that was changed

user_param1 :

the first user parameter (if any) specified with the connect() diff --git a/docs/html/class-gobjectgboxed.html b/docs/html/class-gobjectgboxed.html index ead5e11..30b7dc5 100644 --- a/docs/html/class-gobjectgboxed.html +++ b/docs/html/class-gobjectgboxed.html @@ -1,9 +1,9 @@ -gobject.GBoxed

gobject.GBoxed

gobject.GBoxed — an object containing an opaque chunk of data

Synopsis

class gobject.GBoxed:
-    def copy()

Ancestry

+-- gobject.GBoxed
-

Description

gobject.GBoxed +gobject.GBoxed

gobject.GBoxed

gobject.GBoxed — an object containing an opaque chunk of data

Synopsis

class gobject.GBoxed:
+    def copy()

Ancestry

+-- gobject.GBoxed
+

Description

gobject.GBoxed is an abstract base class that encapsulates an opaque chunk of data to provide an object-oriented interface and a type that is registered with the GLIB type system. A boxed type is registered with functions that provide for the copying and freeing of the underlying data -structure - this allows PyGTK to encapsulate these as Python objects.

Methods

gobject.GBoxed.copy

    def copy()

Returns :

a copy of the gobject.GBoxed +structure - this allows PyGTK to encapsulate these as Python objects.

Methods

gobject.GBoxed.copy

    def copy()

Returns :

a copy of the gobject.GBoxed object

The copy() method makes and returns a copy of the boxed object.

diff --git a/docs/html/class-gobjectginterface.html b/docs/html/class-gobjectginterface.html index b15ef7e..5156c43 100644 --- a/docs/html/class-gobjectginterface.html +++ b/docs/html/class-gobjectginterface.html @@ -1,4 +1,4 @@ -gobject.GInterface

gobject.GInterface

gobject.GInterface — an object representing a GInterface

Synopsis

class gobject.GInterface:
-

Ancestry

+-- gobject.GInterface
-

Description

gobject.GInterface +gobject.GInterface

gobject.GInterface

gobject.GInterface — an object representing a GInterface

Synopsis

class gobject.GInterface:
+

Ancestry

+-- gobject.GInterface
+

Description

gobject.GInterface is an abstract base class that encapsulates a GInterface.

diff --git a/docs/html/class-gobjectgpointer.html b/docs/html/class-gobjectgpointer.html index 4b86cd9..258a160 100644 --- a/docs/html/class-gobjectgpointer.html +++ b/docs/html/class-gobjectgpointer.html @@ -1,7 +1,7 @@ -gobject.GPointer

gobject.GPointer

gobject.GPointer — an object containing a completely opaque chunk of - data

Synopsis

class gobject.GPointer:
-

Ancestry

+-- gobject.GPointer
-

Description

gobject.GPointer +gobject.GPointer

gobject.GPointer

gobject.GPointer — an object containing a completely opaque chunk of + data

Synopsis

class gobject.GPointer:
+

Ancestry

+-- gobject.GPointer
+

Description

gobject.GPointer is an abstract base class that encapsulates an opaque chunk of data and registers it with the GLIB type system. A pointer type has no methods and generic ways of copying and freeing the data. It diff --git a/docs/html/gio-class-reference.html b/docs/html/gio-class-reference.html index a7a8bb8..9b0f9b6 100644 --- a/docs/html/gio-class-reference.html +++ b/docs/html/gio-class-reference.html @@ -1 +1 @@ -PyGio Class Reference

PyGio Class Reference

Table of Contents

gio.AppInfo — Information about an installed application and methods to launch it (with file arguments).
gio.AppLaunchContext — Application launch context.
gio.AsyncResult — Asynchronous Function Results.
gio.BufferedInputStream — Buffered Input Stream
gio.BufferedOutputStream — Buffered Output Stream
gio.Cancellable — Thread-safe Operation Cancellation Stack.
gio.DataInputStream — Data Input Stream
gio.DataOutputStream — Data Output Stream
gio.Drive — Virtual File System drive management.
gio.Emblem — An object for emblems.
gio.EmblemedIcon — Icon with emblems.
gio.File — File and Directory Handling.
gio.FileAttributeInfo — Information about a specific attribute.
gio.FileEnumerator — Enumerated Files Routines.
gio.FileIcon — Icons pointing to an image file.
gio.FileInfo — File Information and Attributes
gio.FileInputStream — Base class for implementing streaming input
gio.FileMonitor — File Monitor
gio.FileOutputStream — Base class for implementing streaming input
gio.FilterInputStream — Filter Input Stream
gio.FilterOutputStream — Filter Output Stream
gio.Icon — Interface for icons.
gio.InputStream — Base class for implementing streaming input
gio.LoadableIcon — Interface for icons.
gio.MemoryInputStream — Base class for implementing streaming input
gio.MemoryOutputStream — Streaming output operations on memory chunks
gio.Mount — Mount management
gio.MountOperation — Authentication methods for mountable locations.
gio.OutputStream — Base class for implementing streaming input
gio.Seekable — Stream seeking interface.
gio.SimpleAsyncResult — Simple asynchronous results implementation.
gio.ThemedIcon — Icon theming support.
gio.Volume — Volume management.
gio.VolumeMonitor — Volume Monitor.
gio Functions
gio Constants — the built-in constants of the gio module
+PyGio Class Reference

PyGio Class Reference

Table of Contents

gio.AppInfo — Information about an installed application and methods to launch it (with file arguments).
gio.AppLaunchContext — Application launch context.
gio.AsyncResult — Asynchronous Function Results.
gio.BufferedInputStream — Buffered Input Stream
gio.BufferedOutputStream — Buffered Output Stream
gio.Cancellable — Thread-safe Operation Cancellation Stack.
gio.DataInputStream — Data Input Stream
gio.DataOutputStream — Data Output Stream
gio.Drive — Virtual File System drive management.
gio.Emblem — An object for emblems.
gio.EmblemedIcon — Icon with emblems.
gio.File — File and Directory Handling.
gio.FileAttributeInfo — Information about a specific attribute.
gio.FileEnumerator — Enumerated Files Routines.
gio.FileIcon — Icons pointing to an image file.
gio.FileInfo — File Information and Attributes
gio.FileInputStream — Base class for implementing streaming input
gio.FileMonitor — File Monitor
gio.FileOutputStream — Base class for implementing streaming input
gio.FilterInputStream — Filter Input Stream
gio.FilterOutputStream — Filter Output Stream
gio.Icon — Interface for icons.
gio.InputStream — Base class for implementing streaming input
gio.LoadableIcon — Interface for icons.
gio.MemoryInputStream — Base class for implementing streaming input
gio.MemoryOutputStream — Streaming output operations on memory chunks
gio.Mount — Mount management
gio.MountOperation — Authentication methods for mountable locations.
gio.OutputStream — Base class for implementing streaming input
gio.Seekable — Stream seeking interface.
gio.SimpleAsyncResult — Simple asynchronous results implementation.
gio.ThemedIcon — Icon theming support.
gio.Volume — Volume management.
gio.VolumeMonitor — Volume Monitor.
gio Functions
gio Constants — the built-in constants of the gio module
diff --git a/docs/html/gio-constants.html b/docs/html/gio-constants.html index b1c8bb2..074b1d4 100644 --- a/docs/html/gio-constants.html +++ b/docs/html/gio-constants.html @@ -1,4 +1,4 @@ -gio Constants

gio Constants

gio Constants — the built-in constants of the gio module

Synopsis

+gio Constants

gio Constants

gio Constants — the built-in constants of the gio module

Synopsis

 Gio AppInfo Create Flags Constants
 Gio Ask Password Flags Constants
 Gio Data Stream Byte Order Constants
diff --git a/docs/html/gio-functions.html b/docs/html/gio-functions.html
index 80287e6..77a4ff7 100644
--- a/docs/html/gio-functions.html
+++ b/docs/html/gio-functions.html
@@ -1,7 +1,7 @@
-gio Functions

gio Functions

gio Functions

Description

+gio Functions

gio Functions

gio Functions

Description

These functions are part of the PyGObject gio module but are not directly associated with a specific class -

Functions

gio.content_type_can_be_executable

    def content_type_can_be_executable(type)

type :

a content type string. +

Functions

gio.content_type_can_be_executable

    def content_type_can_be_executable(type)

type :

a content type string.

Returns :

True if the file type corresponds to a type that can be executable, False otherwise.

diff --git a/docs/html/giounix-class-reference.html b/docs/html/giounix-class-reference.html index 9a1b532..e91aa73 100644 --- a/docs/html/giounix-class-reference.html +++ b/docs/html/giounix-class-reference.html @@ -1 +1 @@ -PyGio Unix Class Reference

PyGio Unix Class Reference

Table of Contents

gio.unix.InputStream — Streaming input operations for UNIX file descriptors.
gio.unix.OutputStream — Streaming output operations for UNIX file descriptors.
+PyGio Unix Class Reference

PyGio Unix Class Reference

Table of Contents

gio.unix.InputStream — Streaming input operations for UNIX file descriptors.
gio.unix.OutputStream — Streaming output operations for UNIX file descriptors.
diff --git a/docs/html/glib-class-reference.html b/docs/html/glib-class-reference.html index 13ca630..fa78a88 100644 --- a/docs/html/glib-class-reference.html +++ b/docs/html/glib-class-reference.html @@ -1,3 +1,3 @@ -PyGlibClass Reference

PyGlibClass Reference

Table of Contents

glib.MainContext — an object representing a set of event sources to be handled +PyGlibClass Reference

PyGlibClass Reference

Table of Contents

glib.MainContext — an object representing a set of event sources to be handled in a glib.MainLoop.
glib.MainLoop — an object representing the main event loop of a PyGTK application.
glib Functions — miscellaneous functions
glib Constants — the built-in constants of the glib module
diff --git a/docs/html/glib-constants.html b/docs/html/glib-constants.html index fd86c99..4e56956 100644 --- a/docs/html/glib-constants.html +++ b/docs/html/glib-constants.html @@ -1,4 +1,4 @@ -glib Constants

glib Constants

glib Constants — the built-in constants of the glib module

Synopsis

+glib Constants

glib Constants

glib Constants — the built-in constants of the glib module

Synopsis

 Glib IO Condition Constants
 Glib Priority Constants
 Glib Spawn Flag Constants
diff --git a/docs/html/glib-functions.html b/docs/html/glib-functions.html
index b1f8138..ffb796f 100644
--- a/docs/html/glib-functions.html
+++ b/docs/html/glib-functions.html
@@ -1,6 +1,6 @@
-glib Functions

glib Functions

glib Functions — miscellaneous functions

Synopsis

-    def glib.idle_add(callback, ...)
def glib.timeout_add(interval, callback, ...)
def glib.timeout_add_seconds(interval, callback, ...)
def glib.io_add_watch(fd, condition, callback, ...)
def glib.source_remove(tag)
def glib.main_context_default()
def glib.markup_escape_text(text)
def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)
def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)
def glib.get_current_time()
def glib.get_user_cache_dir()
def glib.get_user_config_dir()
def glib.get_user_data_dir()
def glib.get_user_special_dir(directory)
def glib.main_depth()
def glib.threads_init()
def glib.filename_display_name(filename)
def glib.filename_display_basename(filename)
def glib.filename_from_utf8(utf8string)

Description

These functions are part of the PyGObject glib -module but are not directly associated with a specific class.

Functions

glib.idle_add

    def glib.idle_add(callback, ...)

callback :

a function to call when +glib Functions

glib Functions

glib Functions — miscellaneous functions

Synopsis

+    def glib.idle_add(callback, ...)
def glib.timeout_add(interval, callback, ...)
def glib.timeout_add_seconds(interval, callback, ...)
def glib.io_add_watch(fd, condition, callback, ...)
def glib.source_remove(tag)
def glib.main_context_default()
def glib.markup_escape_text(text)
def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)
def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)
def glib.get_current_time()
def glib.get_user_cache_dir()
def glib.get_user_config_dir()
def glib.get_user_data_dir()
def glib.get_user_special_dir(directory)
def glib.main_depth()
def glib.threads_init()
def glib.filename_display_name(filename)
def glib.filename_display_basename(filename)
def glib.filename_from_utf8(utf8string)

Description

These functions are part of the PyGObject glib +module but are not directly associated with a specific class.

Functions

glib.idle_add

    def glib.idle_add(callback, ...)

callback :

a function to call when PyGTK is idle

... :

optionals arguments to be passed to callback

Returns :

an integer ID

The glib.idle_add() function adds a function (specified by callback) to be called @@ -10,7 +10,7 @@ loop. The function is given the default idle priority, pass to callback can be specified after callback. The idle priority can be specified as a keyword-value pair with the keyword "priority". If -callback returns FALSE it is +callback returns False it is automatically removed from the list of event sources and will not be called again.

glib.timeout_add

    def glib.timeout_add(interval, callback, ...)

interval :

the time between calls to the function, in milliseconds

callback :

the function to call

... :

zero or more arguments that will be passed to @@ -22,7 +22,7 @@ default priority, glib.PRIORITY_DEFAULT. Additional arguments to pass to callback can be specified after callback. The idle priority may be specified as a keyword-value pair with the keyword "priority".

The function is called repeatedly until it returns -FALSE, at which point the timeout is automatically +False, at which point the timeout is automatically destroyed and the function will not be called again. The first call to the function will be at the end of the first interval. Note that timeout functions may be delayed, due to the processing of other event sources. Thus @@ -67,10 +67,10 @@ signature of the callback function is:

 cb_condition is the condition that triggered the
 signal; and, ... are the zero or more arguments that
 were passed to the glib.io_add_watch()
-function.

If the callback function returns FALSE it +function.

If the callback function returns False it will be automatically removed from the list of event sources and will not be -called again. If it returns TRUE it will be called again -when the condition is matched.

glib.source_remove

    def glib.source_remove(tag)

tag :

an integer ID

Returns :

TRUE if the event source was +called again. If it returns True it will be called again +when the condition is matched.

glib.source_remove

    def glib.source_remove(tag)

tag :

an integer ID

Returns :

True if the event source was removed

The glib.source_remove() function removes the event source specified by tag (as returned by the glib.idle_add(), glib.timeout_add() @@ -102,9 +102,9 @@ of the child process

working_directory :

the child's current working directory, or None to inherit parent's

flags :

flags from the Glib Spawn Flag Constants.

child_setup :

a function to run in the child just before calling exec()

user_data :

the user data for the -child_setup function

standard_input :

if TRUE return the file -descriptor for the child's stdin

standard_output :

if TRUE return the file -descriptor for the child's stdout

standard_error :

if TRUE return the file +child_setup function

standard_input :

if True return the file +descriptor for the child's stdin

standard_output :

if True return the file +descriptor for the child's stdout

standard_error :

if True return the file descriptor for the child's stderr

Returns :

a 4-tuple containing the child's process id and the stdin, stdout and stderr file descriptor integers.

Note

This function is available in PyGTK 2.6 and above.

The glib.spawn_async() function executes a child program asynchronously (your program will not block waiting for the @@ -121,7 +121,7 @@ and stderr. The stdin, stdout and stderr file descriptors are returned only ofthe corresponding standard_input, standard_output or standard_error params are -TRUE.

On Windows, the low-level child process creation API +True.

On Windows, the low-level child process creation API (CreateProcess()) doesn't use argument vectors, but a command line. The C runtime library's spawn*() family of functions (which glib.spawn_async() diff --git a/docs/html/gobject-class-reference.html b/docs/html/gobject-class-reference.html index bbf2133..80d2cce 100644 --- a/docs/html/gobject-class-reference.html +++ b/docs/html/gobject-class-reference.html @@ -1,2 +1,2 @@ -PyGObject Class Reference

PyGObject Class Reference

Table of Contents

gobject.GObject — the base class
gobject.GBoxed — an object containing an opaque chunk of data
gobject.GPointer — an object containing a completely opaque chunk of +PyGObject Class Reference

PyGObject Class Reference

Table of Contents

gobject.GObject — the base class
gobject.GBoxed — an object containing an opaque chunk of data
gobject.GPointer — an object containing a completely opaque chunk of data
gobject.GInterface — an object representing a GInterface
gobject Functions — miscellaneous functions
gobject Constants — the built-in constants of the gobject module
diff --git a/docs/html/gobject-constants.html b/docs/html/gobject-constants.html index 969e25f..6ff3ee5 100644 --- a/docs/html/gobject-constants.html +++ b/docs/html/gobject-constants.html @@ -1,4 +1,4 @@ -gobject Constants

gobject Constants

gobject Constants — the built-in constants of the gobject module

Synopsis

+gobject Constants

gobject Constants

gobject Constants — the built-in constants of the gobject module

Synopsis

 GObject Param Flag Constants
 GObject Signal Flag Constants
 GObject Built-in Type Constants
diff --git a/docs/html/gobject-functions.html b/docs/html/gobject-functions.html
index 1f76f55..3853a06 100644
--- a/docs/html/gobject-functions.html
+++ b/docs/html/gobject-functions.html
@@ -1,12 +1,12 @@
-gobject Functions

gobject Functions

gobject Functions — miscellaneous functions

Synopsis

+gobject Functions

gobject Functions

gobject Functions — miscellaneous functions

Synopsis

     def gobject.type_name(type)
def gobject.type_from_name(type_name)
def gobject.type_parent(type)
def gobject.type_is_a(type, parent_type)
def gobject.type_children(type)
def gobject.type_interfaces(type)
def gobject.type_register(class)
def gobject.signal_new(signal_name, type, flags, return_type, param_types)
def gobject.signal_list_names(type)
def gobject.signal_list_ids(type)
def gobject.signal_lookup(name, type)
def gobject.signal_name(signal_id)
def gobject.signal_query(name, type)
def gobject.signal_query(signal_id)
def gobject.list_properties(type)
def gobject.new(type, ...)
def gobject.signal_accumulator_true_handled()
def gobject.add_emission_hook(type, name, callback, ...)
def gobject.remove_emission_hook(type, name, hook_id)
def gobject._install_metaclass(metaclass) -

Description

These functions are part of the PyGTK gobject +

Description

These functions are part of the PyGTK gobject module but are not directly associated with a specific class.

Note

Many functions that previously were in this namespace got moved to glib namespace instead. They are still available in gobject for backward compatibility, but not documented here. If you miss documentation for some function, be sure to check glib first. -

Functions

gobject.type_name

    def gobject.type_name(type)

type :

a GObject type, type ID or +

Functions

gobject.type_name

    def gobject.type_name(type)

type :

a GObject type, type ID or instance

Returns :

The gobject.type_name() function returns the unique name that is assigned to the specified type. type can be a GObject @@ -24,12 +24,12 @@ the direct parent type ID of the specified typetype has no parent, i.e. is a fundamental type, the RuntimeError exception is raised.

gobject.type_is_a

    def gobject.type_is_a(type, parent_type)

type :

a GObject type, type ID or instance

parent_type :

a GObject type, type ID or -instance

Returns :

TRUE if +instance

Returns :

True if parent_type is an ancestor of type

The gobject.type_is_a() function returns -TRUE if the specified type is a +True if the specified type is a descendant of the type specified by parent_type. This -function also returns TRUE if +function also returns True if parent_type is an interface and type conforms to it.

gobject.type_children

    def gobject.type_children(type)

type :

a GObject type, type ID or instance

Returns :

a list of the child types of diff --git a/docs/html/index.html b/docs/html/index.html index fe8c44c..f5b135d 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -1,4 +1,4 @@ -PyGObject Reference Manual

PyGObject Reference Manual

for PyGObject version 2.21.2

2010-06-10 +PyGObject Reference Manual

PyGObject Reference Manual

for PyGObject version 2.28.6

2011-06-13

Abstract

This reference describes the classes of the python gobject module.


Table of Contents

Introduction
Reference Page Format
PyGlibClass Reference
glib.MainContext — an object representing a set of event sources to be handled in a glib.MainLoop.
glib.MainLoop — an object representing the main event loop of a PyGTK diff --git a/docs/html/pygobject-introduction.html b/docs/html/pygobject-introduction.html index 0f15d2f..bdb81c0 100644 --- a/docs/html/pygobject-introduction.html +++ b/docs/html/pygobject-introduction.html @@ -1,4 +1,4 @@ -Introduction

Introduction

Table of Contents

Reference Page Format

This document describes many of the PyGObject +Introduction

Introduction

Table of Contents

Reference Page Format

This document describes many of the PyGObject version 2.12 classes and their methods and associated functions. Deprecated classes, functions and methods have been specifically left out of this reference though classes that have become diff --git a/docs/reference/pygio-mount.xml b/docs/reference/pygio-mount.xml index aa635d4..f01b155 100644 --- a/docs/reference/pygio-mount.xml +++ b/docs/reference/pygio-mount.xml @@ -536,11 +536,12 @@ - + + The guess_content_type_finish() method finishes guessing content types of mount. If any errors occured during the operation, error will be set to - contain the errors and FALSE will be returned. In particular, you may get an + contain the errors and False will be returned. In particular, you may get an gio.ERROR_NOT_SUPPORTED if the mount does not support content guessing. diff --git a/docs/reference/pyglib-functions.xml b/docs/reference/pyglib-functions.xml index 358fa83..3e11251 100644 --- a/docs/reference/pyglib-functions.xml +++ b/docs/reference/pyglib-functions.xml @@ -148,7 +148,7 @@ loop. The function is given the default idle priority, pass to callback can be specified after callback. The idle priority can be specified as a keyword-value pair with the keyword "priority". If -callback returns FALSE it is +callback returns False it is automatically removed from the list of event sources and will not be called again. @@ -194,7 +194,7 @@ arguments to pass to callback can be specified after keyword-value pair with the keyword "priority". The function is called repeatedly until it returns -FALSE, at which point the timeout is automatically +False, at which point the timeout is automatically destroyed and the function will not be called again. The first call to the function will be at the end of the first interval. Note that timeout functions may be delayed, due to the processing of other event sources. Thus @@ -355,9 +355,9 @@ signal; and, ... are the zero or more arguments that were passed to the glib.io_add_watch() function. - If the callback function returns FALSE it + If the callback function returns False it will be automatically removed from the list of event sources and will not be -called again. If it returns TRUE it will be called again +called again. If it returns True it will be called again when the condition is matched. @@ -376,7 +376,7 @@ when the condition is matched. Returns : - TRUE if the event source was + True if the event source was removed @@ -553,17 +553,17 @@ calling exec() standard_input : - if TRUE return the file + if True return the file descriptor for the child's stdin standard_output : - if TRUE return the file + if True return the file descriptor for the child's stdout standard_error : - if TRUE return the file + if True return the file descriptor for the child's stderr @@ -591,7 +591,7 @@ and stderr. The stdin, stdout and stderr file descriptors are returned only ofthe corresponding standard_input, standard_output or standard_error params are -TRUE. +True. On Windows, the low-level child process creation API (CreateProcess()) doesn't use argument vectors, but a diff --git a/docs/reference/pyglib-maincontext.xml b/docs/reference/pyglib-maincontext.xml index ccb91bb..ee1e985 100644 --- a/docs/reference/pyglib-maincontext.xml +++ b/docs/reference/pyglib-maincontext.xml @@ -91,12 +91,12 @@ object. may_block : - if TRUE the call may block + if True the call may block waiting for an event. Returns : - TRUE if events were + True if events were dispatched. @@ -111,7 +111,7 @@ to be processed; then if no events sources are ready and -may_block is TRUE, waiting for a +may_block is True, waiting for a source to become ready; @@ -121,8 +121,8 @@ sources that are ready Note that even when may_block is -TRUE, it is still possible for -iteration() to return FALSE, +True, it is still possible for +iteration() to return False, since the the wait may be interrupted for other reasons than an event source becoming ready. @@ -137,7 +137,7 @@ becoming ready. Returns : - TRUE if events are + True if events are pending. diff --git a/docs/reference/pyglib-mainloop.xml b/docs/reference/pyglib-mainloop.xml index bd12fca..913e743 100644 --- a/docs/reference/pyglib-mainloop.xml +++ b/docs/reference/pyglib-mainloop.xml @@ -101,10 +101,10 @@ functions. is_running : - if TRUE indicates that the + if True indicates that the loop is running. This is not very important since calling the run() - method will set this to TRUE + method will set this to True anyway. @@ -155,7 +155,7 @@ that the mainloop was created with. Returns : - TRUE if the mainloop is + True if the mainloop is currently being run. diff --git a/docs/reference/pygobject-functions.xml b/docs/reference/pygobject-functions.xml index 7ca3918..1f50fbe 100644 --- a/docs/reference/pygobject-functions.xml +++ b/docs/reference/pygobject-functions.xml @@ -233,16 +233,16 @@ instance Returns : - TRUE if + True if parent_type is an ancestor of type The gobject.type_is_a() function returns -TRUE if the specified type is a +True if the specified type is a descendant of the type specified by parent_type. This -function also returns TRUE if +function also returns True if parent_type is an interface and type conforms to it. diff --git a/docs/reference/pygobject.xml b/docs/reference/pygobject.xml index ac41e47..42cd37b 100644 --- a/docs/reference/pygobject.xml +++ b/docs/reference/pygobject.xml @@ -760,13 +760,13 @@ identifier Returns : - TRUE if the signal handler + True if the signal handler is connected to the object. The handler_is_connected() method -returns TRUE if the signal handler with the specified +returns True if the signal handler with the specified handler_id is connected to the object. diff --git a/dsextras.py b/dsextras.py index 10973e2..b2c9e90 100644 --- a/dsextras.py +++ b/dsextras.py @@ -1,69 +1,96 @@ +# -*- coding: utf-8 -*- # -# dsextras.py - Extra classes and utilities for distutils, adding -# pkg-config support +# dsextras.py - Extra classes and utilities for distutils, +# adding pkg-config support +import os +import sys +import fnmatch +import re +import string + +from distutils import dep_util from distutils.command.build_ext import build_ext from distutils.command.install_lib import install_lib from distutils.command.install_data import install_data from distutils.extension import Extension -import distutils.dep_util -import fnmatch -import os -import re -import string -import sys +from distutils.spawn import find_executable + +try: + import codegen.createdefs + from codegen.override import Overrides + from codegen.defsparser import DefsParser + from codegen.codegen import register_types, SourceWriter, FileOutput +except ImportError: + template_classes_enabled = False +else: + template_classes_enabled = True + GLOBAL_INC = [] GLOBAL_MACROS = [] +codegen_error_message=''' +*************************************************************************** +Codegen could not be found on your system and is required by the +dsextras.Template and dsextras.TemplateExtension classes. +*************************************************************************** +''' + + def get_m4_define(varname): - """Return the value of a m4_define variable as set in configure.in.""" - pattern = re.compile("m4_define\(" + varname + "\,\s*(.+)\)") + '''Return the value of a m4_define variable as set in configure.in.''' + pattern = re.compile('m4_define\(' + varname + '\,\s*(.+)\)') + if os.path.exists('configure.ac'): fname = 'configure.ac' elif os.path.exists('configure.in'): fname = 'configure.in' else: - raise SystemExit('could not find configure file') + raise SystemExit('ERROR: Could not find configure file') for line in open(fname).readlines(): match_obj = pattern.match(line) + if match_obj: return match_obj.group(1) return None def getoutput(cmd): - """Return output (stdout or stderr) of executing cmd in a shell.""" + '''Return output (stdout or stderr) of executing cmd in a shell.''' return getstatusoutput(cmd)[1] def getstatusoutput(cmd): - """Return (status, output) of executing cmd in a shell.""" + '''Return (status, output) of executing cmd in a shell.''' if sys.platform == 'win32': pipe = os.popen(cmd, 'r') text = pipe.read() sts = pipe.close() or 0 - if text[-1:] == '\n': + + while text[-1:] in ['\n', '\r']: text = text[:-1] + return sts, text else: from commands import getstatusoutput return getstatusoutput(cmd) +def have_gcc(): + '''Checks for the existence of gcc''' + if find_executable('gcc'): + return True + def have_pkgconfig(): - """Checks for the existence of pkg-config""" - if (sys.platform == 'win32' and - os.system('pkg-config --version > NUL') == 0): - return 1 - else: - if getstatusoutput('pkg-config')[0] == 256: - return 1 + '''Checks for the existence of pkg-config''' + if find_executable('pkg-config'): + return True def list_files(dir): - """List all files in a dir, with filename match support: + '''List all files in a dir, with filename match support: for example: glade/*.glade will return all files in the glade directory - that matches *.glade. It also looks up the full path""" + that matches *.glade. It also looks up the full path''' if dir.find(os.sep) != -1: parts = dir.split(os.sep) dir = string.join(parts[:-1], os.sep) @@ -74,61 +101,82 @@ def list_files(dir): dir = os.path.abspath(dir) retval = [] + for file in os.listdir(dir): if fnmatch.fnmatch(file, pattern): retval.append(os.path.join(dir, file)) + return retval def pkgc_version_check(name, req_version): - """Check the existence and version number of a package: - returns 0 if not installed or too old, 1 otherwise.""" + '''Check the existence and version number of a package: + returns False if not installed or too old, True otherwise.''' is_installed = not os.system('pkg-config --exists %s' % name) + if not is_installed: - return 0 + return False - orig_version = getoutput('pkg-config --modversion %s' % name) + orig_version = pkgc_get_version(name) version = map(int, orig_version.split('.')) pkc_version = map(int, req_version.split('.')) if version >= pkc_version: - return 1 - - return 0 + return True + + return False + +def pkgc_get_version(name): + '''return the version as return by pkg-config --modversion''' + return getoutput('pkg-config --modversion %s' % name) def pkgc_get_libraries(name): - """returns a list of libraries as returned by pkg-config --libs-only-l""" + '''returns a list of libraries as returned by pkg-config --libs-only-l''' output = getoutput('pkg-config --libs-only-l %s' % name) return output.replace('-l', '').split() def pkgc_get_library_dirs(name): - """returns a list of library dirs as returned by pkg-config --libs-only-L""" + '''returns a list of library dirs as returned by pkg-config --libs-only-L''' output = getoutput('pkg-config --libs-only-L %s' % name) return output.replace('-L', '').split() def pkgc_get_include_dirs(name): - """returns a list of include dirs as returned by pkg-config --cflags-only-I""" + '''returns a list of include dirs as returned by pkg-config --cflags-only-I''' output = getoutput('pkg-config --cflags-only-I %s' % name) return output.replace('-I', '').split() +def pkgc_get_defs_dir(name): + '''returns the defs dir as returned by pkg-config --variable=defsdir''' + output = getoutput('pkg-config --variable=defsdir %s' % name) + return output + + class BuildExt(build_ext): def init_extra_compile_args(self): self.extra_compile_args = [] - if sys.platform == 'win32' and \ - self.compiler.compiler_type == 'mingw32': + + if sys.platform == 'win32' and self.compiler.compiler_type == 'mingw32': + if not have_gcc(): + raise SystemExit('ERROR: Could not find gcc.') + # MSVC compatible struct packing is required. # Note gcc2 uses -fnative-struct while gcc3 - # uses -mms-bitfields. Based on the version - # the proper flag is used below. - msnative_struct = { '2' : '-fnative-struct', - '3' : '-mms-bitfields' } + # and gcc4 use -mms-bitfields. Based on the + # version the proper flag is used below. + msnative_struct = {'2': '-fnative-struct', + '3': '-mms-bitfields', + '4': '-mms-bitfields'} gcc_version = getoutput('gcc -dumpversion') - print 'using MinGW GCC version %s with %s option' % \ - (gcc_version, msnative_struct[gcc_version[0]]) + + print ('using MinGW GCC version %s with %s option' % \ + (gcc_version, msnative_struct[gcc_version[0]])) + self.extra_compile_args.append(msnative_struct[gcc_version[0]]) def modify_compiler(self): - if sys.platform == 'win32' and \ - self.compiler.compiler_type == 'mingw32': + if sys.platform == 'win32' and self.compiler.compiler_type == 'mingw32': + if not have_gcc(): + raise SystemExit('ERROR: Could not find gcc.') + # Remove '-static' linker option to prevent MinGW ld # from trying to link with MSVC import libraries. if self.compiler.linker_so.count('-static'): @@ -145,23 +193,27 @@ class BuildExt(build_ext): def build_extension(self, ext): # Add self.extra_compile_args to ext.extra_compile_args ext.extra_compile_args += self.extra_compile_args + # Generate eventual templates before building if hasattr(ext, 'generate'): ext.generate() + # Filter out 'c' and 'm' libs when compilic w/ msvc if sys.platform == 'win32' and self.compiler.compiler_type == 'msvc': save_libs = ext.libraries - ext.libraries = [lib for lib in ext.libraries + ext.libraries = [lib for lib in ext.libraries if lib not in ['c', 'm']] else: save_libs = ext.libraries + # Invoke base build_extension() build_ext.build_extension(self, ext) - if save_libs != None and save_libs != ext.libraries: + + if save_libs is not None and save_libs != ext.libraries: ext.libraries = save_libs -class InstallLib(install_lib): +class InstallLib(install_lib): local_outputs = [] local_inputs = [] @@ -174,17 +226,17 @@ class InstallLib(install_lib): def get_inputs(self): return install_lib.get_inputs(self) + self.local_inputs -class InstallData(install_data): +class InstallData(install_data): local_outputs = [] local_inputs = [] template_options = {} def prepare(self): - if os.name == "nt": + if os.name == 'nt': self.prefix = os.sep.join(self.install_dir.split(os.sep)[:-3]) else: - # default: os.name == "posix" + # default: os.name == 'posix' self.prefix = os.sep.join(self.install_dir.split(os.sep)[:-4]) self.exec_prefix = '${prefix}/bin' @@ -209,16 +261,17 @@ class InstallData(install_data): self.template_options['@%s@' % name] = value def install_template(self, filename, install_dir): - """Install template filename into target directory install_dir.""" + '''Install template filename into target directory install_dir.''' output_file = os.path.split(filename)[-1][:-3] template = open(filename).read() + for key, value in self.template_options.items(): template = template.replace(key, value) output = os.path.join(install_dir, output_file) self.mkpath(install_dir) - open(output, 'w').write(template) + open(output, 'wb').write(template) self.local_inputs.append(filename) self.local_outputs.append(output) return output @@ -229,31 +282,40 @@ class InstallData(install_data): def get_inputs(self): return install_data.get_inputs(self) + self.local_inputs + class PkgConfigExtension(Extension): # Name of pygobject package extension depends on, can be None pygobject_pkc = 'pygobject-2.0' can_build_ok = None + def __init__(self, **kwargs): name = kwargs['pkc_name'] + if 'include_dirs' in kwargs: kwargs['include_dirs'] += self.get_include_dirs(name) + GLOBAL_INC else: kwargs['include_dirs'] = self.get_include_dirs(name) + GLOBAL_INC + kwargs['define_macros'] = GLOBAL_MACROS + if 'libraries' in kwargs: kwargs['libraries'] += self.get_libraries(name) else: kwargs['libraries'] = self.get_libraries(name) + if 'library_dirs' in kwargs: kwargs['library_dirs'] += self.get_library_dirs(name) else: kwargs['library_dirs'] = self.get_library_dirs(name) + if 'pygobject_pkc' in kwargs: self.pygobject_pkc = kwargs.pop('pygobject_pkc') + if self.pygobject_pkc: kwargs['include_dirs'] += self.get_include_dirs(self.pygobject_pkc) kwargs['libraries'] += self.get_libraries(self.pygobject_pkc) kwargs['library_dirs'] += self.get_library_dirs(self.pygobject_pkc) + self.name = kwargs['name'] self.pkc_name = kwargs['pkc_name'] self.pkc_version = kwargs['pkc_version'] @@ -263,33 +325,39 @@ class PkgConfigExtension(Extension): def get_include_dirs(self, names): if type(names) != tuple: names = (names,) + retval = [] + for name in names: - output = getoutput('pkg-config --cflags-only-I %s' % name) - retval.extend(output.replace('-I', '').split()) + retval.extend(pkgc_get_include_dirs(name)) + return retval def get_libraries(self, names): if type(names) != tuple: names = (names,) + retval = [] + for name in names: - output = getoutput('pkg-config --libs-only-l %s' % name) - retval.extend(output.replace('-l', '').split()) + retval.extend(pkgc_get_libraries(name)) + return retval def get_library_dirs(self, names): if type(names) != tuple: names = (names,) + retval = [] + for name in names: - output = getoutput('pkg-config --libs-only-L %s' % name) - retval.extend(output.replace('-L', '').split()) + retval.extend(pkgc_get_library_dirs(name)) + return retval def can_build(self): - """If the pkg-config version found is good enough""" - if self.can_build_ok != None: + '''If the pkg-config version found is good enough''' + if self.can_build_ok is not None: return self.can_build_ok if type(self.pkc_name) != tuple: @@ -299,63 +367,42 @@ class PkgConfigExtension(Extension): for package, version in reqs: retval = os.system('pkg-config --exists %s' % package) + if retval: - print ("* %s.pc could not be found, bindings for %s" - " will not be built." % (package, self.name)) - self.can_build_ok = 0 - return 0 + print ('* %s.pc could not be found, bindings for %s' + ' will not be built.' % (package, self.name)) + self.can_build_ok = False + return False + + orig_version = pkgc_get_version(package) - orig_version = getoutput('pkg-config --modversion %s' % - package) if (map(int, orig_version.split('.')) >= map(int, version.split('.'))): - self.can_build_ok = 1 - return 1 + + self.can_build_ok = True + return True else: - print "Warning: Too old version of %s" % self.pkc_name - print " Need %s, but %s is installed" % \ - (version, orig_version) - self.can_build_ok = 0 - return 0 + print ('Warning: Too old version of %s' % package) + print (' Need %s, but %s is installed' % (version, orig_version)) + self.can_build_ok = False + return False def generate(self): pass -# The Template and TemplateExtension classes require codegen which is -# currently part of the pygtk distribution. While codegen might ultimately -# be moved to pygobject, it was decided (bug #353849) to keep the Template -# and TemplateExtension code in dsextras. In the meantime, we check for the -# availability of codegen and redirect the user to the pygtk installer if -# he/she wants to get access to Template and TemplateExtension. - -template_classes_enabled=True -codegen_error_message=""" -*************************************************************************** -Codegen could not be found on your system and is required by the -dsextras.Template and dsextras.TemplateExtension classes. codegen is part -of PyGTK. To use either Template or TemplateExtension, you should also -install PyGTK. -*************************************************************************** -""" -try: - from codegen.override import Overrides - from codegen.defsparser import DefsParser - from codegen.codegen import register_types, SourceWriter, \ - FileOutput - import codegen.createdefs -except ImportError, e: - template_classes_enabled=False class Template(object): - def __new__(cls,*args, **kwds): + def __new__(cls, *args, **kwds): + # The Template and TemplateExtension classes require codegen if not template_classes_enabled: - raise NameError("'%s' is not defined\n" % cls.__name__ - + codegen_error_message) - return object.__new__(cls,*args, **kwds) + raise NameError('\'%s\' is not defined\n%s' % (cls.__name__, + codegen_error_message)) + + return object.__new__(cls) def __init__(self, override, output, defs, prefix, register=[], load_types=None, py_ssize_t_clean=False): - + self.override = override self.output = output self.prefix = prefix @@ -363,15 +410,17 @@ class Template(object): self.py_ssize_t_clean = py_ssize_t_clean self.built_defs=[] - if isinstance(defs,tuple): + + if isinstance(defs, tuple): self.defs=defs[0] self.built_defs.append(defs) else: self.defs=defs self.register=[] + for r in register: - if isinstance(r,tuple): + if isinstance(r, tuple): self.register.append(r[0]) self.built_defs.append(r) else: @@ -383,25 +432,25 @@ class Template(object): files.append(self.override) files.append(self.defs) - return not distutils.dep_util.newer_group(files,self.output) + return not dep_util.newer_group(files, self.output) def generate_defs(self): - for (target,sources) in self.built_defs: - if distutils.dep_util.newer_group(sources,target): + for (target, sources) in self.built_defs: + if dep_util.newer_group(sources, target): # createdefs is mostly called from the CLI ! - args=['dummy',target]+sources + args=['dummy', target] + sources codegen.createdefs.main(args) - def generate(self): # Generate defs files if necessary self.generate_defs() + # ... then check the file timestamps if self.check_dates(): return for item in self.register: - dp = DefsParser(item,dict(GLOBAL_MACROS)) + dp = DefsParser(item, dict(GLOBAL_MACROS)) dp.startParsing() register_types(dp) @@ -409,39 +458,44 @@ class Template(object): globals = {} execfile(self.load_types, globals) - dp = DefsParser(self.defs,dict(GLOBAL_MACROS)) + dp = DefsParser(self.defs, dict(GLOBAL_MACROS)) dp.startParsing() register_types(dp) fd = open(self.output, 'w') - sw = SourceWriter(dp,Overrides(self.override), - self.prefix,FileOutput(fd,self.output)) + sw = SourceWriter(dp, Overrides(self.override), self.prefix, + FileOutput(fd, self.output)) sw.write(self.py_ssize_t_clean) fd.close() + class TemplateExtension(PkgConfigExtension): def __new__(cls,*args, **kwds): if not template_classes_enabled: - raise NameError("'%s' is not defined\n" % cls.__name__ - + codegen_error_message) + raise NameError('\'%s\' is not defined\n%s' % (cls.__name__, + codegen_error_message)) + return PkgConfigExtension.__new__(cls,*args, **kwds) - + def __init__(self, **kwargs): name = kwargs['name'] defs = kwargs['defs'] - if isinstance(defs,tuple): + + if isinstance(defs, tuple): output = defs[0][:-5] + '.c' else: output = defs[:-5] + '.c' + override = kwargs['override'] load_types = kwargs.get('load_types') - py_ssize_t_clean = kwargs.pop('py_ssize_t_clean',False) + py_ssize_t_clean = kwargs.pop('py_ssize_t_clean', False) self.templates = [] self.templates.append(Template(override, output, defs, 'py' + name, kwargs['register'], load_types, py_ssize_t_clean)) del kwargs['register'], kwargs['override'], kwargs['defs'] + if load_types: del kwargs['load_types'] @@ -453,5 +507,3 @@ class TemplateExtension(PkgConfigExtension): def generate(self): map(lambda x: x.generate(), self.templates) - - diff --git a/examples/Makefile.am b/examples/Makefile.am index 41cefea..b680b90 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,2 +1,4 @@ -EXTRA_DIST = properties.py signal.py option.py +EXTRA_DIST = properties.py signal.py option.py cairo-demo.py + +-include $(top_srcdir)/git.mk diff --git a/examples/Makefile.in b/examples/Makefile.in index 4953cdd..b0ab293 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -47,12 +47,19 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -83,6 +90,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ @@ -94,6 +104,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_PC = @LIBFFI_PC@ @@ -103,7 +115,9 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -116,10 +130,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ @@ -142,6 +161,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -174,7 +194,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -195,11 +214,11 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -EXTRA_DIST = properties.py signal.py option.py +EXTRA_DIST = properties.py signal.py option.py cairo-demo.py all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -208,9 +227,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu examples/Makefile + $(AUTOMAKE) --foreign examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -224,9 +243,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -381,6 +400,8 @@ uninstall-am: mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am +-include $(top_srcdir)/git.mk + # 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. .NOEXPORT: diff --git a/examples/cairo-demo.py b/examples/cairo-demo.py new file mode 100755 index 0000000..72a0533 --- /dev/null +++ b/examples/cairo-demo.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +"""Based on cairo-demo/X11/cairo-demo.c +""" +import pygtk +pygtk.require('2.0') +import cairo +from gi.repository import Gdk, Gtk + +SIZE = 30 + +def triangle(ctx): + ctx.move_to(SIZE, 0) + ctx.rel_line_to(SIZE, 2*SIZE) + ctx.rel_line_to(-2*SIZE, 0) + ctx.close_path() + +def square(ctx): + ctx.move_to(0, 0) + ctx.rel_line_to(2*SIZE, 0) + ctx.rel_line_to(0, 2*SIZE) + ctx.rel_line_to(-2*SIZE, 0) + ctx.close_path() + +def bowtie(ctx): + ctx.move_to(0, 0) + ctx.rel_line_to(2*SIZE, 2*SIZE) + ctx.rel_line_to(-2*SIZE, 0) + ctx.rel_line_to(2*SIZE, -2*SIZE) + ctx.close_path() + +def inf(ctx): + ctx.move_to(0, SIZE) + ctx.rel_curve_to(0,SIZE, SIZE,SIZE, 2*SIZE,0) + ctx.rel_curve_to(SIZE,-SIZE, 2*SIZE,-SIZE, 2*SIZE,0) + ctx.rel_curve_to(0,SIZE, -SIZE,SIZE, -2*SIZE,0) + ctx.rel_curve_to(-SIZE,-SIZE, -2*SIZE,-SIZE, -2*SIZE,0) + ctx.close_path() + +def draw_shapes(ctx, x, y, fill): + ctx.save() + + ctx.new_path() + ctx.translate(x+SIZE, y+SIZE) + bowtie(ctx) + if fill: + ctx.fill() + else: + ctx.stroke() + + ctx.new_path() + ctx.translate(3*SIZE, 0) + square(ctx) + if fill: + ctx.fill() + else: + ctx.stroke() + + ctx.new_path() + ctx.translate(3*SIZE, 0) + triangle(ctx) + if fill: + ctx.fill() + else: + ctx.stroke() + + ctx.new_path() + ctx.translate(3*SIZE, 0) + inf(ctx) + if fill: + ctx.fill() + else: + ctx.stroke() + + ctx.restore() + +def fill_shapes(ctx, x, y): + draw_shapes(ctx, x, y, True) + +def stroke_shapes(ctx, x, y): + draw_shapes(ctx, x, y, False) + +def expose (da, event): + ctx = Gdk.cairo_create(da.window) + + ctx.set_source_rgb(0, 0, 0) + + ctx.set_line_width(SIZE / 4) + ctx.set_tolerance(0.1) + + ctx.set_line_join(cairo.LINE_JOIN_ROUND) + ctx.set_dash([SIZE/4.0, SIZE/4.0], 0) + stroke_shapes(ctx, 0, 0) + + ctx.set_dash([], 0) + stroke_shapes(ctx, 0, 3*SIZE) + + ctx.set_line_join(cairo.LINE_JOIN_BEVEL) + stroke_shapes(ctx, 0, 6*SIZE) + + ctx.set_line_join(cairo.LINE_JOIN_MITER) + stroke_shapes(ctx, 0, 9*SIZE) + + fill_shapes(ctx, 0, 12*SIZE) + + ctx.set_line_join(cairo.LINE_JOIN_BEVEL) + fill_shapes(ctx, 0, 15*SIZE) + ctx.set_source_rgb(1,0,0) + stroke_shapes(ctx, 0, 15*SIZE) + +def main(): + win = Gtk.Window() + win.connect('destroy', lambda w: Gtk.main_quit()) + win.set_default_size(450, 550) + + drawingarea = Gtk.DrawingArea() + win.add(drawingarea) + drawingarea.connect('expose_event', expose) + + win.show_all() + Gtk.main() + +if __name__ == '__main__': + main() diff --git a/gi/Makefile.am b/gi/Makefile.am new file mode 100644 index 0000000..31f6c79 --- /dev/null +++ b/gi/Makefile.am @@ -0,0 +1,94 @@ +PLATFORM_VERSION = 2.0 + +pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION) +pkgpyexecdir = $(pyexecdir) + +SUBDIRS = \ + repository \ + overrides + +INCLUDES = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib + +pygidir = $(pkgpyexecdir)/gi +pygi_PYTHON = \ + types.py \ + module.py \ + importer.py \ + __init__.py + +_gi_la_CFLAGS = \ + $(PYTHON_INCLUDES) \ + $(GI_CFLAGS) +_gi_la_LDFLAGS = \ + -module \ + -avoid-version \ + -export-symbols-regex "init_gi|PyInit__gi" +_gi_la_LIBADD = \ + $(GI_LIBS) \ + $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la +_gi_la_SOURCES = \ + pygi-repository.c \ + pygi-repository.h \ + pygi-info.c \ + pygi-info.h \ + pygi-invoke.c \ + pygi-invoke.h \ + pygi-foreign.c \ + pygi-foreign.h \ + pygi-foreign-gvariant.c \ + pygi-foreign-gvariant.h \ + pygi-struct.c \ + pygi-struct.h \ + pygi-argument.c \ + pygi-argument.h \ + pygi-type.c \ + pygi-type.h \ + pygi-boxed.c \ + pygi-boxed.h \ + pygi-closure.c \ + pygi-closure.h \ + pygi-callbacks.c \ + pygi-callbacks.h \ + pygi.h \ + pygi-private.h \ + pygi-property.c \ + pygi-property.h \ + pygi-signal-closure.c \ + pygi-signal-closure.h \ + pygobject-external.h \ + gimodule.c + +_gi_cairo_la_CFLAGS = \ + $(PYTHON_INCLUDES) \ + $(GI_CFLAGS) \ + $(PYCAIRO_CFLAGS) +_gi_cairo_la_LDFLAGS = \ + -module \ + -avoid-version \ + -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo" +_gi_cairo_la_LIBADD = \ + $(GI_LIBS) \ + $(PYCAIRO_LIBS) +_gi_cairo_la_SOURCES = pygi-foreign-cairo.c + + +pygi_LTLIBRARIES = _gi.la + +if ENABLE_CAIRO +pygi_LTLIBRARIES += _gi_cairo.la +endif + + +# This is to ensure we have a symlink to the .so in the +# build directory, which the Python interpreter can load +# directly without having to know how to parse .la files. +.la.so: + test -L $@ || $(LN_S) .libs/$@ $@ + +all-local: $(LTLIBRARIES:.la=.so) +check-local: $(LTLIBRARIES:.la=.so) +clean-local: + rm -f $(LTLIBRARIES:.la=.so) + + +-include $(top_srcdir)/git.mk diff --git a/gi/Makefile.in b/gi/Makefile.in new file mode 100644 index 0000000..3015b22 --- /dev/null +++ b/gi/Makefile.in @@ -0,0 +1,1017 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@ENABLE_CAIRO_TRUE@am__append_1 = _gi_cairo.la +subdir = gi +DIST_COMMON = $(pygi_PYTHON) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +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 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pygidir)" "$(DESTDIR)$(pygidir)" +LTLIBRARIES = $(pygi_LTLIBRARIES) +am__DEPENDENCIES_1 = +_gi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la +am__gi_la_OBJECTS = _gi_la-pygi-repository.lo _gi_la-pygi-info.lo \ + _gi_la-pygi-invoke.lo _gi_la-pygi-foreign.lo \ + _gi_la-pygi-foreign-gvariant.lo _gi_la-pygi-struct.lo \ + _gi_la-pygi-argument.lo _gi_la-pygi-type.lo \ + _gi_la-pygi-boxed.lo _gi_la-pygi-closure.lo \ + _gi_la-pygi-callbacks.lo _gi_la-pygi-property.lo \ + _gi_la-pygi-signal-closure.lo _gi_la-gimodule.lo +_gi_la_OBJECTS = $(am__gi_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +_gi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gi_la_CFLAGS) $(CFLAGS) \ + $(_gi_la_LDFLAGS) $(LDFLAGS) -o $@ +_gi_cairo_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__gi_cairo_la_OBJECTS = _gi_cairo_la-pygi-foreign-cairo.lo +_gi_cairo_la_OBJECTS = $(am__gi_cairo_la_OBJECTS) +_gi_cairo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gi_cairo_la_CFLAGS) \ + $(CFLAGS) $(_gi_cairo_la_LDFLAGS) $(LDFLAGS) -o $@ +@ENABLE_CAIRO_TRUE@am__gi_cairo_la_rpath = -rpath $(pygidir) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(_gi_la_SOURCES) $(_gi_cairo_la_SOURCES) +DIST_SOURCES = $(_gi_la_SOURCES) $(_gi_cairo_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +py_compile = $(top_srcdir)/py-compile +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIR = @DATADIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_CFLAGS = @FFI_CFLAGS@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ +GIOUNIX_LIBS = @GIOUNIX_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBFFI_PC = @LIBFFI_PC@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ +PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ +PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ +PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ +PYTHON = @PYTHON@ +PYTHON_BASENAME = @PYTHON_BASENAME@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREADING_CFLAGS = @THREADING_CFLAGS@ +VERSION = @VERSION@ +XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = $(pyexecdir) +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pygobject_CODEGEN_DEFINES = @pygobject_CODEGEN_DEFINES@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +PLATFORM_VERSION = 2.0 +SUBDIRS = \ + repository \ + overrides + +INCLUDES = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib +pygidir = $(pkgpyexecdir)/gi +pygi_PYTHON = \ + types.py \ + module.py \ + importer.py \ + __init__.py + +_gi_la_CFLAGS = \ + $(PYTHON_INCLUDES) \ + $(GI_CFLAGS) + +_gi_la_LDFLAGS = \ + -module \ + -avoid-version \ + -export-symbols-regex "init_gi|PyInit__gi" + +_gi_la_LIBADD = \ + $(GI_LIBS) \ + $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la + +_gi_la_SOURCES = \ + pygi-repository.c \ + pygi-repository.h \ + pygi-info.c \ + pygi-info.h \ + pygi-invoke.c \ + pygi-invoke.h \ + pygi-foreign.c \ + pygi-foreign.h \ + pygi-foreign-gvariant.c \ + pygi-foreign-gvariant.h \ + pygi-struct.c \ + pygi-struct.h \ + pygi-argument.c \ + pygi-argument.h \ + pygi-type.c \ + pygi-type.h \ + pygi-boxed.c \ + pygi-boxed.h \ + pygi-closure.c \ + pygi-closure.h \ + pygi-callbacks.c \ + pygi-callbacks.h \ + pygi.h \ + pygi-private.h \ + pygi-property.c \ + pygi-property.h \ + pygi-signal-closure.c \ + pygi-signal-closure.h \ + pygobject-external.h \ + gimodule.c + +_gi_cairo_la_CFLAGS = \ + $(PYTHON_INCLUDES) \ + $(GI_CFLAGS) \ + $(PYCAIRO_CFLAGS) + +_gi_cairo_la_LDFLAGS = \ + -module \ + -avoid-version \ + -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo" + +_gi_cairo_la_LIBADD = \ + $(GI_LIBS) \ + $(PYCAIRO_LIBS) + +_gi_cairo_la_SOURCES = pygi-foreign-cairo.c +pygi_LTLIBRARIES = _gi.la $(am__append_1) +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .la .lo .o .obj .so +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + 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*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pygiLTLIBRARIES: $(pygi_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pygidir)" || $(MKDIR_P) "$(DESTDIR)$(pygidir)" + @list='$(pygi_LTLIBRARIES)'; test -n "$(pygidir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pygidir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pygidir)"; \ + } + +uninstall-pygiLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pygi_LTLIBRARIES)'; test -n "$(pygidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pygidir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pygidir)/$$f"; \ + done + +clean-pygiLTLIBRARIES: + -test -z "$(pygi_LTLIBRARIES)" || rm -f $(pygi_LTLIBRARIES) + @list='$(pygi_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +_gi.la: $(_gi_la_OBJECTS) $(_gi_la_DEPENDENCIES) + $(AM_V_CCLD)$(_gi_la_LINK) -rpath $(pygidir) $(_gi_la_OBJECTS) $(_gi_la_LIBADD) $(LIBS) +_gi_cairo.la: $(_gi_cairo_la_OBJECTS) $(_gi_cairo_la_DEPENDENCIES) + $(AM_V_CCLD)$(_gi_cairo_la_LINK) $(am__gi_cairo_la_rpath) $(_gi_cairo_la_OBJECTS) $(_gi_cairo_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-gimodule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-argument.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-boxed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-callbacks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-closure.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-foreign-gvariant.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-foreign.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-info.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-invoke.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-signal-closure.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-struct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-type.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +_gi_la-pygi-repository.lo: pygi-repository.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-repository.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-repository.Tpo -c -o _gi_la-pygi-repository.lo `test -f 'pygi-repository.c' || echo '$(srcdir)/'`pygi-repository.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-repository.Tpo $(DEPDIR)/_gi_la-pygi-repository.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-repository.c' object='_gi_la-pygi-repository.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-repository.lo `test -f 'pygi-repository.c' || echo '$(srcdir)/'`pygi-repository.c + +_gi_la-pygi-info.lo: pygi-info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-info.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-info.Tpo -c -o _gi_la-pygi-info.lo `test -f 'pygi-info.c' || echo '$(srcdir)/'`pygi-info.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-info.Tpo $(DEPDIR)/_gi_la-pygi-info.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-info.c' object='_gi_la-pygi-info.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-info.lo `test -f 'pygi-info.c' || echo '$(srcdir)/'`pygi-info.c + +_gi_la-pygi-invoke.lo: pygi-invoke.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-invoke.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-invoke.Tpo -c -o _gi_la-pygi-invoke.lo `test -f 'pygi-invoke.c' || echo '$(srcdir)/'`pygi-invoke.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-invoke.Tpo $(DEPDIR)/_gi_la-pygi-invoke.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-invoke.c' object='_gi_la-pygi-invoke.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-invoke.lo `test -f 'pygi-invoke.c' || echo '$(srcdir)/'`pygi-invoke.c + +_gi_la-pygi-foreign.lo: pygi-foreign.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-foreign.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-foreign.Tpo -c -o _gi_la-pygi-foreign.lo `test -f 'pygi-foreign.c' || echo '$(srcdir)/'`pygi-foreign.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-foreign.Tpo $(DEPDIR)/_gi_la-pygi-foreign.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-foreign.c' object='_gi_la-pygi-foreign.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-foreign.lo `test -f 'pygi-foreign.c' || echo '$(srcdir)/'`pygi-foreign.c + +_gi_la-pygi-foreign-gvariant.lo: pygi-foreign-gvariant.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-foreign-gvariant.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-foreign-gvariant.Tpo -c -o _gi_la-pygi-foreign-gvariant.lo `test -f 'pygi-foreign-gvariant.c' || echo '$(srcdir)/'`pygi-foreign-gvariant.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-foreign-gvariant.Tpo $(DEPDIR)/_gi_la-pygi-foreign-gvariant.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-foreign-gvariant.c' object='_gi_la-pygi-foreign-gvariant.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-foreign-gvariant.lo `test -f 'pygi-foreign-gvariant.c' || echo '$(srcdir)/'`pygi-foreign-gvariant.c + +_gi_la-pygi-struct.lo: pygi-struct.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-struct.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-struct.Tpo -c -o _gi_la-pygi-struct.lo `test -f 'pygi-struct.c' || echo '$(srcdir)/'`pygi-struct.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-struct.Tpo $(DEPDIR)/_gi_la-pygi-struct.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-struct.c' object='_gi_la-pygi-struct.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-struct.lo `test -f 'pygi-struct.c' || echo '$(srcdir)/'`pygi-struct.c + +_gi_la-pygi-argument.lo: pygi-argument.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-argument.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-argument.Tpo -c -o _gi_la-pygi-argument.lo `test -f 'pygi-argument.c' || echo '$(srcdir)/'`pygi-argument.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-argument.Tpo $(DEPDIR)/_gi_la-pygi-argument.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-argument.c' object='_gi_la-pygi-argument.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_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-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) $(AM_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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-type.c' object='_gi_la-pygi-type.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-type.lo `test -f 'pygi-type.c' || echo '$(srcdir)/'`pygi-type.c + +_gi_la-pygi-boxed.lo: pygi-boxed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-boxed.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-boxed.Tpo -c -o _gi_la-pygi-boxed.lo `test -f 'pygi-boxed.c' || echo '$(srcdir)/'`pygi-boxed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-boxed.Tpo $(DEPDIR)/_gi_la-pygi-boxed.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-boxed.c' object='_gi_la-pygi-boxed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-boxed.lo `test -f 'pygi-boxed.c' || echo '$(srcdir)/'`pygi-boxed.c + +_gi_la-pygi-closure.lo: pygi-closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-closure.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-closure.Tpo -c -o _gi_la-pygi-closure.lo `test -f 'pygi-closure.c' || echo '$(srcdir)/'`pygi-closure.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-closure.Tpo $(DEPDIR)/_gi_la-pygi-closure.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-closure.c' object='_gi_la-pygi-closure.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-closure.lo `test -f 'pygi-closure.c' || echo '$(srcdir)/'`pygi-closure.c + +_gi_la-pygi-callbacks.lo: pygi-callbacks.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-callbacks.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-callbacks.Tpo -c -o _gi_la-pygi-callbacks.lo `test -f 'pygi-callbacks.c' || echo '$(srcdir)/'`pygi-callbacks.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-callbacks.Tpo $(DEPDIR)/_gi_la-pygi-callbacks.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-callbacks.c' object='_gi_la-pygi-callbacks.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-callbacks.lo `test -f 'pygi-callbacks.c' || echo '$(srcdir)/'`pygi-callbacks.c + +_gi_la-pygi-property.lo: pygi-property.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-property.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-property.Tpo -c -o _gi_la-pygi-property.lo `test -f 'pygi-property.c' || echo '$(srcdir)/'`pygi-property.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-property.Tpo $(DEPDIR)/_gi_la-pygi-property.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-property.c' object='_gi_la-pygi-property.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-property.lo `test -f 'pygi-property.c' || echo '$(srcdir)/'`pygi-property.c + +_gi_la-pygi-signal-closure.lo: pygi-signal-closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-signal-closure.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-signal-closure.Tpo -c -o _gi_la-pygi-signal-closure.lo `test -f 'pygi-signal-closure.c' || echo '$(srcdir)/'`pygi-signal-closure.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-signal-closure.Tpo $(DEPDIR)/_gi_la-pygi-signal-closure.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-signal-closure.c' object='_gi_la-pygi-signal-closure.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-signal-closure.lo `test -f 'pygi-signal-closure.c' || echo '$(srcdir)/'`pygi-signal-closure.c + +_gi_la-gimodule.lo: gimodule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-gimodule.lo -MD -MP -MF $(DEPDIR)/_gi_la-gimodule.Tpo -c -o _gi_la-gimodule.lo `test -f 'gimodule.c' || echo '$(srcdir)/'`gimodule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-gimodule.Tpo $(DEPDIR)/_gi_la-gimodule.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gimodule.c' object='_gi_la-gimodule.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-gimodule.lo `test -f 'gimodule.c' || echo '$(srcdir)/'`gimodule.c + +_gi_cairo_la-pygi-foreign-cairo.lo: pygi-foreign-cairo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_cairo_la_CFLAGS) $(CFLAGS) -MT _gi_cairo_la-pygi-foreign-cairo.lo -MD -MP -MF $(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Tpo -c -o _gi_cairo_la-pygi-foreign-cairo.lo `test -f 'pygi-foreign-cairo.c' || echo '$(srcdir)/'`pygi-foreign-cairo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Tpo $(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-foreign-cairo.c' object='_gi_cairo_la-pygi-foreign-cairo.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_cairo_la_CFLAGS) $(CFLAGS) -c -o _gi_cairo_la-pygi-foreign-cairo.lo `test -f 'pygi-foreign-cairo.c' || echo '$(srcdir)/'`pygi-foreign-cairo.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pygiPYTHON: $(pygi_PYTHON) + @$(NORMAL_INSTALL) + test -z "$(pygidir)" || $(MKDIR_P) "$(DESTDIR)$(pygidir)" + @list='$(pygi_PYTHON)'; dlist=; list2=; test -n "$(pygidir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + $(am__strip_dir) \ + dlist="$$dlist $$f"; \ + list2="$$list2 $$b$$p"; \ + else :; fi; \ + done; \ + for file in $$list2; do echo $$file; done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pygidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pygidir)" || exit $$?; \ + done || exit $$?; \ + if test -n "$$dlist"; then \ + if test -z "$(DESTDIR)"; then \ + PYTHON=$(PYTHON) $(py_compile) --basedir "$(pygidir)" $$dlist; \ + else \ + PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pygidir)" $$dlist; \ + fi; \ + else :; fi + +uninstall-pygiPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(pygi_PYTHON)'; test -n "$(pygidir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + filesc=`echo "$$files" | sed 's|$$|c|'`; \ + fileso=`echo "$$files" | sed 's|$$|o|'`; \ + echo " ( cd '$(DESTDIR)$(pygidir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pygidir)" && rm -f $$files || exit $$?; \ + echo " ( cd '$(DESTDIR)$(pygidir)' && rm -f" $$filesc ")"; \ + cd "$(DESTDIR)$(pygidir)" && rm -f $$filesc || exit $$?; \ + echo " ( cd '$(DESTDIR)$(pygidir)' && rm -f" $$fileso ")"; \ + cd "$(DESTDIR)$(pygidir)" && rm -f $$fileso + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile $(LTLIBRARIES) all-local +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pygidir)" "$(DESTDIR)$(pygidir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-local \ + clean-pygiLTLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pygiLTLIBRARIES install-pygiPYTHON + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pygiLTLIBRARIES uninstall-pygiPYTHON + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am all-local check check-am check-local clean \ + clean-generic clean-libtool clean-local clean-pygiLTLIBRARIES \ + ctags ctags-recursive distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am \ + install-pygiLTLIBRARIES install-pygiPYTHON install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-pygiLTLIBRARIES uninstall-pygiPYTHON + + +# This is to ensure we have a symlink to the .so in the +# build directory, which the Python interpreter can load +# directly without having to know how to parse .la files. +.la.so: + test -L $@ || $(LN_S) .libs/$@ $@ + +all-local: $(LTLIBRARIES:.la=.so) +check-local: $(LTLIBRARIES:.la=.so) +clean-local: + rm -f $(LTLIBRARIES:.la=.so) + +-include $(top_srcdir)/git.mk + +# 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. +.NOEXPORT: diff --git a/gi/__init__.py b/gi/__init__.py new file mode 100644 index 0000000..314d579 --- /dev/null +++ b/gi/__init__.py @@ -0,0 +1,55 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2005-2009 Johan Dahlin +# +# 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 + +from __future__ import absolute_import + +from ._gi import _API, Repository + +# Force loading the GObject typelib so we have available the wrappers for +# base classes such as GInitiallyUnowned +from gi.repository import GObject + +_versions = {} + +def require_version(namespace, version): + repository = Repository.get_default() + + if namespace in repository.get_loaded_namespaces(): + loaded_version = repository.get_version(namespace) + if loaded_version != version: + raise ValueError('Namespace %s is already loaded with version %s' % \ + (namespace, loaded_version)) + + if namespace in _versions and _versions[namespace] != version: + raise ValueError('Namespace %s already requires version %s' % \ + (namespace, _versions[namespace])) + + available_versions = repository.enumerate_versions(namespace) + if not available_versions: + raise ValueError('Namespace %s not available' % namespace) + + if version not in available_versions: + raise ValueError('Namespace %s not available for version %s' % \ + (namespace, version)) + + _versions[namespace] = version + +def get_required_version(namespace): + return _versions.get(namespace, None) diff --git a/gi/gimodule.c b/gi/gimodule.c new file mode 100644 index 0000000..5ef166f --- /dev/null +++ b/gi/gimodule.c @@ -0,0 +1,531 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * gimodule.c: wrapper for the gobject-introspection library. + * + * 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 + */ + +#include "pygi-private.h" +#include "pygi.h" + +#include +#include + +static PyObject * +_wrap_pyg_enum_add (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "g_type", NULL }; + PyObject *py_g_type; + GType g_type; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O!:enum_add", + kwlist, &PyGTypeWrapper_Type, &py_g_type)) { + return NULL; + } + + g_type = pyg_type_from_object (py_g_type); + if (g_type == G_TYPE_INVALID) { + return NULL; + } + + return pyg_enum_add (NULL, g_type_name (g_type), NULL, g_type); +} + +static PyObject * +_wrap_pyg_enum_register_new_gtype_and_add (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "info", NULL }; + PyGIBaseInfo *py_info; + GIEnumInfo *info; + gint n_values; + GEnumValue *g_enum_values; + GType g_type; + const gchar *type_name; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O:enum_add_make_new_gtype", + kwlist, (PyObject *)&py_info)) { + return NULL; + } + + if (!GI_IS_ENUM_INFO (py_info->info) || + g_base_info_get_type ((GIBaseInfo *) py_info->info) != GI_INFO_TYPE_ENUM) { + PyErr_SetString (PyExc_TypeError, "info must be an EnumInfo with info type GI_INFO_TYPE_ENUM"); + return NULL; + } + + info = (GIEnumInfo *)py_info->info; + n_values = g_enum_info_get_n_values (info); + g_enum_values = g_new0 (GEnumValue, n_values + 1); + + for (int i=0; i < n_values; i++) { + GIValueInfo *value_info; + GEnumValue *enum_value; + const gchar *name; + const gchar *c_identifier; + + value_info = g_enum_info_get_value (info, i); + name = g_base_info_get_name ((GIBaseInfo *) value_info); + c_identifier = g_base_info_get_attribute ((GIBaseInfo *) value_info, + "c:identifier"); + + enum_value = &g_enum_values[i]; + enum_value->value_nick = g_strdup (name); + enum_value->value = g_value_info_get_value (value_info); + + if (c_identifier == NULL) { + enum_value->value_name = enum_value->value_nick; + } else { + enum_value->value_name = g_strdup (c_identifier); + } + + g_base_info_unref ((GIBaseInfo *) value_info); + } + + g_enum_values[n_values].value = 0; + g_enum_values[n_values].value_nick = NULL; + g_enum_values[n_values].value_name = NULL; + + type_name = g_base_info_get_name ((GIBaseInfo *) info); + type_name = g_strdup (type_name); + g_type = g_enum_register_static (type_name, g_enum_values); + + return pyg_enum_add (NULL, g_type_name (g_type), NULL, g_type); +} + +static PyObject * +_wrap_pyg_flags_add (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "g_type", NULL }; + PyObject *py_g_type; + GType g_type; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O!:flags_add", + kwlist, &PyGTypeWrapper_Type, &py_g_type)) { + return NULL; + } + + g_type = pyg_type_from_object (py_g_type); + if (g_type == G_TYPE_INVALID) { + return NULL; + } + + return pyg_flags_add (NULL, g_type_name (g_type), NULL, g_type); +} + +static PyObject * +_wrap_pyg_flags_register_new_gtype_and_add (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "info", NULL }; + PyGIBaseInfo *py_info; + GIEnumInfo *info; + gint n_values; + GFlagsValue *g_flags_values; + GType g_type; + const gchar *type_name; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O:flags_add_make_new_gtype", + kwlist, (PyObject *)&py_info)) { + return NULL; + } + + if (!GI_IS_ENUM_INFO (py_info->info) || + g_base_info_get_type ((GIBaseInfo *) py_info->info) != GI_INFO_TYPE_FLAGS) { + PyErr_SetString (PyExc_TypeError, "info must be an EnumInfo with info type GI_INFO_TYPE_FLAGS"); + return NULL; + } + + info = (GIEnumInfo *)py_info->info; + n_values = g_enum_info_get_n_values (info); + g_flags_values = g_new0 (GFlagsValue, n_values + 1); + + for (int i=0; i < n_values; i++) { + GIValueInfo *value_info; + GFlagsValue *flags_value; + const gchar *name; + const gchar *c_identifier; + + value_info = g_enum_info_get_value (info, i); + name = g_base_info_get_name ((GIBaseInfo *) value_info); + c_identifier = g_base_info_get_attribute ((GIBaseInfo *) value_info, + "c:identifier"); + + flags_value = &g_flags_values[i]; + flags_value->value_nick = g_strdup (name); + flags_value->value = g_value_info_get_value (value_info); + + if (c_identifier == NULL) { + flags_value->value_name = flags_value->value_nick; + } else { + flags_value->value_name = g_strdup (c_identifier); + } + + g_base_info_unref ((GIBaseInfo *) value_info); + } + + g_flags_values[n_values].value = 0; + g_flags_values[n_values].value_nick = NULL; + g_flags_values[n_values].value_name = NULL; + + type_name = g_base_info_get_name ((GIBaseInfo *) info); + type_name = g_strdup (type_name); + g_type = g_flags_register_static (type_name, g_flags_values); + + return pyg_flags_add (NULL, g_type_name (g_type), NULL, g_type); +} + + +static PyObject * +_wrap_pyg_set_object_has_new_constructor (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "g_type", NULL }; + PyObject *py_g_type; + GType g_type; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "O!:set_object_has_new_constructor", + kwlist, &PyGTypeWrapper_Type, &py_g_type)) { + return NULL; + } + + g_type = pyg_type_from_object (py_g_type); + if (!g_type_is_a (g_type, G_TYPE_OBJECT)) { + PyErr_SetString (PyExc_TypeError, "must be a subtype of GObject"); + return NULL; + } + + pyg_set_object_has_new_constructor (g_type); + + Py_RETURN_NONE; +} + +static void +initialize_interface (GTypeInterface *iface, PyTypeObject *pytype) +{ + // pygobject prints a warning if interface_init is NULL +} + +static PyObject * +_wrap_pyg_register_interface_info (PyObject *self, PyObject *args) +{ + PyObject *py_g_type; + GType g_type; + GInterfaceInfo *info; + + if (!PyArg_ParseTuple (args, "O!:register_interface_info", + &PyGTypeWrapper_Type, &py_g_type)) { + return NULL; + } + + g_type = pyg_type_from_object (py_g_type); + if (!g_type_is_a (g_type, G_TYPE_INTERFACE)) { + PyErr_SetString (PyExc_TypeError, "must be an interface"); + return NULL; + } + + info = g_new0 (GInterfaceInfo, 1); + info->interface_init = (GInterfaceInitFunc) initialize_interface; + + pyg_register_interface_info (g_type, info); + + Py_RETURN_NONE; +} + +static void +find_vfunc_info (GIBaseInfo *vfunc_info, + GType implementor_gtype, + gpointer *implementor_class_ret, + gpointer *implementor_vtable_ret, + GIFieldInfo **field_info_ret) +{ + GType ancestor_g_type = 0; + int length, i; + GIBaseInfo *ancestor_info; + GIStructInfo *struct_info; + gpointer implementor_class = NULL; + gboolean is_interface = FALSE; + + ancestor_info = g_base_info_get_container (vfunc_info); + is_interface = g_base_info_get_type (ancestor_info) == GI_INFO_TYPE_INTERFACE; + + ancestor_g_type = g_registered_type_info_get_g_type ( + (GIRegisteredTypeInfo *) ancestor_info); + implementor_class = g_type_class_ref (implementor_gtype); + if (is_interface) { + GTypeInstance *implementor_iface_class; + implementor_iface_class = g_type_interface_peek (implementor_class, + ancestor_g_type); + if (implementor_iface_class == NULL) { + g_type_class_unref (implementor_class); + PyErr_Format (PyExc_RuntimeError, + "Couldn't find GType of implementor of interface %s. " + "Forgot to set __gtype_name__?", + g_type_name (ancestor_g_type)); + return; + } + + *implementor_vtable_ret = implementor_iface_class; + + struct_info = g_interface_info_get_iface_struct ( (GIInterfaceInfo*) ancestor_info); + } else { + struct_info = g_object_info_get_class_struct ( (GIObjectInfo*) ancestor_info); + *implementor_vtable_ret = implementor_class; + } + + *implementor_class_ret = implementor_class; + + length = g_struct_info_get_n_fields (struct_info); + for (i = 0; i < length; i++) { + GIFieldInfo *field_info; + GITypeInfo *type_info; + + field_info = g_struct_info_get_field (struct_info, i); + + if (strcmp (g_base_info_get_name ( (GIBaseInfo*) field_info), + g_base_info_get_name ( (GIBaseInfo*) vfunc_info)) != 0) { + g_base_info_unref (field_info); + continue; + } + + type_info = g_field_info_get_type (field_info); + if (g_type_info_get_tag (type_info) == GI_TYPE_TAG_INTERFACE) { + g_base_info_unref (type_info); + *field_info_ret = field_info; + break; + } + + g_base_info_unref (type_info); + g_base_info_unref (field_info); + } + + g_base_info_unref (struct_info); +} + +static PyObject * +_wrap_pyg_hook_up_vfunc_implementation (PyObject *self, PyObject *args) +{ + PyGIBaseInfo *py_info; + PyObject *py_type; + PyObject *py_function; + GType implementor_gtype = 0; + gpointer implementor_class = NULL; + gpointer implementor_vtable = NULL; + GIFieldInfo *field_info = NULL; + gpointer *method_ptr = NULL; + PyGICClosure *closure = NULL; + + if (!PyArg_ParseTuple (args, "O!O!O:hook_up_vfunc_implementation", + &PyGIBaseInfo_Type, &py_info, + &PyGTypeWrapper_Type, &py_type, + &py_function)) + return NULL; + + implementor_gtype = pyg_type_from_object (py_type); + g_assert (G_TYPE_IS_CLASSED (implementor_gtype)); + + find_vfunc_info (py_info->info, implementor_gtype, &implementor_class, &implementor_vtable, &field_info); + if (field_info != NULL) { + GITypeInfo *type_info; + GIBaseInfo *interface_info; + GICallbackInfo *callback_info; + gint offset; + + type_info = g_field_info_get_type (field_info); + + interface_info = g_type_info_get_interface (type_info); + g_assert (g_base_info_get_type (interface_info) == GI_INFO_TYPE_CALLBACK); + + callback_info = (GICallbackInfo*) interface_info; + offset = g_field_info_get_offset (field_info); + method_ptr = G_STRUCT_MEMBER_P (implementor_vtable, offset); + + closure = _pygi_make_native_closure ( (GICallableInfo*) callback_info, + GI_SCOPE_TYPE_NOTIFIED, py_function, NULL); + + *method_ptr = closure->closure; + + g_base_info_unref (interface_info); + g_base_info_unref (type_info); + g_base_info_unref (field_info); + } + g_type_class_unref (implementor_class); + + Py_RETURN_NONE; +} + +#if 0 +/* Not used, left around for future reference */ +static PyObject * +_wrap_pyg_has_vfunc_implementation (PyObject *self, PyObject *args) +{ + PyGIBaseInfo *py_info; + PyObject *py_type; + PyObject *py_ret; + gpointer implementor_class = NULL; + gpointer implementor_vtable = NULL; + GType implementor_gtype = 0; + GIFieldInfo *field_info = NULL; + + if (!PyArg_ParseTuple (args, "O!O!:has_vfunc_implementation", + &PyGIBaseInfo_Type, &py_info, + &PyGTypeWrapper_Type, &py_type)) + return NULL; + + implementor_gtype = pyg_type_from_object (py_type); + g_assert (G_TYPE_IS_CLASSED (implementor_gtype)); + + py_ret = Py_False; + find_vfunc_info (py_info->info, implementor_gtype, &implementor_class, &implementor_vtable, &field_info); + if (field_info != NULL) { + gpointer *method_ptr; + gint offset; + + offset = g_field_info_get_offset (field_info); + method_ptr = G_STRUCT_MEMBER_P (implementor_vtable, offset); + if (*method_ptr != NULL) { + py_ret = Py_True; + } + + g_base_info_unref (field_info); + } + g_type_class_unref (implementor_class); + + Py_INCREF(py_ret); + return py_ret; +} +#endif + +static PyObject * +_wrap_pyg_variant_new_tuple (PyObject *self, PyObject *args) +{ + PyObject *py_values; + GVariant **values = NULL; + GVariant *variant = NULL; + PyObject *py_variant = NULL; + PyObject *py_type; + gssize i; + + if (!PyArg_ParseTuple (args, "O!:variant_new_tuple", + &PyTuple_Type, &py_values)) { + return NULL; + } + + py_type = _pygi_type_import_by_name ("GLib", "Variant"); + + values = g_newa (GVariant*, PyTuple_Size (py_values)); + + for (i = 0; i < PyTuple_Size (py_values); i++) { + PyObject *value = PyTuple_GET_ITEM (py_values, i); + + if (!PyObject_IsInstance (value, py_type)) { + PyErr_Format (PyExc_TypeError, "argument %" G_GSSIZE_FORMAT " is not a GLib.Variant", i); + return NULL; + } + + values[i] = (GVariant *) ( (PyGPointer *) value)->pointer; + } + + variant = g_variant_new_tuple (values, PyTuple_Size (py_values)); + + py_variant = _pygi_struct_new ( (PyTypeObject *) py_type, variant, FALSE); + + return py_variant; +} + +static PyObject * +_wrap_pyg_variant_type_from_string (PyObject *self, PyObject *args) +{ + char *type_string; + PyObject *py_type; + PyObject *py_variant = NULL; + + if (!PyArg_ParseTuple (args, "s:variant_type_from_string", + &type_string)) { + return NULL; + } + + py_type = _pygi_type_import_by_name ("GLib", "VariantType"); + + if (PyType_IsSubtype (py_type, &PyGIBoxed_Type)) + py_variant = _pygi_boxed_new ( (PyTypeObject *) py_type, type_string, FALSE); + else + py_variant = _pygi_struct_new ( (PyTypeObject *) py_type, type_string, FALSE); + return py_variant; +} + +static PyMethodDef _gi_functions[] = { + { "enum_add", (PyCFunction) _wrap_pyg_enum_add, METH_VARARGS | METH_KEYWORDS }, + { "enum_register_new_gtype_and_add", (PyCFunction) _wrap_pyg_enum_register_new_gtype_and_add, METH_VARARGS | METH_KEYWORDS }, + { "flags_add", (PyCFunction) _wrap_pyg_flags_add, METH_VARARGS | METH_KEYWORDS }, + { "flags_register_new_gtype_and_add", (PyCFunction) _wrap_pyg_flags_register_new_gtype_and_add, METH_VARARGS | METH_KEYWORDS }, + + { "set_object_has_new_constructor", (PyCFunction) _wrap_pyg_set_object_has_new_constructor, METH_VARARGS | METH_KEYWORDS }, + { "register_interface_info", (PyCFunction) _wrap_pyg_register_interface_info, METH_VARARGS }, + { "hook_up_vfunc_implementation", (PyCFunction) _wrap_pyg_hook_up_vfunc_implementation, METH_VARARGS }, + { "variant_new_tuple", (PyCFunction) _wrap_pyg_variant_new_tuple, METH_VARARGS }, + { "variant_type_from_string", (PyCFunction) _wrap_pyg_variant_type_from_string, METH_VARARGS }, + { NULL, NULL, 0 } +}; + +static struct PyGI_API CAPI = { + pygi_type_import_by_g_type_real, + pygi_get_property_value_real, + pygi_set_property_value_real, + pygi_signal_closure_new_real, + pygi_register_foreign_struct_real, +}; + +PYGLIB_MODULE_START(_gi, "_gi") +{ + PyObject *api; + + if (pygobject_init (-1, -1, -1) == NULL) { + return PYGLIB_MODULE_ERROR_RETURN; + } + + if (_pygobject_import() < 0) { + return PYGLIB_MODULE_ERROR_RETURN; + } + + _pygi_repository_register_types (module); + _pygi_info_register_types (module); + _pygi_struct_register_types (module); + _pygi_boxed_register_types (module); + _pygi_argument_init(); + + api = PYGLIB_CPointer_WrapPointer ( (void *) &CAPI, "gi._API"); + if (api == NULL) { + return PYGLIB_MODULE_ERROR_RETURN; + } + PyModule_AddObject (module, "_API", api); +} +PYGLIB_MODULE_END diff --git a/gi/importer.py b/gi/importer.py new file mode 100644 index 0000000..df08274 --- /dev/null +++ b/gi/importer.py @@ -0,0 +1,79 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2005-2009 Johan Dahlin +# +# importer.py: dynamic importer for introspected libraries. +# +# 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 + +from __future__ import absolute_import +import logging +import sys + +import gobject + +from ._gi import Repository, RepositoryError +from .module import DynamicModule, DynamicGObjectModule + + +repository = Repository.get_default() +modules = {} + + +class DynamicImporter(object): + + # Note: see PEP302 for the Importer Protocol implemented below. + + def __init__(self, path): + self.path = path + + def find_module(self, fullname, path=None): + if not fullname.startswith(self.path): + return + + path, namespace = fullname.rsplit('.', 1) + if path != self.path: + return + + if not repository.enumerate_versions(namespace): + logging.error('Could not find any typelib for %s', namespace) + return None + else: + return self + + def load_module(self, fullname): + if fullname in sys.modules: + return sys.modules[fullname] + + path, namespace = fullname.rsplit('.', 1) + + # Workaround for GObject + if namespace == 'GObject': + sys.modules[fullname] = DynamicGObjectModule() + return sys.modules[fullname] + + dynamic_module = DynamicModule(namespace) + modules[namespace] = dynamic_module + + dynamic_module.__file__ = '<%s>' % fullname + dynamic_module.__loader__ = self + + sys.modules[fullname] = dynamic_module + dynamic_module._load() + + return dynamic_module + diff --git a/gi/module.py b/gi/module.py new file mode 100644 index 0000000..70df76c --- /dev/null +++ b/gi/module.py @@ -0,0 +1,287 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2007-2009 Johan Dahlin +# +# module.py: dynamic module for introspected libraries. +# +# 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 + +from __future__ import absolute_import + +import os +import gobject +import string + +import gi +from .overrides import registry + +from ._gi import \ + Repository, \ + FunctionInfo, \ + RegisteredTypeInfo, \ + EnumInfo, \ + ObjectInfo, \ + InterfaceInfo, \ + ConstantInfo, \ + StructInfo, \ + UnionInfo, \ + Struct, \ + Boxed, \ + enum_add, \ + enum_register_new_gtype_and_add, \ + flags_add, \ + flags_register_new_gtype_and_add +from .types import \ + GObjectMeta, \ + StructMeta, \ + Function + +repository = Repository.get_default() + +def get_parent_for_object(object_info): + parent_object_info = object_info.get_parent() + + if not parent_object_info: + return object + + namespace = parent_object_info.get_namespace() + name = parent_object_info.get_name() + + # Workaround for GObject.Object and GObject.InitiallyUnowned. + if namespace == 'GObject' and name == 'Object' or name == 'InitiallyUnowned': + return gobject.GObject + + module = __import__('gi.repository.%s' % namespace, fromlist=[name]) + return getattr(module, name) + + +def get_interfaces_for_object(object_info): + interfaces = [] + for interface_info in object_info.get_interfaces(): + namespace = interface_info.get_namespace() + name = interface_info.get_name() + + module = __import__('gi.repository.%s' % namespace, fromlist=[name]) + interfaces.append(getattr(module, name)) + return interfaces + + +class IntrospectionModule(object): + + def __init__(self, namespace, version=None): + repository.require(namespace, version) + self._namespace = namespace + self._version = version + self.__name__ = 'gi.repository.' + namespace + + repository.require(self._namespace, self._version) + self.__path__ = repository.get_typelib_path(self._namespace) + + if self._version is None: + self._version = repository.get_version(self._namespace) + + def __getattr__(self, name): + info = repository.find_by_name(self._namespace, name) + if not info: + raise AttributeError("%r object has no attribute %r" % ( + self.__name__, name)) + + if isinstance(info, EnumInfo): + g_type = info.get_g_type() + wrapper = g_type.pytype + + if wrapper is None: + if info.is_flags(): + if g_type.is_a(gobject.TYPE_FLAGS): + wrapper = flags_add(g_type) + else: + assert g_type == gobject.TYPE_NONE + wrapper = flags_register_new_gtype_and_add(info) + else: + if g_type.is_a(gobject.TYPE_ENUM): + wrapper = enum_add(g_type) + else: + assert g_type == gobject.TYPE_NONE + wrapper = enum_register_new_gtype_and_add(info) + + wrapper.__info__ = info + wrapper.__module__ = 'gi.repository.' + info.get_namespace() + + # Don't use upper() here to avoid locale specific + # identifier conversion (e. g. in Turkish 'i'.upper() == 'i') + # see https://bugzilla.gnome.org/show_bug.cgi?id=649165 + ascii_upper_trans = string.maketrans( + 'abcdefgjhijklmnopqrstuvwxyz', + 'ABCDEFGJHIJKLMNOPQRSTUVWXYZ') + for value_info in info.get_values(): + value_name = value_info.get_name().translate(ascii_upper_trans) + setattr(wrapper, value_name, wrapper(value_info.get_value())) + + if g_type != gobject.TYPE_NONE: + g_type.pytype = wrapper + + elif isinstance(info, RegisteredTypeInfo): + g_type = info.get_g_type() + + # Check if there is already a Python wrapper. + if g_type != gobject.TYPE_NONE: + type_ = g_type.pytype + if type_ is not None: + self.__dict__[name] = type_ + return type_ + + # Create a wrapper. + if isinstance(info, ObjectInfo): + parent = get_parent_for_object(info) + interfaces = tuple(interface for interface in get_interfaces_for_object(info) + if not issubclass(parent, interface)) + bases = (parent,) + interfaces + metaclass = GObjectMeta + elif isinstance(info, InterfaceInfo): + bases = (gobject.GInterface,) + metaclass = GObjectMeta + elif isinstance(info, (StructInfo, UnionInfo)): + if g_type.is_a(gobject.TYPE_BOXED): + bases = (Boxed,) + elif g_type.is_a(gobject.TYPE_POINTER) or \ + g_type == gobject.TYPE_NONE or \ + g_type.fundamental == g_type: + bases = (Struct,) + else: + raise TypeError("unable to create a wrapper for %s.%s" % (info.get_namespace(), info.get_name())) + metaclass = StructMeta + else: + raise NotImplementedError(info) + + name = info.get_name() + dict_ = { + '__info__': info, + '__module__': 'gi.repository.' + self._namespace, + '__gtype__': g_type + } + wrapper = metaclass(name, bases, dict_) + + # Register the new Python wrapper. + if g_type != gobject.TYPE_NONE: + g_type.pytype = wrapper + + elif isinstance(info, FunctionInfo): + wrapper = Function(info) + elif isinstance(info, ConstantInfo): + wrapper = info.get_value() + else: + raise NotImplementedError(info) + + self.__dict__[name] = wrapper + return wrapper + + def __repr__(self): + path = repository.get_typelib_path(self._namespace) + return "" % (self._namespace, path) + + def __dir__ (self): + # Python's default dir() is just dir(self.__class__) + self.__dict__.keys() + result = set(dir(self.__class__)) + result.update(self.__dict__.keys()) + + # update *set* because some repository attributes have already been + # wrapped by __getattr__() and included in self.__dict__ + namespace_infos = repository.get_infos(self._namespace) + result.update(info.get_name() for info in namespace_infos) + + return list(result) + + +class DynamicGObjectModule(IntrospectionModule): + """Wrapper for the GObject module + + This class allows us to access both the static PyGObject module and the GI GObject module + through the same interface. It is returned when by importing GObject from the gi repository: + + from gi.repository import GObject + + We use this because some PyGI interfaces generated from the GIR require GObject types not wrapped + by the static bindings. This also allows access to module attributes in a way that is more + familiar to GI application developers. Take signal flags as an example. The G_SIGNAL_RUN_FIRST + flag would be accessed as GObject.SIGNAL_RUN_FIRST in the static bindings but in the dynamic bindings + can be accessed as GObject.SignalFlags.RUN_FIRST. The latter follows a GI naming convention which + would be familiar to GI application developers in a number of languages. + """ + + def __init__(self): + IntrospectionModule.__init__(self, namespace='GObject') + + def __getattr__(self, name): + # first see if this attr is in the gobject module + attr = getattr(gobject, name, None) + + # if not in module assume request for an attr exported through GI + if attr is None: + attr = super(DynamicGObjectModule, self).__getattr__(name) + + return attr + + +class DynamicModule(object): + def __init__(self, namespace): + self._namespace = namespace + self._introspection_module = None + self._overrides_module = None + self.__path__ = None + + def _load(self): + version = gi.get_required_version(self._namespace) + self._introspection_module = IntrospectionModule(self._namespace, + version) + + overrides_modules = __import__('gi.overrides', fromlist=[self._namespace]) + self._overrides_module = getattr(overrides_modules, self._namespace, None) + self.__path__ = repository.get_typelib_path(self._namespace) + + def __getattr__(self, name): + if self._overrides_module is not None: + override_exports = getattr(self._overrides_module, '__all__', ()) + if name in override_exports: + return getattr(self._overrides_module, name, None) + else: + # check the registry just in case the module hasn't loaded yet + # TODO: Only gtypes are registered in the registry right now + # but it would be nice to register all overrides and + # get rid of the module imports. We might actually see a + # speedup. + key = '%s.%s' % (self._namespace, name) + if key in registry: + return registry[key] + + return getattr(self._introspection_module, name) + + def __dir__ (self): + # Python's default dir() is just dir(self.__class__) + self.__dict__.keys() + result = set(dir(self.__class__)) + result.update(self.__dict__.keys()) + + result.update(dir(self._introspection_module)) + override_exports = getattr(self._overrides_module, '__all__', ()) + result.update(override_exports) + return list(result) + + def __repr__(self): + path = repository.get_typelib_path(self._namespace) + return "<%s.%s %r from %r>" % (self.__class__.__module__, + self.__class__.__name__, + self._namespace, + path) diff --git a/gi/overrides/GIMarshallingTests.py b/gi/overrides/GIMarshallingTests.py new file mode 100644 index 0000000..aac8883 --- /dev/null +++ b/gi/overrides/GIMarshallingTests.py @@ -0,0 +1,67 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2010 Simon van der Linden +# +# 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 + +from ..overrides import override +from ..importer import modules + +GIMarshallingTests = modules['GIMarshallingTests']._introspection_module + +__all__ = [] + +OVERRIDES_CONSTANT = 7 +__all__.append('OVERRIDES_CONSTANT') + +class OverridesStruct(GIMarshallingTests.OverridesStruct): + + def __new__(cls, long_): + return GIMarshallingTests.OverridesStruct.__new__(cls) + + def __init__(self, long_): + GIMarshallingTests.OverridesStruct.__init__(self) + self.long_ = long_ + + def method(self): + return GIMarshallingTests.OverridesStruct.method(self) / 7 + +OverridesStruct = override(OverridesStruct) +__all__.append('OverridesStruct') + +class OverridesObject(GIMarshallingTests.OverridesObject): + + def __new__(cls, long_): + return GIMarshallingTests.OverridesObject.__new__(cls) + + def __init__(self, long_): + GIMarshallingTests.OverridesObject.__init__(self) + # FIXME: doesn't work yet + #self.long_ = long_ + + @classmethod + def new(cls, long_): + self = GIMarshallingTests.OverridesObject.new() + # FIXME: doesn't work yet + #self.long_ = long_ + return self + + def method(self): + return GIMarshallingTests.OverridesObject.method(self) / 7 + +OverridesObject = override(OverridesObject) +__all__.append('OverridesObject') diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py new file mode 100644 index 0000000..2caf205 --- /dev/null +++ b/gi/overrides/GLib.py @@ -0,0 +1,303 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2010 Tomeu Vizoso +# +# 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 + +from ..importer import modules +from .._gi import variant_new_tuple, variant_type_from_string + +GLib = modules['GLib']._introspection_module + +__all__ = [] + +def _create_variant(value): + '''Create a variant containing the variant "value". + + This is usually done with the GLib.Variant.new_variant() leaf + constructor, but this is currently broken, see GNOME#639952. + ''' + builder = GLib.VariantBuilder() + builder.init(variant_type_from_string('v')) + builder.add_value(value) + return builder.end() + +class _VariantCreator(object): + + _LEAF_CONSTRUCTORS = { + 'b': GLib.Variant.new_boolean, + 'y': GLib.Variant.new_byte, + 'n': GLib.Variant.new_int16, + 'q': GLib.Variant.new_uint16, + 'i': GLib.Variant.new_int32, + 'u': GLib.Variant.new_uint32, + 'x': GLib.Variant.new_int64, + 't': GLib.Variant.new_uint64, + 'h': GLib.Variant.new_handle, + 'd': GLib.Variant.new_double, + 's': GLib.Variant.new_string, + 'o': GLib.Variant.new_object_path, + 'g': GLib.Variant.new_signature, + #'v': GLib.Variant.new_variant, + 'v': _create_variant, + } + + def _create(self, format, args): + '''Create a GVariant object from given format and argument list. + + This method recursively calls itself for complex structures (arrays, + dictionaries, boxed). + + Return a tuple (variant, rest_format, rest_args) with the generated + GVariant, the remainder of the format string, and the remainder of the + arguments. + + If args is None, then this won't actually consume any arguments, and + just parse the format string and generate empty GVariant structures. + This is required for creating empty dictionaries or arrays. + ''' + # leaves (simple types) + constructor = self._LEAF_CONSTRUCTORS.get(format[0]) + if constructor: + if args is not None: + if not args: + raise TypeError('not enough arguments for GVariant format string') + v = constructor(args[0]) + return (v, format[1:], args[1:]) + else: + return (None, format[1:], None) + + if format[0] == '(': + return self._create_tuple(format, args) + + if format.startswith('a{'): + return self._create_dict(format, args) + + if format[0] == 'a': + return self._create_array(format, args) + + raise NotImplementedError('cannot handle GVariant type ' + format) + + def _create_tuple(self, format, args): + '''Handle the case where the outermost type of format is a tuple.''' + + format = format[1:] # eat the '(' + builder = GLib.VariantBuilder() + builder.init(variant_type_from_string('r')) + if args is not None: + if not args or type(args[0]) != type(()): + raise (TypeError, 'expected tuple argument') + + for i in range(len(args[0])): + if format.startswith(')'): + raise (TypeError, 'too many arguments for tuple signature') + + (v, format, _) = self._create(format, args[0][i:]) + builder.add_value(v) + args = args[1:] + return (builder.end(), format[1:], args) + + def _create_dict(self, format, args): + '''Handle the case where the outermost type of format is a dict.''' + + builder = GLib.VariantBuilder() + if args is None or not args[0]: + # empty value: we need to call _create() to parse the subtype, + # and specify the element type precisely + rest_format = self._create(format[2:], None)[1] + rest_format = self._create(rest_format, None)[1] + if not rest_format.startswith('}'): + raise ValueError('dictionary type string not closed with }') + rest_format = rest_format[1:] # eat the } + element_type = format[:len(format) - len(rest_format)] + builder.init(variant_type_from_string(element_type)) + else: + builder.init(variant_type_from_string('a{?*}')) + for k, v in args[0].items(): + (key_v, rest_format, _) = self._create(format[2:], [k]) + (val_v, rest_format, _) = self._create(rest_format, [v]) + + if not rest_format.startswith('}'): + raise ValueError('dictionary type string not closed with }') + rest_format = rest_format[1:] # eat the } + + entry = GLib.VariantBuilder() + entry.init(variant_type_from_string('{?*}')) + entry.add_value(key_v) + entry.add_value(val_v) + builder.add_value(entry.end()) + + if args is not None: + args = args[1:] + return (builder.end(), rest_format, args) + + def _create_array(self, format, args): + '''Handle the case where the outermost type of format is an array.''' + + builder = GLib.VariantBuilder() + if args is None or not args[0]: + # empty value: we need to call _create() to parse the subtype, + # and specify the element type precisely + rest_format = self._create(format[1:], None)[1] + element_type = format[:len(format) - len(rest_format)] + builder.init(variant_type_from_string(element_type)) + else: + builder.init(variant_type_from_string('a*')) + for i in range(len(args[0])): + (v, rest_format, _) = self._create(format[1:], args[0][i:]) + builder.add_value(v) + if args is not None: + args = args[1:] + return (builder.end(), rest_format, args) + +class Variant(GLib.Variant): + def __new__(cls, format_string, value): + '''Create a GVariant from a native Python object. + + format_string is a standard GVariant type signature, value is a Python + object whose structure has to match the signature. + + Examples: + GLib.Variant('i', 1) + GLib.Variant('(is)', (1, 'hello')) + GLib.Variant('(asa{sv})', ([], {'foo': GLib.Variant('b', True), + 'bar': GLib.Variant('i', 2)})) + ''' + creator = _VariantCreator() + (v, rest_format, _) = creator._create(format_string, [value]) + if rest_format: + raise TypeError('invalid remaining format string: "%s"' % rest_format) + return v + + def __repr__(self): + return '' % getattr(self, 'print')(True) + + def unpack(self): + '''Decompose a GVariant into a native Python object.''' + + LEAF_ACCESSORS = { + 'b': self.get_boolean, + 'y': self.get_byte, + 'n': self.get_int16, + 'q': self.get_uint16, + 'i': self.get_int32, + 'u': self.get_uint32, + 'x': self.get_int64, + 't': self.get_uint64, + 'h': self.get_handle, + 'd': self.get_double, + 's': self.get_string, + 'o': self.get_string, # object path + 'g': self.get_string, # signature + } + + # simple values + la = LEAF_ACCESSORS.get(self.get_type_string()) + if la: + return la() + + # tuple + if self.get_type_string().startswith('('): + res = [self.get_child_value(i).unpack() + for i in range(self.n_children())] + return tuple(res) + + # dictionary + if self.get_type_string().startswith('a{'): + res = {} + for i in range(self.n_children()): + v = self.get_child_value(i) + res[v.get_child_value(0).unpack()] = v.get_child_value(1).unpack() + return res + + # array + if self.get_type_string().startswith('a'): + return [self.get_child_value(i).unpack() + for i in range(self.n_children())] + + # variant (just unbox transparently) + if self.get_type_string().startswith('v'): + return self.get_variant().unpack() + + raise NotImplementedError('unsupported GVariant type ' + self.get_type_string()) + + # + # Pythonic iterators + # + def __len__(self): + if self.get_type_string() in ['s', 'o', 'g']: + return len(self.get_string()) + if self.get_type_string().startswith('a') or self.get_type_string().startswith('('): + return self.n_children() + raise TypeError('GVariant type %s does not have a length' % self.get_type_string()) + + def __getitem__(self, key): + # dict + if self.get_type_string().startswith('a{'): + try: + val = self.lookup_value(key, variant_type_from_string('*')) + if val is None: + raise KeyError(key) + return val.unpack() + except TypeError: + # lookup_value() only works for string keys, which is certainly + # the common case; we have to do painful iteration for other + # key types + for i in range(self.n_children()): + v = self.get_child_value(i) + if v.get_child_value(0).unpack() == key: + return v.get_child_value(1).unpack() + raise KeyError(key) + + # array/tuple + if self.get_type_string().startswith('a') or self.get_type_string().startswith('('): + key = int(key) + if key < 0: + key = self.n_children() + key + if key < 0 or key >= self.n_children(): + raise IndexError('list index out of range') + return self.get_child_value(key).unpack() + + # string + if self.get_type_string() in ['s', 'o', 'g']: + return self.get_string().__getitem__(key) + + raise TypeError('GVariant type %s is not a container' % self.get_type_string()) + + def keys(self): + if not self.get_type_string().startswith('a{'): + return TypeError, 'GVariant type %s is not a dictionary' % self.get_type_string() + + res = [] + for i in range(self.n_children()): + v = self.get_child_value(i) + res.append(v.get_child_value(0).unpack()) + return res + +@classmethod +def new_tuple(cls, *elements): + return variant_new_tuple(elements) + +def get_string(self): + value, length = GLib.Variant.get_string(self) + return value + +setattr(Variant, 'new_tuple', new_tuple) +setattr(Variant, 'get_string', get_string) + +__all__.append('Variant') + diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py new file mode 100644 index 0000000..7b86e1f --- /dev/null +++ b/gi/overrides/Gdk.py @@ -0,0 +1,291 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2009 Johan Dahlin +# 2010 Simon van der Linden +# +# 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 + +from ..overrides import override +from ..importer import modules + +import sys + +Gdk = modules['Gdk']._introspection_module + +__all__ = [] + +class Color(Gdk.Color): + + def __init__(self, red, green, blue): + Gdk.Color.__init__(self) + self.red = red + self.green = green + self.blue = blue + + def __new__(cls, *args, **kwargs): + return Gdk.Color.__new__(cls) + + def __eq__(self, other): + return self.equal(other) + + def __repr__(self): + return '' % (self.red, self.green, self.blue) + +Color = override(Color) +__all__.append('Color') + +if Gdk._version == '3.0': + class RGBA(Gdk.RGBA): + def __init__(self, red=1.0, green=1.0, blue=1.0, alpha=1.0): + Gdk.RGBA.__init__(self) + self.red = red + self.green = green + self.blue = blue + self.alpha = alpha + + def __new__(cls, *args, **kwargs): + return Gdk.RGBA.__new__(cls) + + def __eq__(self, other): + return self.equal(other) + + def __repr__(self): + return '' % (self.red, self.green, self.blue, self.alpha) + + RGBA = override(RGBA) + __all__.append('RGBA') + +if Gdk._version == '2.0': + class Rectangle(Gdk.Rectangle): + + def __init__(self, x, y, width, height): + Gdk.Rectangle.__init__(self) + self.x = x + self.y = y + self.width = width + self.height = height + + def __new__(cls, *args, **kwargs): + return Gdk.Rectangle.__new__(cls) + + def __repr__(self): + return '' % (self.x, self.y, self.height, self.width) + + Rectangle = override(Rectangle) + __all__.append('Rectangle') +else: + from gi.repository import cairo as _cairo + Rectangle = _cairo.RectangleInt + + __all__.append('Rectangle') + +if Gdk._version == '2.0': + class Drawable(Gdk.Drawable): + def cairo_create(self): + return Gdk.cairo_create(self) + + Drawable = override(Drawable) + __all__.append('Drawable') +else: + class Window(Gdk.Window): + def __new__(cls, parent, attributes, attributes_mask): + # Gdk.Window had to be made abstract, + # this override allows using the standard constructor + return Gdk.Window.new(parent, attributes, attributes_mask) + def __init__(self, parent, attributes, attributes_mask): + pass + def cairo_create(self): + return Gdk.cairo_create(self) + + Window = override(Window) + __all__.append('Window') + +Gdk.EventType._2BUTTON_PRESS = getattr(Gdk.EventType, "2BUTTON_PRESS") +Gdk.EventType._3BUTTON_PRESS = getattr(Gdk.EventType, "3BUTTON_PRESS") + +class Event(Gdk.Event): + _UNION_MEMBERS = { + Gdk.EventType.DELETE: 'any', + Gdk.EventType.DESTROY: 'any', + Gdk.EventType.EXPOSE: 'expose', + Gdk.EventType.MOTION_NOTIFY: 'motion', + Gdk.EventType.BUTTON_PRESS: 'button', + Gdk.EventType._2BUTTON_PRESS: 'button', + Gdk.EventType._3BUTTON_PRESS: 'button', + Gdk.EventType.BUTTON_RELEASE: 'button', + Gdk.EventType.KEY_PRESS: 'key', + Gdk.EventType.KEY_RELEASE: 'key', + Gdk.EventType.ENTER_NOTIFY: 'crossing', + Gdk.EventType.LEAVE_NOTIFY: 'crossing', + Gdk.EventType.FOCUS_CHANGE: 'focus_change', + Gdk.EventType.CONFIGURE: 'configure', + Gdk.EventType.MAP: 'any', + Gdk.EventType.UNMAP: 'any', + Gdk.EventType.PROPERTY_NOTIFY: 'property', + Gdk.EventType.SELECTION_CLEAR: 'selection', + Gdk.EventType.SELECTION_REQUEST: 'selection', + Gdk.EventType.SELECTION_NOTIFY: 'selection', + Gdk.EventType.PROXIMITY_IN: 'proximity', + Gdk.EventType.PROXIMITY_OUT: 'proximity', + Gdk.EventType.DRAG_ENTER: 'dnd', + Gdk.EventType.DRAG_LEAVE: 'dnd', + Gdk.EventType.DRAG_MOTION: 'dnd', + Gdk.EventType.DRAG_STATUS: 'dnd', + Gdk.EventType.DROP_START: 'dnd', + Gdk.EventType.DROP_FINISHED: 'dnd', + Gdk.EventType.CLIENT_EVENT: 'client', + Gdk.EventType.VISIBILITY_NOTIFY: 'visibility', + } + + if Gdk._version == '2.0': + _UNION_MEMBERS[Gdk.EventType.NO_EXPOSE] = 'no_expose' + + def __new__(cls, *args, **kwargs): + return Gdk.Event.__new__(cls) + + def __getattr__(self, name): + real_event = getattr(self, '_UNION_MEMBERS').get(self.type) + if real_event: + return getattr(getattr(self, real_event), name) + else: + raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, name)) + +Event = override(Event) +__all__.append('Event') + +# manually bind GdkEvent members to GdkEvent + +modname = globals()['__name__'] +module = sys.modules[modname] + +# right now we can't get the type_info from the +# field info so manually list the class names +event_member_classes = ['EventAny', + 'EventExpose', + 'EventVisibility', + 'EventMotion', + 'EventButton', + 'EventScroll', + 'EventKey', + 'EventCrossing', + 'EventFocus', + 'EventConfigure', + 'EventProperty', + 'EventSelection', + 'EventOwnerChange', + 'EventProximity', + 'EventDND', + 'EventWindowState', + 'EventSetting', + 'EventGrabBroken'] + +if Gdk._version == '2.0': + event_member_classes.append('EventNoExpose') + +# whitelist all methods that have a success return we want to mask +gsuccess_mask_funcs = ['get_state', + 'get_axis', + 'get_coords', + 'get_root_coords'] + +def _gsuccess_mask(func): + def cull_success(*args): + result = func(*args) + success = result[0] + if success == False: + return None + else: + if len(result) == 2: + return result[1] + else: + return result[1:] + return cull_success + +for event_class in event_member_classes: + override_class = type(event_class, (getattr(Gdk, event_class),), {}) + # add the event methods + for method_info in Gdk.Event.__info__.get_methods(): + name = method_info.get_name() + event_method = getattr(Gdk.Event, name) + # python2 we need to use the __func__ attr to avoid internal + # instance checks + event_method = getattr(event_method, '__func__', event_method) + + # use the _gsuccess_mask decorator if this method is whitelisted + if name in gsuccess_mask_funcs: + event_method = _gsuccess_mask(event_method) + setattr(override_class, name, event_method) + + setattr(module, event_class, override_class) + __all__.append(event_class) + +# end GdkEvent overrides + +class DragContext(Gdk.DragContext): + def finish(self, success, del_, time): + Gtk = modules['Gtk']._introspection_module + Gtk.drag_finish(self, success, del_, time) + +DragContext = override(DragContext) +__all__.append('DragContext') + +class Cursor(Gdk.Cursor): + def __new__(cls, *args, **kwds): + arg_len = len(args) + kwd_len = len(kwds) + total_len = arg_len + kwd_len + + def _new(cursor_type): + return cls.new(cursor_type) + + def _new_for_display(display, cursor_type): + return cls.new_for_display(display, cursor_type) + + def _new_from_pixbuf(display, pixbuf, x, y): + return cls.new_from_pixbuf(display, pixbuf, x, y) + + def _new_from_pixmap(source, mask, fg, bg, x, y): + return cls.new_from_pixmap(source, mask, fg, bg, x, y) + + _constructor = None + if total_len == 1: + _constructor = _new + elif total_len == 2: + _constructor = _new_for_display + elif total_len == 4: + _constructor = _new_from_pixbuf + elif total_len == 6: + if Gdk._version != '2.0': + # pixmaps don't exist in Gdk 3.0 + raise ValueError("Wrong number of parameters") + _constructor = _new_from_pixmap + else: + raise ValueError("Wrong number of parameters") + + return _constructor(*args, **kwds) + + def __init__(self, *args, **kwargs): + Gdk.Cursor.__init__(self) + +Cursor = override(Cursor) +__all__.append('Cursor') + +import sys + +initialized, argv = Gdk.init_check(sys.argv) +if not initialized: + raise RuntimeError("Gdk couldn't be initialized") diff --git a/gi/overrides/Gio.py b/gi/overrides/Gio.py new file mode 100644 index 0000000..20adf0c --- /dev/null +++ b/gi/overrides/Gio.py @@ -0,0 +1,215 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2010 Ignacio Casal Quinteiro +# +# 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 + +from ..overrides import override +from ..importer import modules + +from gi.repository import GLib + +import sys + +Gio = modules['Gio']._introspection_module + +__all__ = [] + +class FileEnumerator(Gio.FileEnumerator): + def __iter__(self): + return self + + def __next__(self): + file_info = self.next_file(None) + + if file_info is not None: + return file_info + else: + raise StopIteration + + # python 2 compat for the iter protocol + next = __next__ + + +FileEnumerator = override(FileEnumerator) +__all__.append('FileEnumerator') + +class Settings(Gio.Settings): + '''Provide dictionary-like access to GLib.Settings.''' + + def __init__(self, schema, path=None, backend=None): + Gio.Settings.__init__(self, schema=schema, backend=backend, path=path) + + def __contains__(self, key): + return key in self.list_keys() + + def __len__(self): + return len(self.list_keys()) + + def __bool__(self): + # for "if mysettings" we don't want a dictionary-like test here, just + # if the object isn't None + return True + + # alias for Python 2.x object protocol + __nonzero__ = __bool__ + + def __getitem__(self, key): + # get_value() aborts the program on an unknown key + if not key in self: + raise KeyError('unknown key: %r' % (key,)) + + return self.get_value(key).unpack() + + def __setitem__(self, key, value): + # set_value() aborts the program on an unknown key + if not key in self: + raise KeyError('unknown key: %r' % (key,)) + + # determine type string of this key + range = self.get_range(key) + type_ = range.get_child_value(0).get_string() + v = range.get_child_value(1) + if type_ == 'type': + # v is boxed empty array, type of its elements is the allowed value type + type_str = v.get_child_value(0).get_type_string() + assert type_str.startswith('a') + type_str = type_str[1:] + else: + raise NotImplementedError('Cannot handle allowed type range class' + str(type_)) + + self.set_value(key, GLib.Variant(type_str, value)) + + def keys(self): + return self.list_keys() + +Settings = override(Settings) +__all__.append('Settings') + +class _DBusProxyMethodCall: + '''Helper class to implement DBusProxy method calls.''' + + def __init__(self, dbus_proxy, method_name): + self.dbus_proxy = dbus_proxy + self.method_name = method_name + + def __async_result_handler(self, obj, result, user_data): + (result_callback, error_callback, real_user_data) = user_data + try: + ret = obj.call_finish(result) + except Exception: + etype, e = sys.exc_info()[:2] + # return exception as value + if error_callback: + error_callback(obj, e, real_user_data) + else: + result_callback(obj, e, real_user_data) + return + + result_callback(obj, self._unpack_result(ret), real_user_data) + + def __call__(self, *args, **kwargs): + # the first positional argument is the signature, unless we are calling + # a method without arguments; then signature is implied to be '()'. + if args: + signature = args[0] + args = args[1:] + if not isinstance(signature, str): + raise TypeError('first argument must be the method signature string: %r' % signature) + else: + signature = '()' + + arg_variant = GLib.Variant(signature, tuple(args)) + + if 'result_handler' in kwargs: + # asynchronous call + user_data = (kwargs['result_handler'], + kwargs.get('error_handler'), kwargs.get('user_data')) + self.dbus_proxy.call(self.method_name, arg_variant, + kwargs.get('flags', 0), kwargs.get('timeout', -1), None, + self.__async_result_handler, user_data) + else: + # synchronous call + result = self.dbus_proxy.call_sync(self.method_name, arg_variant, + kwargs.get('flags', 0), kwargs.get('timeout', -1), None) + return self._unpack_result(result) + + @classmethod + def _unpack_result(klass, result): + '''Convert a D-BUS return variant into an appropriate return value''' + + result = result.unpack() + + # to be compatible with standard Python behaviour, unbox + # single-element tuples and return None for empty result tuples + if len(result) == 1: + result = result[0] + elif len(result) == 0: + result = None + + return result + +class DBusProxy(Gio.DBusProxy): + '''Provide comfortable and pythonic method calls. + + This marshalls the method arguments into a GVariant, invokes the + call_sync() method on the DBusProxy object, and unmarshalls the result + GVariant back into a Python tuple. + + The first argument always needs to be the D-Bus signature tuple of the + method call. Example: + + proxy = Gio.DBusProxy.new_sync(...) + result = proxy.MyMethod('(is)', 42, 'hello') + + The exception are methods which take no arguments, like + proxy.MyMethod('()'). For these you can omit the signature and just write + proxy.MyMethod(). + + Optional keyword arguments: + + - timeout: timeout for the call in milliseconds (default to D-Bus timeout) + + - flags: Combination of Gio.DBusCallFlags.* + + - result_handler: Do an asynchronous method call and invoke + result_handler(proxy_object, result, user_data) when it finishes. + + - error_handler: If the asynchronous call raises an exception, + error_handler(proxy_object, exception, user_data) is called when it + finishes. If error_handler is not given, result_handler is called with + the exception object as result instead. + + - user_data: Optional user data to pass to result_handler for + asynchronous calls. + + Example for asynchronous calls: + + def mymethod_done(proxy, result, user_data): + if isinstance(result, Exception): + # handle error + else: + # do something with result + + proxy.MyMethod('(is)', 42, 'hello', + result_handler=mymethod_done, user_data='data') + ''' + def __getattr__(self, name): + return _DBusProxyMethodCall(self, name) + +DBusProxy = override(DBusProxy) +__all__.append('DBusProxy') diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py new file mode 100644 index 0000000..30e883c --- /dev/null +++ b/gi/overrides/Gtk.py @@ -0,0 +1,1251 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2009 Johan Dahlin +# 2010 Simon van der Linden +# +# 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 sys +import gobject +from gi.repository import GObject +from ..overrides import override +from ..importer import modules + +if sys.version_info >= (3, 0): + _basestring = str + _callable = lambda c: hasattr(c, '__call__') +else: + _basestring = basestring + _callable = callable + +Gtk = modules['Gtk']._introspection_module +__all__ = [] + +class Widget(Gtk.Widget): + + def translate_coordinates(self, dest_widget, src_x, src_y): + success, dest_x, dest_y = super(Widget, self).translate_coordinates( + dest_widget, src_x, src_y) + if success: + return (dest_x, dest_y,) + +Widget = override(Widget) +__all__.append('Widget') + +class Container(Gtk.Container, Widget): + + def __len__(self): + return len(self.get_children()) + + def __contains__(self, child): + return child in self.get_children() + + def __iter__(self): + return iter(self.get_children()) + + def __bool__(self): + return True + + # alias for Python 2.x object protocol + __nonzero__ = __bool__ + + def get_focus_chain(self): + success, widgets = super(Container, self).get_focus_chain() + if success: + return widgets + +Container = override(Container) +__all__.append('Container') + +class Editable(Gtk.Editable): + + def insert_text(self, text, position): + pos = super(Editable, self).insert_text(text, -1, position) + + return pos + + def get_selection_bounds(self): + success, start_pos, end_pos = super(Editable, self).get_selection_bounds() + if success: + return (start_pos, end_pos,) + else: + return tuple() + +Editable = override(Editable) +__all__.append("Editable") + +class Action(Gtk.Action): + def __init__(self, name, label, tooltip, stock_id, **kwds): + Gtk.Action.__init__(self, name=name, label=label, tooltip=tooltip, stock_id=stock_id, **kwds) + +Action = override(Action) +__all__.append("Action") + +class RadioAction(Gtk.RadioAction): + def __init__(self, name, label, tooltip, stock_id, value, **kwds): + Gtk.RadioAction.__init__(self, name=name, label=label, tooltip=tooltip, stock_id=stock_id, value=value, **kwds) + +RadioAction = override(RadioAction) +__all__.append("RadioAction") + +class ActionGroup(Gtk.ActionGroup): + def __init__(self, name, **kwds): + super(ActionGroup, self).__init__(name = name, **kwds) + + def add_actions(self, entries, user_data=None): + """ + The add_actions() method is a convenience method that creates a number + of gtk.Action objects based on the information in the list of action + entry tuples contained in entries and adds them to the action group. + The entry tuples can vary in size from one to six items with the + following information: + + * The name of the action. Must be specified. + * The stock id for the action. Optional with a default value of None + if a label is specified. + * The label for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None if a stock id is specified. + * The accelerator for the action, in the format understood by the + gtk.accelerator_parse() function. Optional with a default value of + None. + * The tooltip for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None. + * The callback function invoked when the action is activated. + Optional with a default value of None. + + The "activate" signals of the actions are connected to the callbacks and + their accel paths are set to /group-name/action-name. + """ + try: + iter(entries) + except (TypeError): + raise TypeError('entries must be iterable') + + def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None): + action = Action(name, label, tooltip, stock_id) + if callback is not None: + action.connect('activate', callback, user_data) + + self.add_action_with_accel(action, accelerator) + + for e in entries: + # using inner function above since entries can leave out optional arguments + _process_action(*e) + + def add_toggle_actions(self, entries, user_data=None): + """ + The add_toggle_actions() method is a convenience method that creates a + number of gtk.ToggleAction objects based on the information in the list + of action entry tuples contained in entries and adds them to the action + group. The toggle action entry tuples can vary in size from one to seven + items with the following information: + + * The name of the action. Must be specified. + * The stock id for the action. Optional with a default value of None + if a label is specified. + * The label for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None if a stock id is specified. + * The accelerator for the action, in the format understood by the + gtk.accelerator_parse() function. Optional with a default value of + None. + * The tooltip for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None. + * The callback function invoked when the action is activated. + Optional with a default value of None. + * A flag indicating whether the toggle action is active. Optional + with a default value of False. + + The "activate" signals of the actions are connected to the callbacks and + their accel paths are set to /group-name/action-name. + """ + + try: + iter(entries) + except (TypeError): + raise TypeError('entries must be iterable') + + def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None, is_active=False): + action = Gtk.ToggleAction(name, label, tooltip, stock_id) + action.set_active(is_active) + if callback is not None: + action.connect('activate', callback, user_data) + + self.add_action_with_accel(action, accelerator) + + for e in entries: + # using inner function above since entries can leave out optional arguments + _process_action(*e) + + + def add_radio_actions(self, entries, value=None, on_change=None, user_data=None): + """ + The add_radio_actions() method is a convenience method that creates a + number of gtk.RadioAction objects based on the information in the list + of action entry tuples contained in entries and adds them to the action + group. The entry tuples can vary in size from one to six items with the + following information: + + * The name of the action. Must be specified. + * The stock id for the action. Optional with a default value of None + if a label is specified. + * The label for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None if a stock id is specified. + * The accelerator for the action, in the format understood by the + gtk.accelerator_parse() function. Optional with a default value of + None. + * The tooltip for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None. + * The value to set on the radio action. Optional with a default + value of 0. Should be specified in applications. + + The value parameter specifies the radio action that should be set + active. The "changed" signal of the first radio action is connected to + the on_change callback (if specified and not None) and the accel paths + of the actions are set to /group-name/action-name. + """ + try: + iter(entries) + except (TypeError): + raise TypeError('entries must be iterable') + + first_action = None + + def _process_action(group_source, name, stock_id=None, label=None, accelerator=None, tooltip=None, entry_value=0): + action = RadioAction(name, label, tooltip, stock_id, entry_value) + + # FIXME: join_group is a patch to Gtk+ 3.0 + # otherwise we can't effectively add radio actions to a + # group. Should we depend on 3.0 and error out here + # or should we offer the functionality via a compat + # C module? + if hasattr(action, 'join_group'): + action.join_group(group_source) + + if value == entry_value: + action.set_active(True) + + self.add_action_with_accel(action, accelerator) + return action + + for e in entries: + # using inner function above since entries can leave out optional arguments + action = _process_action(first_action, *e) + if first_action is None: + first_action = action + + if first_action is not None and on_change is not None: + first_action.connect('changed', on_change, user_data) + +ActionGroup = override(ActionGroup) +__all__.append('ActionGroup') + +class UIManager(Gtk.UIManager): + def add_ui_from_string(self, buffer): + if not isinstance(buffer, _basestring): + raise TypeError('buffer must be a string') + + length = len(buffer) + + return Gtk.UIManager.add_ui_from_string(self, buffer, length) + + def insert_action_group(self, buffer, length=-1): + return Gtk.UIManager.insert_action_group(self, buffer, length) + +UIManager = override(UIManager) +__all__.append('UIManager') + +class ComboBox(Gtk.ComboBox, Container): + + def get_active_iter(self): + success, aiter = super(ComboBox, self).get_active_iter() + if success: + return aiter + +ComboBox = override(ComboBox) +__all__.append('ComboBox') + +class Builder(Gtk.Builder): + + def connect_signals(self, obj_or_map): + def _full_callback(builder, gobj, signal_name, handler_name, connect_obj, flags, obj_or_map): + handler = None + if isinstance(obj_or_map, dict): + handler = obj_or_map.get(handler_name, None) + else: + handler = getattr(obj_or_map, handler_name, None) + + if handler is None: + raise AttributeError('Handler %s not found' % handler_name) + + if not _callable(handler): + raise TypeError('Handler %s is not a method or function' % handler_name) + + after = flags or GObject.ConnectFlags.AFTER + if connect_obj is not None: + if after: + gobj.connect_object_after(signal_name, handler, connect_obj) + else: + gobj.connect_object(signal_name, handler, connect_obj) + else: + if after: + gobj.connect_after(signal_name, handler) + else: + gobj.connect(signal_name, handler) + + self.connect_signals_full(_full_callback, obj_or_map) + + def add_from_string(self, buffer): + if not isinstance(buffer, _basestring): + raise TypeError('buffer must be a string') + + length = len(buffer) + + return Gtk.Builder.add_from_string(self, buffer, length) + + def add_objects_from_string(self, buffer, object_ids): + if not isinstance(buffer, _basestring): + raise TypeError('buffer must be a string') + + length = len(buffer) + + return Gtk.Builder.add_objects_from_string(self, buffer, length, object_ids) + +Builder = override(Builder) +__all__.append('Builder') + + +class Dialog(Gtk.Dialog, Container): + + def __init__(self, + title=None, + parent=None, + flags=0, + buttons=None, + _buttons_property=None, + **kwds): + + # buttons is overloaded by PyGtk so we have to do the same here + # this breaks some subclasses of Dialog so add a _buttons_property + # keyword to work around this + if _buttons_property is not None: + kwds['buttons'] = _buttons_property + + Gtk.Dialog.__init__(self, **kwds) + if title: + self.set_title(title) + if parent: + self.set_transient_for(parent) + if flags & Gtk.DialogFlags.MODAL: + self.set_modal(True) + if flags & Gtk.DialogFlags.DESTROY_WITH_PARENT: + self.set_destroy_with_parent(True) + + # NO_SEPARATOR has been removed from Gtk 3 + try: + if flags & Gtk.DialogFlags.NO_SEPARATOR: + self.set_has_separator(False) + except AttributeError: + pass + + if buttons is not None: + self.add_buttons(*buttons) + + def add_buttons(self, *args): + """ + The add_buttons() method adds several buttons to the Gtk.Dialog using + the button data passed as arguments to the method. This method is the + same as calling the Gtk.Dialog.add_button() repeatedly. The button data + pairs - button text (or stock ID) and a response ID integer are passed + individually. For example: + + >>> dialog.add_buttons(Gtk.STOCK_OPEN, 42, "Close", Gtk.ResponseType.CLOSE) + + will add "Open" and "Close" buttons to dialog. + """ + def _button(b): + while b: + t, r = b[0:2] + b = b[2:] + yield t, r + + try: + for text, response in _button(args): + self.add_button(text, response) + except (IndexError): + raise TypeError('Must pass an even number of arguments') + +Dialog = override(Dialog) +__all__.append('Dialog') + +class MessageDialog(Gtk.MessageDialog, Dialog): + def __init__(self, + parent=None, + flags=0, + type=Gtk.MessageType.INFO, + buttons=Gtk.ButtonsType.NONE, + message_format=None, + **kwds): + + if message_format != None: + kwds['text'] = message_format + Gtk.MessageDialog.__init__(self, + _buttons_property=buttons, + message_type=type, + **kwds) + Dialog.__init__(self, parent=parent, flags=flags) + + def format_secondary_text(self, message_format): + self.set_property('secondary-use-markup', False) + self.set_property('secondary-text', message_format) + + def format_secondary_markup(self, message_format): + self.set_property('secondary-use-markup', True) + self.set_property('secondary-text', message_format) + +MessageDialog = override(MessageDialog) +__all__.append('MessageDialog') + +class AboutDialog(Gtk.AboutDialog, Dialog): + def __init__(self, **kwds): + Gtk.AboutDialog.__init__(self, **kwds) + Dialog.__init__(self) + +AboutDialog = override(AboutDialog) +__all__.append('AboutDialog') + +class ColorSelectionDialog(Gtk.ColorSelectionDialog, Dialog): + def __init__(self, title=None, **kwds): + Gtk.ColorSelectionDialog.__init__(self, **kwds) + Dialog.__init__(self, title=title) + +ColorSelectionDialog = override(ColorSelectionDialog) +__all__.append('ColorSelectionDialog') + +class FileChooserDialog(Gtk.FileChooserDialog, Dialog): + def __init__(self, + title=None, + parent=None, + action=Gtk.FileChooserAction.OPEN, + buttons=None, + **kwds): + Gtk.FileChooserDialog.__init__(self, + action=action, + **kwds) + Dialog.__init__(self, + title=title, + parent=parent, + buttons=buttons) + +FileChooserDialog = override(FileChooserDialog) +__all__.append('FileChooserDialog') + +class FontSelectionDialog(Gtk.FontSelectionDialog, Dialog): + def __init__(self, title=None, **kwds): + Gtk.FontSelectionDialog.__init__(self, **kwds) + Dialog.__init__(self, title=title) + +FontSelectionDialog = override(FontSelectionDialog) +__all__.append('FontSelectionDialog') + +class RecentChooserDialog(Gtk.RecentChooserDialog, Dialog): + def __init__(self, + title=None, + parent=None, + manager=None, + buttons=None, + **kwds): + + Gtk.RecentChooserDialog.__init__(self, recent_manager=manager, **kwds) + Dialog.__init__(self, + title=title, + parent=parent, + buttons=buttons) + +RecentChooserDialog = override(RecentChooserDialog) +__all__.append('RecentChooserDialog') + +class IconView(Gtk.IconView): + + def get_item_at_pos(self, x, y): + success, path, cell = super(IconView, self).get_item_at_pos(x, y) + if success: + return (path, cell,) + + def get_visible_range(self): + success, start_path, end_path = super(IconView, self).get_visible_range() + if success: + return (start_path, end_path,) + + def get_dest_item_at_pos(self, drag_x, drag_y): + success, path, pos = super(IconView, self).get_dest_item_at_pos(drag_x, drag_y) + if success: + return path, pos + +IconView = override(IconView) +__all__.append('IconView') + +class IMContext(Gtk.IMContext): + + def get_surrounding(self): + success, text, cursor_index = super(IMContext, self).get_surrounding() + if success: + return (text, cursor_index,) + +IMContext = override(IMContext) +__all__.append('IMContext') + +class RecentInfo(Gtk.RecentInfo): + + def get_application_info(self, app_name): + success, app_exec, count, time = super(RecentInfo, self).get_application_info(app_name) + if success: + return (app_exec, count, time,) + +RecentInfo = override(RecentInfo) +__all__.append('RecentInfo') + +class TextBuffer(Gtk.TextBuffer): + def _get_or_create_tag_table(self): + table = self.get_tag_table() + if table is None: + table = Gtk.TextTagTable() + self.set_tag_table(table) + + return table + + def create_tag(self, tag_name=None, **properties): + """ + @tag_name: name of the new tag, or None + @properties: keyword list of properties and their values + + Creates a tag and adds it to the tag table of the TextBuffer. + Equivalent to creating a Gtk.TextTag and then adding the + tag to the buffer's tag table. The returned tag is owned by + the buffer's tag table. + + If @tag_name is None, the tag is anonymous. + + If @tag_name is not None, a tag called @tag_name must not already + exist in the tag table for this buffer. + + Properties are passed as a keyword list of names and values (e.g. + foreground = 'DodgerBlue', weight = Pango.Weight.BOLD) + + Return value: a new tag + """ + + tag = Gtk.TextTag(name=tag_name, **properties) + self._get_or_create_tag_table().add(tag) + return tag + + def create_mark(self, mark_name, where, left_gravity=False): + return Gtk.TextBuffer.create_mark(self, mark_name, where, left_gravity) + + def set_text(self, text, length=-1): + Gtk.TextBuffer.set_text(self, text, length) + + def insert(self, iter, text): + if not isinstance(text , _basestring): + raise TypeError('text must be a string, not %s' % type(text)) + + length = len(text) + Gtk.TextBuffer.insert(self, iter, text, length) + + def insert_with_tags(self, iter, text, *tags): + start_offset = iter.get_offset() + self.insert(iter, text) + + if not tags: + return + + start = self.get_iter_at_offset(start_offset) + + for tag in tags: + self.apply_tag(tag, start, iter) + + def insert_with_tags_by_name(self, iter, text, *tags): + if not tags: + return + + tag_objs = [] + + for tag in tags: + tag_obj = self.get_tag_table().lookup(tag) + if not tag_obj: + raise ValueError('unknown text tag: %s' % tag) + tag_objs.append(tag_obj) + + self.insert_with_tags(iter, text, *tag_objs) + + def insert_at_cursor(self, text): + if not isinstance(text , _basestring): + raise TypeError('text must be a string, not %s' % type(text)) + + length = len(text) + Gtk.TextBuffer.insert_at_cursor(self, text, length) + + def get_selection_bounds(self): + success, start, end = super(TextBuffer, self).get_selection_bounds() + if success: + return (start, end) + else: + return () + +TextBuffer = override(TextBuffer) +__all__.append('TextBuffer') + +class TextIter(Gtk.TextIter): + + def forward_search(self, string, flags, limit): + success, match_start, match_end = super(TextIter, self).forward_search(string, + flags, limit) + return (match_start, match_end,) + + def backward_search(self, string, flags, limit): + success, match_start, match_end = super(TextIter, self).backward_search(string, + flags, limit) + return (match_start, match_end,) + + def begins_tag(self, tag=None): + return super(TextIter, self).begins_tag(tag) + + def ends_tag(self, tag=None): + return super(TextIter, self).ends_tag(tag) + + def toggles_tag(self, tag=None): + return super(TextIter, self).toggles_tag(tag) + +TextIter = override(TextIter) +__all__.append('TextIter') + +class TreeModel(Gtk.TreeModel): + def __len__(self): + return self.iter_n_children(None) + + def __bool__(self): + return True + + # alias for Python 2.x object protocol + __nonzero__ = __bool__ + + def __getitem__(self, key): + if isinstance(key, Gtk.TreeIter): + return TreeModelRow(self, key) + elif isinstance(key, int) and key < 0: + index = len(self) + key + if index < 0: + raise IndexError("row index is out of bounds: %d" % key) + try: + aiter = self.get_iter(index) + except ValueError: + raise IndexError("could not find tree path '%s'" % key) + return TreeModelRow(self, aiter) + else: + try: + aiter = self.get_iter(key) + except ValueError: + raise IndexError("could not find tree path '%s'" % key) + return TreeModelRow(self, aiter) + + def __iter__(self): + return TreeModelRowIter(self, self.get_iter_first()) + + def get_iter(self, path): + if not isinstance(path, Gtk.TreePath): + path = TreePath(path) + + success, aiter = super(TreeModel, self).get_iter(path) + if not success: + raise ValueError("invalid tree path '%s'" % path) + return aiter + + def get_iter_first(self): + success, aiter = super(TreeModel, self).get_iter_first() + if success: + return aiter + + def get_iter_from_string(self, path_string): + success, aiter = super(TreeModel, self).get_iter_from_string(path_string) + if not success: + raise ValueError("invalid tree path '%s'" % path_string) + return aiter + + def iter_next(self, aiter): + next_iter = aiter.copy() + success = super(TreeModel, self).iter_next(next_iter) + if success: + return next_iter + + def iter_children(self, aiter): + success, child_iter = super(TreeModel, self).iter_children(aiter) + if success: + return child_iter + + def iter_nth_child(self, parent, n): + success, child_iter = super(TreeModel, self).iter_nth_child(parent, n) + if success: + return child_iter + + def iter_parent(self, aiter): + success, parent_iter = super(TreeModel, self).iter_parent(aiter) + if success: + return parent_iter + + def set_row(self, treeiter, row): + # TODO: Accept a dictionary for row + # model.append(None,{COLUMN_ICON: icon, COLUMN_NAME: name}) + + n_columns = self.get_n_columns() + if len(row) != n_columns: + raise ValueError('row sequence has the incorrect number of elements') + + for i in range(n_columns): + value = row[i] + if value is None: + continue # None means skip this row + + self.set_value(treeiter, i, value) + + def _convert_value(self, treeiter, column, value): + if value is None: + return + + # we may need to convert to a basic type + type_ = self.get_column_type(column) + if type_ == GObject.TYPE_STRING: + if isinstance(value, str): + value = str(value) + elif sys.version_info < (3, 0): + if isinstance(value, unicode): + value = value.encode('UTF-8') + else: + raise ValueError('Expected string or unicode for column %i but got %s%s' % (column, value, type(value))) + else: + raise ValueError('Expected a string for column %i but got %s' % (column, type(value))) + elif type_ == GObject.TYPE_FLOAT or type_ == GObject.TYPE_DOUBLE: + if isinstance(value, float): + value = float(value) + else: + raise ValueError('Expected a float for column %i but got %s' % (column, type(value))) + elif type_ == GObject.TYPE_LONG or type_ == GObject.TYPE_INT: + if isinstance(value, int): + value = int(value) + elif sys.version_info < (3, 0): + if isinstance(value, long): + value = long(value) + else: + raise ValueError('Expected an long for column %i but got %s' % (column, type(value))) + else: + raise ValueError('Expected an integer for column %i but got %s' % (column, type(value))) + elif type_ == GObject.TYPE_BOOLEAN: + cmp_classes = [int] + if sys.version_info < (3, 0): + cmp_classes.append(long) + + if isinstance(value, tuple(cmp_classes)): + value = bool(value) + else: + raise ValueError('Expected a bool for column %i but got %s' % (column, type(value))) + else: + # use GValues directly to marshal to the correct type + # standard object checks should take care of validation + # so we don't have to do it here + value_container = GObject.Value() + value_container.init(type_) + if type_ == GObject.TYPE_PYOBJECT: + value_container.set_boxed(value) + value = value_container + elif type_ == GObject.TYPE_CHAR: + value_container.set_char(value) + value = value_container + elif type_ == GObject.TYPE_UCHAR: + value_container.set_uchar(value) + value = value_container + elif type_ == GObject.TYPE_UNICHAR: + cmp_classes = [str] + if sys.version_info < (3, 0): + cmp_classes.append(unicode) + + if isinstance(value, tuple(cmp_classes)): + value = ord(value[0]) + + value_container.set_uint(value) + value = value_container + elif type_ == GObject.TYPE_UINT: + value_container.set_uint(value) + value = value_container + elif type_ == GObject.TYPE_ULONG: + value_container.set_ulong(value) + value = value_container + elif type_ == GObject.TYPE_INT64: + value_container.set_int64(value) + value = value_container + elif type_ == GObject.TYPE_UINT64: + value_container.set_uint64(value) + value = value_container + + return value + + def get(self, treeiter, *columns): + n_columns = self.get_n_columns() + + values = [] + for col in columns: + if not isinstance(col, int): + raise TypeError("column numbers must be ints") + + if col < 0 or col >= n_columns: + raise ValueError("column number is out of range") + + values.append(self.get_value(treeiter, col)) + + return tuple(values) + +TreeModel = override(TreeModel) +__all__.append('TreeModel') + +class TreeSortable(Gtk.TreeSortable, ): + + def get_sort_column_id(self): + success, sort_column_id, order = super(TreeSortable, self).get_sort_column_id() + if success: + return (sort_column_id, order,) + else: + return (None, None,) + + def set_sort_func(self, sort_column_id, sort_func, user_data=None): + super(TreeSortable, self).set_sort_func(sort_column_id, sort_func, user_data) + + def set_default_sort_func(self, sort_func, user_data=None): + super(TreeSortable, self).set_default_sort_func(sort_func, user_data) + +TreeSortable = override(TreeSortable) +__all__.append('TreeSortable') + +class ListStore(Gtk.ListStore, TreeModel, TreeSortable): + def __init__(self, *column_types): + Gtk.ListStore.__init__(self) + self.set_column_types(column_types) + + def append(self, row=None): + treeiter = Gtk.ListStore.append(self) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def insert(self, position, row=None): + treeiter = Gtk.ListStore.insert(self, position) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def insert_before(self, sibling, row=None): + treeiter = Gtk.ListStore.insert_before(self, sibling) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def insert_after(self, sibling, row=None): + treeiter = Gtk.ListStore.insert_after(self, sibling) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def set_value(self, treeiter, column, value): + value = self._convert_value(treeiter, column, value) + Gtk.ListStore.set_value(self, treeiter, column, value) + + +ListStore = override(ListStore) +__all__.append('ListStore') + +class TreeModelRow(object): + + def __init__(self, model, iter_or_path): + if not isinstance(model, Gtk.TreeModel): + raise TypeError("expected Gtk.TreeModel, %s found" % type(model).__name__) + self.model = model + if isinstance(iter_or_path, Gtk.TreePath): + self.iter = model.get_iter(iter_or_path) + elif isinstance(iter_or_path, Gtk.TreeIter): + self.iter = iter_or_path + else: + raise TypeError("expected Gtk.TreeIter or Gtk.TreePath, \ + %s found" % type(iter_or_path).__name__) + + @property + def path(self): + return self.model.get_path(self.iter) + + @property + def next(self): + return self.get_next() + + @property + def parent(self): + return self.get_parent() + + def get_next(self): + next_iter = self.model.iter_next(self.iter) + if next_iter: + return TreeModelRow(self.model, next_iter) + + def get_parent(self): + parent_iter = self.model.iter_parent(self.iter) + if parent_iter: + return TreeModelRow(self.model, parent_iter) + + def __getitem__(self, key): + if isinstance(key, int): + if key >= self.model.get_n_columns(): + raise IndexError("column index is out of bounds: %d" % key) + elif key < 0: + key = self._convert_negative_index(key) + return self.model.get_value(self.iter, key) + else: + raise TypeError("indices must be integers, not %s" % type(key).__name__) + + def __setitem__(self, key, value): + if isinstance(key, int): + if key >= self.model.get_n_columns(): + raise IndexError("column index is out of bounds: %d" % key) + elif key < 0: + key = self._convert_negative_index(key) + return self.model.set_value(self.iter, key, value) + else: + raise TypeError("indices must be integers, not %s" % type(key).__name__) + + def _convert_negative_index(self, index): + new_index = self.model.get_n_columns() + index + if new_index < 0: + raise IndexError("column index is out of bounds: %d" % index) + return new_index + + def iterchildren(self): + child_iter = self.model.iter_children(self.iter) + return TreeModelRowIter(self.model, child_iter) + +__all__.append('TreeModelRow') + +class TreeModelRowIter(object): + + def __init__(self, model, aiter): + self.model = model + self.iter = aiter + + def __next__(self): + if not self.iter: + raise StopIteration + row = TreeModelRow(self.model, self.iter) + self.iter = self.model.iter_next(self.iter) + return row + + # alias for Python 2.x object protocol + next = __next__ + + def __iter__(self): + return self + +__all__.append('TreeModelRowIter') + +class TreePath(Gtk.TreePath): + + def __new__(cls, path=0): + if isinstance(path, int): + path = str(path) + elif isinstance(path, tuple): + path = ":".join(str(val) for val in path) + + if len(path) == 0: + raise TypeError("could not parse subscript '%s' as a tree path" % path) + try: + return TreePath.new_from_string(path) + except TypeError: + raise TypeError("could not parse subscript '%s' as a tree path" % path) + + def __str__(self): + return self.to_string() + + def __lt__(self, other): + return not other is None and self.compare(other) < 0 + + def __le__(self, other): + return not other is None and self.compare(other) <= 0 + + def __eq__(self, other): + return not other is None and self.compare(other) == 0 + + def __ne__(self, other): + return other is None or self.compare(other) != 0 + + def __gt__(self, other): + return other is None or self.compare(other) > 0 + + def __ge__(self, other): + return other is None or self.compare(other) >= 0 + +TreePath = override(TreePath) +__all__.append('TreePath') + +class TreeStore(Gtk.TreeStore, TreeModel, TreeSortable): + + def __init__(self, *column_types): + Gtk.TreeStore.__init__(self) + self.set_column_types(column_types) + + def append(self, parent, row=None): + treeiter = Gtk.TreeStore.append(self, parent) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def insert(self, parent, position, row=None): + treeiter = Gtk.TreeStore.insert(self, parent, position) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def insert_before(self, parent, sibling, row=None): + treeiter = Gtk.TreeStore.insert_before(self, parent, sibling) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def insert_after(self, parent, sibling, row=None): + treeiter = Gtk.TreeStore.insert_after(self, parent, sibling) + + if row is not None: + self.set_row(treeiter, row) + + return treeiter + + def set_value(self, treeiter, column, value): + value = self._convert_value(treeiter, column, value) + Gtk.TreeStore.set_value(self, treeiter, column, value) + + +TreeStore = override(TreeStore) +__all__.append('TreeStore') + +class TreeView(Gtk.TreeView, Container): + + def get_path_at_pos(self, x, y): + success, path, column, cell_x, cell_y = super(TreeView, self).get_path_at_pos(x, y) + if success: + return (path, column, cell_x, cell_y,) + + def get_dest_row_at_pos(self, drag_x, drag_y): + success, path, pos = super(TreeView, self).get_dest_row_at_pos(drag_x, drag_y) + if success: + return (path, pos,) + + def _construct_target_list(self, targets): + # FIXME: this should most likely be part of Widget or a global helper + # function + target_entries = [] + for t in targets: + entry = Gtk.TargetEntry.new(*t) + target_entries.append(entry) + return target_entries + + def enable_model_drag_source(self, start_button_mask, targets, actions): + target_entries = self._construct_target_list(targets) + super(TreeView, self).enable_model_drag_source(start_button_mask, + target_entries, + actions) + + def enable_model_drag_dest(self, targets, actions): + target_entries = self._construct_target_list(targets) + super(TreeView, self).enable_model_drag_dest(target_entries, + actions) + + def scroll_to_cell(self, path, column=None, use_align=False, row_align=0.0, col_align=0.0): + if not isinstance(path, Gtk.TreePath): + path = TreePath(path) + super(TreeView, self).scroll_to_cell(path, column, use_align, row_align, col_align) + + +TreeView = override(TreeView) +__all__.append('TreeView') + +class TreeViewColumn(Gtk.TreeViewColumn): + def __init__(self, title='', + cell_renderer=None, + **attributes): + Gtk.TreeViewColumn.__init__(self, title=title) + if cell_renderer: + self.pack_start(cell_renderer, True) + + for (name, value) in attributes.items(): + self.add_attribute(cell_renderer, name, value) + + def cell_get_position(self, cell_renderer): + success, start_pos, width = super(TreeViewColumn, self).cell_get_position(cell_renderer) + if success: + return (start_pos, width,) + + def set_cell_data_func(self, cell_renderer, func, func_data=None): + super(TreeViewColumn, self).set_cell_data_func(cell_renderer, func, func_data) + +TreeViewColumn = override(TreeViewColumn) +__all__.append('TreeViewColumn') + +class TreeSelection(Gtk.TreeSelection): + + def select_path(self, path): + if not isinstance(path, Gtk.TreePath): + path = TreePath(path) + super(TreeSelection, self).select_path(path) + + def get_selected(self): + success, model, aiter = super(TreeSelection, self).get_selected() + if success: + return (model, aiter) + else: + return (model, None) + + # for compatibility with PyGtk + def get_selected_rows(self): + rows, model = super(TreeSelection, self).get_selected_rows() + return (model, rows) + + +TreeSelection = override(TreeSelection) +__all__.append('TreeSelection') + +class Button(Gtk.Button, Container): + def __init__(self, label=None, stock=None, use_underline=False, **kwds): + if stock: + label = stock + use_stock = True + use_underline = True + else: + use_stock = False + Gtk.Button.__init__(self, label=label, use_stock=use_stock, + use_underline=use_underline, **kwds) +Button = override(Button) +__all__.append('Button') + +class LinkButton(Gtk.LinkButton): + def __init__(self, uri, label=None, **kwds): + Gtk.LinkButton.__init__(self, uri=uri, label=label, **kwds) + +LinkButton = override(LinkButton) +__all__.append('LinkButton') + +class Label(Gtk.Label): + def __init__(self, label=None, **kwds): + Gtk.Label.__init__(self, label=label, **kwds) + +Label = override(Label) +__all__.append('Label') + +class Adjustment(Gtk.Adjustment): + def __init__(self, *args, **kwds): + arg_names = ('value', 'lower', 'upper', + 'step_increment', 'page_increment', 'page_size') + new_args = dict(zip(arg_names, args)) + new_args.update(kwds) + Gtk.Adjustment.__init__(self, **new_args) + + # The value property is set between lower and (upper - page_size). + # Just in case lower, upper or page_size was still 0 when value + # was set, we set it again here. + if 'value' in new_args: + self.set_value(new_args['value']) + +Adjustment = override(Adjustment) +__all__.append('Adjustment') + +class Table(Gtk.Table, Container): + def __init__(self, rows=1, columns=1, homogeneous=False, **kwds): + if 'n_rows' in kwds: + rows = kwds.pop('n_rows') + + if 'n_columns' in kwds: + columns = kwds.pop('n_columns') + + Gtk.Table.__init__(self, n_rows=rows, n_columns=columns, homogeneous=homogeneous, **kwds) + + def attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL, xpadding=0, ypadding=0): + Gtk.Table.attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding) + +Table = override(Table) +__all__.append('Table') + +class ScrolledWindow(Gtk.ScrolledWindow): + def __init__(self, hadjustment=None, vadjustment=None, **kwds): + Gtk.ScrolledWindow.__init__(self, hadjustment=hadjustment, vadjustment=vadjustment, **kwds) + +ScrolledWindow = override(ScrolledWindow) +__all__.append('ScrolledWindow') + +class Paned(Gtk.Paned): + def pack1(self, child, resize=False, shrink=True): + super(Paned, self).pack1(child, resize, shrink) + + def pack2(self, child, resize=True, shrink=True): + super(Paned, self).pack2(child, resize, shrink) + +Paned = override(Paned) +__all__.append('Paned') + +if Gtk._version != '2.0': + class Menu(Gtk.Menu): + def popup(self, parent_menu_shell, parent_menu_item, func, data, button, activate_time): + self.popup_for_device(None, parent_menu_shell, parent_menu_item, func, data, button, activate_time) + Menu = override(Menu) + __all__.append('Menu') + +_Gtk_main_quit = Gtk.main_quit +@override(Gtk.main_quit) +def main_quit(*args): + _Gtk_main_quit() + +_Gtk_stock_lookup = Gtk.stock_lookup +@override(Gtk.stock_lookup) +def stock_lookup(*args): + success, item = _Gtk_stock_lookup(*args) + if not success: + return None + + return item + +initialized, argv = Gtk.init_check(sys.argv) +sys.argv = list(argv) +if not initialized: + raise RuntimeError("Gtk couldn't be initialized") diff --git a/gi/overrides/Makefile.am b/gi/overrides/Makefile.am new file mode 100644 index 0000000..7a15b46 --- /dev/null +++ b/gi/overrides/Makefile.am @@ -0,0 +1,17 @@ +PLATFORM_VERSION = 2.0 + +pkgpyexecdir = $(pyexecdir)/gi + +pygioverridesdir = $(pkgpyexecdir)/overrides +pygioverrides_PYTHON = \ + GLib.py \ + Gtk.py \ + Gdk.py \ + Gio.py \ + GIMarshallingTests.py \ + Pango.py \ + keysyms.py \ + __init__.py + + +-include $(top_srcdir)/git.mk diff --git a/gi/overrides/Makefile.in b/gi/overrides/Makefile.in new file mode 100644 index 0000000..96ce126 --- /dev/null +++ b/gi/overrides/Makefile.in @@ -0,0 +1,485 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = gi/overrides +DIST_COMMON = $(pygioverrides_PYTHON) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +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 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pygioverridesdir)" +py_compile = $(top_srcdir)/py-compile +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIR = @DATADIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_CFLAGS = @FFI_CFLAGS@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ +GIOUNIX_LIBS = @GIOUNIX_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBFFI_PC = @LIBFFI_PC@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ +PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ +PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ +PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ +PYTHON = @PYTHON@ +PYTHON_BASENAME = @PYTHON_BASENAME@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREADING_CFLAGS = @THREADING_CFLAGS@ +VERSION = @VERSION@ +XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = $(pyexecdir)/gi +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pygobject_CODEGEN_DEFINES = @pygobject_CODEGEN_DEFINES@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +PLATFORM_VERSION = 2.0 +pygioverridesdir = $(pkgpyexecdir)/overrides +pygioverrides_PYTHON = \ + GLib.py \ + Gtk.py \ + Gdk.py \ + Gio.py \ + GIMarshallingTests.py \ + Pango.py \ + keysyms.py \ + __init__.py + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + 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*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pygioverridesPYTHON: $(pygioverrides_PYTHON) + @$(NORMAL_INSTALL) + test -z "$(pygioverridesdir)" || $(MKDIR_P) "$(DESTDIR)$(pygioverridesdir)" + @list='$(pygioverrides_PYTHON)'; dlist=; list2=; test -n "$(pygioverridesdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + $(am__strip_dir) \ + dlist="$$dlist $$f"; \ + list2="$$list2 $$b$$p"; \ + else :; fi; \ + done; \ + for file in $$list2; do echo $$file; done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pygioverridesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pygioverridesdir)" || exit $$?; \ + done || exit $$?; \ + if test -n "$$dlist"; then \ + if test -z "$(DESTDIR)"; then \ + PYTHON=$(PYTHON) $(py_compile) --basedir "$(pygioverridesdir)" $$dlist; \ + else \ + PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pygioverridesdir)" $$dlist; \ + fi; \ + else :; fi + +uninstall-pygioverridesPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(pygioverrides_PYTHON)'; test -n "$(pygioverridesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + filesc=`echo "$$files" | sed 's|$$|c|'`; \ + fileso=`echo "$$files" | sed 's|$$|o|'`; \ + echo " ( cd '$(DESTDIR)$(pygioverridesdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pygioverridesdir)" && rm -f $$files || exit $$?; \ + echo " ( cd '$(DESTDIR)$(pygioverridesdir)' && rm -f" $$filesc ")"; \ + cd "$(DESTDIR)$(pygioverridesdir)" && rm -f $$filesc || exit $$?; \ + echo " ( cd '$(DESTDIR)$(pygioverridesdir)' && rm -f" $$fileso ")"; \ + cd "$(DESTDIR)$(pygioverridesdir)" && rm -f $$fileso +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: + for dir in "$(DESTDIR)$(pygioverridesdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pygioverridesPYTHON + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pygioverridesPYTHON + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am \ + install-pygioverridesPYTHON install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-pygioverridesPYTHON + + +-include $(top_srcdir)/git.mk + +# 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. +.NOEXPORT: diff --git a/gi/overrides/Pango.py b/gi/overrides/Pango.py new file mode 100644 index 0000000..3269806 --- /dev/null +++ b/gi/overrides/Pango.py @@ -0,0 +1,51 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2010 Paolo Borelli +# +# 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 + +from ..overrides import override +from ..importer import modules + +Pango = modules['Pango']._introspection_module + +__all__ = [] + +class FontDescription(Pango.FontDescription): + + def __new__(cls, string=None): + if string is not None: + return Pango.font_description_from_string (string) + else: + return Pango.FontDescription.__new__(cls) + +FontDescription = override(FontDescription) +__all__.append('FontDescription') + +class Layout(Pango.Layout): + + def __new__(cls, context): + return Pango.Layout.new(context) + + def __init__(self, context, **kwds): + # simply discard 'context', since it was set by + # __new__ and it is not a PangoLayout property + super(Layout, self).__init__(**kwds) + +Layout = override(Layout) +__all__.append('Layout') + diff --git a/gi/overrides/__init__.py b/gi/overrides/__init__.py new file mode 100644 index 0000000..a98974f --- /dev/null +++ b/gi/overrides/__init__.py @@ -0,0 +1,66 @@ +import sys +import types + +import gobject + +registry = None +class _Registry(dict): + def __setitem__(self, key, value): + '''We do checks here to make sure only submodules of the override + module are added. Key and value should be the same object and come + from the gi.override module. + + We add the override to the dict as "override_module.name". For instance + if we were overriding Gtk.Button you would retrive it as such: + registry['Gtk.Button'] + ''' + if not key == value: + raise KeyError('You have tried to modify the registry. This should only be done by the override decorator') + + info = getattr(value, '__info__') + if info == None: + raise KeyError('Can not override a type %s, which is not in a gobject introspection typelib' % value.__name__) + + if not value.__module__.startswith('gi.overrides'): + raise KeyError('You have tried to modify the registry outside of the overrides module. This is not allowed') + + g_type = info.get_g_type() + assert g_type != gobject.TYPE_NONE + if g_type != gobject.TYPE_INVALID: + g_type.pytype = value + + # strip gi.overrides from module name + module = value.__module__[13:] + key = "%s.%s" % (module, value.__name__) + super(_Registry, self).__setitem__(key, value) + + def register(self, override_class): + self[override_class] = override_class + + +class overridefunc(object): + '''decorator for overriding a function''' + def __init__(self, func): + if not hasattr(func, '__info__'): + raise TypeError("func must be an gi function") + from ..importer import modules + self.module = modules[func.__module__]._introspection_module + + def __call__(self, func): + def wrapper(*args, **kwargs): + return func(*args, **kwargs) + wrapper.__name__ = func.__name__ + setattr(self.module, func.__name__, wrapper) + return wrapper + +registry = _Registry() + +def override(type_): + '''Decorator for registering an override''' + if type(type_) == types.FunctionType: + return overridefunc(type_) + else: + registry.register(type_) + return type_ + + diff --git a/gi/overrides/keysyms.py b/gi/overrides/keysyms.py new file mode 100644 index 0000000..35ee8eb --- /dev/null +++ b/gi/overrides/keysyms.py @@ -0,0 +1,1499 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# pygtk - Python bindings for the GTK toolkit. +# Copyright (C) 1998-2003 James Henstridge +# +# gtk/keysyms.py: list of keysyms. +# +# 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 Street, Fifth Floor, Boston, MA 02110-1301 +# USA + +VoidSymbol = 0xFFFFFF +BackSpace = 0xFF08 +Tab = 0xFF09 +Linefeed = 0xFF0A +Clear = 0xFF0B +Return = 0xFF0D +Pause = 0xFF13 +Scroll_Lock = 0xFF14 +Sys_Req = 0xFF15 +Escape = 0xFF1B +Delete = 0xFFFF +Multi_key = 0xFF20 +Codeinput = 0xFF37 +SingleCandidate = 0xFF3C +MultipleCandidate = 0xFF3D +PreviousCandidate = 0xFF3E +Kanji = 0xFF21 +Muhenkan = 0xFF22 +Henkan_Mode = 0xFF23 +Henkan = 0xFF23 +Romaji = 0xFF24 +Hiragana = 0xFF25 +Katakana = 0xFF26 +Hiragana_Katakana = 0xFF27 +Zenkaku = 0xFF28 +Hankaku = 0xFF29 +Zenkaku_Hankaku = 0xFF2A +Touroku = 0xFF2B +Massyo = 0xFF2C +Kana_Lock = 0xFF2D +Kana_Shift = 0xFF2E +Eisu_Shift = 0xFF2F +Eisu_toggle = 0xFF30 +Kanji_Bangou = 0xFF37 +Zen_Koho = 0xFF3D +Mae_Koho = 0xFF3E +Home = 0xFF50 +Left = 0xFF51 +Up = 0xFF52 +Right = 0xFF53 +Down = 0xFF54 +Prior = 0xFF55 +Page_Up = 0xFF55 +Next = 0xFF56 +Page_Down = 0xFF56 +End = 0xFF57 +Begin = 0xFF58 +Select = 0xFF60 +Print = 0xFF61 +Execute = 0xFF62 +Insert = 0xFF63 +Undo = 0xFF65 +Redo = 0xFF66 +Menu = 0xFF67 +Find = 0xFF68 +Cancel = 0xFF69 +Help = 0xFF6A +Break = 0xFF6B +Mode_switch = 0xFF7E +script_switch = 0xFF7E +Num_Lock = 0xFF7F +KP_Space = 0xFF80 +KP_Tab = 0xFF89 +KP_Enter = 0xFF8D +KP_F1 = 0xFF91 +KP_F2 = 0xFF92 +KP_F3 = 0xFF93 +KP_F4 = 0xFF94 +KP_Home = 0xFF95 +KP_Left = 0xFF96 +KP_Up = 0xFF97 +KP_Right = 0xFF98 +KP_Down = 0xFF99 +KP_Prior = 0xFF9A +KP_Page_Up = 0xFF9A +KP_Next = 0xFF9B +KP_Page_Down = 0xFF9B +KP_End = 0xFF9C +KP_Begin = 0xFF9D +KP_Insert = 0xFF9E +KP_Delete = 0xFF9F +KP_Equal = 0xFFBD +KP_Multiply = 0xFFAA +KP_Add = 0xFFAB +KP_Separator = 0xFFAC +KP_Subtract = 0xFFAD +KP_Decimal = 0xFFAE +KP_Divide = 0xFFAF +KP_0 = 0xFFB0 +KP_1 = 0xFFB1 +KP_2 = 0xFFB2 +KP_3 = 0xFFB3 +KP_4 = 0xFFB4 +KP_5 = 0xFFB5 +KP_6 = 0xFFB6 +KP_7 = 0xFFB7 +KP_8 = 0xFFB8 +KP_9 = 0xFFB9 +F1 = 0xFFBE +F2 = 0xFFBF +F3 = 0xFFC0 +F4 = 0xFFC1 +F5 = 0xFFC2 +F6 = 0xFFC3 +F7 = 0xFFC4 +F8 = 0xFFC5 +F9 = 0xFFC6 +F10 = 0xFFC7 +F11 = 0xFFC8 +L1 = 0xFFC8 +F12 = 0xFFC9 +L2 = 0xFFC9 +F13 = 0xFFCA +L3 = 0xFFCA +F14 = 0xFFCB +L4 = 0xFFCB +F15 = 0xFFCC +L5 = 0xFFCC +F16 = 0xFFCD +L6 = 0xFFCD +F17 = 0xFFCE +L7 = 0xFFCE +F18 = 0xFFCF +L8 = 0xFFCF +F19 = 0xFFD0 +L9 = 0xFFD0 +F20 = 0xFFD1 +L10 = 0xFFD1 +F21 = 0xFFD2 +R1 = 0xFFD2 +F22 = 0xFFD3 +R2 = 0xFFD3 +F23 = 0xFFD4 +R3 = 0xFFD4 +F24 = 0xFFD5 +R4 = 0xFFD5 +F25 = 0xFFD6 +R5 = 0xFFD6 +F26 = 0xFFD7 +R6 = 0xFFD7 +F27 = 0xFFD8 +R7 = 0xFFD8 +F28 = 0xFFD9 +R8 = 0xFFD9 +F29 = 0xFFDA +R9 = 0xFFDA +F30 = 0xFFDB +R10 = 0xFFDB +F31 = 0xFFDC +R11 = 0xFFDC +F32 = 0xFFDD +R12 = 0xFFDD +F33 = 0xFFDE +R13 = 0xFFDE +F34 = 0xFFDF +R14 = 0xFFDF +F35 = 0xFFE0 +R15 = 0xFFE0 +Shift_L = 0xFFE1 +Shift_R = 0xFFE2 +Control_L = 0xFFE3 +Control_R = 0xFFE4 +Caps_Lock = 0xFFE5 +Shift_Lock = 0xFFE6 +Meta_L = 0xFFE7 +Meta_R = 0xFFE8 +Alt_L = 0xFFE9 +Alt_R = 0xFFEA +Super_L = 0xFFEB +Super_R = 0xFFEC +Hyper_L = 0xFFED +Hyper_R = 0xFFEE +ISO_Lock = 0xFE01 +ISO_Level2_Latch = 0xFE02 +ISO_Level3_Shift = 0xFE03 +ISO_Level3_Latch = 0xFE04 +ISO_Level3_Lock = 0xFE05 +ISO_Group_Shift = 0xFF7E +ISO_Group_Latch = 0xFE06 +ISO_Group_Lock = 0xFE07 +ISO_Next_Group = 0xFE08 +ISO_Next_Group_Lock = 0xFE09 +ISO_Prev_Group = 0xFE0A +ISO_Prev_Group_Lock = 0xFE0B +ISO_First_Group = 0xFE0C +ISO_First_Group_Lock = 0xFE0D +ISO_Last_Group = 0xFE0E +ISO_Last_Group_Lock = 0xFE0F +ISO_Left_Tab = 0xFE20 +ISO_Move_Line_Up = 0xFE21 +ISO_Move_Line_Down = 0xFE22 +ISO_Partial_Line_Up = 0xFE23 +ISO_Partial_Line_Down = 0xFE24 +ISO_Partial_Space_Left = 0xFE25 +ISO_Partial_Space_Right = 0xFE26 +ISO_Set_Margin_Left = 0xFE27 +ISO_Set_Margin_Right = 0xFE28 +ISO_Release_Margin_Left = 0xFE29 +ISO_Release_Margin_Right = 0xFE2A +ISO_Release_Both_Margins = 0xFE2B +ISO_Fast_Cursor_Left = 0xFE2C +ISO_Fast_Cursor_Right = 0xFE2D +ISO_Fast_Cursor_Up = 0xFE2E +ISO_Fast_Cursor_Down = 0xFE2F +ISO_Continuous_Underline = 0xFE30 +ISO_Discontinuous_Underline = 0xFE31 +ISO_Emphasize = 0xFE32 +ISO_Center_Object = 0xFE33 +ISO_Enter = 0xFE34 +dead_grave = 0xFE50 +dead_acute = 0xFE51 +dead_circumflex = 0xFE52 +dead_tilde = 0xFE53 +dead_macron = 0xFE54 +dead_breve = 0xFE55 +dead_abovedot = 0xFE56 +dead_diaeresis = 0xFE57 +dead_abovering = 0xFE58 +dead_doubleacute = 0xFE59 +dead_caron = 0xFE5A +dead_cedilla = 0xFE5B +dead_ogonek = 0xFE5C +dead_iota = 0xFE5D +dead_voiced_sound = 0xFE5E +dead_semivoiced_sound = 0xFE5F +dead_belowdot = 0xFE60 +First_Virtual_Screen = 0xFED0 +Prev_Virtual_Screen = 0xFED1 +Next_Virtual_Screen = 0xFED2 +Last_Virtual_Screen = 0xFED4 +Terminate_Server = 0xFED5 +AccessX_Enable = 0xFE70 +AccessX_Feedback_Enable = 0xFE71 +RepeatKeys_Enable = 0xFE72 +SlowKeys_Enable = 0xFE73 +BounceKeys_Enable = 0xFE74 +StickyKeys_Enable = 0xFE75 +MouseKeys_Enable = 0xFE76 +MouseKeys_Accel_Enable = 0xFE77 +Overlay1_Enable = 0xFE78 +Overlay2_Enable = 0xFE79 +AudibleBell_Enable = 0xFE7A +Pointer_Left = 0xFEE0 +Pointer_Right = 0xFEE1 +Pointer_Up = 0xFEE2 +Pointer_Down = 0xFEE3 +Pointer_UpLeft = 0xFEE4 +Pointer_UpRight = 0xFEE5 +Pointer_DownLeft = 0xFEE6 +Pointer_DownRight = 0xFEE7 +Pointer_Button_Dflt = 0xFEE8 +Pointer_Button1 = 0xFEE9 +Pointer_Button2 = 0xFEEA +Pointer_Button3 = 0xFEEB +Pointer_Button4 = 0xFEEC +Pointer_Button5 = 0xFEED +Pointer_DblClick_Dflt = 0xFEEE +Pointer_DblClick1 = 0xFEEF +Pointer_DblClick2 = 0xFEF0 +Pointer_DblClick3 = 0xFEF1 +Pointer_DblClick4 = 0xFEF2 +Pointer_DblClick5 = 0xFEF3 +Pointer_Drag_Dflt = 0xFEF4 +Pointer_Drag1 = 0xFEF5 +Pointer_Drag2 = 0xFEF6 +Pointer_Drag3 = 0xFEF7 +Pointer_Drag4 = 0xFEF8 +Pointer_Drag5 = 0xFEFD +Pointer_EnableKeys = 0xFEF9 +Pointer_Accelerate = 0xFEFA +Pointer_DfltBtnNext = 0xFEFB +Pointer_DfltBtnPrev = 0xFEFC +_3270_Duplicate = 0xFD01 +_3270_FieldMark = 0xFD02 +_3270_Right2 = 0xFD03 +_3270_Left2 = 0xFD04 +_3270_BackTab = 0xFD05 +_3270_EraseEOF = 0xFD06 +_3270_EraseInput = 0xFD07 +_3270_Reset = 0xFD08 +_3270_Quit = 0xFD09 +_3270_PA1 = 0xFD0A +_3270_PA2 = 0xFD0B +_3270_PA3 = 0xFD0C +_3270_Test = 0xFD0D +_3270_Attn = 0xFD0E +_3270_CursorBlink = 0xFD0F +_3270_AltCursor = 0xFD10 +_3270_KeyClick = 0xFD11 +_3270_Jump = 0xFD12 +_3270_Ident = 0xFD13 +_3270_Rule = 0xFD14 +_3270_Copy = 0xFD15 +_3270_Play = 0xFD16 +_3270_Setup = 0xFD17 +_3270_Record = 0xFD18 +_3270_ChangeScreen = 0xFD19 +_3270_DeleteWord = 0xFD1A +_3270_ExSelect = 0xFD1B +_3270_CursorSelect = 0xFD1C +_3270_PrintScreen = 0xFD1D +_3270_Enter = 0xFD1E +space = 0x020 +exclam = 0x021 +quotedbl = 0x022 +numbersign = 0x023 +dollar = 0x024 +percent = 0x025 +ampersand = 0x026 +apostrophe = 0x027 +quoteright = 0x027 +parenleft = 0x028 +parenright = 0x029 +asterisk = 0x02a +plus = 0x02b +comma = 0x02c +minus = 0x02d +period = 0x02e +slash = 0x02f +_0 = 0x030 +_1 = 0x031 +_2 = 0x032 +_3 = 0x033 +_4 = 0x034 +_5 = 0x035 +_6 = 0x036 +_7 = 0x037 +_8 = 0x038 +_9 = 0x039 +colon = 0x03a +semicolon = 0x03b +less = 0x03c +equal = 0x03d +greater = 0x03e +question = 0x03f +at = 0x040 +A = 0x041 +B = 0x042 +C = 0x043 +D = 0x044 +E = 0x045 +F = 0x046 +G = 0x047 +H = 0x048 +I = 0x049 +J = 0x04a +K = 0x04b +L = 0x04c +M = 0x04d +N = 0x04e +O = 0x04f +P = 0x050 +Q = 0x051 +R = 0x052 +S = 0x053 +T = 0x054 +U = 0x055 +V = 0x056 +W = 0x057 +X = 0x058 +Y = 0x059 +Z = 0x05a +bracketleft = 0x05b +backslash = 0x05c +bracketright = 0x05d +asciicircum = 0x05e +underscore = 0x05f +grave = 0x060 +quoteleft = 0x060 +a = 0x061 +b = 0x062 +c = 0x063 +d = 0x064 +e = 0x065 +f = 0x066 +g = 0x067 +h = 0x068 +i = 0x069 +j = 0x06a +k = 0x06b +l = 0x06c +m = 0x06d +n = 0x06e +o = 0x06f +p = 0x070 +q = 0x071 +r = 0x072 +s = 0x073 +t = 0x074 +u = 0x075 +v = 0x076 +w = 0x077 +x = 0x078 +y = 0x079 +z = 0x07a +braceleft = 0x07b +bar = 0x07c +braceright = 0x07d +asciitilde = 0x07e +nobreakspace = 0x0a0 +exclamdown = 0x0a1 +cent = 0x0a2 +sterling = 0x0a3 +currency = 0x0a4 +yen = 0x0a5 +brokenbar = 0x0a6 +section = 0x0a7 +diaeresis = 0x0a8 +copyright = 0x0a9 +ordfeminine = 0x0aa +guillemotleft = 0x0ab +notsign = 0x0ac +hyphen = 0x0ad +registered = 0x0ae +macron = 0x0af +degree = 0x0b0 +plusminus = 0x0b1 +twosuperior = 0x0b2 +threesuperior = 0x0b3 +acute = 0x0b4 +mu = 0x0b5 +paragraph = 0x0b6 +periodcentered = 0x0b7 +cedilla = 0x0b8 +onesuperior = 0x0b9 +masculine = 0x0ba +guillemotright = 0x0bb +onequarter = 0x0bc +onehalf = 0x0bd +threequarters = 0x0be +questiondown = 0x0bf +Agrave = 0x0c0 +Aacute = 0x0c1 +Acircumflex = 0x0c2 +Atilde = 0x0c3 +Adiaeresis = 0x0c4 +Aring = 0x0c5 +AE = 0x0c6 +Ccedilla = 0x0c7 +Egrave = 0x0c8 +Eacute = 0x0c9 +Ecircumflex = 0x0ca +Ediaeresis = 0x0cb +Igrave = 0x0cc +Iacute = 0x0cd +Icircumflex = 0x0ce +Idiaeresis = 0x0cf +ETH = 0x0d0 +Eth = 0x0d0 +Ntilde = 0x0d1 +Ograve = 0x0d2 +Oacute = 0x0d3 +Ocircumflex = 0x0d4 +Otilde = 0x0d5 +Odiaeresis = 0x0d6 +multiply = 0x0d7 +Ooblique = 0x0d8 +Ugrave = 0x0d9 +Uacute = 0x0da +Ucircumflex = 0x0db +Udiaeresis = 0x0dc +Yacute = 0x0dd +THORN = 0x0de +Thorn = 0x0de +ssharp = 0x0df +agrave = 0x0e0 +aacute = 0x0e1 +acircumflex = 0x0e2 +atilde = 0x0e3 +adiaeresis = 0x0e4 +aring = 0x0e5 +ae = 0x0e6 +ccedilla = 0x0e7 +egrave = 0x0e8 +eacute = 0x0e9 +ecircumflex = 0x0ea +ediaeresis = 0x0eb +igrave = 0x0ec +iacute = 0x0ed +icircumflex = 0x0ee +idiaeresis = 0x0ef +eth = 0x0f0 +ntilde = 0x0f1 +ograve = 0x0f2 +oacute = 0x0f3 +ocircumflex = 0x0f4 +otilde = 0x0f5 +odiaeresis = 0x0f6 +division = 0x0f7 +oslash = 0x0f8 +ugrave = 0x0f9 +uacute = 0x0fa +ucircumflex = 0x0fb +udiaeresis = 0x0fc +yacute = 0x0fd +thorn = 0x0fe +ydiaeresis = 0x0ff +Aogonek = 0x1a1 +breve = 0x1a2 +Lstroke = 0x1a3 +Lcaron = 0x1a5 +Sacute = 0x1a6 +Scaron = 0x1a9 +Scedilla = 0x1aa +Tcaron = 0x1ab +Zacute = 0x1ac +Zcaron = 0x1ae +Zabovedot = 0x1af +aogonek = 0x1b1 +ogonek = 0x1b2 +lstroke = 0x1b3 +lcaron = 0x1b5 +sacute = 0x1b6 +caron = 0x1b7 +scaron = 0x1b9 +scedilla = 0x1ba +tcaron = 0x1bb +zacute = 0x1bc +doubleacute = 0x1bd +zcaron = 0x1be +zabovedot = 0x1bf +Racute = 0x1c0 +Abreve = 0x1c3 +Lacute = 0x1c5 +Cacute = 0x1c6 +Ccaron = 0x1c8 +Eogonek = 0x1ca +Ecaron = 0x1cc +Dcaron = 0x1cf +Dstroke = 0x1d0 +Nacute = 0x1d1 +Ncaron = 0x1d2 +Odoubleacute = 0x1d5 +Rcaron = 0x1d8 +Uring = 0x1d9 +Udoubleacute = 0x1db +Tcedilla = 0x1de +racute = 0x1e0 +abreve = 0x1e3 +lacute = 0x1e5 +cacute = 0x1e6 +ccaron = 0x1e8 +eogonek = 0x1ea +ecaron = 0x1ec +dcaron = 0x1ef +dstroke = 0x1f0 +nacute = 0x1f1 +ncaron = 0x1f2 +odoubleacute = 0x1f5 +udoubleacute = 0x1fb +rcaron = 0x1f8 +uring = 0x1f9 +tcedilla = 0x1fe +abovedot = 0x1ff +Hstroke = 0x2a1 +Hcircumflex = 0x2a6 +Iabovedot = 0x2a9 +Gbreve = 0x2ab +Jcircumflex = 0x2ac +hstroke = 0x2b1 +hcircumflex = 0x2b6 +idotless = 0x2b9 +gbreve = 0x2bb +jcircumflex = 0x2bc +Cabovedot = 0x2c5 +Ccircumflex = 0x2c6 +Gabovedot = 0x2d5 +Gcircumflex = 0x2d8 +Ubreve = 0x2dd +Scircumflex = 0x2de +cabovedot = 0x2e5 +ccircumflex = 0x2e6 +gabovedot = 0x2f5 +gcircumflex = 0x2f8 +ubreve = 0x2fd +scircumflex = 0x2fe +kra = 0x3a2 +kappa = 0x3a2 +Rcedilla = 0x3a3 +Itilde = 0x3a5 +Lcedilla = 0x3a6 +Emacron = 0x3aa +Gcedilla = 0x3ab +Tslash = 0x3ac +rcedilla = 0x3b3 +itilde = 0x3b5 +lcedilla = 0x3b6 +emacron = 0x3ba +gcedilla = 0x3bb +tslash = 0x3bc +ENG = 0x3bd +eng = 0x3bf +Amacron = 0x3c0 +Iogonek = 0x3c7 +Eabovedot = 0x3cc +Imacron = 0x3cf +Ncedilla = 0x3d1 +Omacron = 0x3d2 +Kcedilla = 0x3d3 +Uogonek = 0x3d9 +Utilde = 0x3dd +Umacron = 0x3de +amacron = 0x3e0 +iogonek = 0x3e7 +eabovedot = 0x3ec +imacron = 0x3ef +ncedilla = 0x3f1 +omacron = 0x3f2 +kcedilla = 0x3f3 +uogonek = 0x3f9 +utilde = 0x3fd +umacron = 0x3fe +OE = 0x13bc +oe = 0x13bd +Ydiaeresis = 0x13be +overline = 0x47e +kana_fullstop = 0x4a1 +kana_openingbracket = 0x4a2 +kana_closingbracket = 0x4a3 +kana_comma = 0x4a4 +kana_conjunctive = 0x4a5 +kana_middledot = 0x4a5 +kana_WO = 0x4a6 +kana_a = 0x4a7 +kana_i = 0x4a8 +kana_u = 0x4a9 +kana_e = 0x4aa +kana_o = 0x4ab +kana_ya = 0x4ac +kana_yu = 0x4ad +kana_yo = 0x4ae +kana_tsu = 0x4af +kana_tu = 0x4af +prolongedsound = 0x4b0 +kana_A = 0x4b1 +kana_I = 0x4b2 +kana_U = 0x4b3 +kana_E = 0x4b4 +kana_O = 0x4b5 +kana_KA = 0x4b6 +kana_KI = 0x4b7 +kana_KU = 0x4b8 +kana_KE = 0x4b9 +kana_KO = 0x4ba +kana_SA = 0x4bb +kana_SHI = 0x4bc +kana_SU = 0x4bd +kana_SE = 0x4be +kana_SO = 0x4bf +kana_TA = 0x4c0 +kana_CHI = 0x4c1 +kana_TI = 0x4c1 +kana_TSU = 0x4c2 +kana_TU = 0x4c2 +kana_TE = 0x4c3 +kana_TO = 0x4c4 +kana_NA = 0x4c5 +kana_NI = 0x4c6 +kana_NU = 0x4c7 +kana_NE = 0x4c8 +kana_NO = 0x4c9 +kana_HA = 0x4ca +kana_HI = 0x4cb +kana_FU = 0x4cc +kana_HU = 0x4cc +kana_HE = 0x4cd +kana_HO = 0x4ce +kana_MA = 0x4cf +kana_MI = 0x4d0 +kana_MU = 0x4d1 +kana_ME = 0x4d2 +kana_MO = 0x4d3 +kana_YA = 0x4d4 +kana_YU = 0x4d5 +kana_YO = 0x4d6 +kana_RA = 0x4d7 +kana_RI = 0x4d8 +kana_RU = 0x4d9 +kana_RE = 0x4da +kana_RO = 0x4db +kana_WA = 0x4dc +kana_N = 0x4dd +voicedsound = 0x4de +semivoicedsound = 0x4df +kana_switch = 0xFF7E +Arabic_comma = 0x5ac +Arabic_semicolon = 0x5bb +Arabic_question_mark = 0x5bf +Arabic_hamza = 0x5c1 +Arabic_maddaonalef = 0x5c2 +Arabic_hamzaonalef = 0x5c3 +Arabic_hamzaonwaw = 0x5c4 +Arabic_hamzaunderalef = 0x5c5 +Arabic_hamzaonyeh = 0x5c6 +Arabic_alef = 0x5c7 +Arabic_beh = 0x5c8 +Arabic_tehmarbuta = 0x5c9 +Arabic_teh = 0x5ca +Arabic_theh = 0x5cb +Arabic_jeem = 0x5cc +Arabic_hah = 0x5cd +Arabic_khah = 0x5ce +Arabic_dal = 0x5cf +Arabic_thal = 0x5d0 +Arabic_ra = 0x5d1 +Arabic_zain = 0x5d2 +Arabic_seen = 0x5d3 +Arabic_sheen = 0x5d4 +Arabic_sad = 0x5d5 +Arabic_dad = 0x5d6 +Arabic_tah = 0x5d7 +Arabic_zah = 0x5d8 +Arabic_ain = 0x5d9 +Arabic_ghain = 0x5da +Arabic_tatweel = 0x5e0 +Arabic_feh = 0x5e1 +Arabic_qaf = 0x5e2 +Arabic_kaf = 0x5e3 +Arabic_lam = 0x5e4 +Arabic_meem = 0x5e5 +Arabic_noon = 0x5e6 +Arabic_ha = 0x5e7 +Arabic_heh = 0x5e7 +Arabic_waw = 0x5e8 +Arabic_alefmaksura = 0x5e9 +Arabic_yeh = 0x5ea +Arabic_fathatan = 0x5eb +Arabic_dammatan = 0x5ec +Arabic_kasratan = 0x5ed +Arabic_fatha = 0x5ee +Arabic_damma = 0x5ef +Arabic_kasra = 0x5f0 +Arabic_shadda = 0x5f1 +Arabic_sukun = 0x5f2 +Arabic_switch = 0xFF7E +Serbian_dje = 0x6a1 +Macedonia_gje = 0x6a2 +Cyrillic_io = 0x6a3 +Ukrainian_ie = 0x6a4 +Ukranian_je = 0x6a4 +Macedonia_dse = 0x6a5 +Ukrainian_i = 0x6a6 +Ukranian_i = 0x6a6 +Ukrainian_yi = 0x6a7 +Ukranian_yi = 0x6a7 +Cyrillic_je = 0x6a8 +Serbian_je = 0x6a8 +Cyrillic_lje = 0x6a9 +Serbian_lje = 0x6a9 +Cyrillic_nje = 0x6aa +Serbian_nje = 0x6aa +Serbian_tshe = 0x6ab +Macedonia_kje = 0x6ac +Ukrainian_ghe_with_upturn = 0x6ad +Byelorussian_shortu = 0x6ae +Cyrillic_dzhe = 0x6af +Serbian_dze = 0x6af +numerosign = 0x6b0 +Serbian_DJE = 0x6b1 +Macedonia_GJE = 0x6b2 +Cyrillic_IO = 0x6b3 +Ukrainian_IE = 0x6b4 +Ukranian_JE = 0x6b4 +Macedonia_DSE = 0x6b5 +Ukrainian_I = 0x6b6 +Ukranian_I = 0x6b6 +Ukrainian_YI = 0x6b7 +Ukranian_YI = 0x6b7 +Cyrillic_JE = 0x6b8 +Serbian_JE = 0x6b8 +Cyrillic_LJE = 0x6b9 +Serbian_LJE = 0x6b9 +Cyrillic_NJE = 0x6ba +Serbian_NJE = 0x6ba +Serbian_TSHE = 0x6bb +Macedonia_KJE = 0x6bc +Ukrainian_GHE_WITH_UPTURN = 0x6bd +Byelorussian_SHORTU = 0x6be +Cyrillic_DZHE = 0x6bf +Serbian_DZE = 0x6bf +Cyrillic_yu = 0x6c0 +Cyrillic_a = 0x6c1 +Cyrillic_be = 0x6c2 +Cyrillic_tse = 0x6c3 +Cyrillic_de = 0x6c4 +Cyrillic_ie = 0x6c5 +Cyrillic_ef = 0x6c6 +Cyrillic_ghe = 0x6c7 +Cyrillic_ha = 0x6c8 +Cyrillic_i = 0x6c9 +Cyrillic_shorti = 0x6ca +Cyrillic_ka = 0x6cb +Cyrillic_el = 0x6cc +Cyrillic_em = 0x6cd +Cyrillic_en = 0x6ce +Cyrillic_o = 0x6cf +Cyrillic_pe = 0x6d0 +Cyrillic_ya = 0x6d1 +Cyrillic_er = 0x6d2 +Cyrillic_es = 0x6d3 +Cyrillic_te = 0x6d4 +Cyrillic_u = 0x6d5 +Cyrillic_zhe = 0x6d6 +Cyrillic_ve = 0x6d7 +Cyrillic_softsign = 0x6d8 +Cyrillic_yeru = 0x6d9 +Cyrillic_ze = 0x6da +Cyrillic_sha = 0x6db +Cyrillic_e = 0x6dc +Cyrillic_shcha = 0x6dd +Cyrillic_che = 0x6de +Cyrillic_hardsign = 0x6df +Cyrillic_YU = 0x6e0 +Cyrillic_A = 0x6e1 +Cyrillic_BE = 0x6e2 +Cyrillic_TSE = 0x6e3 +Cyrillic_DE = 0x6e4 +Cyrillic_IE = 0x6e5 +Cyrillic_EF = 0x6e6 +Cyrillic_GHE = 0x6e7 +Cyrillic_HA = 0x6e8 +Cyrillic_I = 0x6e9 +Cyrillic_SHORTI = 0x6ea +Cyrillic_KA = 0x6eb +Cyrillic_EL = 0x6ec +Cyrillic_EM = 0x6ed +Cyrillic_EN = 0x6ee +Cyrillic_O = 0x6ef +Cyrillic_PE = 0x6f0 +Cyrillic_YA = 0x6f1 +Cyrillic_ER = 0x6f2 +Cyrillic_ES = 0x6f3 +Cyrillic_TE = 0x6f4 +Cyrillic_U = 0x6f5 +Cyrillic_ZHE = 0x6f6 +Cyrillic_VE = 0x6f7 +Cyrillic_SOFTSIGN = 0x6f8 +Cyrillic_YERU = 0x6f9 +Cyrillic_ZE = 0x6fa +Cyrillic_SHA = 0x6fb +Cyrillic_E = 0x6fc +Cyrillic_SHCHA = 0x6fd +Cyrillic_CHE = 0x6fe +Cyrillic_HARDSIGN = 0x6ff +Greek_ALPHAaccent = 0x7a1 +Greek_EPSILONaccent = 0x7a2 +Greek_ETAaccent = 0x7a3 +Greek_IOTAaccent = 0x7a4 +Greek_IOTAdiaeresis = 0x7a5 +Greek_OMICRONaccent = 0x7a7 +Greek_UPSILONaccent = 0x7a8 +Greek_UPSILONdieresis = 0x7a9 +Greek_OMEGAaccent = 0x7ab +Greek_accentdieresis = 0x7ae +Greek_horizbar = 0x7af +Greek_alphaaccent = 0x7b1 +Greek_epsilonaccent = 0x7b2 +Greek_etaaccent = 0x7b3 +Greek_iotaaccent = 0x7b4 +Greek_iotadieresis = 0x7b5 +Greek_iotaaccentdieresis = 0x7b6 +Greek_omicronaccent = 0x7b7 +Greek_upsilonaccent = 0x7b8 +Greek_upsilondieresis = 0x7b9 +Greek_upsilonaccentdieresis = 0x7ba +Greek_omegaaccent = 0x7bb +Greek_ALPHA = 0x7c1 +Greek_BETA = 0x7c2 +Greek_GAMMA = 0x7c3 +Greek_DELTA = 0x7c4 +Greek_EPSILON = 0x7c5 +Greek_ZETA = 0x7c6 +Greek_ETA = 0x7c7 +Greek_THETA = 0x7c8 +Greek_IOTA = 0x7c9 +Greek_KAPPA = 0x7ca +Greek_LAMDA = 0x7cb +Greek_LAMBDA = 0x7cb +Greek_MU = 0x7cc +Greek_NU = 0x7cd +Greek_XI = 0x7ce +Greek_OMICRON = 0x7cf +Greek_PI = 0x7d0 +Greek_RHO = 0x7d1 +Greek_SIGMA = 0x7d2 +Greek_TAU = 0x7d4 +Greek_UPSILON = 0x7d5 +Greek_PHI = 0x7d6 +Greek_CHI = 0x7d7 +Greek_PSI = 0x7d8 +Greek_OMEGA = 0x7d9 +Greek_alpha = 0x7e1 +Greek_beta = 0x7e2 +Greek_gamma = 0x7e3 +Greek_delta = 0x7e4 +Greek_epsilon = 0x7e5 +Greek_zeta = 0x7e6 +Greek_eta = 0x7e7 +Greek_theta = 0x7e8 +Greek_iota = 0x7e9 +Greek_kappa = 0x7ea +Greek_lamda = 0x7eb +Greek_lambda = 0x7eb +Greek_mu = 0x7ec +Greek_nu = 0x7ed +Greek_xi = 0x7ee +Greek_omicron = 0x7ef +Greek_pi = 0x7f0 +Greek_rho = 0x7f1 +Greek_sigma = 0x7f2 +Greek_finalsmallsigma = 0x7f3 +Greek_tau = 0x7f4 +Greek_upsilon = 0x7f5 +Greek_phi = 0x7f6 +Greek_chi = 0x7f7 +Greek_psi = 0x7f8 +Greek_omega = 0x7f9 +Greek_switch = 0xFF7E +leftradical = 0x8a1 +topleftradical = 0x8a2 +horizconnector = 0x8a3 +topintegral = 0x8a4 +botintegral = 0x8a5 +vertconnector = 0x8a6 +topleftsqbracket = 0x8a7 +botleftsqbracket = 0x8a8 +toprightsqbracket = 0x8a9 +botrightsqbracket = 0x8aa +topleftparens = 0x8ab +botleftparens = 0x8ac +toprightparens = 0x8ad +botrightparens = 0x8ae +leftmiddlecurlybrace = 0x8af +rightmiddlecurlybrace = 0x8b0 +topleftsummation = 0x8b1 +botleftsummation = 0x8b2 +topvertsummationconnector = 0x8b3 +botvertsummationconnector = 0x8b4 +toprightsummation = 0x8b5 +botrightsummation = 0x8b6 +rightmiddlesummation = 0x8b7 +lessthanequal = 0x8bc +notequal = 0x8bd +greaterthanequal = 0x8be +integral = 0x8bf +therefore = 0x8c0 +variation = 0x8c1 +infinity = 0x8c2 +nabla = 0x8c5 +approximate = 0x8c8 +similarequal = 0x8c9 +ifonlyif = 0x8cd +implies = 0x8ce +identical = 0x8cf +radical = 0x8d6 +includedin = 0x8da +includes = 0x8db +intersection = 0x8dc +union = 0x8dd +logicaland = 0x8de +logicalor = 0x8df +partialderivative = 0x8ef +function = 0x8f6 +leftarrow = 0x8fb +uparrow = 0x8fc +rightarrow = 0x8fd +downarrow = 0x8fe +blank = 0x9df +soliddiamond = 0x9e0 +checkerboard = 0x9e1 +ht = 0x9e2 +ff = 0x9e3 +cr = 0x9e4 +lf = 0x9e5 +nl = 0x9e8 +vt = 0x9e9 +lowrightcorner = 0x9ea +uprightcorner = 0x9eb +upleftcorner = 0x9ec +lowleftcorner = 0x9ed +crossinglines = 0x9ee +horizlinescan1 = 0x9ef +horizlinescan3 = 0x9f0 +horizlinescan5 = 0x9f1 +horizlinescan7 = 0x9f2 +horizlinescan9 = 0x9f3 +leftt = 0x9f4 +rightt = 0x9f5 +bott = 0x9f6 +topt = 0x9f7 +vertbar = 0x9f8 +emspace = 0xaa1 +enspace = 0xaa2 +em3space = 0xaa3 +em4space = 0xaa4 +digitspace = 0xaa5 +punctspace = 0xaa6 +thinspace = 0xaa7 +hairspace = 0xaa8 +emdash = 0xaa9 +endash = 0xaaa +signifblank = 0xaac +ellipsis = 0xaae +doubbaselinedot = 0xaaf +onethird = 0xab0 +twothirds = 0xab1 +onefifth = 0xab2 +twofifths = 0xab3 +threefifths = 0xab4 +fourfifths = 0xab5 +onesixth = 0xab6 +fivesixths = 0xab7 +careof = 0xab8 +figdash = 0xabb +leftanglebracket = 0xabc +decimalpoint = 0xabd +rightanglebracket = 0xabe +marker = 0xabf +oneeighth = 0xac3 +threeeighths = 0xac4 +fiveeighths = 0xac5 +seveneighths = 0xac6 +trademark = 0xac9 +signaturemark = 0xaca +trademarkincircle = 0xacb +leftopentriangle = 0xacc +rightopentriangle = 0xacd +emopencircle = 0xace +emopenrectangle = 0xacf +leftsinglequotemark = 0xad0 +rightsinglequotemark = 0xad1 +leftdoublequotemark = 0xad2 +rightdoublequotemark = 0xad3 +prescription = 0xad4 +minutes = 0xad6 +seconds = 0xad7 +latincross = 0xad9 +hexagram = 0xada +filledrectbullet = 0xadb +filledlefttribullet = 0xadc +filledrighttribullet = 0xadd +emfilledcircle = 0xade +emfilledrect = 0xadf +enopencircbullet = 0xae0 +enopensquarebullet = 0xae1 +openrectbullet = 0xae2 +opentribulletup = 0xae3 +opentribulletdown = 0xae4 +openstar = 0xae5 +enfilledcircbullet = 0xae6 +enfilledsqbullet = 0xae7 +filledtribulletup = 0xae8 +filledtribulletdown = 0xae9 +leftpointer = 0xaea +rightpointer = 0xaeb +club = 0xaec +diamond = 0xaed +heart = 0xaee +maltesecross = 0xaf0 +dagger = 0xaf1 +doubledagger = 0xaf2 +checkmark = 0xaf3 +ballotcross = 0xaf4 +musicalsharp = 0xaf5 +musicalflat = 0xaf6 +malesymbol = 0xaf7 +femalesymbol = 0xaf8 +telephone = 0xaf9 +telephonerecorder = 0xafa +phonographcopyright = 0xafb +caret = 0xafc +singlelowquotemark = 0xafd +doublelowquotemark = 0xafe +cursor = 0xaff +leftcaret = 0xba3 +rightcaret = 0xba6 +downcaret = 0xba8 +upcaret = 0xba9 +overbar = 0xbc0 +downtack = 0xbc2 +upshoe = 0xbc3 +downstile = 0xbc4 +underbar = 0xbc6 +jot = 0xbca +quad = 0xbcc +uptack = 0xbce +circle = 0xbcf +upstile = 0xbd3 +downshoe = 0xbd6 +rightshoe = 0xbd8 +leftshoe = 0xbda +lefttack = 0xbdc +righttack = 0xbfc +hebrew_doublelowline = 0xcdf +hebrew_aleph = 0xce0 +hebrew_bet = 0xce1 +hebrew_beth = 0xce1 +hebrew_gimel = 0xce2 +hebrew_gimmel = 0xce2 +hebrew_dalet = 0xce3 +hebrew_daleth = 0xce3 +hebrew_he = 0xce4 +hebrew_waw = 0xce5 +hebrew_zain = 0xce6 +hebrew_zayin = 0xce6 +hebrew_chet = 0xce7 +hebrew_het = 0xce7 +hebrew_tet = 0xce8 +hebrew_teth = 0xce8 +hebrew_yod = 0xce9 +hebrew_finalkaph = 0xcea +hebrew_kaph = 0xceb +hebrew_lamed = 0xcec +hebrew_finalmem = 0xced +hebrew_mem = 0xcee +hebrew_finalnun = 0xcef +hebrew_nun = 0xcf0 +hebrew_samech = 0xcf1 +hebrew_samekh = 0xcf1 +hebrew_ayin = 0xcf2 +hebrew_finalpe = 0xcf3 +hebrew_pe = 0xcf4 +hebrew_finalzade = 0xcf5 +hebrew_finalzadi = 0xcf5 +hebrew_zade = 0xcf6 +hebrew_zadi = 0xcf6 +hebrew_qoph = 0xcf7 +hebrew_kuf = 0xcf7 +hebrew_resh = 0xcf8 +hebrew_shin = 0xcf9 +hebrew_taw = 0xcfa +hebrew_taf = 0xcfa +Hebrew_switch = 0xFF7E +Thai_kokai = 0xda1 +Thai_khokhai = 0xda2 +Thai_khokhuat = 0xda3 +Thai_khokhwai = 0xda4 +Thai_khokhon = 0xda5 +Thai_khorakhang = 0xda6 +Thai_ngongu = 0xda7 +Thai_chochan = 0xda8 +Thai_choching = 0xda9 +Thai_chochang = 0xdaa +Thai_soso = 0xdab +Thai_chochoe = 0xdac +Thai_yoying = 0xdad +Thai_dochada = 0xdae +Thai_topatak = 0xdaf +Thai_thothan = 0xdb0 +Thai_thonangmontho = 0xdb1 +Thai_thophuthao = 0xdb2 +Thai_nonen = 0xdb3 +Thai_dodek = 0xdb4 +Thai_totao = 0xdb5 +Thai_thothung = 0xdb6 +Thai_thothahan = 0xdb7 +Thai_thothong = 0xdb8 +Thai_nonu = 0xdb9 +Thai_bobaimai = 0xdba +Thai_popla = 0xdbb +Thai_phophung = 0xdbc +Thai_fofa = 0xdbd +Thai_phophan = 0xdbe +Thai_fofan = 0xdbf +Thai_phosamphao = 0xdc0 +Thai_moma = 0xdc1 +Thai_yoyak = 0xdc2 +Thai_rorua = 0xdc3 +Thai_ru = 0xdc4 +Thai_loling = 0xdc5 +Thai_lu = 0xdc6 +Thai_wowaen = 0xdc7 +Thai_sosala = 0xdc8 +Thai_sorusi = 0xdc9 +Thai_sosua = 0xdca +Thai_hohip = 0xdcb +Thai_lochula = 0xdcc +Thai_oang = 0xdcd +Thai_honokhuk = 0xdce +Thai_paiyannoi = 0xdcf +Thai_saraa = 0xdd0 +Thai_maihanakat = 0xdd1 +Thai_saraaa = 0xdd2 +Thai_saraam = 0xdd3 +Thai_sarai = 0xdd4 +Thai_saraii = 0xdd5 +Thai_saraue = 0xdd6 +Thai_sarauee = 0xdd7 +Thai_sarau = 0xdd8 +Thai_sarauu = 0xdd9 +Thai_phinthu = 0xdda +Thai_maihanakat_maitho = 0xdde +Thai_baht = 0xddf +Thai_sarae = 0xde0 +Thai_saraae = 0xde1 +Thai_sarao = 0xde2 +Thai_saraaimaimuan = 0xde3 +Thai_saraaimaimalai = 0xde4 +Thai_lakkhangyao = 0xde5 +Thai_maiyamok = 0xde6 +Thai_maitaikhu = 0xde7 +Thai_maiek = 0xde8 +Thai_maitho = 0xde9 +Thai_maitri = 0xdea +Thai_maichattawa = 0xdeb +Thai_thanthakhat = 0xdec +Thai_nikhahit = 0xded +Thai_leksun = 0xdf0 +Thai_leknung = 0xdf1 +Thai_leksong = 0xdf2 +Thai_leksam = 0xdf3 +Thai_leksi = 0xdf4 +Thai_lekha = 0xdf5 +Thai_lekhok = 0xdf6 +Thai_lekchet = 0xdf7 +Thai_lekpaet = 0xdf8 +Thai_lekkao = 0xdf9 +Hangul = 0xff31 +Hangul_Start = 0xff32 +Hangul_End = 0xff33 +Hangul_Hanja = 0xff34 +Hangul_Jamo = 0xff35 +Hangul_Romaja = 0xff36 +Hangul_Codeinput = 0xff37 +Hangul_Jeonja = 0xff38 +Hangul_Banja = 0xff39 +Hangul_PreHanja = 0xff3a +Hangul_PostHanja = 0xff3b +Hangul_SingleCandidate = 0xff3c +Hangul_MultipleCandidate = 0xff3d +Hangul_PreviousCandidate = 0xff3e +Hangul_Special = 0xff3f +Hangul_switch = 0xFF7E +Hangul_Kiyeog = 0xea1 +Hangul_SsangKiyeog = 0xea2 +Hangul_KiyeogSios = 0xea3 +Hangul_Nieun = 0xea4 +Hangul_NieunJieuj = 0xea5 +Hangul_NieunHieuh = 0xea6 +Hangul_Dikeud = 0xea7 +Hangul_SsangDikeud = 0xea8 +Hangul_Rieul = 0xea9 +Hangul_RieulKiyeog = 0xeaa +Hangul_RieulMieum = 0xeab +Hangul_RieulPieub = 0xeac +Hangul_RieulSios = 0xead +Hangul_RieulTieut = 0xeae +Hangul_RieulPhieuf = 0xeaf +Hangul_RieulHieuh = 0xeb0 +Hangul_Mieum = 0xeb1 +Hangul_Pieub = 0xeb2 +Hangul_SsangPieub = 0xeb3 +Hangul_PieubSios = 0xeb4 +Hangul_Sios = 0xeb5 +Hangul_SsangSios = 0xeb6 +Hangul_Ieung = 0xeb7 +Hangul_Jieuj = 0xeb8 +Hangul_SsangJieuj = 0xeb9 +Hangul_Cieuc = 0xeba +Hangul_Khieuq = 0xebb +Hangul_Tieut = 0xebc +Hangul_Phieuf = 0xebd +Hangul_Hieuh = 0xebe +Hangul_A = 0xebf +Hangul_AE = 0xec0 +Hangul_YA = 0xec1 +Hangul_YAE = 0xec2 +Hangul_EO = 0xec3 +Hangul_E = 0xec4 +Hangul_YEO = 0xec5 +Hangul_YE = 0xec6 +Hangul_O = 0xec7 +Hangul_WA = 0xec8 +Hangul_WAE = 0xec9 +Hangul_OE = 0xeca +Hangul_YO = 0xecb +Hangul_U = 0xecc +Hangul_WEO = 0xecd +Hangul_WE = 0xece +Hangul_WI = 0xecf +Hangul_YU = 0xed0 +Hangul_EU = 0xed1 +Hangul_YI = 0xed2 +Hangul_I = 0xed3 +Hangul_J_Kiyeog = 0xed4 +Hangul_J_SsangKiyeog = 0xed5 +Hangul_J_KiyeogSios = 0xed6 +Hangul_J_Nieun = 0xed7 +Hangul_J_NieunJieuj = 0xed8 +Hangul_J_NieunHieuh = 0xed9 +Hangul_J_Dikeud = 0xeda +Hangul_J_Rieul = 0xedb +Hangul_J_RieulKiyeog = 0xedc +Hangul_J_RieulMieum = 0xedd +Hangul_J_RieulPieub = 0xede +Hangul_J_RieulSios = 0xedf +Hangul_J_RieulTieut = 0xee0 +Hangul_J_RieulPhieuf = 0xee1 +Hangul_J_RieulHieuh = 0xee2 +Hangul_J_Mieum = 0xee3 +Hangul_J_Pieub = 0xee4 +Hangul_J_PieubSios = 0xee5 +Hangul_J_Sios = 0xee6 +Hangul_J_SsangSios = 0xee7 +Hangul_J_Ieung = 0xee8 +Hangul_J_Jieuj = 0xee9 +Hangul_J_Cieuc = 0xeea +Hangul_J_Khieuq = 0xeeb +Hangul_J_Tieut = 0xeec +Hangul_J_Phieuf = 0xeed +Hangul_J_Hieuh = 0xeee +Hangul_RieulYeorinHieuh = 0xeef +Hangul_SunkyeongeumMieum = 0xef0 +Hangul_SunkyeongeumPieub = 0xef1 +Hangul_PanSios = 0xef2 +Hangul_KkogjiDalrinIeung = 0xef3 +Hangul_SunkyeongeumPhieuf = 0xef4 +Hangul_YeorinHieuh = 0xef5 +Hangul_AraeA = 0xef6 +Hangul_AraeAE = 0xef7 +Hangul_J_PanSios = 0xef8 +Hangul_J_KkogjiDalrinIeung = 0xef9 +Hangul_J_YeorinHieuh = 0xefa +Korean_Won = 0xeff +Armenian_eternity = 0x14a1 +Armenian_section_sign = 0x14a2 +Armenian_full_stop = 0x14a3 +Armenian_verjaket = 0x14a3 +Armenian_parenright = 0x14a4 +Armenian_parenleft = 0x14a5 +Armenian_guillemotright = 0x14a6 +Armenian_guillemotleft = 0x14a7 +Armenian_em_dash = 0x14a8 +Armenian_dot = 0x14a9 +Armenian_mijaket = 0x14a9 +Armenian_separation_mark = 0x14aa +Armenian_but = 0x14aa +Armenian_comma = 0x14ab +Armenian_en_dash = 0x14ac +Armenian_hyphen = 0x14ad +Armenian_yentamna = 0x14ad +Armenian_ellipsis = 0x14ae +Armenian_exclam = 0x14af +Armenian_amanak = 0x14af +Armenian_accent = 0x14b0 +Armenian_shesht = 0x14b0 +Armenian_question = 0x14b1 +Armenian_paruyk = 0x14b1 +Armenian_AYB = 0x14b2 +Armenian_ayb = 0x14b3 +Armenian_BEN = 0x14b4 +Armenian_ben = 0x14b5 +Armenian_GIM = 0x14b6 +Armenian_gim = 0x14b7 +Armenian_DA = 0x14b8 +Armenian_da = 0x14b9 +Armenian_YECH = 0x14ba +Armenian_yech = 0x14bb +Armenian_ZA = 0x14bc +Armenian_za = 0x14bd +Armenian_E = 0x14be +Armenian_e = 0x14bf +Armenian_AT = 0x14c0 +Armenian_at = 0x14c1 +Armenian_TO = 0x14c2 +Armenian_to = 0x14c3 +Armenian_ZHE = 0x14c4 +Armenian_zhe = 0x14c5 +Armenian_INI = 0x14c6 +Armenian_ini = 0x14c7 +Armenian_LYUN = 0x14c8 +Armenian_lyun = 0x14c9 +Armenian_KHE = 0x14ca +Armenian_khe = 0x14cb +Armenian_TSA = 0x14cc +Armenian_tsa = 0x14cd +Armenian_KEN = 0x14ce +Armenian_ken = 0x14cf +Armenian_HO = 0x14d0 +Armenian_ho = 0x14d1 +Armenian_DZA = 0x14d2 +Armenian_dza = 0x14d3 +Armenian_GHAT = 0x14d4 +Armenian_ghat = 0x14d5 +Armenian_TCHE = 0x14d6 +Armenian_tche = 0x14d7 +Armenian_MEN = 0x14d8 +Armenian_men = 0x14d9 +Armenian_HI = 0x14da +Armenian_hi = 0x14db +Armenian_NU = 0x14dc +Armenian_nu = 0x14dd +Armenian_SHA = 0x14de +Armenian_sha = 0x14df +Armenian_VO = 0x14e0 +Armenian_vo = 0x14e1 +Armenian_CHA = 0x14e2 +Armenian_cha = 0x14e3 +Armenian_PE = 0x14e4 +Armenian_pe = 0x14e5 +Armenian_JE = 0x14e6 +Armenian_je = 0x14e7 +Armenian_RA = 0x14e8 +Armenian_ra = 0x14e9 +Armenian_SE = 0x14ea +Armenian_se = 0x14eb +Armenian_VEV = 0x14ec +Armenian_vev = 0x14ed +Armenian_TYUN = 0x14ee +Armenian_tyun = 0x14ef +Armenian_RE = 0x14f0 +Armenian_re = 0x14f1 +Armenian_TSO = 0x14f2 +Armenian_tso = 0x14f3 +Armenian_VYUN = 0x14f4 +Armenian_vyun = 0x14f5 +Armenian_PYUR = 0x14f6 +Armenian_pyur = 0x14f7 +Armenian_KE = 0x14f8 +Armenian_ke = 0x14f9 +Armenian_O = 0x14fa +Armenian_o = 0x14fb +Armenian_FE = 0x14fc +Armenian_fe = 0x14fd +Armenian_apostrophe = 0x14fe +Armenian_ligature_ew = 0x14ff +Georgian_an = 0x15d0 +Georgian_ban = 0x15d1 +Georgian_gan = 0x15d2 +Georgian_don = 0x15d3 +Georgian_en = 0x15d4 +Georgian_vin = 0x15d5 +Georgian_zen = 0x15d6 +Georgian_tan = 0x15d7 +Georgian_in = 0x15d8 +Georgian_kan = 0x15d9 +Georgian_las = 0x15da +Georgian_man = 0x15db +Georgian_nar = 0x15dc +Georgian_on = 0x15dd +Georgian_par = 0x15de +Georgian_zhar = 0x15df +Georgian_rae = 0x15e0 +Georgian_san = 0x15e1 +Georgian_tar = 0x15e2 +Georgian_un = 0x15e3 +Georgian_phar = 0x15e4 +Georgian_khar = 0x15e5 +Georgian_ghan = 0x15e6 +Georgian_qar = 0x15e7 +Georgian_shin = 0x15e8 +Georgian_chin = 0x15e9 +Georgian_can = 0x15ea +Georgian_jil = 0x15eb +Georgian_cil = 0x15ec +Georgian_char = 0x15ed +Georgian_xan = 0x15ee +Georgian_jhan = 0x15ef +Georgian_hae = 0x15f0 +Georgian_he = 0x15f1 +Georgian_hie = 0x15f2 +Georgian_we = 0x15f3 +Georgian_har = 0x15f4 +Georgian_hoe = 0x15f5 +Georgian_fi = 0x15f6 +EcuSign = 0x20a0 +ColonSign = 0x20a1 +CruzeiroSign = 0x20a2 +FFrancSign = 0x20a3 +LiraSign = 0x20a4 +MillSign = 0x20a5 +NairaSign = 0x20a6 +PesetaSign = 0x20a7 +RupeeSign = 0x20a8 +WonSign = 0x20a9 +NewSheqelSign = 0x20aa +DongSign = 0x20ab +EuroSign = 0x20ac diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c new file mode 100644 index 0000000..a9b5b60 --- /dev/null +++ b/gi/pygi-argument.c @@ -0,0 +1,2154 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * pygi-argument.c: GIArgument - PyObject conversion functions. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +#include +#include + +#include +#include +#include + +static void +_pygi_g_type_tag_py_bounds (GITypeTag type_tag, + PyObject **lower, + PyObject **upper) +{ + switch (type_tag) { + case GI_TYPE_TAG_INT8: + *lower = PYGLIB_PyLong_FromLong (-128); + *upper = PYGLIB_PyLong_FromLong (127); + break; + case GI_TYPE_TAG_UINT8: + *upper = PYGLIB_PyLong_FromLong (255); + *lower = PYGLIB_PyLong_FromLong (0); + break; + case GI_TYPE_TAG_INT16: + *lower = PYGLIB_PyLong_FromLong (-32768); + *upper = PYGLIB_PyLong_FromLong (32767); + break; + case GI_TYPE_TAG_UINT16: + *upper = PYGLIB_PyLong_FromLong (65535); + *lower = PYGLIB_PyLong_FromLong (0); + break; + case GI_TYPE_TAG_INT32: + *lower = PYGLIB_PyLong_FromLong (G_MININT32); + *upper = PYGLIB_PyLong_FromLong (G_MAXINT32); + break; + case GI_TYPE_TAG_UINT32: + /* Note: On 32-bit archs, this number doesn't fit in a long. */ + *upper = PyLong_FromLongLong (G_MAXUINT32); + *lower = PYGLIB_PyLong_FromLong (0); + break; + case GI_TYPE_TAG_INT64: + /* Note: On 32-bit archs, these numbers don't fit in a long. */ + *lower = PyLong_FromLongLong (G_MININT64); + *upper = PyLong_FromLongLong (G_MAXINT64); + break; + case GI_TYPE_TAG_UINT64: + *upper = PyLong_FromUnsignedLongLong (G_MAXUINT64); + *lower = PYGLIB_PyLong_FromLong (0); + break; + case GI_TYPE_TAG_FLOAT: + *upper = PyFloat_FromDouble (G_MAXFLOAT); + *lower = PyFloat_FromDouble (-G_MAXFLOAT); + break; + case GI_TYPE_TAG_DOUBLE: + *upper = PyFloat_FromDouble (G_MAXDOUBLE); + *lower = PyFloat_FromDouble (-G_MAXDOUBLE); + break; + default: + PyErr_SetString (PyExc_TypeError, "Non-numeric type tag"); + *lower = *upper = NULL; + return; + } +} + +gint +_pygi_g_registered_type_info_check_object (GIRegisteredTypeInfo *info, + gboolean is_instance, + PyObject *object) +{ + gint retval; + + GType g_type; + PyObject *py_type; + gchar *type_name_expected = NULL; + GIInfoType interface_type; + + interface_type = g_base_info_get_type (info); + if ( (interface_type == GI_INFO_TYPE_STRUCT) && + (g_struct_info_is_foreign ( (GIStructInfo*) info))) { + /* TODO: Could we check is the correct foreign type? */ + return 1; + } + + g_type = g_registered_type_info_get_g_type (info); + if (g_type != G_TYPE_NONE) { + py_type = _pygi_type_get_from_g_type (g_type); + } else { + py_type = _pygi_type_import_by_gi_info ( (GIBaseInfo *) info); + } + + if (py_type == NULL) { + return 0; + } + + g_assert (PyType_Check (py_type)); + + if (is_instance) { + retval = PyObject_IsInstance (object, py_type); + if (!retval) { + type_name_expected = _pygi_g_base_info_get_fullname ( + (GIBaseInfo *) info); + } + } else { + if (!PyObject_Type (py_type)) { + type_name_expected = "type"; + retval = 0; + } else if (!PyType_IsSubtype ( (PyTypeObject *) object, + (PyTypeObject *) py_type)) { + type_name_expected = _pygi_g_base_info_get_fullname ( + (GIBaseInfo *) info); + retval = 0; + } else { + retval = 1; + } + } + + Py_DECREF (py_type); + + if (!retval) { + PyTypeObject *object_type; + + if (type_name_expected == NULL) { + return -1; + } + + object_type = (PyTypeObject *) PyObject_Type (object); + if (object_type == NULL) { + return -1; + } + + PyErr_Format (PyExc_TypeError, "Must be %s, not %s", + type_name_expected, object_type->tp_name); + + g_free (type_name_expected); + } + + return retval; +} + +gint +_pygi_g_type_interface_check_object (GIBaseInfo *info, + PyObject *object) +{ + gint retval = 1; + GIInfoType info_type; + + info_type = g_base_info_get_type (info); + switch (info_type) { + case GI_INFO_TYPE_CALLBACK: + if (!PyCallable_Check (object)) { + PyErr_Format (PyExc_TypeError, "Must be callable, not %s", + object->ob_type->tp_name); + retval = 0; + } + break; + case GI_INFO_TYPE_ENUM: + retval = 0; + if (PyNumber_Check (object)) { + PyObject *number = PYGLIB_PyNumber_Long (object); + if (number == NULL) + PyErr_Clear(); + else { + glong value = PYGLIB_PyLong_AsLong (number); + int i; + for (i = 0; i < g_enum_info_get_n_values (info); i++) { + GIValueInfo *value_info = g_enum_info_get_value (info, i); + glong enum_value = g_value_info_get_value (value_info); + g_base_info_unref (value_info); + if (value == enum_value) { + retval = 1; + break; + } + } + } + } + if (retval < 1) + retval = _pygi_g_registered_type_info_check_object ( + (GIRegisteredTypeInfo *) info, TRUE, object); + break; + case GI_INFO_TYPE_FLAGS: + if (PyNumber_Check (object)) { + /* Accept 0 as a valid flag value */ + PyObject *number = PYGLIB_PyNumber_Long (object); + if (number == NULL) + PyErr_Clear(); + else { + long value = PYGLIB_PyLong_AsLong (number); + if (value == 0) + break; + else if (value == -1) + PyErr_Clear(); + } + } + retval = _pygi_g_registered_type_info_check_object ( + (GIRegisteredTypeInfo *) info, TRUE, object); + break; + case GI_INFO_TYPE_STRUCT: + { + GType type; + + /* Handle special cases. */ + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info); + if (g_type_is_a (type, G_TYPE_CLOSURE)) { + if (!(PyCallable_Check (object) || + pyg_type_from_object_strict (object, FALSE) == G_TYPE_CLOSURE)) { + PyErr_Format (PyExc_TypeError, "Must be callable, not %s", + object->ob_type->tp_name); + retval = 0; + } + break; + } else if (g_type_is_a (type, G_TYPE_VALUE)) { + /* we can't check g_values because we don't have + * enough context so just pass them through */ + break; + } + + /* Fallback. */ + } + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_OBJECT: + retval = _pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) info, TRUE, object); + break; + case GI_INFO_TYPE_UNION: + + + retval = _pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) info, TRUE, object); + + /* If not the same type then check to see if the object's type + * is the same as one of the union's members + */ + if (retval == 0) { + gint i; + gint n_fields; + + n_fields = g_union_info_get_n_fields ( (GIUnionInfo *) info); + + for (i = 0; i < n_fields; i++) { + gint member_retval; + GIFieldInfo *field_info; + GITypeInfo *field_type_info; + + field_info = + g_union_info_get_field ( (GIUnionInfo *) info, i); + field_type_info = g_field_info_get_type (field_info); + + member_retval = _pygi_g_type_info_check_object( + field_type_info, + object, + TRUE); + + g_base_info_unref ( ( GIBaseInfo *) field_type_info); + g_base_info_unref ( ( GIBaseInfo *) field_info); + + if (member_retval == 1) { + retval = member_retval; + break; + } + } + } + + break; + default: + g_assert_not_reached(); + } + + return retval; +} + +gint +_pygi_g_type_info_check_object (GITypeInfo *type_info, + PyObject *object, + gboolean allow_none) +{ + GITypeTag type_tag; + gint retval = 1; + + if (allow_none && object == Py_None) { + return retval; + } + + type_tag = g_type_info_get_tag (type_info); + + switch (type_tag) { + case GI_TYPE_TAG_VOID: + /* No check; VOID means undefined type */ + break; + case GI_TYPE_TAG_BOOLEAN: + /* No check; every Python object has a truth value. */ + break; + case GI_TYPE_TAG_UINT8: + /* UINT8 types can be characters */ + if (PYGLIB_PyBytes_Check(object)) { + if (PYGLIB_PyBytes_Size(object) != 1) { + PyErr_Format (PyExc_TypeError, "Must be a single character"); + retval = 0; + break; + } + + break; + } + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_INT64: + case GI_TYPE_TAG_UINT64: + case GI_TYPE_TAG_FLOAT: + case GI_TYPE_TAG_DOUBLE: + { + PyObject *number, *lower, *upper; + + if (!PyNumber_Check (object)) { + PyErr_Format (PyExc_TypeError, "Must be number, not %s", + object->ob_type->tp_name); + retval = 0; + break; + } + + if (type_tag == GI_TYPE_TAG_FLOAT || type_tag == GI_TYPE_TAG_DOUBLE) { + number = PyNumber_Float (object); + } else { + number = PYGLIB_PyNumber_Long (object); + } + + _pygi_g_type_tag_py_bounds (type_tag, &lower, &upper); + + if (lower == NULL || upper == NULL || number == NULL) { + retval = -1; + goto check_number_release; + } + + /* Check bounds */ + if (PyObject_RichCompareBool (lower, number, Py_GT) + || PyObject_RichCompareBool (upper, number, Py_LT)) { + PyObject *lower_str; + PyObject *upper_str; + + if (PyErr_Occurred()) { + retval = -1; + goto check_number_release; + } + + lower_str = PyObject_Str (lower); + upper_str = PyObject_Str (upper); + if (lower_str == NULL || upper_str == NULL) { + retval = -1; + goto check_number_error_release; + } + +#if PY_VERSION_HEX < 0x03000000 + PyErr_Format (PyExc_ValueError, "Must range from %s to %s", + PyString_AS_STRING (lower_str), + PyString_AS_STRING (upper_str)); +#else + { + PyObject *lower_pybytes_obj = PyUnicode_AsUTF8String (lower_str); + if (!lower_pybytes_obj) + goto utf8_fail; + + PyObject *upper_pybytes_obj = PyUnicode_AsUTF8String (upper_str); + if (!upper_pybytes_obj) { + Py_DECREF(lower_pybytes_obj); + goto utf8_fail; + } + + PyErr_Format (PyExc_ValueError, "Must range from %s to %s", + PyBytes_AsString (lower_pybytes_obj), + PyBytes_AsString (upper_pybytes_obj)); + Py_DECREF (lower_pybytes_obj); + Py_DECREF (upper_pybytes_obj); + } +utf8_fail: +#endif + retval = 0; + +check_number_error_release: + Py_XDECREF (lower_str); + Py_XDECREF (upper_str); + } + +check_number_release: + Py_XDECREF (number); + Py_XDECREF (lower); + Py_XDECREF (upper); + break; + } + case GI_TYPE_TAG_GTYPE: + { + if (pyg_type_from_object (object) == 0) { + PyErr_Format (PyExc_TypeError, "Must be gobject.GType, not %s", + object->ob_type->tp_name); + retval = 0; + } + break; + } + case GI_TYPE_TAG_UNICHAR: + { + Py_ssize_t size; + if (PyUnicode_Check (object)) { + size = PyUnicode_GET_SIZE (object); +#if PY_VERSION_HEX < 0x03000000 + } else if (PyString_Check (object)) { + PyObject *pyuni = PyUnicode_FromEncodedObject (object, "UTF-8", "strict"); + size = PyUnicode_GET_SIZE (pyuni); + Py_DECREF(pyuni); +#endif + } else { + PyErr_Format (PyExc_TypeError, "Must be string, not %s", + object->ob_type->tp_name); + retval = 0; + break; + } + + if (size != 1) { + PyErr_Format (PyExc_TypeError, "Must be a one character string, not %ld characters", + size); + retval = 0; + break; + } + + break; + } + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + if (!PYGLIB_PyBaseString_Check (object) ) { + PyErr_Format (PyExc_TypeError, "Must be string, not %s", + object->ob_type->tp_name); + retval = 0; + } + break; + case GI_TYPE_TAG_ARRAY: + { + gssize fixed_size; + Py_ssize_t length; + GITypeInfo *item_type_info; + Py_ssize_t i; + + if (!PySequence_Check (object)) { + PyErr_Format (PyExc_TypeError, "Must be sequence, not %s", + object->ob_type->tp_name); + retval = 0; + break; + } + + length = PySequence_Length (object); + if (length < 0) { + retval = -1; + break; + } + + fixed_size = g_type_info_get_array_fixed_size (type_info); + if (fixed_size >= 0 && length != fixed_size) { + PyErr_Format (PyExc_ValueError, "Must contain %zd items, not %zd", + fixed_size, length); + retval = 0; + break; + } + + item_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (item_type_info != NULL); + + /* FIXME: This is insain. We really should only check the first + * object and perhaps have a debugging mode. Large arrays + * will cause apps to slow to a crawl. + */ + for (i = 0; i < length; i++) { + PyObject *item; + + item = PySequence_GetItem (object, i); + if (item == NULL) { + retval = -1; + break; + } + + retval = _pygi_g_type_info_check_object (item_type_info, item, TRUE); + + Py_DECREF (item); + + if (retval < 0) { + break; + } + if (!retval) { + _PyGI_ERROR_PREFIX ("Item %zd: ", i); + break; + } + } + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + + break; + } + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + + info = g_type_info_get_interface (type_info); + g_assert (info != NULL); + + retval = _pygi_g_type_interface_check_object(info, object); + + g_base_info_unref (info); + break; + } + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + { + Py_ssize_t length; + GITypeInfo *item_type_info; + Py_ssize_t i; + + if (!PySequence_Check (object)) { + PyErr_Format (PyExc_TypeError, "Must be sequence, not %s", + object->ob_type->tp_name); + retval = 0; + break; + } + + length = PySequence_Length (object); + if (length < 0) { + retval = -1; + break; + } + + item_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (item_type_info != NULL); + + for (i = 0; i < length; i++) { + PyObject *item; + + item = PySequence_GetItem (object, i); + if (item == NULL) { + retval = -1; + break; + } + + retval = _pygi_g_type_info_check_object (item_type_info, item, TRUE); + + Py_DECREF (item); + + if (retval < 0) { + break; + } + if (!retval) { + _PyGI_ERROR_PREFIX ("Item %zd: ", i); + break; + } + } + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + break; + } + case GI_TYPE_TAG_GHASH: + { + Py_ssize_t length; + PyObject *keys; + PyObject *values; + GITypeInfo *key_type_info; + GITypeInfo *value_type_info; + Py_ssize_t i; + + keys = PyMapping_Keys (object); + if (keys == NULL) { + PyErr_Format (PyExc_TypeError, "Must be mapping, not %s", + object->ob_type->tp_name); + retval = 0; + break; + } + + length = PyMapping_Length (object); + if (length < 0) { + Py_DECREF (keys); + retval = -1; + break; + } + + values = PyMapping_Values (object); + if (values == NULL) { + retval = -1; + Py_DECREF (keys); + break; + } + + key_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (key_type_info != NULL); + + value_type_info = g_type_info_get_param_type (type_info, 1); + g_assert (value_type_info != NULL); + + for (i = 0; i < length; i++) { + PyObject *key; + PyObject *value; + + key = PyList_GET_ITEM (keys, i); + value = PyList_GET_ITEM (values, i); + + retval = _pygi_g_type_info_check_object (key_type_info, key, TRUE); + if (retval < 0) { + break; + } + if (!retval) { + _PyGI_ERROR_PREFIX ("Key %zd :", i); + break; + } + + retval = _pygi_g_type_info_check_object (value_type_info, value, TRUE); + if (retval < 0) { + break; + } + if (!retval) { + _PyGI_ERROR_PREFIX ("Value %zd :", i); + break; + } + } + + g_base_info_unref ( (GIBaseInfo *) key_type_info); + g_base_info_unref ( (GIBaseInfo *) value_type_info); + Py_DECREF (values); + Py_DECREF (keys); + break; + } + case GI_TYPE_TAG_ERROR: + PyErr_SetString (PyExc_NotImplementedError, "Error marshalling is not supported yet"); + /* TODO */ + break; + } + + return retval; +} + +GArray * +_pygi_argument_to_array (GIArgument *arg, + GIArgument *args[], + GITypeInfo *type_info, + gboolean is_method) +{ + GITypeInfo *item_type_info; + gboolean is_zero_terminated; + gsize item_size; + gssize length; + GArray *g_array; + + if (arg->v_pointer == NULL) { + return NULL; + } + + is_zero_terminated = g_type_info_is_zero_terminated (type_info); + item_type_info = g_type_info_get_param_type (type_info, 0); + + item_size = _pygi_g_type_info_size (item_type_info); + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + + if (is_zero_terminated) { + length = g_strv_length (arg->v_pointer); + } else { + length = g_type_info_get_array_fixed_size (type_info); + if (length < 0) { + gint length_arg_pos; + + length_arg_pos = g_type_info_get_array_length (type_info); + g_assert (length_arg_pos >= 0); + + /* FIXME: Take into account the type of the argument. */ + length = args[length_arg_pos]->v_int; + } + } + + g_assert (length >= 0); + + g_array = g_array_new (is_zero_terminated, FALSE, item_size); + + g_array->data = arg->v_pointer; + g_array->len = length; + + return g_array; +} + +GIArgument +_pygi_argument_from_object (PyObject *object, + GITypeInfo *type_info, + GITransfer transfer) +{ + GIArgument arg; + GITypeTag type_tag; + + memset(&arg, 0, sizeof(GIArgument)); + type_tag = g_type_info_get_tag (type_info); + + switch (type_tag) { + case GI_TYPE_TAG_VOID: + g_warn_if_fail (transfer == GI_TRANSFER_NOTHING); + arg.v_pointer = object; + break; + case GI_TYPE_TAG_BOOLEAN: + { + arg.v_boolean = PyObject_IsTrue (object); + break; + } + case GI_TYPE_TAG_UINT8: + if (PYGLIB_PyBytes_Check(object)) { + arg.v_long = (long)(PYGLIB_PyBytes_AsString(object)[0]); + break; + } + + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_INT32: + { + PyObject *int_; + + int_ = PYGLIB_PyNumber_Long (object); + if (int_ == NULL) { + break; + } + + arg.v_long = PYGLIB_PyLong_AsLong (int_); + + Py_DECREF (int_); + + break; + } + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_UINT64: + { + PyObject *number; + guint64 value; + + number = PYGLIB_PyNumber_Long (object); + if (number == NULL) { + break; + } + +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check (number)) { + value = PyInt_AS_LONG (number); + } else +#endif + value = PyLong_AsUnsignedLongLong (number); + + arg.v_uint64 = value; + + Py_DECREF (number); + + break; + } + case GI_TYPE_TAG_INT64: + { + PyObject *number; + gint64 value; + + number = PYGLIB_PyNumber_Long (object); + if (number == NULL) { + break; + } + +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check (number)) { + value = PyInt_AS_LONG (number); + } else +#endif + value = PyLong_AsLongLong (number); + + arg.v_int64 = value; + + Py_DECREF (number); + + break; + } + case GI_TYPE_TAG_FLOAT: + { + PyObject *float_; + + float_ = PyNumber_Float (object); + if (float_ == NULL) { + break; + } + + arg.v_float = (float) PyFloat_AsDouble (float_); + Py_DECREF (float_); + + break; + } + case GI_TYPE_TAG_DOUBLE: + { + PyObject *float_; + + float_ = PyNumber_Float (object); + if (float_ == NULL) { + break; + } + + arg.v_double = PyFloat_AsDouble (float_); + Py_DECREF (float_); + + break; + } + case GI_TYPE_TAG_GTYPE: + { + arg.v_long = pyg_type_from_object (object); + + break; + } + case GI_TYPE_TAG_UNICHAR: + { + gchar *string; + + if (object == Py_None) { + arg.v_uint32 = 0; + break; + } + +#if PY_VERSION_HEX < 0x03000000 + if (PyUnicode_Check(object)) { + PyObject *pystr_obj = PyUnicode_AsUTF8String (object); + + if (!pystr_obj) + break; + + string = g_strdup(PyString_AsString (pystr_obj)); + Py_DECREF(pystr_obj); + } else { + string = g_strdup(PyString_AsString (object)); + } +#else + { + PyObject *pybytes_obj = PyUnicode_AsUTF8String (object); + if (!pybytes_obj) + break; + + string = g_strdup(PyBytes_AsString (pybytes_obj)); + Py_DECREF (pybytes_obj); + } +#endif + + arg.v_uint32 = g_utf8_get_char (string); + + break; + } + case GI_TYPE_TAG_UTF8: + { + gchar *string; + + if (object == Py_None) { + arg.v_string = NULL; + break; + } +#if PY_VERSION_HEX < 0x03000000 + if (PyUnicode_Check(object)) { + PyObject *pystr_obj = PyUnicode_AsUTF8String (object); + + if (!pystr_obj) + break; + + string = g_strdup(PyString_AsString (pystr_obj)); + Py_DECREF(pystr_obj); + } else { + string = g_strdup(PyString_AsString (object)); + } +#else + { + PyObject *pybytes_obj = PyUnicode_AsUTF8String (object); + if (!pybytes_obj) + break; + + string = g_strdup(PyBytes_AsString (pybytes_obj)); + Py_DECREF (pybytes_obj); + } +#endif + arg.v_string = string; + + break; + } + case GI_TYPE_TAG_FILENAME: + { + GError *error = NULL; + gchar *string; + +#if PY_VERSION_HEX < 0x03000000 + string = g_strdup(PyString_AsString (object)); +#else + { + PyObject *pybytes_obj = PyUnicode_AsUTF8String (object); + if (!pybytes_obj) + break; + + string = g_strdup(PyBytes_AsString (pybytes_obj)); + Py_DECREF (pybytes_obj); + } +#endif + + if (string == NULL) { + break; + } + + arg.v_string = g_filename_from_utf8 (string, -1, NULL, NULL, &error); + g_free(string); + + if (arg.v_string == NULL) { + PyErr_SetString (PyExc_Exception, error->message); + /* TODO: Convert the error to an exception. */ + } + + break; + } + case GI_TYPE_TAG_ARRAY: + { + Py_ssize_t length; + gboolean is_zero_terminated; + GITypeInfo *item_type_info; + gsize item_size; + GArray *array; + GITransfer item_transfer; + Py_ssize_t i; + + if (object == Py_None) { + arg.v_pointer = NULL; + break; + } + + length = PySequence_Length (object); + if (length < 0) { + break; + } + + is_zero_terminated = g_type_info_is_zero_terminated (type_info); + item_type_info = g_type_info_get_param_type (type_info, 0); + + item_size = _pygi_g_type_info_size (item_type_info); + + array = g_array_sized_new (is_zero_terminated, FALSE, item_size, length); + if (array == NULL) { + g_base_info_unref ( (GIBaseInfo *) item_type_info); + PyErr_NoMemory(); + break; + } + + if (g_type_info_get_tag (item_type_info) == GI_TYPE_TAG_UINT8 && + PYGLIB_PyBytes_Check(object)) { + + memcpy(array->data, PYGLIB_PyBytes_AsString(object), length); + array->len = length; + goto array_success; + } + + + item_transfer = transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer; + + for (i = 0; i < length; i++) { + PyObject *py_item; + GIArgument item; + + py_item = PySequence_GetItem (object, i); + if (py_item == NULL) { + goto array_item_error; + } + + item = _pygi_argument_from_object (py_item, item_type_info, item_transfer); + + Py_DECREF (py_item); + + if (PyErr_Occurred()) { + goto array_item_error; + } + + g_array_insert_val (array, i, item); + continue; + +array_item_error: + /* Free everything we have converted so far. */ + _pygi_argument_release ( (GIArgument *) &array, type_info, + GI_TRANSFER_NOTHING, GI_DIRECTION_IN); + array = NULL; + + _PyGI_ERROR_PREFIX ("Item %zd: ", i); + break; + } + +array_success: + arg.v_pointer = array; + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + break; + } + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + + info = g_type_info_get_interface (type_info); + info_type = g_base_info_get_type (info); + + switch (info_type) { + case GI_INFO_TYPE_CALLBACK: + /* This should be handled in invoke() */ + g_assert_not_reached(); + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_STRUCT: + case GI_INFO_TYPE_UNION: + { + GType type; + + if (object == Py_None) { + arg.v_pointer = NULL; + break; + } + + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info); + + /* Handle special cases first. */ + if (g_type_is_a (type, G_TYPE_VALUE)) { + GValue *value; + GType object_type; + gint retval; + + object_type = pyg_type_from_object_strict ( (PyObject *) object->ob_type, FALSE); + if (object_type == G_TYPE_INVALID) { + PyErr_SetString (PyExc_RuntimeError, "unable to retrieve object's GType"); + break; + } + + g_warn_if_fail (transfer == GI_TRANSFER_NOTHING); + + value = g_slice_new0 (GValue); + + /* if already a gvalue, copy, else marshal into gvalue */ + if (object_type == G_TYPE_VALUE) { + /* src GValue's lifecycle is handled by Python + * so we have to copy it into the destination's + * GValue which is freed during the cleanup of + * invoke. + */ + GValue *src = (GValue *)((PyGObject *) object)->obj; + g_value_init (value, G_VALUE_TYPE (src)); + g_value_copy(src, value); + } else { + g_value_init (value, object_type); + retval = pyg_value_from_pyobject (value, object); + if (retval < 0) { + g_slice_free (GValue, value); + PyErr_SetString (PyExc_RuntimeError, "PyObject conversion to GValue failed"); + break; + } + } + + arg.v_pointer = value; + } else if (g_type_is_a (type, G_TYPE_CLOSURE)) { + GClosure *closure; + + if (pyg_type_from_object_strict (object, FALSE) == G_TYPE_CLOSURE) { + closure = (GClosure *)pyg_boxed_get (object, void); + } else { + closure = pyg_closure_new (object, NULL, NULL); + if (closure == NULL) { + PyErr_SetString (PyExc_RuntimeError, "PyObject conversion to GClosure failed"); + break; + } + } + + arg.v_pointer = closure; + } else if (g_struct_info_is_foreign (info)) { + PyObject *result; + result = pygi_struct_foreign_convert_to_g_argument ( + object, info, transfer, &arg); + } else if (g_type_is_a (type, G_TYPE_BOXED)) { + arg.v_pointer = pyg_boxed_get (object, void); + if (transfer == GI_TRANSFER_EVERYTHING) { + arg.v_pointer = g_boxed_copy (type, arg.v_pointer); + } + } else if (g_type_is_a (type, G_TYPE_POINTER) || type == G_TYPE_NONE) { + g_warn_if_fail (!g_type_info_is_pointer (type_info) || transfer == GI_TRANSFER_NOTHING); + arg.v_pointer = pyg_pointer_get (object, void); + } else { + PyErr_Format (PyExc_NotImplementedError, "structure type '%s' is not supported yet", g_type_name (type)); + } + + break; + } + case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: + { + PyObject *int_; + + int_ = PYGLIB_PyNumber_Long (object); + if (int_ == NULL) { + break; + } + + arg.v_long = PYGLIB_PyLong_AsLong (int_); + + Py_DECREF (int_); + + break; + } + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_OBJECT: + if (object == Py_None) { + arg.v_pointer = NULL; + break; + } + + arg.v_pointer = pygobject_get (object); + if (transfer == GI_TRANSFER_EVERYTHING) { + g_object_ref (arg.v_pointer); + } + + break; + default: + g_assert_not_reached(); + } + g_base_info_unref (info); + break; + } + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + { + Py_ssize_t length; + GITypeInfo *item_type_info; + GSList *list = NULL; + GITransfer item_transfer; + Py_ssize_t i; + + if (object == Py_None) { + arg.v_pointer = NULL; + break; + } + + length = PySequence_Length (object); + if (length < 0) { + break; + } + + item_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (item_type_info != NULL); + + item_transfer = transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer; + + for (i = length - 1; i >= 0; i--) { + PyObject *py_item; + GIArgument item; + + py_item = PySequence_GetItem (object, i); + if (py_item == NULL) { + goto list_item_error; + } + + item = _pygi_argument_from_object (py_item, item_type_info, item_transfer); + + Py_DECREF (py_item); + + if (PyErr_Occurred()) { + goto list_item_error; + } + + if (type_tag == GI_TYPE_TAG_GLIST) { + list = (GSList *) g_list_prepend ( (GList *) list, item.v_pointer); + } else { + list = g_slist_prepend (list, item.v_pointer); + } + + continue; + +list_item_error: + /* Free everything we have converted so far. */ + _pygi_argument_release ( (GIArgument *) &list, type_info, + GI_TRANSFER_NOTHING, GI_DIRECTION_IN); + list = NULL; + + _PyGI_ERROR_PREFIX ("Item %zd: ", i); + break; + } + + arg.v_pointer = list; + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + + break; + } + case GI_TYPE_TAG_GHASH: + { + Py_ssize_t length; + PyObject *keys; + PyObject *values; + GITypeInfo *key_type_info; + GITypeInfo *value_type_info; + GITypeTag key_type_tag; + GHashFunc hash_func; + GEqualFunc equal_func; + GHashTable *hash_table; + GITransfer item_transfer; + Py_ssize_t i; + + + if (object == Py_None) { + arg.v_pointer = NULL; + break; + } + + length = PyMapping_Length (object); + if (length < 0) { + break; + } + + keys = PyMapping_Keys (object); + if (keys == NULL) { + break; + } + + values = PyMapping_Values (object); + if (values == NULL) { + Py_DECREF (keys); + break; + } + + key_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (key_type_info != NULL); + + value_type_info = g_type_info_get_param_type (type_info, 1); + g_assert (value_type_info != NULL); + + key_type_tag = g_type_info_get_tag (key_type_info); + + switch (key_type_tag) { + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + hash_func = g_str_hash; + equal_func = g_str_equal; + break; + default: + hash_func = NULL; + equal_func = NULL; + } + + hash_table = g_hash_table_new (hash_func, equal_func); + if (hash_table == NULL) { + PyErr_NoMemory(); + goto hash_table_release; + } + + item_transfer = transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer; + + for (i = 0; i < length; i++) { + PyObject *py_key; + PyObject *py_value; + GIArgument key; + GIArgument value; + + py_key = PyList_GET_ITEM (keys, i); + py_value = PyList_GET_ITEM (values, i); + + key = _pygi_argument_from_object (py_key, key_type_info, item_transfer); + if (PyErr_Occurred()) { + goto hash_table_item_error; + } + + value = _pygi_argument_from_object (py_value, value_type_info, item_transfer); + if (PyErr_Occurred()) { + _pygi_argument_release (&key, type_info, GI_TRANSFER_NOTHING, GI_DIRECTION_IN); + goto hash_table_item_error; + } + + g_hash_table_insert (hash_table, key.v_pointer, value.v_pointer); + continue; + +hash_table_item_error: + /* Free everything we have converted so far. */ + _pygi_argument_release ( (GIArgument *) &hash_table, type_info, + GI_TRANSFER_NOTHING, GI_DIRECTION_IN); + hash_table = NULL; + + _PyGI_ERROR_PREFIX ("Item %zd: ", i); + break; + } + + arg.v_pointer = hash_table; + +hash_table_release: + g_base_info_unref ( (GIBaseInfo *) key_type_info); + g_base_info_unref ( (GIBaseInfo *) value_type_info); + Py_DECREF (keys); + Py_DECREF (values); + break; + } + case GI_TYPE_TAG_ERROR: + PyErr_SetString (PyExc_NotImplementedError, "error marshalling is not supported yet"); + /* TODO */ + break; + } + + return arg; +} + +static glong +_pygi_glong_from_argument (GIArgument *arg, + GITypeInfo *type_info) +{ + gsize item_size = _pygi_g_type_info_size (type_info); + + if (item_size == sizeof (glong)) + return arg->v_long; + else if (item_size == sizeof (gint)) + return arg->v_int; + else + { + g_warning ("pygi: unsupported item size %ld", item_size); + return arg->v_long; + } +} + +PyObject * +_pygi_argument_to_object (GIArgument *arg, + GITypeInfo *type_info, + GITransfer transfer) +{ + GITypeTag type_tag; + PyObject *object = NULL; + + type_tag = g_type_info_get_tag (type_info); + switch (type_tag) { + case GI_TYPE_TAG_VOID: + if (g_type_info_is_pointer (type_info)) { + /* Raw Python objects are passed to void* args */ + g_warn_if_fail (transfer == GI_TRANSFER_NOTHING); + object = arg->v_pointer; + } else + object = Py_None; + Py_XINCREF (object); + break; + case GI_TYPE_TAG_BOOLEAN: + { + object = PyBool_FromLong (arg->v_boolean); + break; + } + case GI_TYPE_TAG_INT8: + { + object = PYGLIB_PyLong_FromLong (arg->v_int8); + break; + } + case GI_TYPE_TAG_UINT8: + { + object = PYGLIB_PyLong_FromLong (arg->v_uint8); + break; + } + case GI_TYPE_TAG_INT16: + { + object = PYGLIB_PyLong_FromLong (arg->v_int16); + break; + } + case GI_TYPE_TAG_UINT16: + { + object = PYGLIB_PyLong_FromLong (arg->v_uint16); + break; + } + case GI_TYPE_TAG_INT32: + { + object = PYGLIB_PyLong_FromLong (arg->v_int32); + break; + } + case GI_TYPE_TAG_UINT32: + { + object = PyLong_FromLongLong (arg->v_uint32); + break; + } + case GI_TYPE_TAG_INT64: + { + object = PyLong_FromLongLong (arg->v_int64); + break; + } + case GI_TYPE_TAG_UINT64: + { + object = PyLong_FromUnsignedLongLong (arg->v_uint64); + break; + } + case GI_TYPE_TAG_FLOAT: + { + object = PyFloat_FromDouble (arg->v_float); + break; + } + case GI_TYPE_TAG_DOUBLE: + { + object = PyFloat_FromDouble (arg->v_double); + break; + } + case GI_TYPE_TAG_GTYPE: + { + object = pyg_type_wrapper_new ( (GType) arg->v_long); + break; + } + case GI_TYPE_TAG_UNICHAR: + { + /* Preserve the bidirectional mapping between 0 and "" */ + if (arg->v_uint32 == 0) { + object = PYGLIB_PyUnicode_FromString (""); + } else if (g_unichar_validate (arg->v_uint32)) { + gchar utf8[6]; + gint bytes; + + bytes = g_unichar_to_utf8 (arg->v_uint32, utf8); + object = PYGLIB_PyUnicode_FromStringAndSize ((char*)utf8, bytes); + } else { + /* TODO: Convert the error to an exception. */ + PyErr_Format (PyExc_TypeError, + "Invalid unicode codepoint %" G_GUINT32_FORMAT, + arg->v_uint32); + object = Py_None; + Py_INCREF (object); + } + break; + } + case GI_TYPE_TAG_UTF8: + if (arg->v_string == NULL) { + object = Py_None; + Py_INCREF (object); + break; + } + + object = PYGLIB_PyUnicode_FromString (arg->v_string); + break; + case GI_TYPE_TAG_FILENAME: + { + GError *error = NULL; + gchar *string; + + if (arg->v_string == NULL) { + object = Py_None; + Py_INCREF (object); + break; + } + + string = g_filename_to_utf8 (arg->v_string, -1, NULL, NULL, &error); + if (string == NULL) { + PyErr_SetString (PyExc_Exception, error->message); + /* TODO: Convert the error to an exception. */ + break; + } + + object = PYGLIB_PyUnicode_FromString (string); + + g_free (string); + + break; + } + case GI_TYPE_TAG_ARRAY: + { + GArray *array; + GITypeInfo *item_type_info; + GITypeTag item_type_tag; + GITransfer item_transfer; + gsize i, item_size; + + array = arg->v_pointer; + + item_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (item_type_info != NULL); + + item_type_tag = g_type_info_get_tag (item_type_info); + item_transfer = transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer; + + if (item_type_tag == GI_TYPE_TAG_UINT8) { + /* Return as a byte array */ + if (arg->v_pointer == NULL) { + object = PYGLIB_PyBytes_FromString (""); + break; + } + + object = PYGLIB_PyBytes_FromStringAndSize(array->data, array->len); + break; + + } else { + if (arg->v_pointer == NULL) { + object = PyList_New (0); + break; + } + + object = PyList_New (array->len); + if (object == NULL) { + break; + } + + } + item_size = g_array_get_element_size (array); + + for (i = 0; i < array->len; i++) { + GIArgument item; + PyObject *py_item; + gboolean is_struct = FALSE; + + if (item_type_tag == GI_TYPE_TAG_INTERFACE) { + GIBaseInfo *iface_info = g_type_info_get_interface (item_type_info); + switch (g_base_info_get_type (iface_info)) { + case GI_INFO_TYPE_STRUCT: + case GI_INFO_TYPE_BOXED: + is_struct = TRUE; + default: + break; + } + g_base_info_unref ( (GIBaseInfo *) iface_info); + } + + if (is_struct) { + item.v_pointer = &_g_array_index (array, GIArgument, i); + } else { + memcpy (&item, &_g_array_index (array, GIArgument, i), item_size); + } + + py_item = _pygi_argument_to_object (&item, item_type_info, item_transfer); + if (py_item == NULL) { + Py_CLEAR (object); + _PyGI_ERROR_PREFIX ("Item %zu: ", i); + break; + } + + PyList_SET_ITEM (object, i, py_item); + } + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + break; + } + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + + info = g_type_info_get_interface (type_info); + info_type = g_base_info_get_type (info); + + switch (info_type) { + case GI_INFO_TYPE_CALLBACK: + { + /* There is no way we can support a callback return + * as we are never sure if the callback was set from C + * or Python. API that return callbacks are broken + * so we print a warning and send back a None + */ + + g_warning ("You are trying to use an API which returns a callback." + "Callback returns can not be supported. Returning None instead."); + object = Py_None; + Py_INCREF (object); + break; + } + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_STRUCT: + case GI_INFO_TYPE_UNION: + { + GType type; + + if (arg->v_pointer == NULL) { + object = Py_None; + Py_INCREF (object); + break; + } + + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info); + if (g_type_is_a (type, G_TYPE_VALUE)) { + object = pyg_value_as_pyobject (arg->v_pointer, FALSE); + } else if (g_struct_info_is_foreign (info)) { + object = pygi_struct_foreign_convert_from_g_argument (info, arg->v_pointer); + } else if (g_type_is_a (type, G_TYPE_BOXED)) { + PyObject *py_type; + + py_type = _pygi_type_get_from_g_type (type); + if (py_type == NULL) + break; + + object = _pygi_boxed_new ( (PyTypeObject *) py_type, arg->v_pointer, transfer == GI_TRANSFER_EVERYTHING); + + Py_DECREF (py_type); + } else if (g_type_is_a (type, G_TYPE_POINTER)) { + PyObject *py_type; + + py_type = _pygi_type_get_from_g_type (type); + + if (py_type == NULL || !PyType_IsSubtype ( (PyTypeObject *) type, &PyGIStruct_Type)) { + g_warn_if_fail (transfer == GI_TRANSFER_NOTHING); + object = pyg_pointer_new (type, arg->v_pointer); + } else { + object = _pygi_struct_new ( (PyTypeObject *) py_type, arg->v_pointer, transfer == GI_TRANSFER_EVERYTHING); + } + + Py_XDECREF (py_type); + } else if (type == G_TYPE_NONE) { + PyObject *py_type; + + py_type = _pygi_type_import_by_gi_info (info); + if (py_type == NULL) { + break; + } + + /* Only structs created in invoke can be safely marked + * GI_TRANSFER_EVERYTHING. Trust that invoke has + * filtered correctly + */ + object = _pygi_struct_new ( (PyTypeObject *) py_type, arg->v_pointer, + transfer == GI_TRANSFER_EVERYTHING); + + Py_DECREF (py_type); + } else { + PyErr_Format (PyExc_NotImplementedError, "structure type '%s' is not supported yet", g_type_name (type)); + } + + break; + } + case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: + { + GType type; + + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info); + + if (type == G_TYPE_NONE) { + /* An enum with a GType of None is an enum without GType */ + PyObject *py_type = _pygi_type_import_by_gi_info (info); + PyObject *py_args = NULL; + glong val = _pygi_glong_from_argument (arg, type_info); + + if (!py_type) + return NULL; + + py_args = PyTuple_New (1); + if (PyTuple_SetItem (py_args, 0, PyLong_FromLong (val)) != 0) { + Py_DECREF (py_args); + Py_DECREF (py_type); + return NULL; + } + + object = PyObject_CallFunction (py_type, "l", val); + + Py_DECREF (py_args); + Py_DECREF (py_type); + + } else if (info_type == GI_INFO_TYPE_ENUM) { + glong val = _pygi_glong_from_argument (arg, type_info); + object = pyg_enum_from_gtype (type, val); + } else { + object = pyg_flags_from_gtype (type, arg->v_long); + } + + break; + } + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_OBJECT: + if (arg->v_pointer == NULL) { + object = Py_None; + Py_INCREF (object); + break; + } + object = pygobject_new (arg->v_pointer); + break; + default: + g_assert_not_reached(); + } + + g_base_info_unref (info); + break; + } + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + { + GSList *list; + gsize length; + GITypeInfo *item_type_info; + GITransfer item_transfer; + gsize i; + + list = arg->v_pointer; + length = g_slist_length (list); + + object = PyList_New (length); + if (object == NULL) { + break; + } + + item_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (item_type_info != NULL); + + item_transfer = transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer; + + for (i = 0; list != NULL; list = g_slist_next (list), i++) { + GIArgument item; + PyObject *py_item; + + item.v_pointer = list->data; + + py_item = _pygi_argument_to_object (&item, item_type_info, item_transfer); + if (py_item == NULL) { + Py_CLEAR (object); + _PyGI_ERROR_PREFIX ("Item %zu: ", i); + break; + } + + PyList_SET_ITEM (object, i, py_item); + } + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + break; + } + case GI_TYPE_TAG_GHASH: + { + GITypeInfo *key_type_info; + GITypeInfo *value_type_info; + GITransfer item_transfer; + GHashTableIter hash_table_iter; + GIArgument key; + GIArgument value; + + if (arg->v_pointer == NULL) { + object = Py_None; + Py_INCREF (object); + break; + } + + object = PyDict_New(); + if (object == NULL) { + break; + } + + key_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (key_type_info != NULL); + g_assert (g_type_info_get_tag (key_type_info) != GI_TYPE_TAG_VOID); + + value_type_info = g_type_info_get_param_type (type_info, 1); + g_assert (value_type_info != NULL); + g_assert (g_type_info_get_tag (value_type_info) != GI_TYPE_TAG_VOID); + + item_transfer = transfer == GI_TRANSFER_CONTAINER ? GI_TRANSFER_NOTHING : transfer; + + g_hash_table_iter_init (&hash_table_iter, (GHashTable *) arg->v_pointer); + while (g_hash_table_iter_next (&hash_table_iter, &key.v_pointer, &value.v_pointer)) { + PyObject *py_key; + PyObject *py_value; + int retval; + + py_key = _pygi_argument_to_object (&key, key_type_info, item_transfer); + if (py_key == NULL) { + break; + } + + py_value = _pygi_argument_to_object (&value, value_type_info, item_transfer); + if (py_value == NULL) { + Py_DECREF (py_key); + break; + } + + retval = PyDict_SetItem (object, py_key, py_value); + + Py_DECREF (py_key); + Py_DECREF (py_value); + + if (retval < 0) { + Py_CLEAR (object); + break; + } + } + + g_base_info_unref ( (GIBaseInfo *) key_type_info); + g_base_info_unref ( (GIBaseInfo *) value_type_info); + break; + } + case GI_TYPE_TAG_ERROR: + /* Errors should be handled in the invoke wrapper. */ + g_assert_not_reached(); + } + + return object; +} + + +GIArgument +_pygi_argument_from_g_value(const GValue *value, + GITypeInfo *type_info) +{ + GIArgument arg = { 0, }; + + GITypeTag type_tag = g_type_info_get_tag (type_info); + switch (type_tag) { + case GI_TYPE_TAG_BOOLEAN: + arg.v_boolean = g_value_get_boolean (value); + break; + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_INT64: + arg.v_int = g_value_get_int (value); + break; + case GI_TYPE_TAG_UINT8: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_UINT64: + arg.v_uint = g_value_get_uint (value); + break; + case GI_TYPE_TAG_UNICHAR: + arg.v_uint32 = g_value_get_char (value); + break; + case GI_TYPE_TAG_FLOAT: + arg.v_float = g_value_get_float (value); + break; + case GI_TYPE_TAG_DOUBLE: + arg.v_double = g_value_get_double (value); + break; + case GI_TYPE_TAG_GTYPE: + arg.v_long = g_value_get_gtype (value); + break; + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + arg.v_string = g_value_dup_string (value); + break; + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + arg.v_pointer = g_value_get_pointer (value); + break; + case GI_TYPE_TAG_ARRAY: + case GI_TYPE_TAG_GHASH: + arg.v_pointer = g_value_get_boxed (value); + break; + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + + info = g_type_info_get_interface (type_info); + info_type = g_base_info_get_type (info); + + g_base_info_unref (info); + + switch (info_type) { + case GI_INFO_TYPE_FLAGS: + case GI_INFO_TYPE_ENUM: + arg.v_long = g_value_get_enum (value); + break; + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_OBJECT: + arg.v_pointer = g_value_get_object (value); + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_STRUCT: + case GI_INFO_TYPE_UNION: + if (G_VALUE_HOLDS(value, G_TYPE_BOXED)) { + arg.v_pointer = g_value_get_boxed (value); + } else if (G_VALUE_HOLDS(value, G_TYPE_VARIANT)) { + arg.v_pointer = g_value_get_variant (value); + } else { + arg.v_pointer = g_value_get_pointer (value); + } + break; + default: + g_warning("Converting of type '%s' is not implemented", g_info_type_to_string(info_type)); + g_assert_not_reached(); + } + break; + } + case GI_TYPE_TAG_ERROR: + case GI_TYPE_TAG_VOID: + g_critical("Converting of type '%s' is not implemented", g_type_tag_to_string(type_tag)); + g_assert_not_reached(); + } + + return arg; +} + +void +_pygi_argument_release (GIArgument *arg, + GITypeInfo *type_info, + GITransfer transfer, + GIDirection direction) +{ + GITypeTag type_tag; + gboolean is_out = (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT); + + type_tag = g_type_info_get_tag (type_info); + + switch (type_tag) { + case GI_TYPE_TAG_VOID: + /* Don't do anything, it's transparent to the C side */ + break; + case GI_TYPE_TAG_BOOLEAN: + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_UINT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_INT64: + case GI_TYPE_TAG_UINT64: + case GI_TYPE_TAG_FLOAT: + case GI_TYPE_TAG_DOUBLE: + case GI_TYPE_TAG_GTYPE: + case GI_TYPE_TAG_UNICHAR: + break; + case GI_TYPE_TAG_FILENAME: + case GI_TYPE_TAG_UTF8: + /* With allow-none support the string could be NULL */ + if ((arg->v_string != NULL && + (direction == GI_DIRECTION_IN && transfer == GI_TRANSFER_NOTHING)) + || (direction == GI_DIRECTION_OUT && transfer == GI_TRANSFER_EVERYTHING)) { + g_free (arg->v_string); + } + break; + case GI_TYPE_TAG_ARRAY: + { + GArray *array; + gsize i; + + if (arg->v_pointer == NULL) { + return; + } + + array = arg->v_pointer; + + if ( (direction == GI_DIRECTION_IN && transfer != GI_TRANSFER_EVERYTHING) + || (direction == GI_DIRECTION_OUT && transfer == GI_TRANSFER_EVERYTHING)) { + GITypeInfo *item_type_info; + GITransfer item_transfer; + + item_type_info = g_type_info_get_param_type (type_info, 0); + + item_transfer = direction == GI_DIRECTION_IN ? GI_TRANSFER_NOTHING : GI_TRANSFER_EVERYTHING; + + /* Free the items */ + for (i = 0; i < array->len; i++) { + GIArgument *item; + item = &_g_array_index (array, GIArgument, i); + _pygi_argument_release (item, item_type_info, item_transfer, direction); + } + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + } + + if ( (direction == GI_DIRECTION_IN && transfer == GI_TRANSFER_NOTHING) + || (direction == GI_DIRECTION_OUT && transfer != GI_TRANSFER_NOTHING)) { + g_array_free (array, TRUE); + } + + break; + } + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + + info = g_type_info_get_interface (type_info); + info_type = g_base_info_get_type (info); + + switch (info_type) { + case GI_INFO_TYPE_CALLBACK: + /* TODO */ + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_STRUCT: + case GI_INFO_TYPE_UNION: + { + GType type; + + if (arg->v_pointer == NULL) { + return; + } + + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info); + + if (g_type_is_a (type, G_TYPE_VALUE)) { + GValue *value; + + value = arg->v_pointer; + + if ( (direction == GI_DIRECTION_IN && transfer != GI_TRANSFER_EVERYTHING) + || (direction == GI_DIRECTION_OUT && transfer == GI_TRANSFER_EVERYTHING)) { + g_value_unset (value); + } + + if ( (direction == GI_DIRECTION_IN && transfer == GI_TRANSFER_NOTHING) + || (direction == GI_DIRECTION_OUT && transfer != GI_TRANSFER_NOTHING)) { + g_slice_free (GValue, value); + } + } else if (g_struct_info_is_foreign ( (GIStructInfo*) info)) { + if (direction == GI_DIRECTION_OUT && transfer == GI_TRANSFER_EVERYTHING) { + pygi_struct_foreign_release (info, arg->v_pointer); + } + } else if (g_type_is_a (type, G_TYPE_BOXED)) { + } else if (g_type_is_a (type, G_TYPE_POINTER) || type == G_TYPE_NONE) { + g_warn_if_fail (!g_type_info_is_pointer (type_info) || transfer == GI_TRANSFER_NOTHING); + } + + break; + } + case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: + break; + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_OBJECT: + if (arg->v_pointer == NULL) { + return; + } + if (is_out && transfer == GI_TRANSFER_EVERYTHING) { + g_object_unref (arg->v_pointer); + } + break; + default: + g_assert_not_reached(); + } + + g_base_info_unref (info); + break; + } + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + { + GSList *list; + + if (arg->v_pointer == NULL) { + return; + } + + list = arg->v_pointer; + + if ( (direction == GI_DIRECTION_IN && transfer != GI_TRANSFER_EVERYTHING) + || (direction == GI_DIRECTION_OUT && transfer == GI_TRANSFER_EVERYTHING)) { + GITypeInfo *item_type_info; + GITransfer item_transfer; + GSList *item; + + item_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (item_type_info != NULL); + + item_transfer = direction == GI_DIRECTION_IN ? GI_TRANSFER_NOTHING : GI_TRANSFER_EVERYTHING; + + /* Free the items */ + for (item = list; item != NULL; item = g_slist_next (item)) { + _pygi_argument_release ( (GIArgument *) &item->data, item_type_info, + item_transfer, direction); + } + + g_base_info_unref ( (GIBaseInfo *) item_type_info); + } + + if ( (direction == GI_DIRECTION_IN && transfer == GI_TRANSFER_NOTHING) + || (direction == GI_DIRECTION_OUT && transfer != GI_TRANSFER_NOTHING)) { + if (type_tag == GI_TYPE_TAG_GLIST) { + g_list_free ( (GList *) list); + } else { + /* type_tag == GI_TYPE_TAG_GSLIST */ + g_slist_free (list); + } + } + + break; + } + case GI_TYPE_TAG_GHASH: + { + GHashTable *hash_table; + + if (arg->v_pointer == NULL) { + return; + } + + hash_table = arg->v_pointer; + + if (direction == GI_DIRECTION_IN && transfer != GI_TRANSFER_EVERYTHING) { + /* We created the table without a destroy function, so keys and + * values need to be released. */ + GITypeInfo *key_type_info; + GITypeInfo *value_type_info; + GITransfer item_transfer; + GHashTableIter hash_table_iter; + gpointer key; + gpointer value; + + key_type_info = g_type_info_get_param_type (type_info, 0); + g_assert (key_type_info != NULL); + + value_type_info = g_type_info_get_param_type (type_info, 1); + g_assert (value_type_info != NULL); + + if (direction == GI_DIRECTION_IN) { + item_transfer = GI_TRANSFER_NOTHING; + } else { + item_transfer = GI_TRANSFER_EVERYTHING; + } + + g_hash_table_iter_init (&hash_table_iter, hash_table); + while (g_hash_table_iter_next (&hash_table_iter, &key, &value)) { + _pygi_argument_release ( (GIArgument *) &key, key_type_info, + item_transfer, direction); + _pygi_argument_release ( (GIArgument *) &value, value_type_info, + item_transfer, direction); + } + + g_base_info_unref ( (GIBaseInfo *) key_type_info); + g_base_info_unref ( (GIBaseInfo *) value_type_info); + } else if (direction == GI_DIRECTION_OUT && transfer == GI_TRANSFER_CONTAINER) { + /* Be careful to avoid keys and values being freed if the + * callee gave a destroy function. */ + g_hash_table_steal_all (hash_table); + } + + if ( (direction == GI_DIRECTION_IN && transfer == GI_TRANSFER_NOTHING) + || (direction == GI_DIRECTION_OUT && transfer != GI_TRANSFER_NOTHING)) { + g_hash_table_unref (hash_table); + } + + break; + } + case GI_TYPE_TAG_ERROR: + { + GError *error; + + if (arg->v_pointer == NULL) { + return; + } + + error = * (GError **) arg->v_pointer; + + if (error != NULL) { + g_error_free (error); + } + + g_slice_free (GError *, arg->v_pointer); + break; + } + } +} + +void +_pygi_argument_init (void) +{ + PyDateTime_IMPORT; + _pygobject_import(); +} + diff --git a/gi/pygi-argument.h b/gi/pygi-argument.h new file mode 100644 index 0000000..7224c75 --- /dev/null +++ b/gi/pygi-argument.h @@ -0,0 +1,70 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_ARGUMENT_H__ +#define __PYGI_ARGUMENT_H__ + +#include + +#include + +G_BEGIN_DECLS + + +/* Private */ +gint _pygi_g_type_interface_check_object (GIBaseInfo *info, + PyObject *object); + +gint _pygi_g_type_info_check_object (GITypeInfo *type_info, + PyObject *object, + gboolean allow_none); + +gint _pygi_g_registered_type_info_check_object (GIRegisteredTypeInfo *info, + gboolean is_instance, + PyObject *object); + + +GArray* _pygi_argument_to_array (GIArgument *arg, + GIArgument *args[], + GITypeInfo *type_info, + gboolean is_method); + +GIArgument _pygi_argument_from_object (PyObject *object, + GITypeInfo *type_info, + GITransfer transfer); + +PyObject* _pygi_argument_to_object (GIArgument *arg, + GITypeInfo *type_info, + GITransfer transfer); + +GIArgument _pygi_argument_from_g_value(const GValue *value, + GITypeInfo *type_info); + +void _pygi_argument_release (GIArgument *arg, + GITypeInfo *type_info, + GITransfer transfer, + GIDirection direction); + +void _pygi_argument_init (void); + +G_END_DECLS + +#endif /* __PYGI_ARGUMENT_H__ */ diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c new file mode 100644 index 0000000..2fd446c --- /dev/null +++ b/gi/pygi-boxed.c @@ -0,0 +1,182 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2009 Simon van der Linden + * + * pygi-boxed.c: wrapper to handle registered structures. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +#include +#include +#include + +static void +_boxed_dealloc (PyGIBoxed *self) +{ + GType g_type; + + PyObject_GC_UnTrack ( (PyObject *) self); + + PyObject_ClearWeakRefs ( (PyObject *) self); + + if ( ( (PyGBoxed *) self)->free_on_dealloc) { + if (self->slice_allocated) { + g_slice_free1 (self->size, ( (PyGBoxed *) self)->boxed); + } else { + g_type = pyg_type_from_object ( (PyObject *) self); + g_boxed_free (g_type, ( (PyGBoxed *) self)->boxed); + } + } + + Py_TYPE( (PyGObject *) self)->tp_free ( (PyObject *) self); +} + +void * +_pygi_boxed_alloc (GIBaseInfo *info, gsize *size_out) +{ + gsize size; + + /* FIXME: Remove when bgo#622711 is fixed */ + if (g_registered_type_info_get_g_type (info) == G_TYPE_VALUE) { + size = sizeof (GValue); + } else { + switch (g_base_info_get_type (info)) { + case GI_INFO_TYPE_UNION: + size = g_union_info_get_size ( (GIUnionInfo *) info); + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_STRUCT: + size = g_struct_info_get_size ( (GIStructInfo *) info); + break; + default: + PyErr_Format (PyExc_TypeError, + "info should be Boxed or Union, not '%d'", + g_base_info_get_type (info)); + return NULL; + } + } + + if( size_out != NULL) + *size_out = size; + + return g_slice_alloc0 (size); +} + +static PyObject * +_boxed_new (PyTypeObject *type, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { NULL }; + + GIBaseInfo *info; + gsize size = 0; + gpointer boxed; + PyGIBoxed *self = NULL; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "", kwlist)) { + return NULL; + } + + info = _pygi_object_get_gi_info ( (PyObject *) type, &PyGIBaseInfo_Type); + if (info == NULL) { + if (PyErr_ExceptionMatches (PyExc_AttributeError)) { + PyErr_Format (PyExc_TypeError, "missing introspection information"); + } + return NULL; + } + + boxed = _pygi_boxed_alloc (info, &size); + if (boxed == NULL) { + PyErr_NoMemory(); + goto out; + } + + self = (PyGIBoxed *) _pygi_boxed_new (type, boxed, TRUE); + if (self == NULL) { + g_slice_free1 (size, boxed); + goto out; + } + + self->size = size; + self->slice_allocated = TRUE; + +out: + g_base_info_unref (info); + + return (PyObject *) self; +} + +static int +_boxed_init (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + /* Don't call PyGBoxed's init, which raises an exception. */ + return 0; +} + +PYGLIB_DEFINE_TYPE("gi.Boxed", PyGIBoxed_Type, PyGIBoxed); + +PyObject * +_pygi_boxed_new (PyTypeObject *type, + gpointer boxed, + gboolean free_on_dealloc) +{ + PyGIBoxed *self; + + if (!boxed) { + Py_RETURN_NONE; + } + + if (!PyType_IsSubtype (type, &PyGIBoxed_Type)) { + PyErr_SetString (PyExc_TypeError, "must be a subtype of gi.Boxed"); + return NULL; + } + + self = (PyGIBoxed *) type->tp_alloc (type, 0); + if (self == NULL) { + return NULL; + } + + ( (PyGBoxed *) self)->gtype = pyg_type_from_object ( (PyObject *) type); + ( (PyGBoxed *) self)->boxed = boxed; + ( (PyGBoxed *) self)->free_on_dealloc = free_on_dealloc; + self->size = 0; + self->slice_allocated = FALSE; + + return (PyObject *) self; +} + +void +_pygi_boxed_register_types (PyObject *m) +{ + Py_TYPE(&PyGIBoxed_Type) = &PyType_Type; + PyGIBoxed_Type.tp_base = &PyGBoxed_Type; + PyGIBoxed_Type.tp_new = (newfunc) _boxed_new; + PyGIBoxed_Type.tp_init = (initproc) _boxed_init; + PyGIBoxed_Type.tp_dealloc = (destructor) _boxed_dealloc; + PyGIBoxed_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + + if (PyType_Ready (&PyGIBoxed_Type)) + return; + if (PyModule_AddObject (m, "Boxed", (PyObject *) &PyGIBoxed_Type)) + return; +} diff --git a/gi/pygi-boxed.h b/gi/pygi-boxed.h new file mode 100644 index 0000000..a84ec4e --- /dev/null +++ b/gi/pygi-boxed.h @@ -0,0 +1,42 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2009 Simon van der Linden + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_BOXED_H__ +#define __PYGI_BOXED_H__ + +#include + +G_BEGIN_DECLS + +extern PyTypeObject PyGIBoxed_Type; + +PyObject * _pygi_boxed_new (PyTypeObject *type, + gpointer boxed, + gboolean free_on_dealloc); + +void * _pygi_boxed_alloc (GIBaseInfo *info, + gsize *size); + +void _pygi_boxed_register_types (PyObject *m); + +G_END_DECLS + +#endif /* __PYGI_BOXED_H__ */ diff --git a/gi/pygi-callbacks.c b/gi/pygi-callbacks.c new file mode 100644 index 0000000..bae4001 --- /dev/null +++ b/gi/pygi-callbacks.c @@ -0,0 +1,221 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * pygi-callbacks.c: PyGI C Callback Functions and Helpers + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +static PyGICClosure *global_destroy_notify; + +static void +_pygi_destroy_notify_callback_closure (ffi_cif *cif, + void *result, + void **args, + void *data) +{ + PyGICClosure *info = * (void**) (args[0]); + + g_assert (info); + + _pygi_invoke_closure_free (info); +} + + +PyGICClosure* +_pygi_destroy_notify_create (void) +{ + if (!global_destroy_notify) { + + PyGICClosure *destroy_notify = g_slice_new0 (PyGICClosure); + + g_assert (destroy_notify); + + GIBaseInfo* glib_destroy_notify = g_irepository_find_by_name (NULL, "GLib", "DestroyNotify"); + g_assert (glib_destroy_notify != NULL); + g_assert (g_base_info_get_type (glib_destroy_notify) == GI_INFO_TYPE_CALLBACK); + + destroy_notify->closure = g_callable_info_prepare_closure ( (GICallableInfo*) glib_destroy_notify, + &destroy_notify->cif, + _pygi_destroy_notify_callback_closure, + NULL); + + global_destroy_notify = destroy_notify; + } + + return global_destroy_notify; +} + + +gboolean +_pygi_scan_for_callbacks (GIFunctionInfo *function_info, + gboolean is_method, + guint8 *callback_index, + guint8 *user_data_index, + guint8 *destroy_notify_index) +{ + guint i, n_args; + + *callback_index = G_MAXUINT8; + *user_data_index = G_MAXUINT8; + *destroy_notify_index = G_MAXUINT8; + + n_args = g_callable_info_get_n_args ( (GICallableInfo *) function_info); + for (i = 0; i < n_args; i++) { + GIDirection direction; + GIArgInfo *arg_info; + GITypeInfo *type_info; + guint8 destroy, closure; + GITypeTag type_tag; + + arg_info = g_callable_info_get_arg ( (GICallableInfo*) function_info, i); + type_info = g_arg_info_get_type (arg_info); + type_tag = g_type_info_get_tag (type_info); + + if (type_tag == GI_TYPE_TAG_INTERFACE) { + GIBaseInfo* interface_info; + GIInfoType interface_type; + + interface_info = g_type_info_get_interface (type_info); + interface_type = g_base_info_get_type (interface_info); + if (interface_type == GI_INFO_TYPE_CALLBACK && + ! (strcmp (g_base_info_get_namespace ( (GIBaseInfo*) interface_info), "GLib") == 0 && + (strcmp (g_base_info_get_name ( (GIBaseInfo*) interface_info), "DestroyNotify") == 0 || + (strcmp (g_base_info_get_name ( (GIBaseInfo*) interface_info), "FreeFunc") == 0)))) { + if (*callback_index != G_MAXUINT8) { + PyErr_Format (PyExc_TypeError, "Function %s.%s has multiple callbacks, not supported", + g_base_info_get_namespace ( (GIBaseInfo*) function_info), + g_base_info_get_name ( (GIBaseInfo*) function_info)); + g_base_info_unref (interface_info); + return FALSE; + } + *callback_index = i; + } + g_base_info_unref (interface_info); + } + destroy = g_arg_info_get_destroy (arg_info); + + closure = g_arg_info_get_closure (arg_info); + direction = g_arg_info_get_direction (arg_info); + + if (destroy > 0 && destroy < n_args) { + if (*destroy_notify_index != G_MAXUINT8) { + PyErr_Format (PyExc_TypeError, "Function %s has multiple GDestroyNotify, not supported", + g_base_info_get_name ( (GIBaseInfo*) function_info)); + return FALSE; + } + *destroy_notify_index = destroy; + } + + if (closure > 0 && closure < n_args) { + if (*user_data_index != G_MAXUINT8) { + PyErr_Format (PyExc_TypeError, "Function %s has multiple user_data arguments, not supported", + g_base_info_get_name ( (GIBaseInfo*) function_info)); + return FALSE; + } + *user_data_index = closure; + } + + g_base_info_unref ( (GIBaseInfo*) arg_info); + g_base_info_unref ( (GIBaseInfo*) type_info); + } + + return TRUE; +} + +gboolean +_pygi_create_callback (GIBaseInfo *function_info, + gboolean is_method, + gboolean is_constructor, + int n_args, + Py_ssize_t py_argc, + PyObject *py_argv, + guint8 callback_index, + guint8 user_data_index, + guint8 destroy_notify_index, + PyGICClosure **closure_out) +{ + GIArgInfo *callback_arg; + GITypeInfo *callback_type; + GICallbackInfo *callback_info; + GIScopeType scope; + gboolean found_py_function; + PyObject *py_function; + guint8 i, py_argv_pos; + PyObject *py_user_data; + gboolean allow_none; + + callback_arg = g_callable_info_get_arg ( (GICallableInfo*) function_info, callback_index); + scope = g_arg_info_get_scope (callback_arg); + allow_none = g_arg_info_may_be_null (callback_arg); + + callback_type = g_arg_info_get_type (callback_arg); + g_assert (g_type_info_get_tag (callback_type) == GI_TYPE_TAG_INTERFACE); + + callback_info = (GICallbackInfo*) g_type_info_get_interface (callback_type); + g_assert (g_base_info_get_type ( (GIBaseInfo*) callback_info) == GI_INFO_TYPE_CALLBACK); + + /* Find the Python function passed for the callback */ + found_py_function = FALSE; + py_function = Py_None; + py_user_data = NULL; + + /* if its a method then we need to skip over 'self' */ + if (is_method || is_constructor) + py_argv_pos = 1; + else + py_argv_pos = 0; + + for (i = 0; i < n_args && i < py_argc; i++) { + if (i == callback_index) { + py_function = PyTuple_GetItem (py_argv, py_argv_pos); + /* if we allow none then set the closure to NULL and return */ + if (allow_none && py_function == Py_None) { + *closure_out = NULL; + goto out; + } + found_py_function = TRUE; + } else if (i == user_data_index) { + py_user_data = PyTuple_GetItem (py_argv, py_argv_pos); + } + py_argv_pos++; + } + + if (!found_py_function + || (py_function == Py_None || !PyCallable_Check (py_function))) { + PyErr_Format (PyExc_TypeError, "Error invoking %s.%s: Unexpected value " + "for argument '%s'", + g_base_info_get_namespace ( (GIBaseInfo*) function_info), + g_base_info_get_name ( (GIBaseInfo*) function_info), + g_base_info_get_name ( (GIBaseInfo*) callback_arg)); + g_base_info_unref ( (GIBaseInfo*) callback_info); + g_base_info_unref ( (GIBaseInfo*) callback_type); + return FALSE; + } + + /** Now actually build the closure **/ + *closure_out = _pygi_make_native_closure ( (GICallableInfo *) callback_info, + g_arg_info_get_scope (callback_arg), + py_function, + py_user_data); +out: + g_base_info_unref ( (GIBaseInfo*) callback_info); + g_base_info_unref ( (GIBaseInfo*) callback_type); + + return TRUE; +} diff --git a/gi/pygi-callbacks.h b/gi/pygi-callbacks.h new file mode 100644 index 0000000..7535bba --- /dev/null +++ b/gi/pygi-callbacks.h @@ -0,0 +1,48 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_CALLBACKS_H__ +#define __PYGI_CALLBACKS_H__ + +G_BEGIN_DECLS + +void _pygi_callback_notify_info_free (gpointer user_data); + +PyGICClosure*_pygi_destroy_notify_create (void); + +gboolean _pygi_scan_for_callbacks (GIFunctionInfo *self, + gboolean is_method, + guint8 *callback_index, + guint8 *user_data_index, + guint8 *destroy_notify_index); + +gboolean _pygi_create_callback (GIFunctionInfo *self, + gboolean is_method, + gboolean is_constructor, + int n_args, + Py_ssize_t py_argc, + PyObject *py_argv, + guint8 callback_index, + guint8 user_data_index, + guint8 destroy_notify_index, + PyGICClosure **closure_out); + +G_END_DECLS + +#endif diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c new file mode 100644 index 0000000..35281a2 --- /dev/null +++ b/gi/pygi-closure.c @@ -0,0 +1,445 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * pygi-closure.c: PyGI C Closure functions + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +/* This maintains a list of closures which can be free'd whenever + as they have been called. We will free them on the next + library function call. + */ +static GSList* async_free_list; + +static void +_pygi_closure_assign_pyobj_to_out_argument (gpointer out_arg, PyObject *object, + GITypeInfo *type_info, + GITransfer transfer) +{ + GIArgument arg = _pygi_argument_from_object (object, type_info, transfer); + GITypeTag type_tag = g_type_info_get_tag (type_info); + + if (out_arg == NULL) + return; + + switch (type_tag) { + case GI_TYPE_TAG_BOOLEAN: + *((gboolean *) out_arg) = arg.v_boolean; + break; + case GI_TYPE_TAG_INT8: + *((gint8 *) out_arg) = arg.v_int8; + break; + case GI_TYPE_TAG_UINT8: + *((guint8 *) out_arg) = arg.v_uint8; + break; + case GI_TYPE_TAG_INT16: + *((gint16 *) out_arg) = arg.v_int16; + break; + case GI_TYPE_TAG_UINT16: + *((guint16 *) out_arg) = arg.v_uint16; + break; + case GI_TYPE_TAG_INT32: + *((gint32 *) out_arg) = arg.v_int32; + break; + case GI_TYPE_TAG_UINT32: + *((guint32 *) out_arg) = arg.v_uint32; + break; + case GI_TYPE_TAG_INT64: + *((gint64 *) out_arg) = arg.v_int64; + break; + case GI_TYPE_TAG_UINT64: + *((glong *) out_arg) = arg.v_uint64; + break; + case GI_TYPE_TAG_FLOAT: + *((gfloat *) out_arg) = arg.v_float; + break; + case GI_TYPE_TAG_DOUBLE: + *((gdouble *) out_arg) = arg.v_double; + break; + default: + *((GIArgument *) out_arg) = arg; + break; + } +} + +static GIArgument * +_pygi_closure_convert_ffi_arguments (GICallableInfo *callable_info, void **args) +{ + gint num_args, i; + GIArgInfo *arg_info; + GITypeInfo *arg_type; + GITypeTag tag; + GIDirection direction; + GIArgument *g_args; + + num_args = g_callable_info_get_n_args (callable_info); + g_args = g_new0 (GIArgument, num_args); + + for (i = 0; i < num_args; i++) { + arg_info = g_callable_info_get_arg (callable_info, i); + arg_type = g_arg_info_get_type (arg_info); + tag = g_type_info_get_tag (arg_type); + direction = g_arg_info_get_direction (arg_info); + + if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { + g_args[i].v_pointer = * (gpointer *) args[i]; + } else { + switch (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 = g_type_info_get_interface (arg_type); + 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]; + g_base_info_unref (interface); + break; + } else if (interface_type == GI_INFO_TYPE_ENUM || + interface_type == GI_INFO_TYPE_FLAGS) { + g_args[i].v_double = * (double *) args[i]; + g_base_info_unref (interface); + break; + } else if (interface_type == GI_INFO_TYPE_STRUCT) { + g_args[i].v_pointer = * (gpointer *) args[i]; + g_base_info_unref (interface); + break; + } + + g_base_info_unref (interface); + } + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + g_args[i].v_pointer = * (gpointer *) args[i]; + break; + default: + g_args[i].v_pointer = 0; + } + } + g_base_info_unref ( (GIBaseInfo *) arg_info); + g_base_info_unref ( (GIBaseInfo *) arg_type); + } + return g_args; +} + +static gboolean +_pygi_closure_convert_arguments (GICallableInfo *callable_info, void **args, + void *user_data, PyObject **py_args, + GIArgument **out_args) +{ + int n_args = g_callable_info_get_n_args (callable_info); + int n_in_args = 0; + int n_out_args = 0; + int i; + GIArgument *g_args = NULL; + + *py_args = NULL; + *py_args = PyTuple_New (n_args); + if (*py_args == NULL) + goto error; + + *out_args = NULL; + *out_args = g_new0 (GIArgument, n_args); + g_args = _pygi_closure_convert_ffi_arguments (callable_info, args); + + for (i = 0; i < n_args; i++) { + GIArgInfo *arg_info = g_callable_info_get_arg (callable_info, i); + GIDirection direction = g_arg_info_get_direction (arg_info); + + if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) { + GITypeInfo *arg_type = g_arg_info_get_type (arg_info); + GITypeTag arg_tag = g_type_info_get_tag (arg_type); + GITransfer transfer = g_arg_info_get_ownership_transfer (arg_info); + PyObject *value; + GIArgument *arg; + + if (direction == GI_DIRECTION_IN && arg_tag == GI_TYPE_TAG_VOID && + g_type_info_is_pointer (arg_type)) { + + if (user_data == NULL) { + Py_INCREF (Py_None); + value = Py_None; + } else { + value = user_data; + Py_INCREF (value); + } + } else { + if (direction == GI_DIRECTION_IN) + arg = (GIArgument*) &g_args[i]; + else + arg = (GIArgument*) g_args[i].v_pointer; + + value = _pygi_argument_to_object (arg, arg_type, transfer); + if (value == NULL) { + g_base_info_unref (arg_type); + g_base_info_unref (arg_info); + goto error; + } + } + PyTuple_SET_ITEM (*py_args, n_in_args, value); + n_in_args++; + + g_base_info_unref (arg_type); + } + + if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { + (*out_args) [n_out_args] = g_args[i]; + n_out_args++; + } + + g_base_info_unref (arg_info); + } + + if (_PyTuple_Resize (py_args, n_in_args) == -1) + goto error; + + g_free (g_args); + return TRUE; + +error: + Py_CLEAR (*py_args); + g_free (*out_args); + *out_args = NULL; + g_free (g_args); + + return FALSE; +} + +static void +_pygi_closure_set_out_arguments (GICallableInfo *callable_info, + PyObject *py_retval, GIArgument *out_args, + void *resp) +{ + int n_args, i, i_py_retval, i_out_args; + GITypeInfo *return_type_info; + GITypeTag return_type_tag; + + i_py_retval = 0; + return_type_info = g_callable_info_get_return_type (callable_info); + return_type_tag = g_type_info_get_tag (return_type_info); + if (return_type_tag != GI_TYPE_TAG_VOID) { + GITransfer transfer = g_callable_info_get_caller_owns (callable_info); + if (PyTuple_Check (py_retval)) { + PyObject *item = PyTuple_GET_ITEM (py_retval, 0); + _pygi_closure_assign_pyobj_to_out_argument (resp, item, + return_type_info, transfer); + } else { + _pygi_closure_assign_pyobj_to_out_argument (resp, py_retval, + return_type_info, transfer); + } + i_py_retval++; + } + g_base_info_unref (return_type_info); + + i_out_args = 0; + n_args = g_callable_info_get_n_args (callable_info); + for (i = 1; i < n_args; i++) { + GIArgInfo *arg_info = g_callable_info_get_arg (callable_info, i); + GITypeInfo *type_info = g_arg_info_get_type (arg_info); + GIDirection direction = g_arg_info_get_direction (arg_info); + + if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { + GITransfer transfer = g_arg_info_get_ownership_transfer (arg_info); + + if (g_type_info_get_tag (type_info) == GI_TYPE_TAG_ERROR) { + /* TODO: check if an exception has been set and convert it to a GError */ + out_args[i_out_args].v_pointer = NULL; + i_out_args++; + continue; + } + + if (PyTuple_Check (py_retval)) { + PyObject *item = PyTuple_GET_ITEM (py_retval, i_py_retval); + _pygi_closure_assign_pyobj_to_out_argument ( + out_args[i_out_args].v_pointer, item, type_info, transfer); + } else if (i_py_retval == 0) { + _pygi_closure_assign_pyobj_to_out_argument ( + out_args[i_out_args].v_pointer, py_retval, type_info, + transfer); + } else + g_assert_not_reached(); + + i_out_args++; + i_py_retval++; + } + g_base_info_unref (type_info); + g_base_info_unref (arg_info); + } +} + +void +_pygi_closure_handle (ffi_cif *cif, + void *result, + void **args, + void *data) +{ + PyGILState_STATE state; + PyGICClosure *closure = data; + GITypeTag return_tag; + GITransfer return_transfer; + GITypeInfo *return_type; + PyObject *retval; + PyObject *py_args; + GIArgument *out_args = NULL; + + /* Lock the GIL as we are coming into this code without the lock and we + may be executing python code */ + state = PyGILState_Ensure(); + + return_type = g_callable_info_get_return_type (closure->info); + return_tag = g_type_info_get_tag (return_type); + return_transfer = g_callable_info_get_caller_owns (closure->info); + + if (!_pygi_closure_convert_arguments ( (GICallableInfo *) closure->info, args, + closure->user_data, + &py_args, &out_args)) { + if (PyErr_Occurred ()) + PyErr_Print(); + goto end; + } + + retval = PyObject_CallObject ( (PyObject *) closure->function, py_args); + Py_DECREF (py_args); + + if (retval == NULL) { + PyErr_Print(); + goto end; + } + + _pygi_closure_set_out_arguments (closure->info, retval, out_args, result); + +end: + g_free (out_args); + g_base_info_unref ( (GIBaseInfo*) return_type); + + PyGILState_Release (state); + + /* 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 and we can free async + anytime we want as long as its after we return from this function (you can't free the closure + you are currently using!) + */ + switch (closure->scope) { + case GI_SCOPE_TYPE_CALL: + case GI_SCOPE_TYPE_NOTIFIED: + break; + case GI_SCOPE_TYPE_ASYNC: + /* Append this PyGICClosure to a list of closure that we will free + after we're done with this function invokation */ + async_free_list = g_slist_prepend (async_free_list, closure); + break; + default: + g_error ("Invalid scope reached inside %s. Possibly a bad annotation?", + g_base_info_get_name (closure->info)); + } +} + +void _pygi_invoke_closure_free (gpointer data) +{ + PyGICClosure* invoke_closure = (PyGICClosure *) data; + + Py_DECREF (invoke_closure->function); + + g_callable_info_free_closure (invoke_closure->info, + invoke_closure->closure); + + if (invoke_closure->info) + g_base_info_unref ( (GIBaseInfo*) invoke_closure->info); + + Py_XDECREF (invoke_closure->user_data); + + g_slice_free (PyGICClosure, invoke_closure); +} + + +PyGICClosure* +_pygi_make_native_closure (GICallableInfo* info, + GIScopeType scope, + PyObject *py_function, + gpointer py_user_data) +{ + PyGICClosure *closure; + ffi_closure *fficlosure; + + /* Begin by cleaning up old async functions */ + g_slist_foreach (async_free_list, (GFunc) _pygi_invoke_closure_free, NULL); + g_slist_free (async_free_list); + async_free_list = NULL; + + /* Build the closure itself */ + closure = g_slice_new0 (PyGICClosure); + closure->info = (GICallableInfo *) g_base_info_ref ( (GIBaseInfo *) info); + closure->function = py_function; + closure->user_data = py_user_data; + + Py_INCREF (py_function); + if (closure->user_data) + Py_INCREF (closure->user_data); + + fficlosure = + g_callable_info_prepare_closure (info, &closure->cif, _pygi_closure_handle, + closure); + closure->closure = fficlosure; + + /* Give the closure the information it needs to determine when + to free itself later */ + closure->scope = scope; + + return closure; +} diff --git a/gi/pygi-closure.h b/gi/pygi-closure.h new file mode 100644 index 0000000..6f98339 --- /dev/null +++ b/gi/pygi-closure.h @@ -0,0 +1,57 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_CLOSURE_H__ +#define __PYGI_CLOSURE_H__ + +#include +#include +#include + +G_BEGIN_DECLS + + +/* Private */ + +typedef struct _PyGICClosure +{ + GICallableInfo *info; + PyObject *function; + + ffi_closure *closure; + ffi_cif cif; + + GIScopeType scope; + + PyObject* user_data; +} PyGICClosure; + +void _pygi_closure_handle (ffi_cif *cif, void *result, void + **args, void *userdata); + +void _pygi_invoke_closure_free (gpointer user_data); + +PyGICClosure* _pygi_make_native_closure (GICallableInfo* info, + GIScopeType scope, + PyObject *function, + gpointer user_data); + +G_END_DECLS + +#endif /* __PYGI_CLOSURE_H__ */ diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c new file mode 100644 index 0000000..e332a22 --- /dev/null +++ b/gi/pygi-foreign-cairo.c @@ -0,0 +1,136 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2010 Collabora Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include +#include + +#if PY_VERSION_HEX < 0x03000000 +#include +#else +#include +#endif + +Pycairo_CAPI_t *Pycairo_CAPI; + +#include "pygi-foreign.h" + +#include + +PyObject * +cairo_context_to_arg (PyObject *value, + GIInterfaceInfo *iface_info, + GITransfer transfer, + GIArgument *arg) +{ + cairo_t *cr; + + g_assert (transfer == GI_TRANSFER_NOTHING); + + cr = PycairoContext_GET (value); + if (!cr) { + return NULL; + } + + arg->v_pointer = cr; + Py_RETURN_NONE; +} + +PyObject * +cairo_context_from_arg (GIInterfaceInfo *iface_info, + gpointer data) +{ + cairo_t *context = (cairo_t*) data; + + cairo_reference (context); + + return PycairoContext_FromContext (context, &PycairoContext_Type, NULL); +} + +PyObject * +cairo_context_release (GIBaseInfo *base_info, + gpointer struct_) +{ + cairo_destroy ( (cairo_t*) struct_); + Py_RETURN_NONE; +} + + +PyObject * +cairo_surface_to_arg (PyObject *value, + GIInterfaceInfo *iface_info, + GITransfer transfer, + GIArgument *arg) +{ + cairo_surface_t *surface; + + g_assert (transfer == GI_TRANSFER_NOTHING); + + surface = ( (PycairoSurface*) value)->surface; + if (!surface) { + PyErr_SetString (PyExc_ValueError, "Surface instance wrapping a NULL surface"); + return NULL; + } + + arg->v_pointer = surface; + Py_RETURN_NONE; +} + +PyObject * +cairo_surface_from_arg (GIInterfaceInfo *iface_info, + gpointer data) +{ + cairo_surface_t *surface = (cairo_surface_t*) data; + + cairo_surface_reference (surface); + + return PycairoSurface_FromSurface (surface, NULL); +} + +PyObject * +cairo_surface_release (GIBaseInfo *base_info, + gpointer struct_) +{ + cairo_surface_destroy ( (cairo_surface_t*) struct_); + Py_RETURN_NONE; +} + +static PyMethodDef _gi_cairo_functions[] = {}; +PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo") +{ + Pycairo_IMPORT; + if (Pycairo_CAPI == NULL) + return PYGLIB_MODULE_ERROR_RETURN; + + pygi_register_foreign_struct ("cairo", + "Context", + cairo_context_to_arg, + cairo_context_from_arg, + cairo_context_release); + + pygi_register_foreign_struct ("cairo", + "Surface", + cairo_surface_to_arg, + cairo_surface_from_arg, + cairo_surface_release); +} +PYGLIB_MODULE_END; diff --git a/gi/pygi-foreign-gvariant.c b/gi/pygi-foreign-gvariant.c new file mode 100644 index 0000000..9249d44 --- /dev/null +++ b/gi/pygi-foreign-gvariant.c @@ -0,0 +1,62 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2010 Collabora Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "pygobject.h" + +#include "pygi-private.h" +#include "pygi-foreign-gvariant.h" + +PyObject * +g_variant_to_arg (PyObject *value, + GIInterfaceInfo *type_info, + GITransfer transfer, + GIArgument *arg) +{ + g_assert (transfer == GI_TRANSFER_NOTHING); + + /* TODO check that value is a PyGPointer */ + + arg->v_pointer = (GVariant *) ( (PyGPointer *) value)->pointer; + Py_RETURN_NONE; +} + +PyObject * +g_variant_from_arg (GIInterfaceInfo *iface_info, + gpointer data) +{ + GVariant *variant = (GVariant *) data; + PyObject *type = _pygi_type_import_by_gi_info (iface_info); + + g_variant_ref_sink (variant); + + return _pygi_struct_new ( (PyTypeObject *) type, variant, FALSE); +} + +PyObject * +g_variant_release_foreign (GIBaseInfo *base_info, + gpointer struct_) +{ + g_variant_unref ( (GVariant *) struct_); + Py_RETURN_NONE; +} + diff --git a/gi/pygi-foreign-gvariant.h b/gi/pygi-foreign-gvariant.h new file mode 100644 index 0000000..8ebc4cd --- /dev/null +++ b/gi/pygi-foreign-gvariant.h @@ -0,0 +1,39 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2010 Collabora Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __PYGI_FOREIGN_G_VARIANT_H__ +#define __PYGI_FOREIGN_G_VARIANT_H__ + +#include "pygi-foreign.h" + +PyObject *g_variant_to_arg (PyObject *value, + GIInterfaceInfo *iface_info, + GITransfer transfer, + GIArgument *arg); +PyObject *g_variant_from_arg (GIInterfaceInfo *iface_info, + gpointer data); +PyObject *g_variant_release_foreign (GIBaseInfo *base_info, + gpointer struct_); + +#endif /* __PYGI_FOREIGN_G_VARIANT_H__ */ + diff --git a/gi/pygi-foreign.c b/gi/pygi-foreign.c new file mode 100644 index 0000000..eafaca3 --- /dev/null +++ b/gi/pygi-foreign.c @@ -0,0 +1,173 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2010 litl, LLC + * Copyright (c) 2010 Collabora Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "pygi-foreign.h" +#include "pygi-foreign-gvariant.h" + +#include + +typedef struct { + const char *namespace; + const char *name; + PyGIArgOverrideToGIArgumentFunc to_func; + PyGIArgOverrideFromGIArgumentFunc from_func; + PyGIArgOverrideReleaseFunc release_func; +} PyGIForeignStruct; + +static GPtrArray *foreign_structs = NULL; + +void +init_foreign_structs () +{ + foreign_structs = g_ptr_array_new (); + + pygi_register_foreign_struct ("GLib", + "Variant", + g_variant_to_arg, + g_variant_from_arg, + g_variant_release_foreign); +} + +static PyGIForeignStruct * +do_lookup (const gchar *namespace, const gchar *name) +{ + gint i; + for (i = 0; i < foreign_structs->len; i++) { + PyGIForeignStruct *foreign_struct = \ + g_ptr_array_index (foreign_structs, i); + + if ( (strcmp (namespace, foreign_struct->namespace) == 0) && + (strcmp (name, foreign_struct->name) == 0)) { + return foreign_struct; + } + } + return NULL; +} + +static PyGIForeignStruct * +pygi_struct_foreign_lookup (GIBaseInfo *base_info) +{ + PyGIForeignStruct *result; + const gchar *namespace = g_base_info_get_namespace (base_info); + const gchar *name = g_base_info_get_name (base_info); + + if (foreign_structs == NULL) { + init_foreign_structs (); + } + + result = do_lookup (namespace, name); + + if (result == NULL) { + gchar *module_name = g_strconcat ("gi._gi_", namespace, NULL); + PyObject *module = PyImport_ImportModule (module_name); + + g_free (module_name); + + if (module == NULL) + PyErr_Clear (); + else { + Py_DECREF (module); + result = do_lookup (namespace, name); + } + } + + if (result == NULL) { + PyErr_Format (PyExc_TypeError, + "Couldn't find conversion for foreign struct '%s.%s'", + namespace, + name); + } + + return result; +} + +PyObject * +pygi_struct_foreign_convert_to_g_argument (PyObject *value, + GIInterfaceInfo *iface_info, + GITransfer transfer, + GIArgument *arg) +{ + GIBaseInfo *base_info = (GIBaseInfo *) iface_info; + PyGIForeignStruct *foreign_struct = pygi_struct_foreign_lookup (base_info); + + if (foreign_struct == NULL) + return NULL; + + if (!foreign_struct->to_func (value, iface_info, transfer, arg)) + return NULL; + + Py_RETURN_NONE; +} + +PyObject * +pygi_struct_foreign_convert_from_g_argument (GIInterfaceInfo *iface_info, + GIArgument *arg) +{ + GIBaseInfo *base_info = (GIBaseInfo *) iface_info; + PyGIForeignStruct *foreign_struct = pygi_struct_foreign_lookup (base_info); + + if (foreign_struct == NULL) + return NULL; + + return foreign_struct->from_func (iface_info, arg); +} + +PyObject * +pygi_struct_foreign_release (GIBaseInfo *base_info, + gpointer struct_) +{ + PyGIForeignStruct *foreign_struct = pygi_struct_foreign_lookup (base_info); + + if (foreign_struct == NULL) + return NULL; + + if (!foreign_struct->release_func) + Py_RETURN_NONE; + + if (!foreign_struct->release_func (base_info, struct_)) + return NULL; + + Py_RETURN_NONE; +} + +void +pygi_register_foreign_struct_real (const char* namespace_, + const char* name, + PyGIArgOverrideToGIArgumentFunc to_func, + PyGIArgOverrideFromGIArgumentFunc from_func, + PyGIArgOverrideReleaseFunc release_func) +{ + PyGIForeignStruct *new_struct = g_slice_new (PyGIForeignStruct); + new_struct->namespace = namespace_; + new_struct->name = name; + new_struct->to_func = to_func; + new_struct->from_func = from_func; + new_struct->release_func = release_func; + + g_ptr_array_add (foreign_structs, new_struct); +} diff --git a/gi/pygi-foreign.h b/gi/pygi-foreign.h new file mode 100644 index 0000000..b07f682 --- /dev/null +++ b/gi/pygi-foreign.h @@ -0,0 +1,48 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2010 litl, LLC + * Copyright (c) 2010 Collabora Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __PYGI_FOREIGN_H__ +#define __PYGI_FOREIGN_H__ + +#include +#include + +#include "pygi.h" + +PyObject *pygi_struct_foreign_convert_to_g_argument (PyObject *value, + GIInterfaceInfo *iface_info, + GITransfer transfer, + GIArgument *arg); +PyObject *pygi_struct_foreign_convert_from_g_argument (GIInterfaceInfo *iface_info, + GIArgument *arg); +PyObject *pygi_struct_foreign_release (GIBaseInfo *base_info, + gpointer struct_); + +void pygi_register_foreign_struct_real (const char* namespace_, + const char* name, + PyGIArgOverrideToGIArgumentFunc to_func, + PyGIArgOverrideFromGIArgumentFunc from_func, + PyGIArgOverrideReleaseFunc release_func); + +#endif /* __PYGI_FOREIGN_H__ */ diff --git a/gi/pygi-info.c b/gi/pygi-info.c new file mode 100644 index 0000000..1bfd7d8 --- /dev/null +++ b/gi/pygi-info.c @@ -0,0 +1,1617 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * pygi-info.c: GI.*Info wrappers. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +#include +#include + +/* BaseInfo */ + +static void +_base_info_dealloc (PyGIBaseInfo *self) +{ + PyObject_GC_UnTrack ( (PyObject *) self); + + PyObject_ClearWeakRefs ( (PyObject *) self); + + g_base_info_unref (self->info); + + Py_TYPE( (PyObject *) self)->tp_free ( (PyObject *) self); +} + +static int +_base_info_traverse (PyGIBaseInfo *self, + visitproc visit, + void *arg) +{ + return 0; +} + +static PyObject * +_base_info_repr (PyGIBaseInfo *self) +{ + return PYGLIB_PyUnicode_FromFormat ("<%s object (%s) at 0x%p>", + Py_TYPE( (PyObject *) self)->tp_name, + g_base_info_get_name (self->info), + (void *) self); +} + +static PyObject * +_base_info_richcompare (PyGIBaseInfo *self, PyObject *other, int op) +{ + PyObject *res; + GIBaseInfo *other_info; + + if (!PyObject_TypeCheck(other, &PyGIBaseInfo_Type)) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + + other_info = ((PyGIBaseInfo *)other)->info; + + switch (op) { + case Py_EQ: + res = g_base_info_equal (self->info, other_info) ? Py_True : Py_False; + break; + case Py_NE: + res = g_base_info_equal (self->info, other_info) ? Py_False : Py_True; + break; + default: + res = Py_NotImplemented; + break; + } + Py_INCREF(res); + return res; +} + +static PyMethodDef _PyGIBaseInfo_methods[]; + +PYGLIB_DEFINE_TYPE("gi.BaseInfo", PyGIBaseInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_base_info_get_name (PyGIBaseInfo *self) +{ + return PYGLIB_PyUnicode_FromString (g_base_info_get_name (self->info)); +} + +static PyObject * +_wrap_g_base_info_get_namespace (PyGIBaseInfo *self) +{ + return PYGLIB_PyUnicode_FromString (g_base_info_get_namespace (self->info)); +} + +static PyObject * +_wrap_g_base_info_get_container (PyGIBaseInfo *self) +{ + GIBaseInfo *info; + + info = g_base_info_get_container (self->info); + + if (info == NULL) { + Py_RETURN_NONE; + } + + return _pygi_info_new (info); +} + + +static PyMethodDef _PyGIBaseInfo_methods[] = { + { "get_name", (PyCFunction) _wrap_g_base_info_get_name, METH_NOARGS }, + { "get_namespace", (PyCFunction) _wrap_g_base_info_get_namespace, METH_NOARGS }, + { "get_container", (PyCFunction) _wrap_g_base_info_get_container, METH_NOARGS }, + { NULL, NULL, 0 } +}; + +PyObject * +_pygi_info_new (GIBaseInfo *info) +{ + GIInfoType info_type; + PyTypeObject *type = NULL; + PyGIBaseInfo *self; + + info_type = g_base_info_get_type (info); + + switch (info_type) + { + case GI_INFO_TYPE_INVALID: + PyErr_SetString (PyExc_RuntimeError, "Invalid info type"); + return NULL; + case GI_INFO_TYPE_FUNCTION: + type = &PyGIFunctionInfo_Type; + break; + case GI_INFO_TYPE_CALLBACK: + type = &PyGICallbackInfo_Type; + break; + case GI_INFO_TYPE_STRUCT: + type = &PyGIStructInfo_Type; + break; + case GI_INFO_TYPE_BOXED: + type = &PyGIBoxedInfo_Type; + break; + case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: + type = &PyGIEnumInfo_Type; + break; + case GI_INFO_TYPE_OBJECT: + type = &PyGIObjectInfo_Type; + break; + case GI_INFO_TYPE_INTERFACE: + type = &PyGIInterfaceInfo_Type; + break; + case GI_INFO_TYPE_CONSTANT: + type = &PyGIConstantInfo_Type; + break; + case GI_INFO_TYPE_ERROR_DOMAIN: + type = &PyGIErrorDomainInfo_Type; + break; + case GI_INFO_TYPE_UNION: + type = &PyGIUnionInfo_Type; + break; + case GI_INFO_TYPE_VALUE: + type = &PyGIValueInfo_Type; + break; + case GI_INFO_TYPE_SIGNAL: + type = &PyGISignalInfo_Type; + break; + case GI_INFO_TYPE_VFUNC: + type = &PyGIVFuncInfo_Type; + break; + case GI_INFO_TYPE_PROPERTY: + type = &PyGIPropertyInfo_Type; + break; + case GI_INFO_TYPE_FIELD: + type = &PyGIFieldInfo_Type; + break; + case GI_INFO_TYPE_ARG: + type = &PyGIArgInfo_Type; + break; + case GI_INFO_TYPE_TYPE: + type = &PyGITypeInfo_Type; + break; + case GI_INFO_TYPE_UNRESOLVED: + type = &PyGIUnresolvedInfo_Type; + break; + } + + self = (PyGIBaseInfo *) type->tp_alloc (type, 0); + if (self == NULL) { + return NULL; + } + + self->info = g_base_info_ref (info); + + return (PyObject *) self; +} + +GIBaseInfo * +_pygi_object_get_gi_info (PyObject *object, + PyTypeObject *type) +{ + PyObject *py_info; + GIBaseInfo *info = NULL; + + py_info = PyObject_GetAttrString (object, "__info__"); + if (py_info == NULL) { + return NULL; + } + if (!PyObject_TypeCheck (py_info, type)) { + PyErr_Format (PyExc_TypeError, "attribute '__info__' must be %s, not %s", + type->tp_name, Py_TYPE(&py_info)->tp_name); + goto out; + } + + info = ( (PyGIBaseInfo *) py_info)->info; + g_base_info_ref (info); + +out: + Py_DECREF (py_info); + + return info; +} + + +/* CallableInfo */ +PYGLIB_DEFINE_TYPE ("gi.CallableInfo", PyGICallableInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_callable_info_get_arguments (PyGIBaseInfo *self) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + n_infos = g_callable_info_get_n_args ( (GICallableInfo *) self->info); + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + info = (GIBaseInfo *) g_callable_info_get_arg ( (GICallableInfo *) self->info, i); + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyMethodDef _PyGICallableInfo_methods[] = { + { "invoke", (PyCFunction) _wrap_g_callable_info_invoke, METH_VARARGS | METH_KEYWORDS }, + { "get_arguments", (PyCFunction) _wrap_g_callable_info_get_arguments, METH_NOARGS }, + { NULL, NULL, 0 } +}; + +/* CallbackInfo */ +PYGLIB_DEFINE_TYPE ("gi.CallbackInfo", PyGICallbackInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGICallbackInfo_methods[] = { + { NULL, NULL, 0 } +}; + +/* BoxedInfo */ +PYGLIB_DEFINE_TYPE ("gi.BoxedInfo", PyGIBoxedInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGIBoxedInfo_methods[] = { + { NULL, NULL, 0 } +}; + +/* ErrorDomainInfo */ +PYGLIB_DEFINE_TYPE ("gi.ErrorDomainInfo", PyGIErrorDomainInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGIErrorDomainInfo_methods[] = { + { NULL, NULL, 0 } +}; + +/* SignalInfo */ +PYGLIB_DEFINE_TYPE ("gi.SignalInfo", PyGISignalInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGISignalInfo_methods[] = { + { NULL, NULL, 0 } +}; + +/* PropertyInfo */ +PYGLIB_DEFINE_TYPE ("gi.PropertyInfo", PyGIPropertyInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGIPropertyInfo_methods[] = { + { NULL, NULL, 0 } +}; + +/* ArgInfo */ +PYGLIB_DEFINE_TYPE ("gi.ArgInfo", PyGIArgInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGIArgInfo_methods[] = { + { NULL, NULL, 0 } +}; + +/* TypeInfo */ +PYGLIB_DEFINE_TYPE ("gi.TypeInfo", PyGITypeInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGITypeInfo_methods[] = { + { NULL, NULL, 0 } +}; + + +/* FunctionInfo */ +PYGLIB_DEFINE_TYPE ("gi.FunctionInfo", PyGIFunctionInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_function_info_is_constructor (PyGIBaseInfo *self) +{ + GIFunctionInfoFlags flags; + gboolean is_constructor; + + flags = g_function_info_get_flags ( (GIFunctionInfo*) self->info); + is_constructor = flags & GI_FUNCTION_IS_CONSTRUCTOR; + + return PyBool_FromLong (is_constructor); +} + +static PyObject * +_wrap_g_function_info_is_method (PyGIBaseInfo *self) +{ + GIFunctionInfoFlags flags; + gboolean is_method; + + flags = g_function_info_get_flags ( (GIFunctionInfo*) self->info); + is_method = flags & GI_FUNCTION_IS_METHOD; + + return PyBool_FromLong (is_method); +} + +gsize +_pygi_g_type_tag_size (GITypeTag type_tag) +{ + gsize size = 0; + + switch (type_tag) { + case GI_TYPE_TAG_BOOLEAN: + size = sizeof (gboolean); + break; + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_UINT8: + size = sizeof (gint8); + break; + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_UINT16: + size = sizeof (gint16); + break; + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_UINT32: + size = sizeof (gint32); + break; + case GI_TYPE_TAG_INT64: + case GI_TYPE_TAG_UINT64: + size = sizeof (gint64); + break; + case GI_TYPE_TAG_FLOAT: + size = sizeof (gfloat); + break; + case GI_TYPE_TAG_DOUBLE: + size = sizeof (gdouble); + break; + case GI_TYPE_TAG_GTYPE: + size = sizeof (GType); + break; + case GI_TYPE_TAG_UNICHAR: + size = sizeof (gunichar); + break; + case GI_TYPE_TAG_VOID: + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + case GI_TYPE_TAG_ARRAY: + case GI_TYPE_TAG_INTERFACE: + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + case GI_TYPE_TAG_GHASH: + case GI_TYPE_TAG_ERROR: + PyErr_Format (PyExc_TypeError, + "Unable to know the size (assuming %s is not a pointer)", + g_type_tag_to_string (type_tag)); + break; + } + + return size; +} + +gsize +_pygi_g_type_info_size (GITypeInfo *type_info) +{ + gsize size = 0; + + GITypeTag type_tag; + + type_tag = g_type_info_get_tag (type_info); + switch (type_tag) { + case GI_TYPE_TAG_BOOLEAN: + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_UINT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_INT64: + case GI_TYPE_TAG_UINT64: + case GI_TYPE_TAG_FLOAT: + case GI_TYPE_TAG_DOUBLE: + case GI_TYPE_TAG_GTYPE: + case GI_TYPE_TAG_UNICHAR: + if (g_type_info_is_pointer (type_info)) { + size = sizeof (gpointer); + } else { + size = _pygi_g_type_tag_size (type_tag); + g_assert (size > 0); + } + break; + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + + info = g_type_info_get_interface (type_info); + info_type = g_base_info_get_type (info); + + switch (info_type) { + case GI_INFO_TYPE_STRUCT: + if (g_type_info_is_pointer (type_info)) { + size = sizeof (gpointer); + } else { + size = g_struct_info_get_size ( (GIStructInfo *) info); + } + break; + case GI_INFO_TYPE_UNION: + if (g_type_info_is_pointer (type_info)) { + size = sizeof (gpointer); + } else { + size = g_union_info_get_size ( (GIUnionInfo *) info); + } + break; + case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: + if (g_type_info_is_pointer (type_info)) { + size = sizeof (gpointer); + } else { + GITypeTag type_tag; + + type_tag = g_enum_info_get_storage_type ( (GIEnumInfo *) info); + size = _pygi_g_type_tag_size (type_tag); + } + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_OBJECT: + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_CALLBACK: + size = sizeof (gpointer); + break; + case GI_INFO_TYPE_VFUNC: + case GI_INFO_TYPE_INVALID: + case GI_INFO_TYPE_FUNCTION: + case GI_INFO_TYPE_CONSTANT: + case GI_INFO_TYPE_ERROR_DOMAIN: + case GI_INFO_TYPE_VALUE: + case GI_INFO_TYPE_SIGNAL: + case GI_INFO_TYPE_PROPERTY: + case GI_INFO_TYPE_FIELD: + case GI_INFO_TYPE_ARG: + case GI_INFO_TYPE_TYPE: + case GI_INFO_TYPE_UNRESOLVED: + g_assert_not_reached(); + break; + } + + g_base_info_unref (info); + break; + } + case GI_TYPE_TAG_ARRAY: + case GI_TYPE_TAG_VOID: + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + case GI_TYPE_TAG_GHASH: + case GI_TYPE_TAG_ERROR: + size = sizeof (gpointer); + break; + } + + return size; +} + +static PyMethodDef _PyGIFunctionInfo_methods[] = { + { "is_constructor", (PyCFunction) _wrap_g_function_info_is_constructor, METH_NOARGS }, + { "is_method", (PyCFunction) _wrap_g_function_info_is_method, METH_NOARGS }, + { NULL, NULL, 0 } +}; + + +/* RegisteredTypeInfo */ +PYGLIB_DEFINE_TYPE ("gi.RegisteredTypeInfo", PyGIRegisteredTypeInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_registered_type_info_get_g_type (PyGIBaseInfo *self) +{ + GType type; + + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) self->info); + + return pyg_type_wrapper_new (type); +} + +static PyMethodDef _PyGIRegisteredTypeInfo_methods[] = { + { "get_g_type", (PyCFunction) _wrap_g_registered_type_info_get_g_type, METH_NOARGS }, + { NULL, NULL, 0 } +}; + + +/* GIStructInfo */ +PYGLIB_DEFINE_TYPE ("StructInfo", PyGIStructInfo_Type, PyGIBaseInfo); + +static PyObject * +_get_fields (PyGIBaseInfo *self, GIInfoType info_type) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + switch (info_type) { + case GI_INFO_TYPE_STRUCT: + n_infos = g_struct_info_get_n_fields ( (GIStructInfo *) self->info); + break; + case GI_INFO_TYPE_OBJECT: + n_infos = g_object_info_get_n_fields ( (GIObjectInfo *) self->info); + break; + default: + g_assert_not_reached(); + } + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + switch (info_type) { + case GI_INFO_TYPE_STRUCT: + info = (GIBaseInfo *) g_struct_info_get_field ( (GIStructInfo *) self->info, i); + break; + case GI_INFO_TYPE_OBJECT: + info = (GIBaseInfo *) g_object_info_get_field ( (GIObjectInfo *) self->info, i); + break; + default: + g_assert_not_reached(); + } + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_get_methods (PyGIBaseInfo *self, GIInfoType info_type) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + switch (info_type) { + case GI_INFO_TYPE_STRUCT: + n_infos = g_struct_info_get_n_methods ( (GIStructInfo *) self->info); + break; + case GI_INFO_TYPE_OBJECT: + n_infos = g_object_info_get_n_methods ( (GIObjectInfo *) self->info); + break; + default: + g_assert_not_reached(); + } + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + switch (info_type) { + case GI_INFO_TYPE_STRUCT: + info = (GIBaseInfo *) g_struct_info_get_method ( (GIStructInfo *) self->info, i); + break; + case GI_INFO_TYPE_OBJECT: + info = (GIBaseInfo *) g_object_info_get_method ( (GIObjectInfo *) self->info, i); + break; + default: + g_assert_not_reached(); + } + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_get_constants (PyGIBaseInfo *self, GIInfoType info_type) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + switch (info_type) { + case GI_INFO_TYPE_INTERFACE: + n_infos = g_interface_info_get_n_constants ( (GIInterfaceInfo *) self->info); + break; + case GI_INFO_TYPE_OBJECT: + n_infos = g_object_info_get_n_constants ( (GIObjectInfo *) self->info); + break; + default: + g_assert_not_reached(); + } + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + switch (info_type) { + case GI_INFO_TYPE_INTERFACE: + info = (GIBaseInfo *) g_interface_info_get_constant ( (GIInterfaceInfo *) self->info, i); + break; + case GI_INFO_TYPE_OBJECT: + info = (GIBaseInfo *) g_object_info_get_constant ( (GIObjectInfo *) self->info, i); + break; + default: + g_assert_not_reached(); + } + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_get_vfuncs (PyGIBaseInfo *self, GIInfoType info_type) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + switch (info_type) { + case GI_INFO_TYPE_INTERFACE: + n_infos = g_interface_info_get_n_vfuncs ( (GIInterfaceInfo *) self->info); + break; + case GI_INFO_TYPE_OBJECT: + n_infos = g_object_info_get_n_vfuncs ( (GIObjectInfo *) self->info); + break; + default: + g_assert_not_reached(); + } + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + switch (info_type) { + case GI_INFO_TYPE_INTERFACE: + info = (GIBaseInfo *) g_interface_info_get_vfunc ( (GIInterfaceInfo *) self->info, i); + break; + case GI_INFO_TYPE_OBJECT: + info = (GIBaseInfo *) g_object_info_get_vfunc ( (GIObjectInfo *) self->info, i); + break; + default: + g_assert_not_reached(); + } + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_wrap_g_struct_info_get_fields (PyGIBaseInfo *self) +{ + return _get_fields (self, GI_INFO_TYPE_STRUCT); +} + +static PyObject * +_wrap_g_struct_info_get_methods (PyGIBaseInfo *self) +{ + return _get_methods (self, GI_INFO_TYPE_STRUCT); +} + +static PyMethodDef _PyGIStructInfo_methods[] = { + { "get_fields", (PyCFunction) _wrap_g_struct_info_get_fields, METH_NOARGS }, + { "get_methods", (PyCFunction) _wrap_g_struct_info_get_methods, METH_NOARGS }, + { NULL, NULL, 0 } +}; + +gboolean +pygi_g_struct_info_is_simple (GIStructInfo *struct_info) +{ + gboolean is_simple; + gsize n_field_infos; + gsize i; + + is_simple = TRUE; + + n_field_infos = g_struct_info_get_n_fields (struct_info); + + for (i = 0; i < n_field_infos && is_simple; i++) { + GIFieldInfo *field_info; + GITypeInfo *field_type_info; + + field_info = g_struct_info_get_field (struct_info, i); + field_type_info = g_field_info_get_type (field_info); + + GITypeTag field_type_tag; + + field_type_tag = g_type_info_get_tag (field_type_info); + + switch (field_type_tag) { + case GI_TYPE_TAG_BOOLEAN: + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_UINT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_INT64: + case GI_TYPE_TAG_UINT64: + case GI_TYPE_TAG_FLOAT: + case GI_TYPE_TAG_DOUBLE: + case GI_TYPE_TAG_UNICHAR: + if (g_type_info_is_pointer (field_type_info)) { + is_simple = FALSE; + } + break; + case GI_TYPE_TAG_VOID: + case GI_TYPE_TAG_GTYPE: + case GI_TYPE_TAG_ERROR: + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + case GI_TYPE_TAG_ARRAY: + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + case GI_TYPE_TAG_GHASH: + is_simple = FALSE; + break; + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + + info = g_type_info_get_interface (field_type_info); + info_type = g_base_info_get_type (info); + + switch (info_type) { + case GI_INFO_TYPE_STRUCT: + if (g_type_info_is_pointer (field_type_info)) { + is_simple = FALSE; + } else { + is_simple = pygi_g_struct_info_is_simple ( (GIStructInfo *) info); + } + break; + case GI_INFO_TYPE_UNION: + /* TODO */ + is_simple = FALSE; + break; + case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: + if (g_type_info_is_pointer (field_type_info)) { + is_simple = FALSE; + } + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_OBJECT: + case GI_INFO_TYPE_CALLBACK: + case GI_INFO_TYPE_INTERFACE: + is_simple = FALSE; + break; + case GI_INFO_TYPE_VFUNC: + case GI_INFO_TYPE_INVALID: + case GI_INFO_TYPE_FUNCTION: + case GI_INFO_TYPE_CONSTANT: + case GI_INFO_TYPE_ERROR_DOMAIN: + case GI_INFO_TYPE_VALUE: + case GI_INFO_TYPE_SIGNAL: + case GI_INFO_TYPE_PROPERTY: + case GI_INFO_TYPE_FIELD: + case GI_INFO_TYPE_ARG: + case GI_INFO_TYPE_TYPE: + case GI_INFO_TYPE_UNRESOLVED: + g_assert_not_reached(); + } + + g_base_info_unref (info); + break; + } + } + + g_base_info_unref ( (GIBaseInfo *) field_type_info); + g_base_info_unref ( (GIBaseInfo *) field_info); + } + + return is_simple; +} + + +/* EnumInfo */ +PYGLIB_DEFINE_TYPE ("gi.EnumInfo", PyGIEnumInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_enum_info_get_values (PyGIBaseInfo *self) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + n_infos = g_enum_info_get_n_values ( (GIEnumInfo *) self->info); + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + info = (GIBaseInfo *) g_enum_info_get_value ( (GIEnumInfo *) self->info, i); + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_wrap_g_enum_info_is_flags (PyGIBaseInfo *self) +{ + GIInfoType info_type = g_base_info_get_type ((GIBaseInfo *) self->info); + + if (info_type == GI_INFO_TYPE_ENUM) { + Py_RETURN_FALSE; + } else if (info_type == GI_INFO_TYPE_FLAGS) { + Py_RETURN_TRUE; + } else { + g_assert_not_reached(); + } +} + +static PyMethodDef _PyGIEnumInfo_methods[] = { + { "get_values", (PyCFunction) _wrap_g_enum_info_get_values, METH_NOARGS }, + { "is_flags", (PyCFunction) _wrap_g_enum_info_is_flags, METH_NOARGS }, + { NULL, NULL, 0 } +}; + + +/* ObjectInfo */ +PYGLIB_DEFINE_TYPE ("ObjectInfo", PyGIObjectInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_object_info_get_parent (PyGIBaseInfo *self) +{ + GIBaseInfo *info; + PyObject *py_info; + + info = (GIBaseInfo *) g_object_info_get_parent ( (GIObjectInfo*) self->info); + + if (info == NULL) { + Py_RETURN_NONE; + } + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + return py_info; +} + +static PyObject * +_wrap_g_object_info_get_methods (PyGIBaseInfo *self) +{ + return _get_methods (self, GI_INFO_TYPE_OBJECT); +} + +static PyObject * +_wrap_g_object_info_get_fields (PyGIBaseInfo *self) +{ + return _get_fields (self, GI_INFO_TYPE_OBJECT); +} + +static PyObject * +_wrap_g_object_info_get_interfaces (PyGIBaseInfo *self) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + n_infos = g_object_info_get_n_interfaces ( (GIObjectInfo *) self->info); + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + info = (GIBaseInfo *) g_object_info_get_interface ( (GIObjectInfo *) self->info, i); + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_wrap_g_object_info_get_constants (PyGIBaseInfo *self) +{ + return _get_constants (self, GI_INFO_TYPE_OBJECT); +} + +static PyObject * +_wrap_g_object_info_get_vfuncs (PyGIBaseInfo *self) +{ + return _get_vfuncs (self, GI_INFO_TYPE_OBJECT); +} + +static PyMethodDef _PyGIObjectInfo_methods[] = { + { "get_parent", (PyCFunction) _wrap_g_object_info_get_parent, METH_NOARGS }, + { "get_methods", (PyCFunction) _wrap_g_object_info_get_methods, METH_NOARGS }, + { "get_fields", (PyCFunction) _wrap_g_object_info_get_fields, METH_NOARGS }, + { "get_interfaces", (PyCFunction) _wrap_g_object_info_get_interfaces, METH_NOARGS }, + { "get_constants", (PyCFunction) _wrap_g_object_info_get_constants, METH_NOARGS }, + { "get_vfuncs", (PyCFunction) _wrap_g_object_info_get_vfuncs, METH_NOARGS }, + { NULL, NULL, 0 } +}; + + +/* GIInterfaceInfo */ +PYGLIB_DEFINE_TYPE ("InterfaceInfo", PyGIInterfaceInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_interface_info_get_methods (PyGIBaseInfo *self) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + n_infos = g_interface_info_get_n_methods ( (GIInterfaceInfo *) self->info); + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + info = (GIBaseInfo *) g_interface_info_get_method ( (GIInterfaceInfo *) self->info, i); + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_wrap_g_interface_info_get_constants (PyGIBaseInfo *self) +{ + return _get_constants (self, GI_INFO_TYPE_INTERFACE); +} + +static PyObject * +_wrap_g_interface_info_get_vfuncs (PyGIBaseInfo *self) +{ + return _get_vfuncs (self, GI_INFO_TYPE_INTERFACE); +} + +static PyMethodDef _PyGIInterfaceInfo_methods[] = { + { "get_methods", (PyCFunction) _wrap_g_interface_info_get_methods, METH_NOARGS }, + { "get_constants", (PyCFunction) _wrap_g_interface_info_get_constants, METH_NOARGS }, + { "get_vfuncs", (PyCFunction) _wrap_g_interface_info_get_vfuncs, METH_NOARGS }, + { NULL, NULL, 0 } +}; + +/* GIConstantInfo */ +PYGLIB_DEFINE_TYPE ("gi.ConstantInfo", PyGIConstantInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_constant_info_get_value (PyGIBaseInfo *self) +{ + GITypeInfo *type_info; + GIArgument value; + PyObject *py_value; + + if (g_constant_info_get_value ( (GIConstantInfo *) self->info, &value) < 0) { + PyErr_SetString (PyExc_RuntimeError, "unable to get value"); + return NULL; + } + + type_info = g_constant_info_get_type ( (GIConstantInfo *) self->info); + + py_value = _pygi_argument_to_object (&value, type_info, GI_TRANSFER_NOTHING); + + g_base_info_unref ( (GIBaseInfo *) type_info); + + return py_value; +} + +static PyMethodDef _PyGIConstantInfo_methods[] = { + { "get_value", (PyCFunction) _wrap_g_constant_info_get_value, METH_NOARGS }, + { NULL, NULL, 0 } +}; + +/* GIValueInfo */ +PYGLIB_DEFINE_TYPE ("gi.ValueInfo", PyGIValueInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_value_info_get_value (PyGIBaseInfo *self) +{ + glong value; + + value = g_value_info_get_value ( (GIValueInfo *) self->info); + + return PYGLIB_PyLong_FromLong (value); +} + + +static PyMethodDef _PyGIValueInfo_methods[] = { + { "get_value", (PyCFunction) _wrap_g_value_info_get_value, METH_NOARGS }, + { NULL, NULL, 0 } +}; + + +/* GIFieldInfo */ +PYGLIB_DEFINE_TYPE ("gi.FieldInfo", PyGIFieldInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_field_info_get_value (PyGIBaseInfo *self, + PyObject *args) +{ + PyObject *instance; + GIBaseInfo *container_info; + GIInfoType container_info_type; + gpointer pointer; + GITypeInfo *field_type_info; + GIArgument value; + PyObject *py_value = NULL; + + memset(&value, 0, sizeof(GIArgument)); + + if (!PyArg_ParseTuple (args, "O:FieldInfo.get_value", &instance)) { + return NULL; + } + + container_info = g_base_info_get_container (self->info); + g_assert (container_info != NULL); + + /* Check the instance. */ + if (!_pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) container_info, TRUE, instance)) { + _PyGI_ERROR_PREFIX ("argument 1: "); + return NULL; + } + + /* Get the pointer to the container. */ + container_info_type = g_base_info_get_type (container_info); + switch (container_info_type) { + case GI_INFO_TYPE_UNION: + case GI_INFO_TYPE_STRUCT: + pointer = pyg_boxed_get (instance, void); + break; + case GI_INFO_TYPE_OBJECT: + pointer = pygobject_get (instance); + break; + default: + /* Other types don't have fields. */ + g_assert_not_reached(); + } + + /* Get the field's value. */ + field_type_info = g_field_info_get_type ( (GIFieldInfo *) self->info); + + /* A few types are not handled by g_field_info_get_field, so do it here. */ + if (!g_type_info_is_pointer (field_type_info) + && g_type_info_get_tag (field_type_info) == GI_TYPE_TAG_INTERFACE) { + GIBaseInfo *info; + GIInfoType info_type; + + if (! (g_field_info_get_flags ( (GIFieldInfo *) self->info) & GI_FIELD_IS_READABLE)) { + PyErr_SetString (PyExc_RuntimeError, "field is not readable"); + goto out; + } + + info = g_type_info_get_interface (field_type_info); + + info_type = g_base_info_get_type (info); + + g_base_info_unref (info); + + switch (info_type) { + case GI_INFO_TYPE_UNION: + PyErr_SetString (PyExc_NotImplementedError, "getting an union is not supported yet"); + goto out; + case GI_INFO_TYPE_STRUCT: + { + gsize offset; + + offset = g_field_info_get_offset ( (GIFieldInfo *) self->info); + + value.v_pointer = pointer + offset; + + goto argument_to_object; + } + default: + /* Fallback. */ + break; + } + } + + if (!g_field_info_get_field ( (GIFieldInfo *) self->info, pointer, &value)) { + PyErr_SetString (PyExc_RuntimeError, "unable to get the value"); + goto out; + } + + if ( (g_type_info_get_tag (field_type_info) == GI_TYPE_TAG_ARRAY) && + (g_type_info_get_array_type (field_type_info) == GI_ARRAY_TYPE_C)) { + value.v_pointer = _pygi_argument_to_array (&value, NULL, + field_type_info, FALSE); + } + +argument_to_object: + py_value = _pygi_argument_to_object (&value, field_type_info, GI_TRANSFER_NOTHING); + + if ( (value.v_pointer != NULL) && + (g_type_info_get_tag (field_type_info) == GI_TYPE_TAG_ARRAY) && + (g_type_info_get_array_type (field_type_info) == GI_ARRAY_TYPE_C)) { + g_array_free (value.v_pointer, FALSE); + } + +out: + g_base_info_unref ( (GIBaseInfo *) field_type_info); + + return py_value; +} + +static PyObject * +_wrap_g_field_info_set_value (PyGIBaseInfo *self, + PyObject *args) +{ + PyObject *instance; + PyObject *py_value; + GIBaseInfo *container_info; + GIInfoType container_info_type; + gpointer pointer; + GITypeInfo *field_type_info; + GIArgument value; + PyObject *retval = NULL; + + if (!PyArg_ParseTuple (args, "OO:FieldInfo.set_value", &instance, &py_value)) { + return NULL; + } + + container_info = g_base_info_get_container (self->info); + g_assert (container_info != NULL); + + /* Check the instance. */ + if (!_pygi_g_registered_type_info_check_object ( (GIRegisteredTypeInfo *) container_info, TRUE, instance)) { + _PyGI_ERROR_PREFIX ("argument 1: "); + return NULL; + } + + /* Get the pointer to the container. */ + container_info_type = g_base_info_get_type (container_info); + switch (container_info_type) { + case GI_INFO_TYPE_UNION: + case GI_INFO_TYPE_STRUCT: + pointer = pyg_boxed_get (instance, void); + break; + case GI_INFO_TYPE_OBJECT: + pointer = pygobject_get (instance); + break; + default: + /* Other types don't have fields. */ + g_assert_not_reached(); + } + + field_type_info = g_field_info_get_type ( (GIFieldInfo *) self->info); + + /* Check the value. */ + { + gboolean retval; + + retval = _pygi_g_type_info_check_object (field_type_info, py_value, TRUE); + if (retval < 0) { + goto out; + } + + if (!retval) { + _PyGI_ERROR_PREFIX ("argument 2: "); + goto out; + } + } + + /* Set the field's value. */ + /* A few types are not handled by g_field_info_set_field, so do it here. */ + if (!g_type_info_is_pointer (field_type_info) + && g_type_info_get_tag (field_type_info) == GI_TYPE_TAG_INTERFACE) { + GIBaseInfo *info; + GIInfoType info_type; + + if (! (g_field_info_get_flags ( (GIFieldInfo *) self->info) & GI_FIELD_IS_WRITABLE)) { + PyErr_SetString (PyExc_RuntimeError, "field is not writable"); + goto out; + } + + info = g_type_info_get_interface (field_type_info); + + info_type = g_base_info_get_type (info); + + switch (info_type) { + case GI_INFO_TYPE_UNION: + PyErr_SetString (PyExc_NotImplementedError, "setting an union is not supported yet"); + goto out; + case GI_INFO_TYPE_STRUCT: + { + gboolean is_simple; + gsize offset; + gssize size; + + is_simple = pygi_g_struct_info_is_simple ( (GIStructInfo *) info); + + if (!is_simple) { + PyErr_SetString (PyExc_TypeError, + "cannot set a structure which has no well-defined ownership transfer rules"); + g_base_info_unref (info); + goto out; + } + + value = _pygi_argument_from_object (py_value, field_type_info, GI_TRANSFER_NOTHING); + if (PyErr_Occurred()) { + g_base_info_unref (info); + goto out; + } + + offset = g_field_info_get_offset ( (GIFieldInfo *) self->info); + size = g_struct_info_get_size ( (GIStructInfo *) info); + g_assert (size > 0); + + g_memmove (pointer + offset, value.v_pointer, size); + + g_base_info_unref (info); + + retval = Py_None; + goto out; + } + default: + /* Fallback. */ + break; + } + + g_base_info_unref (info); + } + + value = _pygi_argument_from_object (py_value, field_type_info, GI_TRANSFER_EVERYTHING); + if (PyErr_Occurred()) { + goto out; + } + + if (!g_field_info_set_field ( (GIFieldInfo *) self->info, pointer, &value)) { + _pygi_argument_release (&value, field_type_info, GI_TRANSFER_NOTHING, GI_DIRECTION_IN); + PyErr_SetString (PyExc_RuntimeError, "unable to set value for field"); + goto out; + } + + retval = Py_None; + +out: + g_base_info_unref ( (GIBaseInfo *) field_type_info); + + Py_XINCREF (retval); + return retval; +} + +static PyMethodDef _PyGIFieldInfo_methods[] = { + { "get_value", (PyCFunction) _wrap_g_field_info_get_value, METH_VARARGS }, + { "set_value", (PyCFunction) _wrap_g_field_info_set_value, METH_VARARGS }, + { NULL, NULL, 0 } +}; + + +/* GIUnresolvedInfo */ +PYGLIB_DEFINE_TYPE ("gi.UnresolvedInfo", PyGIUnresolvedInfo_Type, PyGIBaseInfo); + +static PyMethodDef _PyGIUnresolvedInfo_methods[] = { + { NULL, NULL, 0 } +}; + +/* GIVFuncInfo */ +PYGLIB_DEFINE_TYPE ("gi.VFuncInfo", PyGIVFuncInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_vfunc_info_get_invoker (PyGIBaseInfo *self) +{ + PyObject *result = Py_None; + GIBaseInfo *info; + + info = (GIBaseInfo *) g_vfunc_info_get_invoker ( (GIVFuncInfo *) self->info ); + if (info) + result = _pygi_info_new(info); + else + Py_INCREF(Py_None); + + return result; +} + +static PyMethodDef _PyGIVFuncInfo_methods[] = { + { "get_invoker", (PyCFunction) _wrap_g_vfunc_info_get_invoker, METH_NOARGS }, + { NULL, NULL, 0 } +}; + + +/* GIUnionInfo */ +PYGLIB_DEFINE_TYPE ("gi.UnionInfo", PyGIUnionInfo_Type, PyGIBaseInfo); + +static PyObject * +_wrap_g_union_info_get_fields (PyGIBaseInfo *self) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + n_infos = g_union_info_get_n_fields ( (GIUnionInfo *) self->info); + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + info = (GIBaseInfo *) g_union_info_get_field ( (GIUnionInfo *) self->info, i); + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_wrap_g_union_info_get_methods (PyGIBaseInfo *self) +{ + gssize n_infos; + PyObject *infos; + gssize i; + + n_infos = g_union_info_get_n_methods ( (GIUnionInfo *) self->info); + + infos = PyTuple_New (n_infos); + if (infos == NULL) { + return NULL; + } + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + info = (GIBaseInfo *) g_union_info_get_method ( (GIUnionInfo *) self->info, i); + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyMethodDef _PyGIUnionInfo_methods[] = { + { "get_fields", (PyCFunction) _wrap_g_union_info_get_fields, METH_NOARGS }, + { "get_methods", (PyCFunction) _wrap_g_union_info_get_methods, METH_NOARGS }, + { NULL, NULL, 0 } +}; + +/* Private */ + +gchar * +_pygi_g_base_info_get_fullname (GIBaseInfo *info) +{ + GIBaseInfo *container_info; + gchar *fullname; + + container_info = g_base_info_get_container (info); + if (container_info != NULL) { + fullname = g_strdup_printf ("%s.%s.%s", + g_base_info_get_namespace (container_info), + g_base_info_get_name (container_info), + g_base_info_get_name (info)); + } else { + fullname = g_strdup_printf ("%s.%s", + g_base_info_get_namespace (info), + g_base_info_get_name (info)); + } + + if (fullname == NULL) { + PyErr_NoMemory(); + } + + return fullname; +} + +void +_pygi_info_register_types (PyObject *m) +{ +#define _PyGI_REGISTER_TYPE(m, type, cname, base) \ + Py_TYPE(&type) = &PyType_Type; \ + type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); \ + type.tp_weaklistoffset = offsetof(PyGIBaseInfo, inst_weakreflist); \ + type.tp_methods = _PyGI##cname##_methods; \ + type.tp_base = &base; \ + if (PyType_Ready(&type)) \ + return; \ + if (PyModule_AddObject(m, #cname, (PyObject *)&type)) \ + return + + Py_TYPE(&PyGIBaseInfo_Type) = &PyType_Type; + + PyGIBaseInfo_Type.tp_dealloc = (destructor) _base_info_dealloc; + PyGIBaseInfo_Type.tp_repr = (reprfunc) _base_info_repr; + PyGIBaseInfo_Type.tp_flags = (Py_TPFLAGS_DEFAULT | + Py_TPFLAGS_BASETYPE | + Py_TPFLAGS_HAVE_GC); + PyGIBaseInfo_Type.tp_traverse = (traverseproc) _base_info_traverse; + PyGIBaseInfo_Type.tp_weaklistoffset = offsetof(PyGIBaseInfo, inst_weakreflist); + PyGIBaseInfo_Type.tp_methods = _PyGIBaseInfo_methods; + PyGIBaseInfo_Type.tp_richcompare = (richcmpfunc)_base_info_richcompare; + + if (PyType_Ready(&PyGIBaseInfo_Type)) + return; + + if (PyModule_AddObject(m, "BaseInfo", (PyObject *)&PyGIBaseInfo_Type)) + return; + + _PyGI_REGISTER_TYPE (m, PyGIUnresolvedInfo_Type, UnresolvedInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGICallableInfo_Type, CallableInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGICallbackInfo_Type, CallbackInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIFunctionInfo_Type, FunctionInfo, + PyGICallableInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIRegisteredTypeInfo_Type, RegisteredTypeInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIStructInfo_Type, StructInfo, + PyGIRegisteredTypeInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIEnumInfo_Type, EnumInfo, + PyGIRegisteredTypeInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIObjectInfo_Type, ObjectInfo, + PyGIRegisteredTypeInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIInterfaceInfo_Type, InterfaceInfo, + PyGIRegisteredTypeInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIConstantInfo_Type, ConstantInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIValueInfo_Type, ValueInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIFieldInfo_Type, FieldInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIVFuncInfo_Type, VFuncInfo, + PyGICallableInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIUnionInfo_Type, UnionInfo, + PyGIRegisteredTypeInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIBoxedInfo_Type, BoxedInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIErrorDomainInfo_Type, ErrorDomainInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGISignalInfo_Type, SignalInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIPropertyInfo_Type, PropertyInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGIArgInfo_Type, ArgInfo, + PyGIBaseInfo_Type); + _PyGI_REGISTER_TYPE (m, PyGITypeInfo_Type, TypeInfo, + PyGIBaseInfo_Type); + + +#undef _PyGI_REGISTER_TYPE +} diff --git a/gi/pygi-info.h b/gi/pygi-info.h new file mode 100644 index 0000000..afd65dc --- /dev/null +++ b/gi/pygi-info.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_INFO_H__ +#define __PYGI_INFO_H__ + +#include + +#include + +G_BEGIN_DECLS + +gboolean pygi_g_struct_info_is_simple (GIStructInfo *struct_info); + + +/* Private */ + +extern PyTypeObject PyGIBaseInfo_Type; +extern PyTypeObject PyGICallableInfo_Type; +extern PyTypeObject PyGICallbackInfo_Type; +extern PyTypeObject PyGIFunctionInfo_Type; +extern PyTypeObject PyGIRegisteredTypeInfo_Type; +extern PyTypeObject PyGIStructInfo_Type; +extern PyTypeObject PyGIEnumInfo_Type; +extern PyTypeObject PyGIObjectInfo_Type; +extern PyTypeObject PyGIInterfaceInfo_Type; +extern PyTypeObject PyGIConstantInfo_Type; +extern PyTypeObject PyGIValueInfo_Type; +extern PyTypeObject PyGIFieldInfo_Type; +extern PyTypeObject PyGIUnresolvedInfo_Type; +extern PyTypeObject PyGIVFuncInfo_Type; +extern PyTypeObject PyGIUnionInfo_Type; +extern PyTypeObject PyGIBoxedInfo_Type; +extern PyTypeObject PyGIErrorDomainInfo_Type; +extern PyTypeObject PyGISignalInfo_Type; +extern PyTypeObject PyGIPropertyInfo_Type; +extern PyTypeObject PyGIArgInfo_Type; +extern PyTypeObject PyGITypeInfo_Type; + +#define PyGIBaseInfo_GET_GI_INFO(object) g_base_info_ref(((PyGIBaseInfo *)object)->info) + +PyObject* _pygi_info_new (GIBaseInfo *info); +GIBaseInfo* _pygi_object_get_gi_info (PyObject *object, + PyTypeObject *type); + +gchar* _pygi_g_base_info_get_fullname (GIBaseInfo *info); + +gsize _pygi_g_type_tag_size (GITypeTag type_tag); +gsize _pygi_g_type_info_size (GITypeInfo *type_info); + +void _pygi_info_register_types (PyObject *m); + +G_END_DECLS + +#endif /* __PYGI_INFO_H__ */ diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c new file mode 100644 index 0000000..f9e09bb --- /dev/null +++ b/gi/pygi-invoke.c @@ -0,0 +1,1034 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * pygi-invoke.c: main invocation function + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include +#include "pygi-invoke.h" + +struct invocation_state +{ + gboolean is_method; + gboolean is_constructor; + + gsize n_args; + gsize n_in_args; + gsize n_out_args; + gsize n_backup_args; + Py_ssize_t n_py_args; + gsize n_aux_in_args; + gsize n_aux_out_args; + gsize n_return_values; + + guint8 callback_index; + guint8 user_data_index; + guint8 destroy_notify_index; + PyGICClosure *closure; + + glong error_arg_pos; + + GIArgInfo **arg_infos; + GITypeInfo **arg_type_infos; + GITypeInfo *return_type_info; + GITypeTag return_type_tag; + + GIArgument **args; + gboolean *args_is_auxiliary; + + GIArgument *in_args; + GIArgument *out_args; + GIArgument *out_values; + GIArgument *backup_args; + GIArgument return_arg; + + PyObject *return_value; + + GType implementor_gtype; + + /* hack to avoid treating C arrays as GArrays during free + * due to overly complicated array handling + * this will be removed when the new invoke branch is merged + */ + gboolean c_arrays_are_wrapped; +}; + +static gboolean +_initialize_invocation_state (struct invocation_state *state, + GIFunctionInfo *info, + PyObject *py_args, + PyObject *kwargs) +{ + if (g_base_info_get_type (info) == GI_INFO_TYPE_FUNCTION) { + GIFunctionInfoFlags flags = g_function_info_get_flags (info); + + state->is_method = (flags & GI_FUNCTION_IS_METHOD) != 0; + state->is_constructor = (flags & GI_FUNCTION_IS_CONSTRUCTOR) != 0; + state->implementor_gtype = 0; + } else { + PyObject *obj; + + state->is_method = TRUE; + state->is_constructor = FALSE; + + obj = PyDict_GetItemString (kwargs, "gtype"); + if (obj == NULL) { + PyErr_SetString (PyExc_TypeError, + "need the GType of the implementor class"); + return FALSE; + } + + state->implementor_gtype = pyg_type_from_object (obj); + if (state->implementor_gtype == 0) + return FALSE; + } + + /* Count arguments. */ + state->n_args = g_callable_info_get_n_args ( (GICallableInfo *) info); + state->n_in_args = 0; + state->n_out_args = 0; + state->n_backup_args = 0; + state->n_aux_in_args = 0; + state->n_aux_out_args = 0; + + /* Check the argument count. */ + state->n_py_args = PyTuple_Size (py_args); + g_assert (state->n_py_args >= 0); + + state->error_arg_pos = -1; + + state->arg_infos = g_slice_alloc0 (sizeof (gpointer) * state->n_args); + state->arg_type_infos = g_slice_alloc0 (sizeof (gpointer) * state->n_args); + state->args_is_auxiliary = g_slice_alloc0 (sizeof (gboolean) * state->n_args); + + state->return_value = NULL; + state->closure = NULL; + state->return_type_info = NULL; + state->args = NULL; + state->in_args = NULL; + state->out_args = NULL; + state->out_values = NULL; + state->backup_args = NULL; + + /* HACK: this gets marked FALSE whenever a C array in the args is + * not wrapped by a GArray + */ + state->c_arrays_are_wrapped = TRUE; + + return TRUE; +} + +static gboolean +_prepare_invocation_state (struct invocation_state *state, + GIFunctionInfo *function_info, PyObject *py_args) +{ + gsize i; + + if (!_pygi_scan_for_callbacks (function_info, + state->is_method, + &state->callback_index, &state->user_data_index, + &state->destroy_notify_index)) + return FALSE; + + if (state->callback_index != G_MAXUINT8) { + + if (!_pygi_create_callback (function_info, + state->is_method, + state->is_constructor, + state->n_args, state->n_py_args, + py_args, state->callback_index, + state->user_data_index, + state->destroy_notify_index, &state->closure)) + return FALSE; + + state->args_is_auxiliary[state->callback_index] = FALSE; + if (state->destroy_notify_index != G_MAXUINT8) { + state->args_is_auxiliary[state->destroy_notify_index] = TRUE; + state->n_aux_in_args += 1; + } + } + + if (state->is_method) { + /* The first argument is the instance. */ + state->n_in_args += 1; + } + + /* We do a first (well, second) pass here over the function to scan for special cases. + * This is currently array+length combinations, GError and GValue. + */ + for (i = 0; i < state->n_args; i++) { + GIDirection direction; + GITransfer transfer; + GITypeTag arg_type_tag; + + state->arg_infos[i] = g_callable_info_get_arg ( (GICallableInfo *) function_info, + i); + + state->arg_type_infos[i] = g_arg_info_get_type (state->arg_infos[i]); + + direction = g_arg_info_get_direction (state->arg_infos[i]); + transfer = g_arg_info_get_ownership_transfer (state->arg_infos[i]); + arg_type_tag = g_type_info_get_tag (state->arg_type_infos[i]); + + if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) { + state->n_in_args += 1; + } + if (direction == GI_DIRECTION_INOUT) { + state->n_backup_args += 1; + } + if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { + state->n_out_args += 1; + } + + switch (arg_type_tag) { + case GI_TYPE_TAG_ARRAY: + { + gint length_arg_pos; + + length_arg_pos = g_type_info_get_array_length (state->arg_type_infos[i]); + + if (length_arg_pos < 0) { + break; + } + + /* For array lengths, we're going to delete the length argument; + * so remove the extra backup we just added above */ + if (direction == GI_DIRECTION_INOUT) { + state->n_backup_args -= 1; + } + + g_assert (length_arg_pos < state->n_args); + state->args_is_auxiliary[length_arg_pos] = TRUE; + + if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) { + state->n_aux_in_args += 1; + } + if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { + state->n_aux_out_args += 1; + } + + break; + } + case GI_TYPE_TAG_ERROR: + g_warn_if_fail (state->error_arg_pos < 0); + state->error_arg_pos = i; + break; + default: + break; + } + } + + state->return_type_info = g_callable_info_get_return_type ( (GICallableInfo *) function_info); + state->return_type_tag = g_type_info_get_tag (state->return_type_info); + + if (state->return_type_tag == GI_TYPE_TAG_ARRAY) { + gint length_arg_pos; + length_arg_pos = g_type_info_get_array_length (state->return_type_info); + + if (length_arg_pos >= 0) { + g_assert (length_arg_pos < state->n_args); + state->args_is_auxiliary[length_arg_pos] = TRUE; + state->n_aux_out_args += 1; + } + } + + state->n_return_values = state->n_out_args - state->n_aux_out_args; + if (state->return_type_tag != GI_TYPE_TAG_VOID) { + state->n_return_values += 1; + } + + { + gsize n_py_args_expected; + Py_ssize_t py_args_pos; + + n_py_args_expected = state->n_in_args + + (state->is_constructor ? 1 : 0) + - state->n_aux_in_args + - (state->error_arg_pos >= 0 ? 1 : 0); + + if (state->n_py_args != n_py_args_expected) { + PyErr_Format (PyExc_TypeError, + "%s() takes exactly %zd argument(s) (%zd given)", + g_base_info_get_name ( (GIBaseInfo *) function_info), + n_py_args_expected, state->n_py_args); + return FALSE; + } + + /* Check argument typestate-> */ + py_args_pos = 0; + if (state->is_constructor || state->is_method) { + py_args_pos += 1; + } + + for (i = 0; i < state->n_args; i++) { + GIDirection direction; + GITypeTag type_tag; + PyObject *py_arg; + gint retval; + gboolean allow_none; + + direction = g_arg_info_get_direction (state->arg_infos[i]); + type_tag = g_type_info_get_tag (state->arg_type_infos[i]); + + if (direction == GI_DIRECTION_OUT + || state->args_is_auxiliary[i] + || type_tag == GI_TYPE_TAG_ERROR) { + continue; + } + + g_assert (py_args_pos < state->n_py_args); + py_arg = PyTuple_GET_ITEM (py_args, py_args_pos); + + allow_none = g_arg_info_may_be_null (state->arg_infos[i]); + + retval = _pygi_g_type_info_check_object (state->arg_type_infos[i], + py_arg, + allow_none); + + if (retval < 0) { + return FALSE; + } else if (!retval) { + _PyGI_ERROR_PREFIX ("argument %zd: ", py_args_pos); + return FALSE; + } + + py_args_pos += 1; + } + + g_assert (py_args_pos == state->n_py_args); + } + + state->args = g_slice_alloc0 (sizeof (gpointer) * state->n_args); + state->in_args = g_slice_alloc0 (sizeof (GIArgument) * state->n_in_args); + state->out_args = g_slice_alloc0 (sizeof (GIArgument) * state->n_out_args); + state->out_values = g_slice_alloc0 (sizeof (GIArgument) * state->n_out_args); + state->backup_args = g_slice_alloc0 (sizeof (GIArgument) * state->n_backup_args); + + /* Bind args so we can use an unique index. */ + { + gsize in_args_pos; + gsize out_args_pos; + + in_args_pos = state->is_method ? 1 : 0; + out_args_pos = 0; + + for (i = 0; i < state->n_args; i++) { + GIDirection direction; + GIBaseInfo *info; + gboolean is_caller_allocates; + + direction = g_arg_info_get_direction (state->arg_infos[i]); + is_caller_allocates = g_arg_info_is_caller_allocates (state->arg_infos[i]); + + switch (direction) { + case GI_DIRECTION_IN: + g_assert (in_args_pos < state->n_in_args); + state->args[i] = &state->in_args[in_args_pos]; + in_args_pos += 1; + break; + case GI_DIRECTION_INOUT: + g_assert (in_args_pos < state->n_in_args); + g_assert (out_args_pos < state->n_out_args); + + state->in_args[in_args_pos].v_pointer = &state->out_values[out_args_pos]; + in_args_pos += 1; + case GI_DIRECTION_OUT: + g_assert (out_args_pos < state->n_out_args); + + /* caller allocates only applies to structures but GI has + * no way to denote that yet, so we only use caller allocates + * if we see a structure + */ + if (is_caller_allocates) { + GITypeTag type_tag; + + is_caller_allocates = FALSE; + type_tag = g_type_info_get_tag (state->arg_type_infos[i]); + + if (type_tag == GI_TYPE_TAG_INTERFACE) { + GIInfoType info_type; + + info = g_type_info_get_interface (state->arg_type_infos[i]); + g_assert (info != NULL); + info_type = g_base_info_get_type (info); + + if (info_type == GI_INFO_TYPE_STRUCT) + is_caller_allocates = TRUE; + } + } + + if (is_caller_allocates) { + /* if caller allocates only use one level of indirection */ + state->out_args[out_args_pos].v_pointer = NULL; + state->args[i] = &state->out_args[out_args_pos]; + if (g_struct_info_is_foreign((GIStructInfo *) info) ) { + PyObject *foreign_struct = + pygi_struct_foreign_convert_from_g_argument(info, NULL); + + pygi_struct_foreign_convert_to_g_argument( + foreign_struct, + info, + GI_TRANSFER_EVERYTHING, + state->args[i]); + + Py_DECREF(foreign_struct); + } else if (g_type_is_a (g_registered_type_info_get_g_type (info), G_TYPE_BOXED)) { + state->args[i]->v_pointer = _pygi_boxed_alloc (info, NULL); + } else { + gssize size = g_struct_info_get_size ( (GIStructInfo *) info); + state->args[i]->v_pointer = g_malloc0 (size); + } + } else { + state->out_args[out_args_pos].v_pointer = &state->out_values[out_args_pos]; + state->out_values[out_args_pos].v_pointer = NULL; + state->args[i] = &state->out_values[out_args_pos]; + } + + out_args_pos += 1; + } + } + + g_assert (in_args_pos == state->n_in_args); + g_assert (out_args_pos == state->n_out_args); + } + + /* Convert the input arguments. */ + { + Py_ssize_t py_args_pos; + gsize backup_args_pos; + + py_args_pos = 0; + backup_args_pos = 0; + + if (state->is_constructor) { + /* Skip the first argument. */ + py_args_pos += 1; + } else if (state->is_method) { + /* Get the instance. */ + GIBaseInfo *container_info; + GIInfoType container_info_type; + PyObject *py_arg; + gint check_val; + + container_info = g_base_info_get_container (function_info); + container_info_type = g_base_info_get_type (container_info); + + g_assert (py_args_pos < state->n_py_args); + py_arg = PyTuple_GET_ITEM (py_args, py_args_pos); + + /* In python 2 python takes care of checking the type + * of the self instance. In python 3 it does not + * so we have to check it here + */ + check_val = _pygi_g_type_interface_check_object(container_info, + py_arg); + if (check_val < 0) { + return FALSE; + } else if (!check_val) { + _PyGI_ERROR_PREFIX ("instance: "); + return FALSE; + } + + switch (container_info_type) { + case GI_INFO_TYPE_UNION: + case GI_INFO_TYPE_STRUCT: + { + GType type; + + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) container_info); + + if (g_type_is_a (type, G_TYPE_BOXED)) { + g_assert (state->n_in_args > 0); + state->in_args[0].v_pointer = pyg_boxed_get (py_arg, void); + } else if (g_struct_info_is_foreign (container_info)) { + PyObject *result; + result = pygi_struct_foreign_convert_to_g_argument ( + py_arg, container_info, + GI_TRANSFER_NOTHING, + &state->in_args[0]); + } else if (g_type_is_a (type, G_TYPE_POINTER) || type == G_TYPE_NONE) { + g_assert (state->n_in_args > 0); + state->in_args[0].v_pointer = pyg_pointer_get (py_arg, void); + } else { + PyErr_Format (PyExc_TypeError, "unable to convert an instance of '%s'", g_type_name (type)); + return FALSE; + } + + break; + } + case GI_INFO_TYPE_OBJECT: + case GI_INFO_TYPE_INTERFACE: + g_assert (state->n_in_args > 0); + state->in_args[0].v_pointer = pygobject_get (py_arg); + break; + default: + /* Other types don't have methods. */ + g_assert_not_reached(); + } + + py_args_pos += 1; + } + + for (i = 0; i < state->n_args; i++) { + GIDirection direction; + + if (i == state->callback_index) { + if (state->closure) + state->args[i]->v_pointer = state->closure->closure; + else + /* Some callbacks params accept NULL */ + state->args[i]->v_pointer = NULL; + py_args_pos++; + continue; + } else if (i == state->user_data_index) { + state->args[i]->v_pointer = state->closure; + py_args_pos++; + continue; + } else if (i == state->destroy_notify_index) { + if (state->closure) { + /* No need to clean up if the callback is NULL */ + PyGICClosure *destroy_notify = _pygi_destroy_notify_create(); + state->args[i]->v_pointer = destroy_notify->closure; + } + continue; + } + + if (state->args_is_auxiliary[i]) { + continue; + } + + direction = g_arg_info_get_direction (state->arg_infos[i]); + + if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) { + PyObject *py_arg; + GITypeTag arg_type_tag; + GITransfer transfer; + + arg_type_tag = g_type_info_get_tag (state->arg_type_infos[i]); + + if (arg_type_tag == GI_TYPE_TAG_ERROR) { + GError **error; + + error = g_slice_new (GError *); + *error = NULL; + + state->args[i]->v_pointer = error; + continue; + } + + transfer = g_arg_info_get_ownership_transfer (state->arg_infos[i]); + + g_assert (py_args_pos < state->n_py_args); + py_arg = PyTuple_GET_ITEM (py_args, py_args_pos); + + *state->args[i] = _pygi_argument_from_object (py_arg, state->arg_type_infos[i], transfer); + + if (PyErr_Occurred()) { + /* TODO: release previous input arguments. */ + return FALSE; + } + + if (direction == GI_DIRECTION_INOUT) { + /* We need to keep a copy of the argument to be able to release it later. */ + g_assert (backup_args_pos < state->n_backup_args); + state->backup_args[backup_args_pos] = *state->args[i]; + backup_args_pos += 1; + } + + if (arg_type_tag == GI_TYPE_TAG_ARRAY) { + GArray *array; + gssize length_arg_pos; + + array = state->args[i]->v_pointer; + + length_arg_pos = g_type_info_get_array_length (state->arg_type_infos[i]); + if (length_arg_pos >= 0) { + int len = 0; + /* Set the auxiliary argument holding the length. */ + if (array) + len = array->len; + + state->args[length_arg_pos]->v_size = len; + } + + /* Get rid of the GArray. */ + if ( (array != NULL) && + (g_type_info_get_array_type (state->arg_type_infos[i]) == GI_ARRAY_TYPE_C)) { + state->args[i]->v_pointer = array->data; + + /* HACK: We have unwrapped a C array so + * set the state to reflect this. + * If there is an error between now + * and when we rewrap the array + * we will leak C arrays due to + * being in an inconsitant state. + * e.g. for interfaces with more + * than one C array argument, an + * error may occure when not all + * C arrays have been rewrapped. + * This will be removed once the invoke + * rewrite branch is merged. + */ + state->c_arrays_are_wrapped = FALSE; + if (direction != GI_DIRECTION_INOUT || transfer != GI_TRANSFER_NOTHING) { + /* The array hasn't been referenced anywhere, so free it to avoid losing memory. */ + g_array_free (array, FALSE); + } + } + } + + py_args_pos += 1; + } + } + + g_assert (py_args_pos == state->n_py_args); + g_assert (backup_args_pos == state->n_backup_args); + } + + return TRUE; +} + +static gboolean +_invoke_function (struct invocation_state *state, + GICallableInfo *callable_info, PyObject *py_args) +{ + GError *error; + gint retval; + + error = NULL; + + pyg_begin_allow_threads; + if (g_base_info_get_type (callable_info) == GI_INFO_TYPE_FUNCTION) { + retval = g_function_info_invoke ( (GIFunctionInfo *) callable_info, + state->in_args, + state->n_in_args, + state->out_args, + state->n_out_args, + &state->return_arg, + &error); + } else { + retval = g_vfunc_info_invoke ( (GIVFuncInfo *) callable_info, + state->implementor_gtype, + state->in_args, + state->n_in_args, + state->out_args, + state->n_out_args, + &state->return_arg, + &error); + } + pyg_end_allow_threads; + + if (!retval) { + pyglib_error_check(&error); + + /* TODO: release input arguments. */ + + return FALSE; + } + + if (state->error_arg_pos >= 0) { + GError **error; + + error = state->args[state->error_arg_pos]->v_pointer; + + if (pyglib_error_check(error)) { + /* TODO: release input arguments. */ + + return FALSE; + } + } + + return TRUE; +} + +static gboolean +_process_invocation_state (struct invocation_state *state, + GIFunctionInfo *function_info, PyObject *py_args) +{ + gsize i; + + /* Convert the return value. */ + if (state->is_constructor) { + PyTypeObject *py_type; + GIBaseInfo *info; + GIInfoType info_type; + GITransfer transfer; + + if (state->return_arg.v_pointer == NULL) { + PyErr_SetString (PyExc_TypeError, "constructor returned NULL"); + return FALSE; + } + + g_assert (state->n_py_args > 0); + py_type = (PyTypeObject *) PyTuple_GET_ITEM (py_args, 0); + + info = g_type_info_get_interface (state->return_type_info); + g_assert (info != NULL); + + info_type = g_base_info_get_type (info); + + transfer = g_callable_info_get_caller_owns ( (GICallableInfo *) function_info); + + switch (info_type) { + case GI_INFO_TYPE_UNION: + case GI_INFO_TYPE_STRUCT: + { + GType type; + + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info); + + if (g_struct_info_is_foreign (info)) { + state->return_value = + pygi_struct_foreign_convert_from_g_argument ( + info, state->return_arg.v_pointer); + } else if (g_type_is_a (type, G_TYPE_BOXED)) { + g_warn_if_fail (transfer == GI_TRANSFER_EVERYTHING); + state->return_value = _pygi_boxed_new (py_type, state->return_arg.v_pointer, transfer == GI_TRANSFER_EVERYTHING); + } else if (g_type_is_a (type, G_TYPE_POINTER) || type == G_TYPE_NONE) { + if (transfer != GI_TRANSFER_NOTHING) + g_warning ("Return argument in %s returns a struct " + "with a transfer mode of \"full\" " + "Transfer mode should be set to None for " + "struct types as there is no way to free " + "them safely. Ignoring transfer mode " + "to prevent a potential invalid free. " + "This may cause a leak in your application.", + g_base_info_get_name ( (GIBaseInfo *) function_info) ); + + state->return_value = _pygi_struct_new (py_type, state->return_arg.v_pointer, FALSE); + } else { + PyErr_Format (PyExc_TypeError, "cannot create '%s' instances", py_type->tp_name); + g_base_info_unref (info); + return FALSE; + } + + break; + } + case GI_INFO_TYPE_OBJECT: + if (state->return_arg.v_pointer == NULL) { + PyErr_SetString (PyExc_TypeError, "constructor returned NULL"); + break; + } + state->return_value = pygobject_new (state->return_arg.v_pointer); + if (transfer == GI_TRANSFER_EVERYTHING) { + /* The new wrapper increased the reference count, so decrease it. */ + g_object_unref (state->return_arg.v_pointer); + } + if (state->is_constructor && G_IS_INITIALLY_UNOWNED (state->return_arg.v_pointer)) { + /* GInitiallyUnowned constructors always end up with one extra reference, so decrease it. */ + g_object_unref (state->return_arg.v_pointer); + } + break; + default: + /* Other types don't have neither methods nor constructors. */ + g_assert_not_reached(); + } + + g_base_info_unref (info); + + if (state->return_value == NULL) { + /* TODO: release arguments. */ + return FALSE; + } + } else { + GITransfer transfer; + + if ( (state->return_type_tag == GI_TYPE_TAG_ARRAY) && + (g_type_info_get_array_type (state->return_type_info) == GI_ARRAY_TYPE_C)) { + /* Create a #GArray. */ + state->return_arg.v_pointer = _pygi_argument_to_array (&state->return_arg, state->args, state->return_type_info, state->is_method); + } + + transfer = g_callable_info_get_caller_owns ( (GICallableInfo *) function_info); + + state->return_value = _pygi_argument_to_object (&state->return_arg, state->return_type_info, transfer); + if (state->return_value == NULL) { + /* TODO: release argument. */ + return FALSE; + } + + _pygi_argument_release (&state->return_arg, state->return_type_info, transfer, GI_DIRECTION_OUT); + + if (state->return_type_tag == GI_TYPE_TAG_ARRAY + && transfer == GI_TRANSFER_NOTHING) { + /* We created a #GArray, so free it. */ + state->return_arg.v_pointer = g_array_free (state->return_arg.v_pointer, FALSE); + } + } + + /* Convert output arguments and release arguments. */ + { + gsize return_values_pos; + + return_values_pos = 0; + + if (state->n_return_values > 1) { + /* Return a tuple. */ + PyObject *return_values; + + return_values = PyTuple_New (state->n_return_values); + if (return_values == NULL) { + /* TODO: release arguments. */ + return FALSE; + } + + if (state->return_type_tag == GI_TYPE_TAG_VOID) { + /* The current return value is None. */ + Py_DECREF (state->return_value); + } else { + /* Put the return value first. */ + g_assert (state->return_value != NULL); + PyTuple_SET_ITEM (return_values, return_values_pos, state->return_value); + return_values_pos += 1; + } + + state->return_value = return_values; + } + + for (i = 0; i < state->n_args; i++) { + GIDirection direction; + GITypeTag type_tag; + GITransfer transfer; + + if (state->args_is_auxiliary[i]) { + /* Auxiliary arguments are handled at the same time as their relatives. */ + continue; + } + + direction = g_arg_info_get_direction (state->arg_infos[i]); + transfer = g_arg_info_get_ownership_transfer (state->arg_infos[i]); + + type_tag = g_type_info_get_tag (state->arg_type_infos[i]); + + if ( (type_tag == GI_TYPE_TAG_ARRAY) && + (g_type_info_get_array_type (state->arg_type_infos[i]) == GI_ARRAY_TYPE_C) && + (direction != GI_DIRECTION_IN || transfer == GI_TRANSFER_NOTHING)) { + /* Create a #GArray. */ + state->args[i]->v_pointer = _pygi_argument_to_array (state->args[i], state->args, state->arg_type_infos[i], state->is_method); + } + + if (direction == GI_DIRECTION_INOUT || direction == GI_DIRECTION_OUT) { + /* Convert the argument. */ + PyObject *obj; + + /* If we created it, deallocate when it goes out of scope + * otherwise it is unsafe to deallocate random structures + * we are given + */ + if (type_tag == GI_TYPE_TAG_INTERFACE) { + GIBaseInfo *info; + GIInfoType info_type; + GType type; + + info = g_type_info_get_interface (state->arg_type_infos[i]); + g_assert (info != NULL); + info_type = g_base_info_get_type (info); + type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info); + + if ( (info_type == GI_INFO_TYPE_STRUCT) && + !g_struct_info_is_foreign((GIStructInfo *) info) && + !g_type_is_a (type, G_TYPE_BOXED)) { + if (g_arg_info_is_caller_allocates (state->arg_infos[i])) { + transfer = GI_TRANSFER_EVERYTHING; + } else if (transfer == GI_TRANSFER_EVERYTHING) { + transfer = GI_TRANSFER_NOTHING; + g_warning ("Out argument %ld in %s returns a struct " + "with a transfer mode of \"full\". " + "Transfer mode should be set to \"none\" for " + "struct type returns as there is no way to free " + "them safely. Ignoring transfer mode " + "to prevent a potential invalid free. " + "This may cause a leak in your application.", + i, g_base_info_get_name ( (GIBaseInfo *) function_info) ); + } + } + } + + obj = _pygi_argument_to_object (state->args[i], state->arg_type_infos[i], transfer); + if (obj == NULL) { + /* TODO: release arguments. */ + return FALSE; + } + + g_assert (return_values_pos < state->n_return_values); + + if (state->n_return_values > 1) { + PyTuple_SET_ITEM (state->return_value, return_values_pos, obj); + } else { + /* The current return value is None. */ + Py_DECREF (state->return_value); + state->return_value = obj; + } + + return_values_pos += 1; + } + + } + + /* HACK: We rewrapped any C arrays above in a GArray so they are ok to + * free as GArrays. We will always leak C arrays if there is + * an error before we reach this state as there is no easy way + * to know which arrays were wrapped if there are more than one. + * This will be removed with better array handling once merge + * the invoke rewrite branch. + */ + state->c_arrays_are_wrapped = TRUE; + g_assert (state->n_return_values <= 1 || return_values_pos == state->n_return_values); + } + + return TRUE; +} + +static void +_free_invocation_state (struct invocation_state *state) +{ + gsize i; + gsize backup_args_pos; + + if (state->return_type_info != NULL) { + g_base_info_unref ( (GIBaseInfo *) state->return_type_info); + } + + if (state->closure != NULL) { + if (state->closure->scope == GI_SCOPE_TYPE_CALL) + _pygi_invoke_closure_free (state->closure); + } + + /* release all arguments. */ + backup_args_pos = 0; + for (i = 0; i < state->n_args; i++) { + + if (state->args_is_auxiliary[i]) { + /* Auxiliary arguments are not released. */ + continue; + } + + if (state->arg_infos[i] != NULL + && state->arg_type_infos[i] != NULL) { + GIDirection direction; + GITypeTag type_tag; + GITransfer transfer; + + direction = g_arg_info_get_direction (state->arg_infos[i]); + transfer = g_arg_info_get_ownership_transfer (state->arg_infos[i]); + + /* Release the argument. */ + if (direction == GI_DIRECTION_INOUT) { + if (state->args != NULL) { + _pygi_argument_release (&state->backup_args[backup_args_pos], + state->arg_type_infos[i], + transfer, GI_DIRECTION_IN); + } + backup_args_pos += 1; + } + if (state->args != NULL && state->args[i] != NULL) { + type_tag = g_type_info_get_tag (state->arg_type_infos[i]); + + if (type_tag == GI_TYPE_TAG_ARRAY && + (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) && + (g_type_info_get_array_type (state->arg_type_infos[i]) == GI_ARRAY_TYPE_C) && + !state->c_arrays_are_wrapped) { + /* HACK: Noop - we are in an inconsitant state due to + * complex array handler so leak any C arrays + * as we don't know if we can free them safely. + * This will be removed when we merge the + * invoke rewrite branch. + */ + } else { + _pygi_argument_release (state->args[i], state->arg_type_infos[i], + transfer, direction); + } + + if (type_tag == GI_TYPE_TAG_ARRAY + && (direction != GI_DIRECTION_IN && transfer == GI_TRANSFER_NOTHING)) { + /* We created an *out* #GArray and it has not been released above, so free it. */ + state->args[i]->v_pointer = g_array_free (state->args[i]->v_pointer, FALSE); + } + } + + } + + if (state->arg_type_infos[i] != NULL) + g_base_info_unref ( (GIBaseInfo *) state->arg_type_infos[i]); + if (state->arg_infos[i] != NULL) + g_base_info_unref ( (GIBaseInfo *) state->arg_infos[i]); + } + g_assert (backup_args_pos == state->n_backup_args); + + g_slice_free1 (sizeof (gpointer) * state->n_args, state->arg_infos); + g_slice_free1 (sizeof (gpointer) * state->n_args, state->arg_type_infos); + g_slice_free1 (sizeof (gboolean) * state->n_args, state->args_is_auxiliary); + + if (state->args != NULL) { + g_slice_free1 (sizeof (gpointer) * state->n_args, state->args); + } + + if (state->in_args != NULL) { + g_slice_free1 (sizeof (GIArgument) * state->n_in_args, state->in_args); + } + + if (state->out_args != NULL) { + g_slice_free1 (sizeof (GIArgument) * state->n_out_args, state->out_args); + } + + if (state->out_values != NULL) { + g_slice_free1 (sizeof (GIArgument) * state->n_out_args, state->out_values); + } + + if (state->backup_args != NULL) { + g_slice_free1 (sizeof (GIArgument) * state->n_backup_args, state->backup_args); + } + + if (PyErr_Occurred()) { + Py_CLEAR (state->return_value); + } +} + + +PyObject * +_wrap_g_callable_info_invoke (PyGIBaseInfo *self, PyObject *py_args, + PyObject *kwargs) +{ + struct invocation_state state = { 0, }; + + if (!_initialize_invocation_state (&state, self->info, py_args, kwargs)) { + _free_invocation_state (&state); + return NULL; + } + + if (!_prepare_invocation_state (&state, self->info, py_args)) { + _free_invocation_state (&state); + return NULL; + } + + if (!_invoke_function (&state, self->info, py_args)) { + _free_invocation_state (&state); + return NULL; + } + + if (!_process_invocation_state (&state, self->info, py_args)) { + _free_invocation_state (&state); + return NULL; + } + + _free_invocation_state (&state); + return state.return_value; +} + diff --git a/gi/pygi-invoke.h b/gi/pygi-invoke.h new file mode 100644 index 0000000..dc1ce18 --- /dev/null +++ b/gi/pygi-invoke.h @@ -0,0 +1,38 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_INVOKE_H__ +#define __PYGI_INVOKE_H__ + +#include + +#include + +#include "pygi-private.h" + +G_BEGIN_DECLS + +PyObject *_wrap_g_callable_info_invoke (PyGIBaseInfo *self, PyObject *py_args, + PyObject *kwargs); + +G_END_DECLS + +#endif /* __PYGI_INVOKE_H__ */ diff --git a/gi/pygi-private.h b/gi/pygi-private.h new file mode 100644 index 0000000..efe62c8 --- /dev/null +++ b/gi/pygi-private.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + */ +#ifndef __PYGI_PRIVATE_H__ +#define __PYGI_PRIVATE_H__ + +#ifdef __PYGI_H__ +# error "Import pygi.h or pygi-private.h, but not both" +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "pygi.h" + +#include "pygobject-external.h" + +#include "pygi-repository.h" +#include "pygi-info.h" +#include "pygi-struct.h" +#include "pygi-boxed.h" +#include "pygi-argument.h" +#include "pygi-type.h" +#include "pygi-foreign.h" +#include "pygi-closure.h" +#include "pygi-callbacks.h" +#include "pygi-invoke.h" +#include "pygi-property.h" +#include "pygi-signal-closure.h" + +G_BEGIN_DECLS +#if PY_VERSION_HEX >= 0x03000000 + +#define _PyGI_ERROR_PREFIX(format, ...) G_STMT_START { \ + PyObject *py_error_prefix; \ + py_error_prefix = PyUnicode_FromFormat(format, ## __VA_ARGS__); \ + if (py_error_prefix != NULL) { \ + PyObject *py_error_type, *py_error_value, *py_error_traceback; \ + PyErr_Fetch(&py_error_type, &py_error_value, &py_error_traceback); \ + if (PyUnicode_Check(py_error_value)) { \ + PyObject *new; \ + new = PyUnicode_Concat(py_error_prefix, py_error_value); \ + Py_DECREF(py_error_value); \ + if (new != NULL) { \ + py_error_value = new; \ + } \ + } \ + PyErr_Restore(py_error_type, py_error_value, py_error_traceback); \ + } \ +} G_STMT_END + +#else + +#define _PyGI_ERROR_PREFIX(format, ...) G_STMT_START { \ + PyObject *py_error_prefix; \ + py_error_prefix = PyString_FromFormat(format, ## __VA_ARGS__); \ + if (py_error_prefix != NULL) { \ + PyObject *py_error_type, *py_error_value, *py_error_traceback; \ + PyErr_Fetch(&py_error_type, &py_error_value, &py_error_traceback); \ + if (PyString_Check(py_error_value)) { \ + PyString_ConcatAndDel(&py_error_prefix, py_error_value); \ + if (py_error_prefix != NULL) { \ + py_error_value = py_error_prefix; \ + } \ + } \ + PyErr_Restore(py_error_type, py_error_value, py_error_traceback); \ + } \ +} G_STMT_END + +#endif + +/* Redefine g_array_index because we want it to return the i-th element, casted + * to the type t, of the array a, and not the i-th element of the array a + * casted to the type t. */ +#define _g_array_index(a,t,i) \ + *(t *)((a)->data + g_array_get_element_size(a) * (i)) + + +G_END_DECLS + +#endif /* __PYGI_PRIVATE_H__ */ diff --git a/gi/pygi-property.c b/gi/pygi-property.c new file mode 100644 index 0000000..2f8970d --- /dev/null +++ b/gi/pygi-property.c @@ -0,0 +1,349 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2010 Collabora Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "pygi-private.h" + +#include + +/* Copied from glib */ +static void +canonicalize_key (gchar *key) +{ + gchar *p; + + for (p = key; *p != 0; p++) + { + gchar c = *p; + + if (c != '-' && + (c < '0' || c > '9') && + (c < 'A' || c > 'Z') && + (c < 'a' || c > 'z')) + *p = '-'; + } +} + +static GIPropertyInfo * +_pygi_lookup_property_from_g_type (GType g_type, const gchar *attr_name) +{ + GIRepository *repository; + GIBaseInfo *info; + gssize n_infos; + gssize i; + GType parent; + + repository = g_irepository_get_default(); + info = g_irepository_find_by_gtype (repository, g_type); + if (info == NULL) { + return NULL; + } + + n_infos = g_object_info_get_n_properties ( (GIObjectInfo *) info); + for (i = 0; i < n_infos; i++) { + GIPropertyInfo *property_info; + + property_info = g_object_info_get_property ( (GIObjectInfo *) info, i); + g_assert (info != NULL); + + if (strcmp (attr_name, g_base_info_get_name (property_info)) == 0) { + g_base_info_unref (info); + return property_info; + } + + g_base_info_unref (property_info); + } + + g_base_info_unref (info); + + parent = g_type_parent (g_type); + if (parent > 0) + return _pygi_lookup_property_from_g_type (parent, attr_name); + + return NULL; +} + +PyObject * +pygi_get_property_value_real (PyGObject *instance, + const gchar *attr_name) +{ + GType g_type; + GIPropertyInfo *property_info = NULL; + char *property_name = g_strdup (attr_name); + GParamSpec *pspec = NULL; + GValue value = { 0, }; + GIArgument arg = { 0, }; + PyObject *py_value = NULL; + GITypeInfo *type_info = NULL; + GITransfer transfer; + + canonicalize_key (property_name); + + g_type = pyg_type_from_object ((PyObject *)instance); + property_info = _pygi_lookup_property_from_g_type (g_type, property_name); + + if (property_info == NULL) + goto out; + + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (instance->obj), + attr_name); + if (pspec == NULL) + goto out; + + g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); + g_object_get_property (instance->obj, attr_name, &value); + + type_info = g_property_info_get_type (property_info); + transfer = g_property_info_get_ownership_transfer (property_info); + + GITypeTag type_tag = g_type_info_get_tag (type_info); + switch (type_tag) { + case GI_TYPE_TAG_BOOLEAN: + arg.v_boolean = g_value_get_boolean (&value); + break; + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_INT64: + arg.v_int = g_value_get_int (&value); + break; + case GI_TYPE_TAG_UINT8: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_UINT64: + arg.v_uint = g_value_get_uint (&value); + break; + case GI_TYPE_TAG_FLOAT: + arg.v_float = g_value_get_float (&value); + break; + case GI_TYPE_TAG_DOUBLE: + arg.v_double = g_value_get_double (&value); + break; + case GI_TYPE_TAG_GTYPE: + arg.v_size = g_value_get_gtype (&value); + break; + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + arg.v_string = g_value_dup_string (&value); + break; + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + GType type; + + info = g_type_info_get_interface (type_info); + type = g_registered_type_info_get_g_type (info); + info_type = g_base_info_get_type (info); + + g_base_info_unref (info); + + switch (info_type) { + case GI_INFO_TYPE_ENUM: + arg.v_int32 = g_value_get_enum (&value); + break; + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_OBJECT: + arg.v_pointer = g_value_get_object (&value); + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_STRUCT: + case GI_INFO_TYPE_UNION: + + if (g_type_is_a (type, G_TYPE_BOXED)) { + arg.v_pointer = g_value_get_boxed (&value); + } else if (g_type_is_a (type, G_TYPE_POINTER)) { + arg.v_pointer = g_value_get_pointer (&value); + } else { + PyErr_Format (PyExc_NotImplementedError, + "Retrieving properties of type '%s' is not implemented", + g_type_name (type)); + } + break; + default: + PyErr_Format (PyExc_NotImplementedError, + "Retrieving properties of type '%s' is not implemented", + g_type_name (type)); + goto out; + } + break; + } + case GI_TYPE_TAG_GHASH: + arg.v_pointer = g_value_get_boxed (&value); + break; + case GI_TYPE_TAG_GLIST: + arg.v_pointer = g_value_get_pointer (&value); + break; + default: + PyErr_Format (PyExc_NotImplementedError, + "Retrieving properties of type %s is not implemented", + g_type_tag_to_string (g_type_info_get_tag (type_info))); + goto out; + } + + py_value = _pygi_argument_to_object (&arg, type_info, transfer); + +out: + g_free (property_name); + if (property_info != NULL) + g_base_info_unref (property_info); + if (type_info != NULL) + g_base_info_unref (type_info); + + return py_value; +} + +gint +pygi_set_property_value_real (PyGObject *instance, + const gchar *attr_name, + PyObject *py_value) +{ + GType g_type; + GIPropertyInfo *property_info = NULL; + char *property_name = g_strdup (attr_name); + GITypeInfo *type_info = NULL; + GITypeTag type_tag; + GITransfer transfer; + GValue value = { 0, }; + GIArgument arg = { 0, }; + GParamSpec *pspec = NULL; + gint ret_value = -1; + + canonicalize_key (property_name); + + g_type = pyg_type_from_object ((PyObject *)instance); + property_info = _pygi_lookup_property_from_g_type (g_type, property_name); + + if (property_info == NULL) + goto out; + + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (instance->obj), + attr_name); + if (pspec == NULL) + goto out; + + if (! (pspec->flags & G_PARAM_WRITABLE)) + goto out; + + type_info = g_property_info_get_type (property_info); + transfer = g_property_info_get_ownership_transfer (property_info); + arg = _pygi_argument_from_object (py_value, type_info, transfer); + + g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); + + // FIXME: Lots of types still unhandled + type_tag = g_type_info_get_tag (type_info); + switch (type_tag) { + case GI_TYPE_TAG_INTERFACE: + { + GIBaseInfo *info; + GIInfoType info_type; + GType type; + + info = g_type_info_get_interface (type_info); + type = g_registered_type_info_get_g_type (info); + info_type = g_base_info_get_type (info); + + g_base_info_unref (info); + + switch (info_type) { + case GI_INFO_TYPE_ENUM: + g_value_set_enum (&value, arg.v_int32); + break; + case GI_INFO_TYPE_INTERFACE: + case GI_INFO_TYPE_OBJECT: + g_value_set_object (&value, arg.v_pointer); + break; + case GI_INFO_TYPE_BOXED: + case GI_INFO_TYPE_STRUCT: + case GI_INFO_TYPE_UNION: + if (g_type_is_a (type, G_TYPE_BOXED)) { + g_value_set_boxed (&value, arg.v_pointer); + } else { + PyErr_Format (PyExc_NotImplementedError, + "Setting properties of type '%s' is not implemented", + g_type_name (type)); + } + break; + default: + PyErr_Format (PyExc_NotImplementedError, + "Setting properties of type '%s' is not implemented", + g_type_name (type)); + goto out; + } + break; + } + case GI_TYPE_TAG_BOOLEAN: + g_value_set_boolean (&value, arg.v_boolean); + break; + case GI_TYPE_TAG_INT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_INT64: + g_value_set_int (&value, arg.v_int); + break; + case GI_TYPE_TAG_UINT8: + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_UINT64: + g_value_set_uint (&value, arg.v_uint); + break; + case GI_TYPE_TAG_FLOAT: + g_value_set_float (&value, arg.v_float); + break; + case GI_TYPE_TAG_DOUBLE: + g_value_set_double (&value, arg.v_double); + break; + case GI_TYPE_TAG_GTYPE: + g_value_set_gtype (&value, arg.v_size); + break; + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + g_value_set_string (&value, arg.v_string); + break; + case GI_TYPE_TAG_GHASH: + g_value_set_boxed (&value, arg.v_pointer); + break; + case GI_TYPE_TAG_GLIST: + g_value_set_pointer (&value, arg.v_pointer); + break; + default: + PyErr_Format (PyExc_NotImplementedError, + "Setting properties of type %s is not implemented", + g_type_tag_to_string (g_type_info_get_tag (type_info))); + goto out; + } + + g_object_set_property (instance->obj, attr_name, &value); + + ret_value = 0; + +out: + g_free (property_name); + if (property_info != NULL) + g_base_info_unref (property_info); + if (type_info != NULL) + g_base_info_unref (type_info); + + return ret_value; +} + diff --git a/gi/pygi-property.h b/gi/pygi-property.h new file mode 100644 index 0000000..31d0e42 --- /dev/null +++ b/gi/pygi-property.h @@ -0,0 +1,39 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2010 Collabora Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __PYGI_PROPERTY_H__ +#define __PYGI_PROPERTY_H__ + +#include +#include + +#include "pygi.h" + +PyObject *pygi_get_property_value_real (PyGObject *instance, + const gchar *attr_name); + +gint pygi_set_property_value_real (PyGObject *instance, + const gchar *attr_name, + PyObject *py_value); + +#endif /* __PYGI_PROPERTY_H__ */ diff --git a/gi/pygi-repository.c b/gi/pygi-repository.c new file mode 100644 index 0000000..c48d2ce --- /dev/null +++ b/gi/pygi-repository.c @@ -0,0 +1,292 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * pygi-repository.c: GIRepository wrapper. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +#include + +PyObject *PyGIRepositoryError; + +static PyMethodDef _PyGIRepository_methods[]; + +PYGLIB_DEFINE_TYPE("gi.Repository", PyGIRepository_Type, PyGIRepository); + +static PyObject * +_wrap_g_irepository_enumerate_versions (PyGIRepository *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "namespace", NULL }; + const char *namespace_; + GList *versions, *item; + PyObject *ret = NULL; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "s:Repository.enumerate_versions", + kwlist, &namespace_)) { + return NULL; + } + + versions = g_irepository_enumerate_versions (self->repository, namespace_); + ret = PyList_New(0); + for (item = versions; item; item = item->next) { + char *version = item->data; + PyObject *py_version = PYGLIB_PyUnicode_FromString (version); + PyList_Append(ret, py_version); + Py_DECREF(py_version); + g_free (version); + } + g_list_free(versions); + + return ret; +} + +static PyObject * +_wrap_g_irepository_get_default (PyObject *self) +{ + static PyGIRepository *repository = NULL; + + if (!repository) { + repository = (PyGIRepository *) PyObject_New (PyGIRepository, &PyGIRepository_Type); + if (repository == NULL) { + return NULL; + } + + repository->repository = g_irepository_get_default(); + } + + Py_INCREF ( (PyObject *) repository); + return (PyObject *) repository; +} + +static PyObject * +_wrap_g_irepository_require (PyGIRepository *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "namespace", "version", "lazy", NULL }; + + const char *namespace_; + const char *version = NULL; + PyObject *lazy = NULL; + GIRepositoryLoadFlags flags = 0; + GTypelib *typelib; + GError *error; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "s|zO:Repository.require", + kwlist, &namespace_, &version, &lazy)) { + return NULL; + } + + if (lazy != NULL && PyObject_IsTrue (lazy)) { + flags |= G_IREPOSITORY_LOAD_FLAG_LAZY; + } + + error = NULL; + typelib = g_irepository_require (self->repository, namespace_, version, flags, &error); + if (error != NULL) { + PyErr_SetString (PyGIRepositoryError, error->message); + g_error_free (error); + return NULL; + } + + Py_RETURN_NONE; +} + +static PyObject * +_wrap_g_irepository_find_by_name (PyGIRepository *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "namespace", "name", NULL }; + + const char *namespace_; + const char *name; + GIBaseInfo *info; + PyObject *py_info; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "ss:Repository.find_by_name", kwlist, &namespace_, &name)) { + return NULL; + } + + info = g_irepository_find_by_name (self->repository, namespace_, name); + if (info == NULL) { + Py_RETURN_NONE; + } + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + return py_info; +} + +static PyObject * +_wrap_g_irepository_get_infos (PyGIRepository *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "namespace", NULL }; + + const char *namespace_; + gssize n_infos; + PyObject *infos; + gssize i; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "s:Repository.get_infos", + kwlist, &namespace_)) { + return NULL; + } + + n_infos = g_irepository_get_n_infos (self->repository, namespace_); + if (n_infos < 0) { + PyErr_Format (PyExc_RuntimeError, "Namespace '%s' not loaded", namespace_); + return NULL; + } + + infos = PyTuple_New (n_infos); + + for (i = 0; i < n_infos; i++) { + GIBaseInfo *info; + PyObject *py_info; + + info = g_irepository_get_info (self->repository, namespace_, i); + g_assert (info != NULL); + + py_info = _pygi_info_new (info); + + g_base_info_unref (info); + + if (py_info == NULL) { + Py_CLEAR (infos); + break; + } + + PyTuple_SET_ITEM (infos, i, py_info); + } + + return infos; +} + +static PyObject * +_wrap_g_irepository_get_typelib_path (PyGIRepository *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "namespace", NULL }; + const char *namespace_; + const gchar *typelib_path; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "s:Repository.get_typelib_path", kwlist, &namespace_)) { + return NULL; + } + + typelib_path = g_irepository_get_typelib_path (self->repository, namespace_); + if (typelib_path == NULL) { + PyErr_Format (PyExc_RuntimeError, "Namespace '%s' not loaded", namespace_); + return NULL; + } + + return PYGLIB_PyBytes_FromString (typelib_path); +} + +static PyObject * +_wrap_g_irepository_get_version (PyGIRepository *self, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "namespace", NULL }; + const char *namespace_; + const gchar *version; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, + "s:Repository.get_version", kwlist, &namespace_)) { + return NULL; + } + + version = g_irepository_get_version (self->repository, namespace_); + if (version == NULL) { + PyErr_Format (PyExc_RuntimeError, "Namespace '%s' not loaded", namespace_); + return NULL; + } + + return PYGLIB_PyUnicode_FromString (version); +} + +static PyObject * +_wrap_g_irepository_get_loaded_namespaces (PyGIRepository *self) +{ + char **namespaces; + PyObject *py_namespaces; + gssize i; + + namespaces = g_irepository_get_loaded_namespaces (self->repository); + + py_namespaces = PyList_New (0); + 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_free (namespaces[i]); + } + + g_free (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 }, + { "require", (PyCFunction) _wrap_g_irepository_require, METH_VARARGS | METH_KEYWORDS }, + { "get_infos", (PyCFunction) _wrap_g_irepository_get_infos, METH_VARARGS | METH_KEYWORDS }, + { "find_by_name", (PyCFunction) _wrap_g_irepository_find_by_name, METH_VARARGS | METH_KEYWORDS }, + { "get_typelib_path", (PyCFunction) _wrap_g_irepository_get_typelib_path, METH_VARARGS | METH_KEYWORDS }, + { "get_version", (PyCFunction) _wrap_g_irepository_get_version, METH_VARARGS | METH_KEYWORDS }, + { "get_loaded_namespaces", (PyCFunction) _wrap_g_irepository_get_loaded_namespaces, METH_NOARGS }, + { NULL, NULL, 0 } +}; + +void +_pygi_repository_register_types (PyObject *m) +{ + Py_TYPE(&PyGIRepository_Type) = &PyType_Type; + + PyGIRepository_Type.tp_flags = Py_TPFLAGS_DEFAULT; + PyGIRepository_Type.tp_methods = _PyGIRepository_methods; + + if (PyType_Ready (&PyGIRepository_Type)) { + return; + } + + if (PyModule_AddObject (m, "Repository", (PyObject *) &PyGIRepository_Type)) { + return; + } + + PyGIRepositoryError = PyErr_NewException ("gi.RepositoryError", NULL, NULL); + if (PyModule_AddObject (m, "RepositoryError", PyGIRepositoryError)) { + return; + } +} + diff --git a/gi/pygi-repository.h b/gi/pygi-repository.h new file mode 100644 index 0000000..d8eb8cf --- /dev/null +++ b/gi/pygi-repository.h @@ -0,0 +1,39 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_REPOSITORY_H__ +#define __PYGI_REPOSITORY_H__ + +#include + +G_BEGIN_DECLS + +/* Private */ + +extern PyTypeObject PyGIRepository_Type; + +extern PyObject *PyGIRepositoryError; + +void _pygi_repository_register_types (PyObject *m); + +G_END_DECLS + +#endif /* __PYGI_REPOSITORY_H__ */ diff --git a/gi/pygi-signal-closure.c b/gi/pygi-signal-closure.c new file mode 100644 index 0000000..1482529 --- /dev/null +++ b/gi/pygi-signal-closure.c @@ -0,0 +1,245 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2011 Laszlo Pandy + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +/* Copied from glib */ +static void +canonicalize_key (gchar *key) +{ + gchar *p; + + for (p = key; *p != 0; p++) + { + gchar c = *p; + + if (c != '-' && + (c < '0' || c > '9') && + (c < 'A' || c > 'Z') && + (c < 'a' || c > 'z')) + *p = '-'; + } +} + +static GISignalInfo * +_pygi_lookup_signal_from_g_type (GType g_type, + const gchar *signal_name) +{ + GIRepository *repository; + GIBaseInfo *info; + gssize n_infos; + gssize i; + GType parent; + + repository = g_irepository_get_default(); + info = g_irepository_find_by_gtype (repository, g_type); + if (info != NULL) { + n_infos = g_object_info_get_n_signals ( (GIObjectInfo *) info); + for (i = 0; i < n_infos; i++) { + GISignalInfo *signal_info; + + signal_info = g_object_info_get_signal ( (GIObjectInfo *) info, i); + g_assert (info != NULL); + + if (strcmp (signal_name, g_base_info_get_name (signal_info)) == 0) { + g_base_info_unref (info); + return signal_info; + } + + g_base_info_unref (signal_info); + } + + g_base_info_unref (info); + } + + parent = g_type_parent (g_type); + if (parent > 0) + return _pygi_lookup_signal_from_g_type (parent, signal_name); + + return NULL; +} + +static void +pygi_signal_closure_invalidate(gpointer data, + GClosure *closure) +{ + PyGClosure *pc = (PyGClosure *)closure; + PyGILState_STATE state; + + state = PyGILState_Ensure(); + Py_XDECREF(pc->callback); + Py_XDECREF(pc->extra_args); + Py_XDECREF(pc->swap_data); + PyGILState_Release(state); + + pc->callback = NULL; + pc->extra_args = NULL; + pc->swap_data = NULL; + + g_base_info_unref (((PyGISignalClosure *) pc)->signal_info); + ((PyGISignalClosure *) pc)->signal_info = NULL; +} + +static void +pygi_signal_closure_marshal(GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + PyGILState_STATE state; + PyGClosure *pc = (PyGClosure *)closure; + PyObject *params, *ret = NULL; + guint i; + GISignalInfo *signal_info; + gint n_sig_info_args; + gint sig_info_highest_arg; + + state = PyGILState_Ensure(); + + signal_info = ((PyGISignalClosure *)closure)->signal_info; + n_sig_info_args = g_callable_info_get_n_args(signal_info); + /* the first argument to a signal callback is instance, + but instance is not counted in the introspection data */ + sig_info_highest_arg = n_sig_info_args + 1; + g_assert_cmpint(sig_info_highest_arg, ==, n_param_values); + + /* construct Python tuple for the parameter values */ + params = PyTuple_New(n_param_values); + for (i = 0; i < n_param_values; i++) { + /* swap in a different initial data for connect_object() */ + if (i == 0 && G_CCLOSURE_SWAP_DATA(closure)) { + g_return_if_fail(pc->swap_data != NULL); + Py_INCREF(pc->swap_data); + PyTuple_SetItem(params, 0, pc->swap_data); + + } else if (i == 0) { + PyObject *item = pyg_value_as_pyobject(¶m_values[i], FALSE); + + if (!item) { + goto out; + } + PyTuple_SetItem(params, i, item); + + } else if (i < sig_info_highest_arg) { + GIArgInfo arg_info; + GITypeInfo type_info; + GITransfer transfer; + GIArgument arg = { 0, }; + PyObject *item = NULL; + + g_callable_info_load_arg(signal_info, i - 1, &arg_info); + g_arg_info_load_type(&arg_info, &type_info); + transfer = g_arg_info_get_ownership_transfer(&arg_info); + + arg = _pygi_argument_from_g_value(¶m_values[i], &type_info); + item = _pygi_argument_to_object(&arg, &type_info, transfer); + + if (item == NULL) { + goto out; + } + PyTuple_SetItem(params, i, item); + } + } + /* params passed to function may have extra arguments */ + if (pc->extra_args) { + PyObject *tuple = params; + params = PySequence_Concat(tuple, pc->extra_args); + Py_DECREF(tuple); + } + ret = PyObject_CallObject(pc->callback, params); + if (ret == NULL) { + if (pc->exception_handler) + pc->exception_handler(return_value, n_param_values, param_values); + else + PyErr_Print(); + goto out; + } + + if (return_value && pyg_value_from_pyobject(return_value, ret) != 0) { + PyErr_SetString(PyExc_TypeError, + "can't convert return value to desired type"); + + if (pc->exception_handler) + pc->exception_handler(return_value, n_param_values, param_values); + else + PyErr_Print(); + } + Py_DECREF(ret); + + out: + Py_DECREF(params); + PyGILState_Release(state); +} + +GClosure * +pygi_signal_closure_new_real (PyGObject *instance, + const gchar *sig_name, + PyObject *callback, + PyObject *extra_args, + PyObject *swap_data) +{ + GClosure *closure = NULL; + PyGISignalClosure *pygi_closure = NULL; + GType g_type; + GISignalInfo *signal_info = NULL; + char *signal_name = g_strdup (sig_name); + + g_return_val_if_fail(callback != NULL, NULL); + + canonicalize_key(signal_name); + + g_type = pyg_type_from_object ((PyObject *)instance); + signal_info = _pygi_lookup_signal_from_g_type (g_type, signal_name); + + if (signal_info == NULL) + goto out; + + closure = g_closure_new_simple(sizeof(PyGISignalClosure), NULL); + g_closure_add_invalidate_notifier(closure, NULL, pygi_signal_closure_invalidate); + g_closure_set_marshal(closure, pygi_signal_closure_marshal); + + pygi_closure = (PyGISignalClosure *)closure; + + pygi_closure->signal_info = signal_info; + Py_INCREF(callback); + pygi_closure->pyg_closure.callback = callback; + + if (extra_args != NULL && extra_args != Py_None) { + Py_INCREF(extra_args); + if (!PyTuple_Check(extra_args)) { + PyObject *tmp = PyTuple_New(1); + PyTuple_SetItem(tmp, 0, extra_args); + extra_args = tmp; + } + pygi_closure->pyg_closure.extra_args = extra_args; + } + if (swap_data) { + Py_INCREF(swap_data); + pygi_closure->pyg_closure.swap_data = swap_data; + closure->derivative_flag = TRUE; + } + +out: + g_free (signal_name); + + return closure; +} diff --git a/gi/pygi-signal-closure.h b/gi/pygi-signal-closure.h new file mode 100644 index 0000000..4687f3f --- /dev/null +++ b/gi/pygi-signal-closure.h @@ -0,0 +1,46 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2011 Laszlo Pandy + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __PYGI_SIGNAL_CLOSURE_H__ +#define __PYGI_SIGNAL_CLOSURE_H__ + +#include "pygi.h" + +G_BEGIN_DECLS + +/* Private */ +typedef struct _PyGISignalClosure +{ + PyGClosure pyg_closure; + GISignalInfo *signal_info; +} PyGISignalClosure; + +GClosure * pygi_signal_closure_new_real (PyGObject *instance, + const gchar *sig_name, + PyObject *callback, + PyObject *extra_args, + PyObject *swap_data); + +G_END_DECLS + +#endif /* __PYGI_SIGNAL_CLOSURE_H__ */ diff --git a/gi/pygi-struct.c b/gi/pygi-struct.c new file mode 100644 index 0000000..c2e1f4d --- /dev/null +++ b/gi/pygi-struct.c @@ -0,0 +1,146 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2009 Simon van der Linden + * + * pygi-struct.c: wrapper to handle non-registered structures. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + +#include +#include +#include + +static void +_struct_dealloc (PyGIStruct *self) +{ + GIBaseInfo *info = _pygi_object_get_gi_info ( + (PyObject *) self, + &PyGIStructInfo_Type); + + PyObject_GC_UnTrack ( (PyObject *) self); + + PyObject_ClearWeakRefs ( (PyObject *) self); + + if (info != NULL && g_struct_info_is_foreign ( (GIStructInfo *) info)) { + pygi_struct_foreign_release (info, ( (PyGPointer *) self)->pointer); + } else if (self->free_on_dealloc) { + g_free ( ( (PyGPointer *) self)->pointer); + } + + g_base_info_unref (info); + + Py_TYPE( (PyGPointer *) self )->tp_free ( (PyObject *) self); +} + +static PyObject * +_struct_new (PyTypeObject *type, + PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { NULL }; + + GIBaseInfo *info; + gsize size; + gpointer pointer; + PyObject *self = NULL; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "", kwlist)) { + return NULL; + } + + info = _pygi_object_get_gi_info ( (PyObject *) type, &PyGIStructInfo_Type); + if (info == NULL) { + if (PyErr_ExceptionMatches (PyExc_AttributeError)) { + PyErr_Format (PyExc_TypeError, "missing introspection information"); + } + return NULL; + } + + size = g_struct_info_get_size ( (GIStructInfo *) info); + pointer = g_try_malloc0 (size); + if (pointer == NULL) { + PyErr_NoMemory(); + goto out; + } + + self = _pygi_struct_new (type, pointer, TRUE); + if (self == NULL) { + g_free (pointer); + } + +out: + g_base_info_unref (info); + + return (PyObject *) self; +} + +static int +_struct_init (PyObject *self, + PyObject *args, + PyObject *kwargs) +{ + /* Don't call PyGPointer's init, which raises an exception. */ + return 0; +} + +PYGLIB_DEFINE_TYPE("gi.Struct", PyGIStruct_Type, PyGIStruct); + +PyObject * +_pygi_struct_new (PyTypeObject *type, + gpointer pointer, + gboolean free_on_dealloc) +{ + PyGIStruct *self; + GType g_type; + + if (!PyType_IsSubtype (type, &PyGIStruct_Type)) { + PyErr_SetString (PyExc_TypeError, "must be a subtype of gi.Struct"); + return NULL; + } + + self = (PyGIStruct *) type->tp_alloc (type, 0); + if (self == NULL) { + return NULL; + } + + g_type = pyg_type_from_object ( (PyObject *) type); + + ( (PyGPointer *) self)->gtype = g_type; + ( (PyGPointer *) self)->pointer = pointer; + self->free_on_dealloc = free_on_dealloc; + + return (PyObject *) self; +} + +void +_pygi_struct_register_types (PyObject *m) +{ + Py_TYPE(&PyGIStruct_Type) = &PyType_Type; + PyGIStruct_Type.tp_base = &PyGPointer_Type; + PyGIStruct_Type.tp_new = (newfunc) _struct_new; + PyGIStruct_Type.tp_init = (initproc) _struct_init; + PyGIStruct_Type.tp_dealloc = (destructor) _struct_dealloc; + PyGIStruct_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + + if (PyType_Ready (&PyGIStruct_Type)) + return; + if (PyModule_AddObject (m, "Struct", (PyObject *) &PyGIStruct_Type)) + return; +} diff --git a/gi/pygi-struct.h b/gi/pygi-struct.h new file mode 100644 index 0000000..963d05a --- /dev/null +++ b/gi/pygi-struct.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2009 Simon van der Linden + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_STRUCT_H__ +#define __PYGI_STRUCT_H__ + +#include + +G_BEGIN_DECLS + +extern PyTypeObject PyGIStruct_Type; + +PyObject * +_pygi_struct_new (PyTypeObject *type, + gpointer pointer, + gboolean free_on_dealloc); + +void _pygi_struct_register_types (PyObject *m); + +G_END_DECLS + +#endif /* __PYGI_STRUCT_H__ */ diff --git a/gi/pygi-type.c b/gi/pygi-type.c new file mode 100644 index 0000000..129ea98 --- /dev/null +++ b/gi/pygi-type.c @@ -0,0 +1,99 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2009 Simon van der Linden + * + * pygi-type.c: helpers to lookup Python wrappers from GType and GIBaseInfo. + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include "pygi-private.h" + + +PyObject * +_pygi_type_import_by_name (const char *namespace_, + const char *name) +{ + gchar *module_name; + PyObject *py_module; + PyObject *py_object; + + module_name = g_strconcat ("gi.repository.", namespace_, NULL); + + py_module = PyImport_ImportModule (module_name); + + g_free (module_name); + + if (py_module == NULL) { + return NULL; + } + + py_object = PyObject_GetAttrString (py_module, name); + + Py_DECREF (py_module); + + return py_object; +} + +PyObject * +pygi_type_import_by_g_type_real (GType g_type) +{ + GIRepository *repository; + GIBaseInfo *info; + PyObject *type; + + repository = g_irepository_get_default(); + + info = g_irepository_find_by_gtype (repository, g_type); + if (info == NULL) { + return NULL; + } + + type = _pygi_type_import_by_gi_info (info); + g_base_info_unref (info); + + return type; +} + +PyObject * +_pygi_type_import_by_gi_info (GIBaseInfo *info) +{ + return _pygi_type_import_by_name (g_base_info_get_namespace (info), + g_base_info_get_name (info)); +} + +PyObject * +_pygi_type_get_from_g_type (GType g_type) +{ + PyObject *py_g_type; + PyObject *py_type; + + py_g_type = pyg_type_wrapper_new (g_type); + if (py_g_type == NULL) { + return NULL; + } + + py_type = PyObject_GetAttrString (py_g_type, "pytype"); + if (py_type == Py_None) { + py_type = pygi_type_import_by_g_type_real (g_type); + } + + Py_DECREF (py_g_type); + + return py_type; +} + diff --git a/gi/pygi-type.h b/gi/pygi-type.h new file mode 100644 index 0000000..bb43d19 --- /dev/null +++ b/gi/pygi-type.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2009 Simon van der Linden + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_TYPE_H__ +#define __PYGI_TYPE_H__ + +#include + +G_BEGIN_DECLS + +/* Public */ + +PyObject *pygi_type_import_by_g_type_real (GType g_type); + + +/* Private */ + +PyObject *_pygi_type_import_by_name (const char *namespace_, const char *name); + +PyObject *_pygi_type_import_by_gi_info (GIBaseInfo *info); + +PyObject *_pygi_type_get_from_g_type (GType g_type); + + +G_END_DECLS + +#endif /* __PYGI_TYPE_H__ */ diff --git a/gi/pygi.h b/gi/pygi.h new file mode 100644 index 0000000..1c3bf5e --- /dev/null +++ b/gi/pygi.h @@ -0,0 +1,208 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2005-2009 Johan Dahlin + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_H__ +#define __PYGI_H__ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#define NO_IMPORT_PYGOBJECT +#include + +#if ENABLE_INTROSPECTION + +#include + +typedef struct { + PyObject_HEAD + GIRepository *repository; +} PyGIRepository; + +typedef struct { + PyObject_HEAD + GIBaseInfo *info; + PyObject *inst_weakreflist; +} PyGIBaseInfo; + +typedef struct { + PyGPointer base; + gboolean free_on_dealloc; +} PyGIStruct; + +typedef struct { + PyGBoxed base; + gboolean slice_allocated; + gsize size; +} PyGIBoxed; + +typedef PyObject * (*PyGIArgOverrideToGIArgumentFunc) (PyObject *value, + GITypeInfo *type_info, + GITransfer transfer, + GIArgument *arg); +typedef PyObject * (*PyGIArgOverrideFromGIArgumentFunc) (GITypeInfo *type_info, + gpointer data); +typedef PyObject * (*PyGIArgOverrideReleaseFunc) (GITypeInfo *type_info, + gpointer struct_); + +struct PyGI_API { + PyObject* (*type_import_by_g_type) (GType g_type); + PyObject* (*get_property_value) (PyGObject *instance, + const gchar *attr_name); + gint (*set_property_value) (PyGObject *instance, + const gchar *attr_name, + PyObject *value); + GClosure * (*signal_closure_new) (PyGObject *instance, + const gchar *sig_name, + PyObject *callback, + PyObject *extra_args, + PyObject *swap_data); + void (*register_foreign_struct) (const char* namespace_, + const char* name, + PyGIArgOverrideToGIArgumentFunc to_func, + PyGIArgOverrideFromGIArgumentFunc from_func, + PyGIArgOverrideReleaseFunc release_func); +}; + +static struct PyGI_API *PyGI_API = NULL; + +static int +_pygi_import (void) +{ + PyObject *modules_dict; + + if (PyGI_API != NULL) { + return 1; + } + + modules_dict = PyImport_GetModuleDict(); /* borrowed reference -- don't unref */ + if (PyMapping_HasKeyString(modules_dict, "gi")) { +#if PY_VERSION_HEX >= 0x03000000 + PyGI_API = (struct PyGI_API*) PyCapsule_Import("gi._API", FALSE); +#else + PyGI_API = (struct PyGI_API*) PyCObject_Import("gi", "_API"); +#endif + } + if (PyGI_API == NULL) { + return -1; + } + + return 0; +} + +static inline PyObject * +pygi_type_import_by_g_type (GType g_type) +{ + if (_pygi_import() < 0) { + return NULL; + } + return PyGI_API->type_import_by_g_type(g_type); +} + +static inline PyObject * +pygi_get_property_value (PyGObject *instance, + const gchar *attr_name) +{ + if (_pygi_import() < 0) { + return NULL; + } + return PyGI_API->get_property_value(instance, attr_name); +} + +static inline gint +pygi_set_property_value (PyGObject *instance, + const gchar *attr_name, + PyObject *value) +{ + if (_pygi_import() < 0) { + return -1; + } + return PyGI_API->set_property_value(instance, attr_name, value); +} + +static inline GClosure * +pygi_signal_closure_new (PyGObject *instance, + const gchar *sig_name, + PyObject *callback, + PyObject *extra_args, + PyObject *swap_data) +{ + if (_pygi_import() < 0) { + return NULL; + } + return PyGI_API->signal_closure_new(instance, sig_name, callback, extra_args, swap_data); +} + +static inline PyObject * +pygi_register_foreign_struct (const char* namespace_, + const char* name, + PyGIArgOverrideToGIArgumentFunc to_func, + PyGIArgOverrideFromGIArgumentFunc from_func, + PyGIArgOverrideReleaseFunc release_func) +{ + if (_pygi_import() < 0) { + return NULL; + } + PyGI_API->register_foreign_struct(namespace_, + name, + to_func, + from_func, + release_func); + Py_RETURN_NONE; +} + +#else /* ENABLE_INTROSPECTION */ + +static inline PyObject * +pygi_type_import_by_g_type (GType g_type) +{ + return NULL; +} + +static inline PyObject * +pygi_get_property_value (PyGObject *instance, + const gchar *attr_name) +{ + return NULL; +} + +static inline gint +pygi_set_property_value (PyGObject *instance, + const gchar *attr_name, + PyObject *value) +{ + return -1; +} + +static inline GClosure * +pygi_signal_closure_new (PyGObject *instance, + const gchar *sig_name, + PyObject *callback, + PyObject *extra_args, + PyObject *swap_data) +{ + return NULL; +} + +#endif /* ENABLE_INTROSPECTION */ + +#endif /* __PYGI_H__ */ diff --git a/gi/pygobject-external.h b/gi/pygobject-external.h new file mode 100644 index 0000000..00b8b6f --- /dev/null +++ b/gi/pygobject-external.h @@ -0,0 +1,83 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2009 Simon van der Linden + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGOBJECT_EXTERN_H__ +#define __PYGOBJECT_EXTERN_H__ + +#include + +G_BEGIN_DECLS + +static PyTypeObject *_PyGObject_Type; +static PyTypeObject *_PyGTypeWrapper_Type; + +#define PyGObject_Type (*_PyGObject_Type) +#define PyGTypeWrapper_Type (*_PyGTypeWrapper_Type) + +__attribute__ ( (unused)) +static int +_pygobject_import (void) +{ + static gboolean imported = FALSE; + PyObject *from_list; + PyObject *module; + int retval = 0; + + if (imported) { + return 1; + } + + from_list = Py_BuildValue ("(ss)", "GObject", "GTypeWrapper"); + if (from_list == NULL) { + return -1; + } + + module = PyImport_ImportModuleEx ("gobject", NULL, NULL, from_list); + + Py_DECREF (from_list); + + if (module == NULL) { + return -1; + } + + _PyGObject_Type = (PyTypeObject *) PyObject_GetAttrString (module, "GObject"); + if (_PyGObject_Type == NULL) { + retval = -1; + goto out; + } + + _PyGTypeWrapper_Type = (PyTypeObject *) PyObject_GetAttrString (module, "GType"); + if (_PyGTypeWrapper_Type == NULL) { + retval = -1; + goto out; + } + + imported = TRUE; + +out: + Py_DECREF (module); + + return retval; +} + +G_END_DECLS + +#endif /* __PYGOBJECT_EXTERN_H__ */ diff --git a/gi/repository/Makefile.am b/gi/repository/Makefile.am new file mode 100644 index 0000000..ece9c4f --- /dev/null +++ b/gi/repository/Makefile.am @@ -0,0 +1,10 @@ +PLATFORM_VERSION = 2.0 + +pkgpyexecdir = $(pyexecdir)/gi + +pygirepositorydir = $(pkgpyexecdir)/repository +pygirepository_PYTHON = \ + __init__.py + + +-include $(top_srcdir)/git.mk diff --git a/gi/repository/Makefile.in b/gi/repository/Makefile.in new file mode 100644 index 0000000..7da2e99 --- /dev/null +++ b/gi/repository/Makefile.in @@ -0,0 +1,478 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = gi/repository +DIST_COMMON = $(pygirepository_PYTHON) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +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 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pygirepositorydir)" +py_compile = $(top_srcdir)/py-compile +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIR = @DATADIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_CFLAGS = @FFI_CFLAGS@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ +GIOUNIX_LIBS = @GIOUNIX_LIBS@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBFFI_PC = @LIBFFI_PC@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ +PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ +PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ +PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ +PYTHON = @PYTHON@ +PYTHON_BASENAME = @PYTHON_BASENAME@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREADING_CFLAGS = @THREADING_CFLAGS@ +VERSION = @VERSION@ +XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = $(pyexecdir)/gi +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pygobject_CODEGEN_DEFINES = @pygobject_CODEGEN_DEFINES@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +PLATFORM_VERSION = 2.0 +pygirepositorydir = $(pkgpyexecdir)/repository +pygirepository_PYTHON = \ + __init__.py + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + 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*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pygirepositoryPYTHON: $(pygirepository_PYTHON) + @$(NORMAL_INSTALL) + test -z "$(pygirepositorydir)" || $(MKDIR_P) "$(DESTDIR)$(pygirepositorydir)" + @list='$(pygirepository_PYTHON)'; dlist=; list2=; test -n "$(pygirepositorydir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + $(am__strip_dir) \ + dlist="$$dlist $$f"; \ + list2="$$list2 $$b$$p"; \ + else :; fi; \ + done; \ + for file in $$list2; do echo $$file; done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pygirepositorydir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pygirepositorydir)" || exit $$?; \ + done || exit $$?; \ + if test -n "$$dlist"; then \ + if test -z "$(DESTDIR)"; then \ + PYTHON=$(PYTHON) $(py_compile) --basedir "$(pygirepositorydir)" $$dlist; \ + else \ + PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pygirepositorydir)" $$dlist; \ + fi; \ + else :; fi + +uninstall-pygirepositoryPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(pygirepository_PYTHON)'; test -n "$(pygirepositorydir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + filesc=`echo "$$files" | sed 's|$$|c|'`; \ + fileso=`echo "$$files" | sed 's|$$|o|'`; \ + echo " ( cd '$(DESTDIR)$(pygirepositorydir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pygirepositorydir)" && rm -f $$files || exit $$?; \ + echo " ( cd '$(DESTDIR)$(pygirepositorydir)' && rm -f" $$filesc ")"; \ + cd "$(DESTDIR)$(pygirepositorydir)" && rm -f $$filesc || exit $$?; \ + echo " ( cd '$(DESTDIR)$(pygirepositorydir)' && rm -f" $$fileso ")"; \ + cd "$(DESTDIR)$(pygirepositorydir)" && rm -f $$fileso +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: + for dir in "$(DESTDIR)$(pygirepositorydir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pygirepositoryPYTHON + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pygirepositoryPYTHON + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am \ + install-pygirepositoryPYTHON install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-pygirepositoryPYTHON + + +-include $(top_srcdir)/git.mk + +# 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. +.NOEXPORT: diff --git a/gi/repository/__init__.py b/gi/repository/__init__.py new file mode 100644 index 0000000..5c5552a --- /dev/null +++ b/gi/repository/__init__.py @@ -0,0 +1,30 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2009 Johan Dahlin +# +# 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 + +from __future__ import absolute_import + +import sys + +from ..importer import DynamicImporter + +sys.meta_path.append(DynamicImporter('gi.repository')) + +del DynamicImporter +del sys diff --git a/gi/types.py b/gi/types.py new file mode 100644 index 0000000..210fdc1 --- /dev/null +++ b/gi/types.py @@ -0,0 +1,301 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab +# +# Copyright (C) 2005-2009 Johan Dahlin +# +# types.py: base types for introspected items. +# +# 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 + +from __future__ import absolute_import + +import sys +import gobject + +from ._gi import \ + InterfaceInfo, \ + ObjectInfo, \ + StructInfo, \ + VFuncInfo, \ + set_object_has_new_constructor, \ + register_interface_info, \ + hook_up_vfunc_implementation + +if sys.version_info > (3, 0): + def callable(obj): + return hasattr(obj, '__call__') + +def Function(info): + + def function(*args): + return info.invoke(*args) + function.__info__ = info + function.__name__ = info.get_name() + function.__module__ = info.get_namespace() + + return function + + +def NativeVFunc(info, cls): + + def native_vfunc(*args): + return info.invoke(*args, **dict(gtype=cls.__gtype__)) + native_vfunc.__info__ = info + native_vfunc.__name__ = info.get_name() + native_vfunc.__module__ = info.get_namespace() + + return native_vfunc + +def Constructor(info): + + def constructor(cls, *args): + cls_name = info.get_container().get_name() + if cls.__name__ != cls_name: + raise TypeError('%s constructor cannot be used to create instances of a subclass' % cls_name) + return info.invoke(cls, *args) + + constructor.__info__ = info + constructor.__name__ = info.get_name() + constructor.__module__ = info.get_namespace() + + return constructor + + +class MetaClassHelper(object): + + def _setup_constructors(cls): + for method_info in cls.__info__.get_methods(): + if method_info.is_constructor(): + name = method_info.get_name() + constructor = classmethod(Constructor(method_info)) + setattr(cls, name, constructor) + + def _setup_methods(cls): + for method_info in cls.__info__.get_methods(): + name = method_info.get_name() + function = Function(method_info) + if method_info.is_method(): + method = function + elif method_info.is_constructor(): + continue + else: + method = staticmethod(function) + setattr(cls, name, method) + + def _setup_fields(cls): + for field_info in cls.__info__.get_fields(): + name = field_info.get_name().replace('-', '_') + setattr(cls, name, property(field_info.get_value, field_info.set_value)) + + def _setup_constants(cls): + for constant_info in cls.__info__.get_constants(): + name = constant_info.get_name() + value = constant_info.get_value() + setattr(cls, name, value) + + def _setup_vfuncs(cls): + for vfunc_name, py_vfunc in cls.__dict__.items(): + if not vfunc_name.startswith("do_") or not callable(py_vfunc): + continue + + # If a method name starts with "do_" assume it is a vfunc, and search + # in the base classes for a method with the same name to override. + # Recursion is not necessary here because getattr() searches all + # super class attributes as well. + vfunc_info = None + for base in cls.__bases__: + method = getattr(base, vfunc_name, None) + if method is not None and hasattr(method, '__info__') and \ + isinstance(method.__info__, VFuncInfo): + vfunc_info = method.__info__ + break + + # If we did not find a matching method name in the bases, we might + # be overriding an interface virtual method. Since interfaces do not + # provide implementations, there will be no method attribute installed + # on the object. Instead we have to search through + # InterfaceInfo.get_vfuncs(). Note that the infos returned by + # get_vfuncs() use the C vfunc name (ie. there is no "do_" prefix). + if vfunc_info is None: + vfunc_info = find_vfunc_info_in_interface(cls.__bases__, vfunc_name[len("do_"):]) + + if vfunc_info is not None: + assert vfunc_name == ('do_' + vfunc_info.get_name()) + # Check to see if there are vfuncs with the same name in the bases. + # We have no way of specifying which one we are supposed to override. + ambiguous_base = find_vfunc_conflict_in_bases(vfunc_info, cls.__bases__) + if ambiguous_base is not None: + base_info = vfunc_info.get_container() + raise TypeError('Method %s() on class %s.%s is ambiguous ' + 'with methods in base classes %s.%s and %s.%s' % + (vfunc_name, + cls.__info__.get_namespace(), + cls.__info__.get_name(), + base_info.get_namespace(), + base_info.get_name(), + ambiguous_base.__info__.get_namespace(), + ambiguous_base.__info__.get_name())) + + hook_up_vfunc_implementation(vfunc_info, cls.__gtype__, + py_vfunc) + + def _setup_native_vfuncs(cls): + # Only InterfaceInfo and ObjectInfo have the get_vfuncs() method. + # We skip InterfaceInfo because interfaces have no implementations for vfuncs. + # Also check if __info__ in __dict__, not hasattr('__info__', ...) + # because we do not want to accidentally retrieve __info__ from a base class. + class_info = cls.__dict__.get('__info__') + if class_info is None or not isinstance(class_info, ObjectInfo): + return + + for vfunc_info in class_info.get_vfuncs(): + name = 'do_%s' % vfunc_info.get_name() + value = NativeVFunc(vfunc_info, cls) + setattr(cls, name, value) + +def find_vfunc_info_in_interface(bases, vfunc_name): + for base in bases: + # All wrapped interfaces inherit from GInterface. + # This can be seen in IntrospectionModule.__getattr__() in module.py. + # We do not need to search regular classes here, only wrapped interfaces. + # We also skip GInterface, because it is not wrapped and has no __info__ attr. + if base is gobject.GInterface or\ + not issubclass(base, gobject.GInterface) or\ + not isinstance(base.__info__, InterfaceInfo): + continue + + for vfunc in base.__info__.get_vfuncs(): + if vfunc.get_name() == vfunc_name: + return vfunc + + vfunc = find_vfunc_info_in_interface(base.__bases__, vfunc_name) + if vfunc is not None: + return vfunc + + return None + +def find_vfunc_conflict_in_bases(vfunc, bases): + for klass in bases: + if not hasattr(klass, '__info__') or \ + not hasattr(klass.__info__, 'get_vfuncs'): + continue + vfuncs = klass.__info__.get_vfuncs() + vfunc_name = vfunc.get_name() + for v in vfuncs: + if v.get_name() == vfunc_name and v != vfunc: + return klass + + aklass = find_vfunc_conflict_in_bases(vfunc, klass.__bases__) + if aklass is not None: + return aklass + return None + +class GObjectMeta(gobject.GObjectMeta, MetaClassHelper): + + def __init__(cls, name, bases, dict_): + super(GObjectMeta, cls).__init__(name, bases, dict_) + is_gi_defined = False + if cls.__module__ == 'gi.repository.' + cls.__info__.get_namespace(): + is_gi_defined = True + + is_python_defined = False + if not is_gi_defined and cls.__module__ != GObjectMeta.__module__: + is_python_defined = True + + if is_python_defined: + cls._setup_vfuncs() + elif is_gi_defined: + cls._setup_methods() + cls._setup_constants() + cls._setup_native_vfuncs() + + if isinstance(cls.__info__, ObjectInfo): + cls._setup_fields() + cls._setup_constructors() + set_object_has_new_constructor(cls.__info__.get_g_type()) + elif isinstance(cls.__info__, InterfaceInfo): + register_interface_info(cls.__info__.get_g_type()) + + def mro(cls): + return mro(cls) + + def _must_register_type(cls, namespace): + ## don't register the class if already registered + if '__gtype__' in namespace: + return False + + # Do not register a new GType for the overrides, as this would sort of + # defeat the purpose of overrides... + return not cls.__module__.startswith('gi.overrides.') + + +def mro(C): + """Compute the class precedence list (mro) according to C3 + + Based on http://www.python.org/download/releases/2.3/mro/ + Modified to consider that interfaces don't create the diamond problem + """ + # TODO: If this turns out being too slow, consider using generators + bases = [] + bases_of_subclasses = [[C]] + + if C.__bases__: + bases_of_subclasses += list(map(mro, C.__bases__)) + [list(C.__bases__)] + + while bases_of_subclasses: + for subclass_bases in bases_of_subclasses: + candidate = subclass_bases[0] + not_head = [s for s in bases_of_subclasses if candidate in s[1:]] + if not_head and gobject.GInterface not in candidate.__bases__: + candidate = None # conflict, reject candidate + else: + break + + if candidate is None: + raise TypeError('Cannot create a consistent method resolution ' + 'order (MRO)') + + bases.append(candidate) + + for subclass_bases in bases_of_subclasses[:]: # remove candidate + if subclass_bases and subclass_bases[0] == candidate: + del subclass_bases[0] + if not subclass_bases: + bases_of_subclasses.remove(subclass_bases) + + return bases + + +class StructMeta(type, MetaClassHelper): + + def __init__(cls, name, bases, dict_): + super(StructMeta, cls).__init__(name, bases, dict_) + + # Avoid touching anything else than the base class. + g_type = cls.__info__.get_g_type() + if g_type != gobject.TYPE_INVALID and g_type.pytype is not None: + return + + cls._setup_fields() + cls._setup_methods() + cls._setup_constructors() + + for method_info in cls.__info__.get_methods(): + if method_info.is_constructor() and \ + method_info.get_name() == 'new' and \ + not method_info.get_arguments(): + cls.__new__ = staticmethod(Constructor(method_info)) + break diff --git a/gio/Makefile.am b/gio/Makefile.am index a34fd19..6b3eb57 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -109,6 +109,7 @@ endif if BUILD_GIO all: $(pkgpyexec_LTLIBRARIES:.la=.so) +check-local: $(pkgpyexec_LTLIBRARIES:.la=.so) clean-local: rm -f $(pkgpyexec_LTLIBRARIES:.la=.so) .la.so: diff --git a/gio/Makefile.in b/gio/Makefile.in index f0cd632..041c085 100644 --- a/gio/Makefile.in +++ b/gio/Makefile.in @@ -85,17 +85,20 @@ _gio_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ am__gio_la_OBJECTS = _gio_la-giomodule.lo _gio_la-pygio-utils.lo nodist__gio_la_OBJECTS = _gio_la-gio.lo _gio_la_OBJECTS = $(am__gio_la_OBJECTS) $(nodist__gio_la_OBJECTS) -_gio_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(_gio_la_CFLAGS) $(CFLAGS) \ - $(_gio_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +_gio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gio_la_CFLAGS) \ + $(CFLAGS) $(_gio_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_GIO_TRUE@am__gio_la_rpath = -rpath $(pkgpyexecdir) unix_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_unix_la_OBJECTS = unix_la-unixmodule.lo nodist_unix_la_OBJECTS = unix_la-unix.lo unix_la_OBJECTS = $(am_unix_la_OBJECTS) $(nodist_unix_la_OBJECTS) -unix_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(unix_la_CFLAGS) $(CFLAGS) \ - $(unix_la_LDFLAGS) $(LDFLAGS) -o $@ +unix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(unix_la_CFLAGS) \ + $(CFLAGS) $(unix_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_GIOUNIX_TRUE@am_unix_la_rpath = -rpath $(pkgpyexecdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -103,13 +106,26 @@ am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(_gio_la_SOURCES) $(nodist__gio_la_SOURCES) \ $(unix_la_SOURCES) $(nodist_unix_la_SOURCES) DIST_SOURCES = $(_gio_la_SOURCES) $(unix_la_SOURCES) @@ -121,6 +137,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -151,6 +168,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ @@ -162,6 +182,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_PC = @LIBFFI_PC@ @@ -171,7 +193,9 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -184,10 +208,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ @@ -210,6 +239,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -242,7 +272,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -343,7 +372,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .defs .la .lo .o .obj .so -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -352,9 +381,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gio/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gio/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu gio/Makefile + $(AUTOMAKE) --foreign gio/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -368,9 +397,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkgpyexecLTLIBRARIES: $(pkgpyexec_LTLIBRARIES) @@ -436,9 +465,9 @@ clean-pyexecLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done _gio.la: $(_gio_la_OBJECTS) $(_gio_la_DEPENDENCIES) - $(_gio_la_LINK) $(am__gio_la_rpath) $(_gio_la_OBJECTS) $(_gio_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(_gio_la_LINK) $(am__gio_la_rpath) $(_gio_la_OBJECTS) $(_gio_la_LIBADD) $(LIBS) unix.la: $(unix_la_OBJECTS) $(unix_la_DEPENDENCIES) - $(unix_la_LINK) $(am_unix_la_rpath) $(unix_la_OBJECTS) $(unix_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(unix_la_LINK) $(am_unix_la_rpath) $(unix_la_OBJECTS) $(unix_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -453,60 +482,68 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix_la-unixmodule.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< _gio_la-giomodule.lo: giomodule.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-giomodule.lo -MD -MP -MF $(DEPDIR)/_gio_la-giomodule.Tpo -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gio_la-giomodule.Tpo $(DEPDIR)/_gio_la-giomodule.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-giomodule.lo -MD -MP -MF $(DEPDIR)/_gio_la-giomodule.Tpo -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gio_la-giomodule.Tpo $(DEPDIR)/_gio_la-giomodule.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='giomodule.c' object='_gio_la-giomodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-giomodule.lo `test -f 'giomodule.c' || echo '$(srcdir)/'`giomodule.c _gio_la-pygio-utils.lo: pygio-utils.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-pygio-utils.lo -MD -MP -MF $(DEPDIR)/_gio_la-pygio-utils.Tpo -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gio_la-pygio-utils.Tpo $(DEPDIR)/_gio_la-pygio-utils.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-pygio-utils.lo -MD -MP -MF $(DEPDIR)/_gio_la-pygio-utils.Tpo -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gio_la-pygio-utils.Tpo $(DEPDIR)/_gio_la-pygio-utils.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygio-utils.c' object='_gio_la-pygio-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-pygio-utils.lo `test -f 'pygio-utils.c' || echo '$(srcdir)/'`pygio-utils.c _gio_la-gio.lo: gio.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-gio.lo -MD -MP -MF $(DEPDIR)/_gio_la-gio.Tpo -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gio_la-gio.Tpo $(DEPDIR)/_gio_la-gio.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -MT _gio_la-gio.lo -MD -MP -MF $(DEPDIR)/_gio_la-gio.Tpo -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gio_la-gio.Tpo $(DEPDIR)/_gio_la-gio.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gio.c' object='_gio_la-gio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gio_la_CFLAGS) $(CFLAGS) -c -o _gio_la-gio.lo `test -f 'gio.c' || echo '$(srcdir)/'`gio.c unix_la-unixmodule.lo: unixmodule.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unixmodule.lo -MD -MP -MF $(DEPDIR)/unix_la-unixmodule.Tpo -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unix_la-unixmodule.Tpo $(DEPDIR)/unix_la-unixmodule.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unixmodule.lo -MD -MP -MF $(DEPDIR)/unix_la-unixmodule.Tpo -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unix_la-unixmodule.Tpo $(DEPDIR)/unix_la-unixmodule.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='unixmodule.c' object='unix_la-unixmodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unixmodule.lo `test -f 'unixmodule.c' || echo '$(srcdir)/'`unixmodule.c unix_la-unix.lo: unix.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unix.lo -MD -MP -MF $(DEPDIR)/unix_la-unix.Tpo -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unix_la-unix.Tpo $(DEPDIR)/unix_la-unix.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -MT unix_la-unix.lo -MD -MP -MF $(DEPDIR)/unix_la-unix.Tpo -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unix_la-unix.Tpo $(DEPDIR)/unix_la-unix.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='unix.c' object='unix_la-unix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(unix_la_CFLAGS) $(CFLAGS) -c -o unix_la-unix.lo `test -f 'unix.c' || echo '$(srcdir)/'`unix.c mostlyclean-libtool: -rm -f *.lo @@ -654,7 +691,9 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done +@BUILD_GIO_FALSE@check-local: check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: @@ -762,23 +801,24 @@ ps-am: uninstall-am: uninstall-defsDATA uninstall-pkgpyexecLTLIBRARIES \ uninstall-pyexecLTLIBRARIES uninstall-pygioPYTHON -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-local clean-pkgpyexecLTLIBRARIES \ - clean-pyexecLTLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-defsDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgpyexecLTLIBRARIES \ - install-ps install-ps-am install-pyexecLTLIBRARIES \ - install-pygioPYTHON install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-defsDATA uninstall-pkgpyexecLTLIBRARIES \ +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-generic clean-libtool clean-local \ + clean-pkgpyexecLTLIBRARIES clean-pyexecLTLIBRARIES ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-defsDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkgpyexecLTLIBRARIES install-ps \ + install-ps-am install-pyexecLTLIBRARIES install-pygioPYTHON \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-defsDATA uninstall-pkgpyexecLTLIBRARIES \ uninstall-pyexecLTLIBRARIES uninstall-pygioPYTHON gio.c: $(GIO_DEFS) $(GIO_OVERRIDES) @@ -797,6 +837,7 @@ unix.c: $(GIOUNIX_DEFS) unix.override && rm -f $(*D)/gen-$(*F).c @BUILD_GIO_TRUE@all: $(pkgpyexec_LTLIBRARIES:.la=.so) +@BUILD_GIO_TRUE@check-local: $(pkgpyexec_LTLIBRARIES:.la=.so) @BUILD_GIO_TRUE@clean-local: @BUILD_GIO_TRUE@ rm -f $(pkgpyexec_LTLIBRARIES:.la=.so) @BUILD_GIO_TRUE@.la.so: diff --git a/gio/gappinfo.override b/gio/gappinfo.override index 414769b..7f09ce8 100644 --- a/gio/gappinfo.override +++ b/gio/gappinfo.override @@ -106,6 +106,11 @@ _wrap_g_app_info_launch_uris(PyGObject *self, PyObject *args, PyObject *kwargs) ret = g_app_info_launch_uris(G_APP_INFO(self->obj), file_list, ctx, &error); + /* in python 3 the C strings are not internal to the Unicode string object + * so we now strdup when adding element to the list and must free them here + */ + g_list_foreach (file_list, + (GFunc) g_free, NULL); g_list_free(file_list); if (pyg_error_check(&error)) diff --git a/gio/gfile.override b/gio/gfile.override index 71e2d98..1301963 100644 --- a/gio/gfile.override +++ b/gio/gfile.override @@ -840,7 +840,7 @@ _wrap_g_file_set_attribute(PyGObject *self, PyObject *args, PyObject *kwargs) static char *kwlist[] = { "attribute", "type", "value_p", "flags", "cancellable", NULL }; GFileQueryInfoFlags flags = G_FILE_QUERY_INFO_NONE; - int ret; + int ret = 0; GCancellable *cancellable = NULL; GError *error = NULL; char *attribute; @@ -883,7 +883,7 @@ _wrap_g_file_set_attribute(PyGObject *self, PyObject *args, PyObject *kwargs) &error); } break; - + case G_FILE_ATTRIBUTE_TYPE_BYTE_STRING: { char* s; @@ -902,7 +902,6 @@ _wrap_g_file_set_attribute(PyGObject *self, PyObject *args, PyObject *kwargs) &error); } break; - case G_FILE_ATTRIBUTE_TYPE_STRINGV: { @@ -1155,7 +1154,7 @@ _wrap_g_file_append_to_async(PyGObject *self, PyObject *args, PyObject *kwargs) "O|OiOO:File.append_to_async", kwlist, ¬ify->callback, - &flags, &io_priority, + &py_flags, &io_priority, &pycancellable, ¬ify->data)) goto error; @@ -1203,7 +1202,7 @@ _wrap_g_file_create_async(PyGObject *self, PyObject *args, PyObject *kwargs) "O|OiOO:File.create_async", kwlist, ¬ify->callback, - &flags, &io_priority, + &py_flags, &io_priority, &pycancellable, ¬ify->data)) goto error; @@ -1253,7 +1252,7 @@ _wrap_g_file_create_readwrite_async(PyGObject *self, "O|OiOO:File.create_readwrite_async", kwlist, ¬ify->callback, - &flags, &io_priority, + &py_flags, &io_priority, &pycancellable, ¬ify->data)) goto error; @@ -1405,7 +1404,7 @@ _wrap_g_file_replace_async(PyGObject *self, PyObject *args, PyObject *kwargs) kwlist, ¬ify->callback, &etag, &py_backup, - &flags, &io_priority, + &py_flags, &io_priority, &pycancellable, ¬ify->data)) goto error; diff --git a/gio/gio.override b/gio/gio.override index 6d001b9..7fdcb1c 100644 --- a/gio/gio.override +++ b/gio/gio.override @@ -141,7 +141,7 @@ pygio_notify_allocate_buffer(PyGIONotify *notify, gsize buffer_size) if (buffer_size > 0) { notify->buffer = g_slice_alloc(buffer_size); if (!notify->buffer) { - PyErr_Format(PyExc_MemoryError, "failed to allocate %d bytes", buffer_size); + PyErr_Format(PyExc_MemoryError, "failed to allocate %" G_GSIZE_FORMAT " bytes", buffer_size); return FALSE; } @@ -330,7 +330,12 @@ _wrap_g_content_type_guess(PyGObject *self, PyObject *args, PyObject *kwargs) { char *kwlist[] = {"filename", "data", "want_uncertain", NULL}; char *filename = NULL, *data = NULL, *type; +#ifdef PY_SSIZE_T_CLEAN + Py_ssize_t data_size = 0; +#else int data_size = 0; +#endif + gboolean result_uncertain, want_uncertain = FALSE; PyObject *ret; diff --git a/gio/giomodule.c b/gio/giomodule.c index 409aeef..a9ddd38 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -39,167 +40,169 @@ void pygio_add_constants(PyObject *module, const gchar *strip_prefix); extern PyMethodDef pygio_functions[]; -DL_EXPORT(void) -init_gio(void) +PYGLIB_INIT_FUNCTION(_gio, "gio._gio", pygio_functions) { - PyObject *m, *d; + PyObject *d; PyObject *tuple; PyObject *e; + /* perform any initialisation required by the library here */ - m = Py_InitModule("gio._gio", pygio_functions); - d = PyModule_GetDict(m); + d = PyModule_GetDict(module); g_type_init(); pyglib_init(); - init_pygobject_check(2, 15, 2); + if (pygobject_init(2, 15, 2) == NULL) + return -1; pygio_register_classes(d); - pygio_add_constants(m, "G_IO_"); + pygio_add_constants(module, "G_IO_"); - PyModule_AddStringConstant(m, "ERROR", g_quark_to_string(G_IO_ERROR)); + PyModule_AddStringConstant(module, "ERROR", g_quark_to_string(G_IO_ERROR)); e = pyglib_register_exception_for_domain("gio.Error", G_IO_ERROR); PyDict_SetItemString(d, "Error", e); Py_DECREF(e); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_TYPE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_TYPE", G_FILE_ATTRIBUTE_STANDARD_TYPE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_HIDDEN", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_HIDDEN", G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_BACKUP", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_BACKUP", G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_SYMLINK", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_SYMLINK", G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL", G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_NAME", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_NAME", G_FILE_ATTRIBUTE_STANDARD_NAME); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME", G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_EDIT_NAME", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_EDIT_NAME", G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_COPY_NAME", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_COPY_NAME", G_FILE_ATTRIBUTE_STANDARD_COPY_NAME); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_DESCRIPTION", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_DESCRIPTION", G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_ICON", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_ICON", G_FILE_ATTRIBUTE_STANDARD_ICON); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE", G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE", G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_SIZE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_SIZE", G_FILE_ATTRIBUTE_STANDARD_SIZE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET", G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_TARGET_URI", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_TARGET_URI", G_FILE_ATTRIBUTE_STANDARD_TARGET_URI); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_STANDARD_SORT_ORDER", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_STANDARD_SORT_ORDER", G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ETAG_VALUE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ETAG_VALUE", G_FILE_ATTRIBUTE_ETAG_VALUE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ID_FILE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ID_FILE", G_FILE_ATTRIBUTE_ID_FILE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ID_FILESYSTEM", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ID_FILESYSTEM", G_FILE_ATTRIBUTE_ID_FILESYSTEM); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_READ", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_READ", G_FILE_ATTRIBUTE_ACCESS_CAN_READ); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_WRITE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_WRITE", G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE", G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_DELETE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_DELETE", G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_TRASH", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_TRASH", G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_ACCESS_CAN_RENAME", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_ACCESS_CAN_RENAME", G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT", G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT", G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT", G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE", G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI", G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_MODIFIED", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_MODIFIED", G_FILE_ATTRIBUTE_TIME_MODIFIED); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_MODIFIED_USEC", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_MODIFIED_USEC", G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_ACCESS", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_ACCESS", G_FILE_ATTRIBUTE_TIME_ACCESS); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_ACCESS_USEC", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_ACCESS_USEC", G_FILE_ATTRIBUTE_TIME_ACCESS_USEC); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CHANGED", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CHANGED", G_FILE_ATTRIBUTE_TIME_CHANGED); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CHANGED_USEC", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CHANGED_USEC", G_FILE_ATTRIBUTE_TIME_CHANGED_USEC); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CREATED", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CREATED", G_FILE_ATTRIBUTE_TIME_CREATED); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TIME_CREATED_USEC", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TIME_CREATED_USEC", G_FILE_ATTRIBUTE_TIME_CREATED_USEC); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_DEVICE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_DEVICE", G_FILE_ATTRIBUTE_UNIX_DEVICE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_INODE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_INODE", G_FILE_ATTRIBUTE_UNIX_INODE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_MODE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_MODE", G_FILE_ATTRIBUTE_UNIX_MODE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_NLINK", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_NLINK", G_FILE_ATTRIBUTE_UNIX_NLINK); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_UID", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_UID", G_FILE_ATTRIBUTE_UNIX_UID); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_GID", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_GID", G_FILE_ATTRIBUTE_UNIX_GID); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_RDEV", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_RDEV", G_FILE_ATTRIBUTE_UNIX_RDEV); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_BLOCK_SIZE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_BLOCK_SIZE", G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_BLOCKS", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_BLOCKS", G_FILE_ATTRIBUTE_UNIX_BLOCKS); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT", G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_DOS_IS_ARCHIVE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_DOS_IS_ARCHIVE", G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_DOS_IS_SYSTEM", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_DOS_IS_SYSTEM", G_FILE_ATTRIBUTE_DOS_IS_SYSTEM); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_OWNER_USER", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_OWNER_USER", G_FILE_ATTRIBUTE_OWNER_USER); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_OWNER_USER_REAL", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_OWNER_USER_REAL", G_FILE_ATTRIBUTE_OWNER_USER_REAL); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_OWNER_GROUP", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_OWNER_GROUP", G_FILE_ATTRIBUTE_OWNER_GROUP); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_THUMBNAIL_PATH", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_THUMBNAIL_PATH", G_FILE_ATTRIBUTE_THUMBNAIL_PATH); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_THUMBNAILING_FAILED", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_THUMBNAILING_FAILED", G_FILE_ATTRIBUTE_THUMBNAILING_FAILED); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_SIZE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_SIZE", G_FILE_ATTRIBUTE_FILESYSTEM_SIZE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_FREE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_FREE", G_FILE_ATTRIBUTE_FILESYSTEM_FREE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_TYPE", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_TYPE", G_FILE_ATTRIBUTE_FILESYSTEM_TYPE); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_READONLY", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_READONLY", G_FILE_ATTRIBUTE_FILESYSTEM_READONLY); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW", G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_GVFS_BACKEND", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_GVFS_BACKEND", G_FILE_ATTRIBUTE_GVFS_BACKEND); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_SELINUX_CONTEXT", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_SELINUX_CONTEXT", G_FILE_ATTRIBUTE_SELINUX_CONTEXT); - PyModule_AddStringConstant(m, "FILE_ATTRIBUTE_TRASH_ITEM_COUNT", + PyModule_AddStringConstant(module, "FILE_ATTRIBUTE_TRASH_ITEM_COUNT", G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT); - - PyModule_AddStringConstant(m, "ERROR", g_quark_to_string(G_IO_ERROR)); + + PyModule_AddStringConstant(module, "ERROR", g_quark_to_string(G_IO_ERROR)); /* pygio version */ tuple = Py_BuildValue ("(iii)", PYGIO_MAJOR_VERSION, PYGIO_MINOR_VERSION, PYGIO_MICRO_VERSION); - PyDict_SetItemString(d, "pygio_version", tuple); + PyDict_SetItemString(d, "pygio_version", tuple); Py_DECREF(tuple); + + return 0; } diff --git a/gio/pygio-utils.c b/gio/pygio-utils.c index be41453..f89c4b9 100644 --- a/gio/pygio-utils.c +++ b/gio/pygio-utils.c @@ -22,6 +22,7 @@ */ #include "pygio-utils.h" +#include /** * pygio_check_cancellable: @@ -115,14 +116,28 @@ pygio_pylist_to_uri_glist(PyObject *pyfile_list) len = PySequence_Size(pyfile_list); for (i = 0; i < len; i++) { - item = PySequence_GetItem(pyfile_list, i); - if (!PyString_Check(item)) { + item = PySequence_GetItem(pyfile_list, i); + if (!PYGLIB_PyUnicode_Check(item)) { PyErr_SetString(PyExc_TypeError, "files must be strings"); g_list_free(file_list); return NULL; } - file_list = g_list_prepend(file_list, PyString_AsString(item)); + +#if PY_VERSION_HEX < 0x03000000 + file_list = g_list_prepend(file_list, g_strdup(PyString_AsString(item))); +#else + { + PyObject *utf8_bytes_obj = PyUnicode_AsUTF8String (item); + if (!utf8_bytes_obj) { + g_list_free(file_list); + return NULL; + } + file_list = g_list_prepend(file_list, g_strdup(PyBytes_AsString(utf8_bytes_obj))); + Py_DECREF (utf8_bytes_obj); + } +#endif + } file_list = g_list_reverse(file_list); @@ -144,9 +159,9 @@ strv_to_pylist (char **strv) len = strv ? g_strv_length (strv) : 0; list = PyList_New (len); - for (i = 0; i < len; i++) - PyList_SetItem (list, i, PyString_FromString (strv[i])); - + for (i = 0; i < len; i++) { + PyList_SetItem (list, i, PYGLIB_PyUnicode_FromString (strv[i])); + } return list; } @@ -191,7 +206,7 @@ pylist_to_strv (PyObject *list, return FALSE; } - if (!PyString_Check (item)) + if (!PYGLIB_PyUnicode_Check (item)) { Py_DECREF (item); g_strfreev (ret); @@ -199,7 +214,20 @@ pylist_to_strv (PyObject *list, return FALSE; } +#if PY_VERSION_HEX < 0x03000000 ret[i] = g_strdup (PyString_AsString (item)); +#else + { + PyObject *utf8_bytes_obj = PyUnicode_AsUTF8String (item); + if (!utf8_bytes_obj) { + Py_DECREF (item); + g_strfreev (ret); + return FALSE; + } + ret[i] = g_strdup (PyBytes_AsString(utf8_bytes_obj)); + Py_DECREF (utf8_bytes_obj); + } +#endif Py_DECREF (item); } diff --git a/glib/Makefile.am b/glib/Makefile.am index d230da4..e210318 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -6,7 +6,7 @@ pkginclude_HEADERS = pyglib.h lib_LTLIBRARIES = libpyglib-2.0-@PYTHON_BASENAME@.la -pkgpyexecdir = $(pyexecdir)/gtk-2.0 +pkgpyexecdir = $(pyexecdir) pyglibdir = $(pkgpyexecdir)/glib pyglib_PYTHON = \ @@ -51,9 +51,11 @@ if PLATFORM_WIN32 _glib_la_CFLAGS += -DPLATFORM_WIN32 endif - all: $(pyglib_LTLIBRARIES:.la=.so) +check-local: $(pyglib_LTLIBRARIES:.la=.so) clean-local: rm -f $(pyglib_LTLIBRARIES:.la=.so) .la.so: $(LN_S) .libs/$@ $@ || true + +-include $(top_srcdir)/git.mk diff --git a/glib/Makefile.in b/glib/Makefile.in index 634bdce..e23bffc 100644 --- a/glib/Makefile.in +++ b/glib/Makefile.in @@ -83,18 +83,21 @@ am__glib_la_OBJECTS = _glib_la-glibmodule.lo _glib_la-pygiochannel.lo \ _glib_la-pygmaincontext.lo _glib_la-pygmainloop.lo \ _glib_la-pygsource.lo _glib_la-pygspawn.lo _glib_la_OBJECTS = $(am__glib_la_OBJECTS) -_glib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(_glib_la_CFLAGS) $(CFLAGS) \ - $(_glib_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +_glib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_glib_la_CFLAGS) \ + $(CFLAGS) $(_glib_la_LDFLAGS) $(LDFLAGS) -o $@ libpyglib_2_0_@PYTHON_BASENAME@_la_DEPENDENCIES = \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS = \ libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS = \ $(am_libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS) -libpyglib_2_0_@PYTHON_BASENAME@_la_LINK = $(LIBTOOL) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) \ +libpyglib_2_0_@PYTHON_BASENAME@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ + --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -102,13 +105,26 @@ am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(_glib_la_SOURCES) \ $(libpyglib_2_0_@PYTHON_BASENAME@_la_SOURCES) DIST_SOURCES = $(_glib_la_SOURCES) \ @@ -122,6 +138,7 @@ pkgincludedir = $(includedir)/pygtk-2.0 ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -152,6 +169,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ @@ -163,6 +183,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_PC = @LIBFFI_PC@ @@ -172,7 +194,9 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -185,10 +209,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ @@ -211,6 +240,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -243,12 +273,11 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgpyexecdir = $(pyexecdir)/gtk-2.0 +pkgpyexecdir = $(pyexecdir) pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -307,7 +336,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .la .lo .o .obj .so -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -316,9 +345,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu glib/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign glib/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu glib/Makefile + $(AUTOMAKE) --foreign glib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -332,9 +361,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @@ -400,9 +429,9 @@ clean-pyglibLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done _glib.la: $(_glib_la_OBJECTS) $(_glib_la_DEPENDENCIES) - $(_glib_la_LINK) -rpath $(pyglibdir) $(_glib_la_OBJECTS) $(_glib_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(_glib_la_LINK) -rpath $(pyglibdir) $(_glib_la_OBJECTS) $(_glib_la_LIBADD) $(LIBS) libpyglib-2.0-@PYTHON_BASENAME@.la: $(libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS) $(libpyglib_2_0_@PYTHON_BASENAME@_la_DEPENDENCIES) - $(libpyglib_2_0_@PYTHON_BASENAME@_la_LINK) -rpath $(libdir) $(libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS) $(libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libpyglib_2_0_@PYTHON_BASENAME@_la_LINK) -rpath $(libdir) $(libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS) $(libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -421,88 +450,100 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< _glib_la-glibmodule.lo: glibmodule.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-glibmodule.lo -MD -MP -MF $(DEPDIR)/_glib_la-glibmodule.Tpo -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-glibmodule.Tpo $(DEPDIR)/_glib_la-glibmodule.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-glibmodule.lo -MD -MP -MF $(DEPDIR)/_glib_la-glibmodule.Tpo -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-glibmodule.Tpo $(DEPDIR)/_glib_la-glibmodule.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='glibmodule.c' object='_glib_la-glibmodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c _glib_la-pygiochannel.lo: pygiochannel.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygiochannel.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygiochannel.Tpo -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-pygiochannel.Tpo $(DEPDIR)/_glib_la-pygiochannel.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygiochannel.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygiochannel.Tpo -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygiochannel.Tpo $(DEPDIR)/_glib_la-pygiochannel.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygiochannel.c' object='_glib_la-pygiochannel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c _glib_la-pygoptioncontext.lo: pygoptioncontext.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptioncontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptioncontext.Tpo -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-pygoptioncontext.Tpo $(DEPDIR)/_glib_la-pygoptioncontext.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptioncontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptioncontext.Tpo -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygoptioncontext.Tpo $(DEPDIR)/_glib_la-pygoptioncontext.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygoptioncontext.c' object='_glib_la-pygoptioncontext.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c _glib_la-pygoptiongroup.lo: pygoptiongroup.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptiongroup.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptiongroup.Tpo -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-pygoptiongroup.Tpo $(DEPDIR)/_glib_la-pygoptiongroup.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptiongroup.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptiongroup.Tpo -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygoptiongroup.Tpo $(DEPDIR)/_glib_la-pygoptiongroup.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygoptiongroup.c' object='_glib_la-pygoptiongroup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c _glib_la-pygmaincontext.lo: pygmaincontext.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmaincontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmaincontext.Tpo -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-pygmaincontext.Tpo $(DEPDIR)/_glib_la-pygmaincontext.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmaincontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmaincontext.Tpo -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygmaincontext.Tpo $(DEPDIR)/_glib_la-pygmaincontext.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygmaincontext.c' object='_glib_la-pygmaincontext.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c _glib_la-pygmainloop.lo: pygmainloop.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmainloop.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmainloop.Tpo -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-pygmainloop.Tpo $(DEPDIR)/_glib_la-pygmainloop.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmainloop.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmainloop.Tpo -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygmainloop.Tpo $(DEPDIR)/_glib_la-pygmainloop.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygmainloop.c' object='_glib_la-pygmainloop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c _glib_la-pygsource.lo: pygsource.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygsource.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygsource.Tpo -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-pygsource.Tpo $(DEPDIR)/_glib_la-pygsource.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygsource.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygsource.Tpo -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygsource.Tpo $(DEPDIR)/_glib_la-pygsource.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygsource.c' object='_glib_la-pygsource.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c _glib_la-pygspawn.lo: pygspawn.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygspawn.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygspawn.Tpo -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_glib_la-pygspawn.Tpo $(DEPDIR)/_glib_la-pygspawn.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygspawn.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygspawn.Tpo -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygspawn.Tpo $(DEPDIR)/_glib_la-pygspawn.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygspawn.c' object='_glib_la-pygspawn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo: pyglib.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -MT libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo -MD -MP -MF $(DEPDIR)/libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.Tpo -c -o libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.Tpo $(DEPDIR)/libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -MT libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo -MD -MP -MF $(DEPDIR)/libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.Tpo -c -o libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.Tpo $(DEPDIR)/libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pyglib.c' object='libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -c -o libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -c -o libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c mostlyclean-libtool: -rm -f *.lo @@ -651,6 +692,7 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: @@ -755,10 +797,10 @@ ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS \ uninstall-pyglibLTLIBRARIES uninstall-pyglibPYTHON -.MAKE: install-am install-strip +.MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-local \ +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ clean-pyglibLTLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ @@ -777,11 +819,14 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS \ all: $(pyglib_LTLIBRARIES:.la=.so) +check-local: $(pyglib_LTLIBRARIES:.la=.so) clean-local: rm -f $(pyglib_LTLIBRARIES:.la=.so) .la.so: $(LN_S) .libs/$@ $@ || true +-include $(top_srcdir)/git.mk + # 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. .NOEXPORT: diff --git a/glib/glibmodule.c b/glib/glibmodule.c index f794d5d..963e5ea 100644 --- a/glib/glibmodule.c +++ b/glib/glibmodule.c @@ -68,19 +68,19 @@ get_handler_priority(gint *priority, PyObject *kwargs) } pos = 0; PyDict_Next(kwargs, &pos, &key, &val); - if (!_PyUnicode_Check(key)) { + if (!PYGLIB_PyUnicode_Check(key)) { PyErr_SetString(PyExc_TypeError, "keyword argument name is not a string"); return -1; } - if (strcmp(_PyUnicode_AsString(key), "priority") != 0) { + if (strcmp(PYGLIB_PyUnicode_AsString(key), "priority") != 0) { PyErr_SetString(PyExc_TypeError, "only 'priority' keyword argument accepted"); return -1; } - *priority = _PyLong_AsLong(val); + *priority = PYGLIB_PyLong_AsLong(val); if (PyErr_Occurred()) { PyErr_Clear(); PyErr_SetString(PyExc_ValueError, "could not get priority value"); @@ -135,7 +135,7 @@ pyglib_idle_add(PyObject *self, PyObject *args, PyObject *kwargs) handler_id = g_idle_add_full(priority, _pyglib_handler_marshal, data, _pyglib_destroy_notify); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } @@ -175,7 +175,7 @@ pyglib_timeout_add(PyObject *self, PyObject *args, PyObject *kwargs) handler_id = g_timeout_add_full(priority, interval, _pyglib_handler_marshal, data, _pyglib_destroy_notify); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } static PyObject * @@ -214,7 +214,7 @@ pyglib_timeout_add_seconds(PyObject *self, PyObject *args, PyObject *kwargs) handler_id = g_timeout_add_seconds_full(priority, interval, _pyglib_handler_marshal, data, _pyglib_destroy_notify); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } static gboolean @@ -305,7 +305,7 @@ pyglib_io_add_watch(PyObject *self, PyObject *args, PyObject *kwargs) (GDestroyNotify)_pyglib_destroy_notify); g_io_channel_unref(iochannel); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } static PyObject * @@ -385,7 +385,7 @@ pyglib_child_watch_add(PyObject *unused, PyObject *args, PyObject *kwargs) Py_INCREF(child_data->data); id = g_child_watch_add_full(priority, pid, child_watch_func, child_data, child_watch_dnotify); - return _PyLong_FromLong(id); + return PYGLIB_PyLong_FromLong(id); } static PyObject * @@ -402,7 +402,7 @@ pyglib_markup_escape_text(PyObject *unused, PyObject *args, PyObject *kwargs) return NULL; text_out = g_markup_escape_text(text_in, text_size); - retval = _PyUnicode_FromString(text_out); + retval = PYGLIB_PyUnicode_FromString(text_out); g_free(text_out); return retval; } @@ -417,12 +417,10 @@ pyglib_get_current_time(PyObject *unused) } static PyObject* -pyglib_get_user_cache_dir(PyObject *self) +get_user_dir(const char *path) { - const char *path = g_get_user_cache_dir(); - if (path) - return _PyUnicode_FromString(path); + return PYGLIB_PyUnicode_FromString(path); else { Py_INCREF(Py_None); return Py_None; @@ -432,27 +430,19 @@ pyglib_get_user_cache_dir(PyObject *self) static PyObject* pyglib_get_user_config_dir(PyObject *self) { - const char *path = g_get_user_config_dir(); + return get_user_dir(g_get_user_config_dir()); +} - if (path) - return _PyUnicode_FromString(path); - else { - Py_INCREF(Py_None); - return Py_None; - } +static PyObject* +pyglib_get_user_cache_dir(PyObject *self) +{ + return get_user_dir(g_get_user_cache_dir()); } static PyObject* pyglib_get_user_data_dir(PyObject *self) { - const char *path = g_get_user_data_dir(); - - if (path) - return _PyUnicode_FromString(path); - else { - Py_INCREF(Py_None); - return Py_None; - } + return get_user_dir(g_get_user_data_dir()); } static PyObject * @@ -469,7 +459,7 @@ pyglib_get_user_special_dir(PyObject *unused, PyObject *args, PyObject *kwargs) path = g_get_user_special_dir(directory); if (path) - return _PyUnicode_FromString(path); + return PYGLIB_PyUnicode_FromString(path); else { Py_INCREF(Py_None); return Py_None; @@ -479,7 +469,7 @@ pyglib_get_user_special_dir(PyObject *unused, PyObject *args, PyObject *kwargs) static PyObject * pyglib_main_depth(PyObject *unused) { - return _PyLong_FromLong(g_main_depth()); + return PYGLIB_PyLong_FromLong(g_main_depth()); } static PyObject * @@ -535,7 +525,7 @@ pyglib_filename_from_utf8(PyObject *self, PyObject *args) g_free(filename); return NULL; } - py_filename = _PyUnicode_FromStringAndSize(filename, bytes_written); + py_filename = PYGLIB_PyUnicode_FromStringAndSize(filename, bytes_written); g_free(filename); return py_filename; } @@ -551,19 +541,19 @@ pyglib_get_application_name(PyObject *self) Py_INCREF(Py_None); return Py_None; } - return _PyUnicode_FromString(name); + return PYGLIB_PyUnicode_FromString(name); } static PyObject* pyglib_set_application_name(PyObject *self, PyObject *arg) { - if (!PyString_Check(arg)) { + if (!PYGLIB_PyUnicode_Check(arg)) { PyErr_Format(PyExc_TypeError, "first argument must be a string, not '%s'", - PyString_AS_STRING(PyObject_Repr(arg))); + PYGLIB_PyUnicode_AsString(PyObject_Repr(arg))); return NULL; } - g_set_application_name(PyString_AS_STRING(arg)); + g_set_application_name(PYGLIB_PyUnicode_AsString(arg)); Py_INCREF(Py_None); return Py_None; } @@ -578,19 +568,19 @@ pyglib_get_prgname(PyObject *self) Py_INCREF(Py_None); return Py_None; } - return _PyUnicode_FromString(name); + return PYGLIB_PyUnicode_FromString(name); } static PyObject* pyglib_set_prgname(PyObject *self, PyObject *arg) { - if (!PyString_Check(arg)) { + if (!PYGLIB_PyUnicode_Check(arg)) { PyErr_Format(PyExc_TypeError, "first argument must be a string, not '%s'", - PyString_AS_STRING(PyObject_Repr(arg))); + PYGLIB_PyUnicode_AsString(PyObject_Repr(arg))); return NULL; } - g_set_prgname(PyString_AS_STRING(arg)); + g_set_prgname(PYGLIB_PyUnicode_AsString(arg)); Py_INCREF(Py_None); return Py_None; } @@ -608,11 +598,81 @@ pyglib_find_program_in_path(PyObject *unused, PyObject *args, PyObject *kwargs) return NULL; ret = g_find_program_in_path(program); - retval = _PyUnicode_FromString(ret); + retval = PYGLIB_PyUnicode_FromString(ret); g_free(ret); return retval; } +static PyObject * +pyglib_uri_list_extract_uris(PyObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "uri_list", NULL }; + char *uri_list; + char **uris, **tmp; + int i = 0, j; + PyObject *ret; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:uri_list_extract_uris", kwlist, &uri_list)) + return NULL; + + uris = (char **)g_uri_list_extract_uris(uri_list); + if (!uris) { + Py_INCREF(Py_None); + return Py_None; + } + + tmp = uris; + while (*tmp) + tmp++, i++; + + ret = PyTuple_New(i); + for (j = 0; j < i; j++) + PyTuple_SetItem(ret, j, PYGLIB_PyUnicode_FromString(uris[j])); + + g_strfreev(uris); + + return ret; +} + +/* FIXME: we should use strv_to_pylist (in pygio-utils.h) here, but that + * function should be moved into pyglib first. See + * https://bugzilla.gnome.org/show_bug.cgi?id=630508 + */ +static PyObject * +tuple_of_strings_from_dirs(const gchar* const *dirs) +{ + char **tmp; + int i = 0, j; + PyObject *ret; + + if (!dirs) { + Py_INCREF(Py_None); + return Py_None; + } + + tmp = (char **)dirs; + while (*tmp) + tmp++, i++; + + ret = PyTuple_New(i); + for (j = 0; j < i; j++) + PyTuple_SetItem(ret, j, PYGLIB_PyUnicode_FromString(dirs[j])); + + return ret; +} + +static PyObject* +pyglib_get_system_config_dirs(PyObject *self) +{ + return tuple_of_strings_from_dirs(g_get_system_config_dirs()); +} + +static PyObject* +pyglib_get_system_data_dirs(PyObject *self) +{ + return tuple_of_strings_from_dirs(g_get_system_data_dirs()); +} + static PyMethodDef _glib_functions[] = { { "threads_init", (PyCFunction) pyglib_threads_init, METH_NOARGS, @@ -708,6 +768,16 @@ static PyMethodDef _glib_functions[] = { (PyCFunction)pyglib_markup_escape_text, METH_VARARGS|METH_KEYWORDS }, { "find_program_in_path", (PyCFunction)pyglib_find_program_in_path, METH_VARARGS|METH_KEYWORDS }, + { "uri_list_extract_uris", + (PyCFunction)pyglib_uri_list_extract_uris, METH_VARARGS|METH_KEYWORDS, + "uri_list_extract_uris(uri_list) -> tuple of strings holding URIs\n" + "Splits an string containing an URI list conforming to the \n" + "text/uri-list mime type defined in RFC 2483 into individual URIs, \n" + "discarding any comments. The URIs are not validated." }, + { "get_system_config_dirs", + (PyCFunction)pyglib_get_system_config_dirs, METH_NOARGS }, + { "get_system_data_dirs", + (PyCFunction)pyglib_get_system_data_dirs, METH_NOARGS }, { NULL, NULL, 0 } }; @@ -717,7 +787,10 @@ static struct _PyGLib_Functions pyglib_api = { FALSE, /* threads_enabled */ NULL, /* gerror_exception */ NULL, /* block_threads */ - NULL /* unblock_threads */ + NULL, /* unblock_threads */ + pyg_main_context_new, + pyg_option_context_new, + pyg_option_group_new, }; static void @@ -727,7 +800,7 @@ pyglib_register_api(PyObject *d) /* for addon libraries ... */ PyDict_SetItemString(d, "_PyGLib_API", - o=PyCObject_FromVoidPtr(&pyglib_api,NULL)); + o=PYGLIB_CPointer_WrapPointer(&pyglib_api,"glib._PyGLib_API")); Py_DECREF(o); pyglib_init_internal(o); diff --git a/glib/option.py b/glib/option.py index 027752f..bdfbe1d 100644 --- a/glib/option.py +++ b/glib/option.py @@ -34,6 +34,13 @@ import optparse from optparse import OptParseError, OptionError, OptionValueError, \ BadOptionError, OptionConflictError +if sys.version_info >= (3, 0): + _basestring = str + _bytes = lambda s: s.encode() +else: + _basestring = basestring + _bytes = str + import glib _glib = sys.modules['glib._glib'] @@ -42,7 +49,7 @@ __all__ = [ "OptionError", "OptionValueError", "BadOptionError", - "OptionConflictError" + "OptionConflictError", "Option", "OptionGroup", "OptionParser", @@ -110,10 +117,10 @@ class Option(optparse.Option): flags = 0 if self.hidden: - self.flags |= _glib.OPTION_FLAG_HIDDEN + flags |= _glib.OPTION_FLAG_HIDDEN if self.in_main: - self.flags |= _glib.OPTION_FLAG_IN_MAIN + flags |= _glib.OPTION_FLAG_IN_MAIN if self.takes_value(): if self.optional_arg: @@ -125,10 +132,10 @@ class Option(optparse.Option): flags |= _glib.OPTION_FLAG_FILENAME for (long_name, short_name) in zip(self._long_opts, self._short_opts): - yield (long_name[2:], short_name[1], flags, self.help, self.metavar) + yield (long_name[2:], _bytes(short_name[1]), flags, self.help, self.metavar) for long_name in self._long_opts[len(self._short_opts):]: - yield (long_name[2:], '\0', flags, self.help, self.metavar) + yield (long_name[2:], _bytes('\0'), flags, self.help, self.metavar) class OptionGroup(optparse.OptionGroup): """A group of command line options. @@ -199,6 +206,7 @@ class OptionGroup(optparse.OptionGroup): entries = [] for option in self.option_list: entries.extend(option._to_goptionentries()) + group.add_entries(entries) return group @@ -214,7 +222,7 @@ class OptionGroup(optparse.OptionGroup): def set_values_to_defaults(self): for option in self.option_list: default = self.defaults.get(option.dest) - if isinstance(default, basestring): + if isinstance(default, _basestring): opt_str = option.get_opt_string() self.defaults[option.dest] = option.check_value( opt_str, default) @@ -292,7 +300,7 @@ class OptionParser(optparse.OptionParser): return context def add_option_group(self, *args, **kwargs): - if isinstance(args[0], basestring): + if isinstance(args[0], _basestring): optparse.OptionParser.add_option_group(self, OptionGroup(self, *args, **kwargs)) return diff --git a/glib/pygiochannel.c b/glib/pygiochannel.c index 4c935e8..f7e2bc4 100644 --- a/glib/pygiochannel.c +++ b/glib/pygiochannel.c @@ -39,17 +39,23 @@ py_io_channel_next(PyGIOChannel *self) return NULL; } - ret_obj = _PyUnicode_FromStringAndSize(str_return, length); + ret_obj = PYGLIB_PyUnicode_FromStringAndSize(str_return, length); g_free(str_return); return ret_obj; } -static int -py_io_channel_compare(PyGIOChannel *self, PyGIOChannel *v) +static PyObject* +py_io_channel_richcompare(PyObject *self, PyObject *other, int op) { - if (self->channel == v->channel) return 0; - if (self->channel > v->channel) return -1; - return 1; + if (Py_TYPE(self) == Py_TYPE(other) && + Py_TYPE(self) == &PyGIOChannel_Type) { + return _pyglib_generic_ptr_richcompare(((PyGIOChannel*)self)->channel, + ((PyGIOChannel*)other)->channel, + op); + } else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static PyObject* @@ -88,7 +94,7 @@ py_io_channel_shutdown(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(ret); + return PYGLIB_PyLong_FromLong(ret); } /* character encoding conversion involved functions. @@ -112,7 +118,7 @@ py_io_channel_set_buffer_size(PyGIOChannel* self, PyObject *args, PyObject *kwar static PyObject* py_io_channel_get_buffer_size(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_buffer_size(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_buffer_size(self->channel)); } static PyObject* @@ -133,7 +139,7 @@ py_io_channel_set_buffered(PyGIOChannel* self, PyObject *args, PyObject *kwargs) static PyObject* py_io_channel_get_buffered(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_buffered(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_buffered(self->channel)); } static PyObject* @@ -164,7 +170,7 @@ py_io_channel_get_encoding(PyGIOChannel* self) return Py_None; } - return _PyUnicode_FromString(encoding); + return PYGLIB_PyUnicode_FromString(encoding); } #define CHUNK_SIZE (8 * 1024) @@ -183,7 +189,7 @@ py_io_channel_read_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs) return NULL; if (max_count == 0) - return _PyUnicode_FromString(""); + return PYGLIB_PyUnicode_FromString(""); while (status == G_IO_STATUS_NORMAL && (max_count == -1 || total_read < max_count)) { @@ -200,16 +206,16 @@ py_io_channel_read_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs) } if ( ret_obj == NULL ) { - ret_obj = _PyUnicode_FromStringAndSize((char *)NULL, buf_size); + ret_obj = PYGLIB_PyBytes_FromStringAndSize((char *)NULL, buf_size); if (ret_obj == NULL) goto failure; } - else if (buf_size + total_read > _PyUnicode_GET_SIZE(ret_obj)) { - if (_PyUnicode_Resize(&ret_obj, buf_size + total_read) == -1) + else if (buf_size + total_read > PYGLIB_PyBytes_Size(ret_obj)) { + if (PYGLIB_PyBytes_Resize(&ret_obj, buf_size + total_read) == -1) goto failure; } - buf = _PyUnicode_AS_STRING(ret_obj) + total_read; + buf = PYGLIB_PyBytes_AsString(ret_obj) + total_read; pyglib_unblock_threads(); status = g_io_channel_read_chars(self->channel, buf, buf_size, @@ -221,10 +227,28 @@ py_io_channel_read_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs) total_read += single_read; } - if ( total_read != _PyUnicode_GET_SIZE(ret_obj) ) { - if (_PyUnicode_Resize(&ret_obj, total_read) == -1) + if ( total_read != PYGLIB_PyBytes_Size(ret_obj) ) { + if (PYGLIB_PyBytes_Resize(&ret_obj, total_read) == -1) + goto failure; + } + +#if PY_VERSION_HEX >= 0x03000000 + /* If this is not UTF8 encoded channel return the raw bytes */ + if (g_io_channel_get_encoding(self->channel) != NULL) + return ret_obj; + + /* convert to Unicode string */ + { + PyObject *unicode_obj; + + unicode_obj = PyUnicode_FromString(PyBytes_AS_STRING(ret_obj)); + if (unicode_obj == NULL) goto failure; + Py_DECREF(ret_obj); + ret_obj = unicode_obj; } +#endif + return ret_obj; failure: @@ -252,7 +276,7 @@ py_io_channel_write_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(count); + return PYGLIB_PyLong_FromLong(count); } static PyObject* @@ -278,13 +302,13 @@ py_io_channel_write_lines(PyGIOChannel* self, PyObject *args, PyObject *kwargs) PyErr_Clear(); goto normal_exit; } - if (!_PyUnicode_Check(value)) { + if (!PYGLIB_PyUnicode_Check(value)) { PyErr_SetString(PyExc_TypeError, "glib.IOChannel.writelines must" " be sequence/iterator of strings"); Py_DECREF(iter); return NULL; } - _PyUnicode_AsStringAndSize(value, &buf, &buf_len); + PYGLIB_PyUnicode_AsStringAndSize(value, &buf, &buf_len); pyglib_unblock_threads(); status = g_io_channel_write_chars(self->channel, buf, buf_len, &count, &error); pyglib_unblock_threads(); @@ -312,7 +336,7 @@ py_io_channel_flush(PyGIOChannel* self) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(status); + return PYGLIB_PyLong_FromLong(status); } static PyObject* @@ -331,19 +355,19 @@ py_io_channel_set_flags(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(status); + return PYGLIB_PyLong_FromLong(status); } static PyObject* py_io_channel_get_flags(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_flags(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_flags(self->channel)); } static PyObject* py_io_channel_get_buffer_condition(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_buffer_condition(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_buffer_condition(self->channel)); } static PyObject* @@ -494,7 +518,7 @@ py_io_channel_win32_poll(PyObject *self, PyObject *args, PyObject *kwargs) pyfd = PyList_GET_ITEM(pyfds, i); ((PyGPollFD *) pyfd)->pollfd = pollfd[i]; } - return _PyLong_FromLong(result); + return PYGLIB_PyLong_FromLong(result); } static PyObject * @@ -538,7 +562,7 @@ py_io_channel_read_line(PyGIOChannel* self, PyObject *args, PyObject *kwargs) &terminator_pos, &error); if (pyglib_error_check(&error)) return NULL; - ret_obj = _PyUnicode_FromStringAndSize(str_return, length); + ret_obj = PYGLIB_PyUnicode_FromStringAndSize(str_return, length); g_free(str_return); return ret_obj; } @@ -567,7 +591,7 @@ py_io_channel_read_lines(PyGIOChannel* self, PyObject *args, PyObject *kwargs) Py_DECREF(line); return NULL; } - line = _PyUnicode_FromStringAndSize(str_return, length); + line = PYGLIB_PyUnicode_FromStringAndSize(str_return, length); g_free(str_return); if (PyList_Append(list, line)) { Py_DECREF(line); @@ -608,7 +632,7 @@ py_io_channel_seek(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(status); + return PYGLIB_PyLong_FromLong(status); } #if 0 // Not wrapped @@ -643,29 +667,29 @@ static PyMemberDef py_io_channel_members[] = { }; static PyMethodDef py_io_channel_methods[] = { - { "close", (PyCFunction)py_io_channel_shutdown, METH_KEYWORDS }, + { "close", (PyCFunction)py_io_channel_shutdown, METH_VARARGS|METH_KEYWORDS }, { "flush", (PyCFunction)py_io_channel_flush, METH_NOARGS }, - { "set_encoding", (PyCFunction)py_io_channel_set_encoding, METH_KEYWORDS }, + { "set_encoding", (PyCFunction)py_io_channel_set_encoding, METH_VARARGS|METH_KEYWORDS }, { "get_encoding", (PyCFunction)py_io_channel_get_encoding, METH_NOARGS }, - { "set_buffered", (PyCFunction)py_io_channel_set_buffered, METH_KEYWORDS }, + { "set_buffered", (PyCFunction)py_io_channel_set_buffered, METH_VARARGS|METH_KEYWORDS }, { "get_buffered", (PyCFunction)py_io_channel_get_buffered, METH_NOARGS }, - { "set_buffer_size", (PyCFunction)py_io_channel_set_buffer_size, METH_KEYWORDS }, + { "set_buffer_size", (PyCFunction)py_io_channel_set_buffer_size, METH_VARARGS|METH_KEYWORDS }, { "get_buffer_size", (PyCFunction)py_io_channel_get_buffer_size, METH_NOARGS }, - { "read", (PyCFunction)py_io_channel_read_chars, METH_KEYWORDS }, - { "readline", (PyCFunction)py_io_channel_read_line, METH_KEYWORDS }, - { "readlines", (PyCFunction)py_io_channel_read_lines, METH_KEYWORDS }, - { "write", (PyCFunction)py_io_channel_write_chars, METH_KEYWORDS }, - { "writelines", (PyCFunction)py_io_channel_write_lines, METH_KEYWORDS }, - { "set_flags", (PyCFunction)py_io_channel_set_flags, METH_KEYWORDS }, + { "read", (PyCFunction)py_io_channel_read_chars, METH_VARARGS|METH_KEYWORDS }, + { "readline", (PyCFunction)py_io_channel_read_line, METH_VARARGS|METH_KEYWORDS }, + { "readlines", (PyCFunction)py_io_channel_read_lines, METH_VARARGS|METH_KEYWORDS }, + { "write", (PyCFunction)py_io_channel_write_chars, METH_VARARGS|METH_KEYWORDS }, + { "writelines", (PyCFunction)py_io_channel_write_lines, METH_VARARGS|METH_KEYWORDS }, + { "set_flags", (PyCFunction)py_io_channel_set_flags, METH_VARARGS|METH_KEYWORDS }, { "get_flags", (PyCFunction)py_io_channel_get_flags, METH_NOARGS }, { "get_buffer_condition", (PyCFunction)py_io_channel_get_buffer_condition, METH_NOARGS }, - { "set_close_on_unref", (PyCFunction)py_io_channel_set_close_on_unref, METH_KEYWORDS }, + { "set_close_on_unref", (PyCFunction)py_io_channel_set_close_on_unref, METH_VARARGS | METH_KEYWORDS }, { "get_close_on_unref", (PyCFunction)py_io_channel_get_close_on_unref, METH_NOARGS }, - { "add_watch", (PyCFunction)py_io_channel_add_watch, METH_KEYWORDS }, - { "seek", (PyCFunction)py_io_channel_seek, METH_KEYWORDS }, + { "add_watch", (PyCFunction)py_io_channel_add_watch, METH_VARARGS|METH_KEYWORDS }, + { "seek", (PyCFunction)py_io_channel_seek, METH_VARARGS|METH_KEYWORDS }, #ifdef G_OS_WIN32 - { "win32_make_pollfd", (PyCFunction)py_io_channel_win32_make_pollfd, METH_KEYWORDS }, - { "win32_poll", (PyCFunction)py_io_channel_win32_poll, METH_KEYWORDS|METH_STATIC }, + { "win32_make_pollfd", (PyCFunction)py_io_channel_win32_make_pollfd, METH_VARARGS | METH_KEYWORDS }, + { "win32_poll", (PyCFunction)py_io_channel_win32_poll, METH_VARARGS|METH_KEYWORDS|METH_STATIC }, #endif { NULL, NULL, 0 } }; @@ -732,7 +756,7 @@ pyglib_iochannel_register_types(PyObject *d) PyGIOChannel_Type.tp_members = py_io_channel_members; PyGIOChannel_Type.tp_methods = py_io_channel_methods; PyGIOChannel_Type.tp_hash = (hashfunc)py_io_channel_hash; - PyGIOChannel_Type.tp_compare = (cmpfunc)py_io_channel_compare; + PyGIOChannel_Type.tp_richcompare = (richcmpfunc)py_io_channel_richcompare; PyGIOChannel_Type.tp_iter = (getiterfunc)py_io_channel_get_iter; PyGIOChannel_Type.tp_iternext = (iternextfunc)py_io_channel_next; diff --git a/glib/pyglib-private.h b/glib/pyglib-private.h index 8b033e1..183184f 100644 --- a/glib/pyglib-private.h +++ b/glib/pyglib-private.h @@ -34,6 +34,9 @@ struct _PyGLib_Functions { PyObject *gerror_exception; PyGLibThreadBlockFunc block_threads; PyGLibThreadBlockFunc unblock_threads; + PyObject* (*main_context_new)(GMainContext *context); + PyObject* (*option_context_new)(GOptionContext *context); + PyObject* (*option_group_new)(GOptionGroup *group); }; gboolean _pyglib_handler_marshal(gpointer user_data); diff --git a/glib/pyglib-python-compat.h b/glib/pyglib-python-compat.h index 915a912..8c1dd51 100644 --- a/glib/pyglib-python-compat.h +++ b/glib/pyglib-python-compat.h @@ -41,31 +41,144 @@ typedef int Py_ssize_t; typedef inquiry lenfunc; #endif +/* PyCObject superceded by PyCapsule on Python >= 2.7 + * However since this effects header files used by + * static bindings we are only applying the change to + * Python 3.x where we don't support the static bindings. + * 3.2 removed PyCObject so we don't have any choice here. + * + * There is talk upstream of undeprecating PyCObject + * (at least where the 2.x branch is concerned) + * and there is no danger of it being remove from 2.7. + **/ +#if PY_VERSION_HEX >= 0x03000000 +# define PYGLIB_CPointer_Check PyCapsule_CheckExact +# define PYGLIB_CPointer_WrapPointer(ptr, typename) \ + PyCapsule_New(ptr, typename, NULL) +# define PYGLIB_CPointer_GetPointer(obj, typename) \ + PyCapsule_GetPointer(obj, typename) +# define PYGLIB_CPointer_Import(module, symbol) \ + PyCapsule_Import(##module##.##symbol##, FALSE) +#else +# define PYGLIB_CPointer_Check PyCObject_Check +# define PYGLIB_CPointer_WrapPointer(ptr, typename) \ + PyCObject_FromVoidPtr(ptr, NULL) +# define PYGLIB_CPointer_GetPointer(obj, typename) \ + PyCObject_AsVoidPtr(obj) +# define PYGLIB_CPointer_Import(module, symbol) \ + PyCObject_Import(module, symbol) +#endif + +#if PY_VERSION_HEX < 0x03000000 + +#define PYGLIB_INIT_FUNCTION(modname, fullpkgname, functions) \ +static int _pyglib_init_##modname(PyObject *module); \ +void init##modname(void) \ +{ \ + PyObject *module = Py_InitModule(fullpkgname, functions); \ + _pyglib_init_##modname(module); \ +} \ +static int _pyglib_init_##modname(PyObject *module) + +#else + +#define PYGLIB_INIT_FUNCTION(modname, fullpkgname, functions) \ +static struct PyModuleDef _##modname##module = { \ + PyModuleDef_HEAD_INIT, \ + fullpkgname, \ + NULL, \ + -1, \ + functions, \ + NULL, \ + NULL, \ + NULL, \ + NULL \ +}; \ +static int _pyglib_init_##modname(PyObject *module); \ +PyObject *PyInit_##modname(void) \ +{ \ + PyObject *module = PyModule_Create(&_##modname##module); \ + if (module == NULL) \ + return NULL; \ + if (_pyglib_init_##modname(module) != 0 ) {\ + Py_DECREF(module); \ + return NULL; \ + } \ + return module; \ +} \ +static int _pyglib_init_##modname(PyObject *module) + +#endif + /* Compilation on Python 2.x */ #if PY_VERSION_HEX < 0x03000000 +#define PYGLIB_MODULE_ERROR_RETURN + #define RO READONLY -#define _PyUnicode_Check PyString_Check -#define _PyUnicode_AsString PyString_AsString -#define _PyUnicode_AsStringAndSize PyString_AsStringAndSize -#define _PyUnicode_FromString PyString_FromString -#define _PyUnicode_FromStringAndSize PyString_FromStringAndSize -#define _PyUnicode_FromFormat PyString_FromFormat -#define _PyUnicode_AS_STRING PyString_AS_STRING -#define _PyUnicode_GET_SIZE PyString_GET_SIZE -#define _PyUnicode_Resize _PyString_Resize -#define _PyUnicode_Type PyString_Type -#define _PyLong_Check PyInt_Check -#define _PyLong_FromLong PyInt_FromLong -#define _PyLong_AsLong PyInt_AsLong -#define _PyLongObject PyIntObject -#define _PyLong_Type PyInt_Type -#define _PyLong_AS_LONG PyInt_AS_LONG + +#define PYGLIB_PyBaseString_Check(ob) (PyString_Check(ob) || PyUnicode_Check(ob)) + +#define PYGLIB_PyUnicode_Check PyString_Check +#define PYGLIB_PyUnicode_AsString PyString_AsString +#define PYGLIB_PyUnicode_AsStringAndSize PyString_AsStringAndSize +#define PYGLIB_PyUnicode_FromString PyString_FromString +#define PYGLIB_PyUnicode_FromStringAndSize PyString_FromStringAndSize +#define PYGLIB_PyUnicode_FromFormat PyString_FromFormat +#define PYGLIB_PyUnicode_AS_STRING PyString_AS_STRING +#define PYGLIB_PyUnicode_GET_SIZE PyString_GET_SIZE +#define PYGLIB_PyUnicode_Type PyString_Type + +#define PYGLIB_PyBytes_FromString PyString_FromString +#define PYGLIB_PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PYGLIB_PyBytes_Resize _PyString_Resize +#define PYGLIB_PyBytes_AsString PyString_AsString +#define PYGLIB_PyBytes_Size PyString_Size +#define PYGLIB_PyBytes_Check PyString_Check + +#define PYGLIB_PyLong_Check PyInt_Check +#define PYGLIB_PyLong_FromLong PyInt_FromLong +#define PYGLIB_PyLong_FromSsize_t PyInt_FromSsize_t +#define PYGLIB_PyLong_FromSize_t PyInt_FromSize_t +#define PYGLIB_PyLong_AsLong PyInt_AsLong +#define PYGLIB_PyLongObject PyIntObject +#define PYGLIB_PyLong_Type PyInt_Type +#define PYGLIB_PyLong_AS_LONG PyInt_AS_LONG #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + +#define PYGLIB_PyNumber_Long PyNumber_Int + +#ifndef PyVarObject_HEAD_INIT +#define PyVarObject_HEAD_INIT(base, size) \ + PyObject_HEAD_INIT(base) \ + size, +#endif + +#define PYGLIB_MODULE_START(symbol, modname) \ +DL_EXPORT(void) init##symbol(void) \ +{ \ + PyObject *module; \ + module = Py_InitModule(modname, symbol##_functions); +#define PYGLIB_MODULE_END } +#define PYGLIB_DEFINE_TYPE(typename, symbol, csymbol) \ +PyTypeObject symbol = { \ + PyObject_HEAD_INIT(NULL) \ + 0, \ + typename, \ + sizeof(csymbol), \ + 0, \ +}; +#define PYGLIB_REGISTER_TYPE(d, type, name) \ + if (!type.tp_alloc) \ + type.tp_alloc = PyType_GenericAlloc; \ + if (!type.tp_new) \ + type.tp_new = PyType_GenericNew; \ + if (PyType_Ready(&type)) \ + return; \ + PyDict_SetItemString(d, name, (PyObject *)&type); + #else -#undef PYGLIB_MODULE_START -#undef PYGLIB_MODULE_END -#undef PYGLIB_DEFINE_TYPE -#undef PYGLIB_REGISTER_TYPE + +#define PYGLIB_MODULE_ERROR_RETURN 0 #define PYGLIB_MODULE_START(symbol, modname) \ static struct PyModuleDef _##symbol##module = { \ @@ -99,22 +212,34 @@ PyTypeObject symbol = { \ return; \ PyDict_SetItemString(d, name, (PyObject *)&type); -#define _PyUnicode_Check PyUnicode_Check -#define _PyUnicode_AsString PyUnicode_AsString -#define _PyUnicode_AsStringAndSize(obj, buf, size) PyUnicode_AsStringAndSize(obj, size) -#define _PyUnicode_FromString PyUnicode_FromString -#define _PyUnicode_FromStringAndSize PyUnicode_FromStringAndSize -#define _PyUnicode_FromFormat PyUnicode_FromFormat -#define _PyUnicode_AS_STRING _PyUnicode_AsString -#define _PyUnicode_GET_SIZE PyUnicode_GET_SIZE -#define _PyUnicode_Resize PyUnicode_Resize -#define _PyUnicode_Type PyUnicode_Type -#define _PyLong_Check PyLong_Check -#define _PyLong_FromLong PyLong_FromLong -#define _PyLong_AsLong PyLong_AsLong -#define _PyLong_AS_LONG PyLong_AS_LONG -#define _PyLongObject PyLongObject -#define _PyLong_Type PyLong_Type +#define PYGLIB_PyBaseString_Check PyUnicode_Check + +#define PYGLIB_PyUnicode_Check PyUnicode_Check +#define PYGLIB_PyUnicode_AsString _PyUnicode_AsString +#define PYGLIB_PyUnicode_AsStringAndSize(obj, buf, size) \ + (((*(buf) = _PyUnicode_AsStringAndSize(obj, size)) != NULL) ? 0 : -1) +#define PYGLIB_PyUnicode_FromString PyUnicode_FromString +#define PYGLIB_PyUnicode_FromStringAndSize PyUnicode_FromStringAndSize +#define PYGLIB_PyUnicode_FromFormat PyUnicode_FromFormat +#define PYGLIB_PyUnicode_GET_SIZE PyUnicode_GET_SIZE +#define PYGLIB_PyUnicode_Resize PyUnicode_Resize +#define PYGLIB_PyUnicode_Type PyUnicode_Type +#define PYGLIB_PyLong_Check PyLong_Check +#define PYGLIB_PyLong_FromLong PyLong_FromLong +#define PYGLIB_PyLong_AsLong PyLong_AsLong +#define PYGLIB_PyLong_AS_LONG(o) PyLong_AS_LONG((PyObject*)(o)) +#define PYGLIB_PyLongObject PyLongObject +#define PYGLIB_PyLong_Type PyLong_Type + +#define PYGLIB_PyBytes_FromString PyBytes_FromString +#define PYGLIB_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +#define PYGLIB_PyBytes_Resize(o, len) _PyBytes_Resize(o, len) +#define PYGLIB_PyBytes_AsString PyBytes_AsString +#define PYGLIB_PyBytes_Size PyBytes_Size +#define PYGLIB_PyBytes_Check PyBytes_Check + +#define PYGLIB_PyNumber_Long PyNumber_Long + #endif #endif /* __PYGLIB_PYTHON_COMPAT_H__ */ diff --git a/glib/pyglib.c b/glib/pyglib.c index a1bdbb9..1e024c2 100644 --- a/glib/pyglib.c +++ b/glib/pyglib.c @@ -35,15 +35,6 @@ static struct _PyGLib_Functions *_PyGLib_API; static int pyglib_thread_state_tls_key; static PyObject *exception_table = NULL; -static PyTypeObject *_PyGMainContext_Type; -#define PyGMainContext_Type (*_PyGMainContext_Type) - -static PyTypeObject *_PyGOptionGroup_Type; -#define PyGOptionGroup_Type (*_PyGOptionGroup_Type) - -static PyTypeObject *_PyGOptionContext_Type; -#define PyGOptionContext_Type (*_PyGOptionContext_Type) - void pyglib_init(void) { @@ -61,7 +52,7 @@ pyglib_init(void) Py_XDECREF(traceback); PyErr_Format(PyExc_ImportError, "could not import glib (error was: %s)", - _PyUnicode_AsString(py_orig_exc)); + PYGLIB_PyUnicode_AsString(py_orig_exc)); Py_DECREF(py_orig_exc); } else { PyErr_SetString(PyExc_ImportError, @@ -71,24 +62,20 @@ pyglib_init(void) } cobject = PyObject_GetAttrString(glib, "_PyGLib_API"); - if (cobject && PyCObject_Check(cobject)) - _PyGLib_API = (struct _PyGLib_Functions *) PyCObject_AsVoidPtr(cobject); + if (cobject && PYGLIB_CPointer_Check(cobject)) + _PyGLib_API = (struct _PyGLib_Functions *) PYGLIB_CPointer_GetPointer(cobject, "glib._PyGLib_API"); else { PyErr_SetString(PyExc_ImportError, "could not import glib (could not find _PyGLib_API object)"); Py_DECREF(glib); return; } - - _PyGMainContext_Type = (PyTypeObject*)PyObject_GetAttrString(glib, "MainContext"); - _PyGOptionGroup_Type = (PyTypeObject*)PyObject_GetAttrString(glib, "OptionGroup"); - _PyGOptionContext_Type = (PyTypeObject*)PyObject_GetAttrString(glib, "OptionContext"); } void pyglib_init_internal(PyObject *api) { - _PyGLib_API = (struct _PyGLib_Functions *) PyCObject_AsVoidPtr(api); + _PyGLib_API = (struct _PyGLib_Functions *) PYGLIB_CPointer_GetPointer(api, "glib._PyGLib_API"); } gboolean @@ -107,7 +94,11 @@ pyglib_gil_state_ensure(void) if (!_PyGLib_API->threads_enabled) return PyGILState_LOCKED; +#ifdef DISABLE_THREADING + return PyGILState_LOCKED; +#else return PyGILState_Ensure(); +#endif } void @@ -118,7 +109,9 @@ pyglib_gil_state_release(PyGILState_STATE state) if (!_PyGLib_API->threads_enabled) return; +#ifndef DISABLE_THREADING PyGILState_Release(state); +#endif } /** @@ -184,13 +177,19 @@ _pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback) int pyglib_gil_state_ensure_py23 (void) { +#ifdef DISABLE_THREADING + return 0; +#else return PyGILState_Ensure(); +#endif } void pyglib_gil_state_release_py23 (int flag) { +#ifndef DISABLE_THREADING PyGILState_Release(flag); +#endif } /** @@ -264,7 +263,7 @@ pyglib_error_check(GError **error) if (exception_table != NULL) { PyObject *item; - item = PyDict_GetItem(exception_table, _PyLong_FromLong((*error)->domain)); + item = PyDict_GetItem(exception_table, PYGLIB_PyLong_FromLong((*error)->domain)); if (item != NULL) exc_type = item; } @@ -273,19 +272,19 @@ pyglib_error_check(GError **error) if ((*error)->domain) { PyObject_SetAttrString(exc_instance, "domain", - d=_PyUnicode_FromString(g_quark_to_string((*error)->domain))); + d=PYGLIB_PyUnicode_FromString(g_quark_to_string((*error)->domain))); Py_DECREF(d); } else PyObject_SetAttrString(exc_instance, "domain", Py_None); PyObject_SetAttrString(exc_instance, "code", - d=_PyLong_FromLong((*error)->code)); + d=PYGLIB_PyLong_FromLong((*error)->code)); Py_DECREF(d); if ((*error)->message) { PyObject_SetAttrString(exc_instance, "message", - d=_PyUnicode_FromString((*error)->message)); + d=PYGLIB_PyUnicode_FromString((*error)->message)); Py_DECREF(d); } else { PyObject_SetAttrString(exc_instance, "message", Py_None); @@ -338,28 +337,28 @@ pyglib_gerror_exception_check(GError **error) Py_XDECREF(traceback); py_message = PyObject_GetAttrString(value, "message"); - if (!py_message || !_PyUnicode_Check(py_message)) { + if (!py_message || !PYGLIB_PyUnicode_Check(py_message)) { bad_gerror_message = "glib.GError instances must have a 'message' string attribute"; goto bad_gerror; } py_domain = PyObject_GetAttrString(value, "domain"); - if (!py_domain || !_PyUnicode_Check(py_domain)) { + if (!py_domain || !PYGLIB_PyUnicode_Check(py_domain)) { bad_gerror_message = "glib.GError instances must have a 'domain' string attribute"; Py_DECREF(py_message); goto bad_gerror; } py_code = PyObject_GetAttrString(value, "code"); - if (!py_code || !_PyLong_Check(py_code)) { + if (!py_code || !PYGLIB_PyLong_Check(py_code)) { bad_gerror_message = "glib.GError instances must have a 'code' int attribute"; Py_DECREF(py_message); Py_DECREF(py_domain); goto bad_gerror; } - g_set_error(error, g_quark_from_string(_PyUnicode_AsString(py_domain)), - _PyLong_AsLong(py_code), _PyUnicode_AsString(py_message)); + g_set_error(error, g_quark_from_string(PYGLIB_PyUnicode_AsString(py_domain)), + PYGLIB_PyLong_AsLong(py_code), "%s", PYGLIB_PyUnicode_AsString(py_message)); Py_DECREF(py_message); Py_DECREF(py_code); @@ -368,7 +367,7 @@ pyglib_gerror_exception_check(GError **error) bad_gerror: Py_DECREF(value); - g_set_error(error, g_quark_from_static_string("pyglib"), 0, bad_gerror_message); + g_set_error(error, g_quark_from_static_string("pyglib"), 0, "%s", bad_gerror_message); PyErr_SetString(PyExc_ValueError, bad_gerror_message); PyErr_Print(); return -2; @@ -397,7 +396,7 @@ pyglib_register_exception_for_domain(gchar *name, exception_table = PyDict_New(); PyDict_SetItem(exception_table, - _PyLong_FromLong(error_domain), + PYGLIB_PyLong_FromLong(error_domain), exception); return exception; @@ -414,15 +413,7 @@ pyglib_register_exception_for_domain(gchar *name, PyObject * pyglib_main_context_new(GMainContext *context) { - PyGMainContext *self; - - self = (PyGMainContext *)PyObject_NEW(PyGMainContext, - &PyGMainContext_Type); - if (self == NULL) - return NULL; - - self->context = g_main_context_ref(context); - return (PyObject *)self; + return _PyGLib_API->main_context_new(context); } /** @@ -472,18 +463,7 @@ pyglib_option_group_transfer_group(PyObject *obj) PyObject * pyglib_option_group_new (GOptionGroup *group) { - PyGOptionGroup *self; - - self = (PyGOptionGroup *)PyObject_NEW(PyGOptionGroup, - &PyGOptionGroup_Type); - if (self == NULL) - return NULL; - - self->group = group; - self->other_owner = TRUE; - self->is_in_context = FALSE; - - return (PyObject *)self; + return _PyGLib_API->option_group_new(group); } /** @@ -495,17 +475,7 @@ pyglib_option_group_new (GOptionGroup *group) PyObject * pyglib_option_context_new (GOptionContext *context) { - PyGOptionContext *self; - - self = (PyGOptionContext *)PyObject_NEW(PyGOptionContext, - &PyGOptionContext_Type); - if (self == NULL) - return NULL; - - self->context = context; - self->main_group = NULL; - - return (PyObject *)self; + return _PyGLib_API->option_context_new(context); } /** @@ -574,4 +544,90 @@ _pyglib_handler_marshal(gpointer user_data) return res; } +PyObject* +_pyglib_generic_ptr_richcompare(void* a, void *b, int op) +{ + PyObject *res; + + switch (op) { + + case Py_EQ: + res = (a == b) ? Py_True : Py_False; + break; + + case Py_NE: + res = (a != b) ? Py_True : Py_False; + break; + + case Py_LT: + res = (a < b) ? Py_True : Py_False; + break; + + case Py_LE: + res = (a <= b) ? Py_True : Py_False; + break; + + case Py_GT: + res = (a > b) ? Py_True : Py_False; + break; + + case Py_GE: + res = (a >= b) ? Py_True : Py_False; + break; + + default: + res = Py_NotImplemented; + break; + } + + Py_INCREF(res); + return res; +} + +PyObject* +_pyglib_generic_long_richcompare(long a, long b, int op) +{ + PyObject *res; + + switch (op) { + + case Py_EQ: + res = (a == b) ? Py_True : Py_False; + Py_INCREF(res); + break; + + case Py_NE: + res = (a != b) ? Py_True : Py_False; + Py_INCREF(res); + break; + + + case Py_LT: + res = (a < b) ? Py_True : Py_False; + Py_INCREF(res); + break; + + case Py_LE: + res = (a <= b) ? Py_True : Py_False; + Py_INCREF(res); + break; + + case Py_GT: + res = (a > b) ? Py_True : Py_False; + Py_INCREF(res); + break; + + case Py_GE: + res = (a >= b) ? Py_True : Py_False; + Py_INCREF(res); + break; + + default: + res = Py_NotImplemented; + Py_INCREF(res); + break; + } + + return res; +} diff --git a/glib/pyglib.h b/glib/pyglib.h index 84bb36c..44ead47 100644 --- a/glib/pyglib.h +++ b/glib/pyglib.h @@ -53,6 +53,8 @@ PyObject * pyglib_float_from_timeval(GTimeVal timeval); /* Private: for gobject <-> glib interaction only. */ void _pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback); +PyObject* _pyglib_generic_ptr_richcompare(void* a, void *b, int op); +PyObject* _pyglib_generic_long_richcompare(long a, long b, int op); #define pyglib_begin_allow_threads \ G_STMT_START { \ @@ -65,20 +67,6 @@ void _pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback); PyEval_RestoreThread(_save); \ } G_STMT_END -#define PYGLIB_MODULE_START(symbol, modname) \ -DL_EXPORT(void) init##symbol(void) \ -{ \ - PyObject *module; \ - module = Py_InitModule(modname, symbol##_functions); -#define PYGLIB_MODULE_END } -#define PYGLIB_DEFINE_TYPE(typename, symbol, csymbol) \ -PyTypeObject symbol = { \ - PyObject_HEAD_INIT(NULL) \ - 0, \ - typename, \ - sizeof(csymbol), \ - 0, \ -}; #define PYGLIB_REGISTER_TYPE(d, type, name) \ if (!type.tp_alloc) \ type.tp_alloc = PyType_GenericAlloc; \ @@ -88,6 +76,7 @@ PyTypeObject symbol = { \ return; \ PyDict_SetItemString(d, name, (PyObject *)&type); + G_END_DECLS #endif /* __PYGLIB_H__ */ diff --git a/glib/pygmaincontext.c b/glib/pygmaincontext.c index 186215a..cfb7ddd 100644 --- a/glib/pygmaincontext.c +++ b/glib/pygmaincontext.c @@ -33,6 +33,28 @@ PYGLIB_DEFINE_TYPE("glib.MainContext", PyGMainContext_Type, PyGMainContext) +/** + * pyg_main_context_new: + * @context: a GMainContext. + * + * Creates a wrapper for a GMainContext. + * + * Returns: the GMainContext wrapper. + */ +PyObject * +pyg_main_context_new(GMainContext *context) +{ + PyGMainContext *self; + + self = (PyGMainContext *)PyObject_NEW(PyGMainContext, &PyGMainContext_Type); + if (self == NULL) + return NULL; + + self->context = g_main_context_ref(context); + + return (PyObject *)self; +} + static int pyg_main_context_init(PyGMainContext *self) { @@ -51,12 +73,17 @@ pyg_main_context_dealloc(PyGMainContext *self) PyObject_Del(self); } -static int -pyg_main_context_compare(PyGMainContext *self, PyGMainContext *v) +static PyObject* +pyg_main_context_richcompare(PyObject *self, PyObject *other, int op) { - if (self->context == v->context) return 0; - if (self->context > v->context) return -1; - return 1; + if (Py_TYPE(self) == Py_TYPE(other) && Py_TYPE(self) == &PyGMainContext_Type) + return _pyglib_generic_ptr_richcompare(((PyGMainContext*)self)->context, + ((PyGMainContext*)other)->context, + op); + else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static PyObject * @@ -91,7 +118,7 @@ void pyglib_maincontext_register_types(PyObject *d) { PyGMainContext_Type.tp_dealloc = (destructor)pyg_main_context_dealloc; - PyGMainContext_Type.tp_compare = (cmpfunc)pyg_main_context_compare; + PyGMainContext_Type.tp_richcompare = pyg_main_context_richcompare; PyGMainContext_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; PyGMainContext_Type.tp_methods = _PyGMainContext_methods; PyGMainContext_Type.tp_init = (initproc)pyg_main_context_init; diff --git a/glib/pygmaincontext.h b/glib/pygmaincontext.h index 038cb37..4ffa3c9 100644 --- a/glib/pygmaincontext.h +++ b/glib/pygmaincontext.h @@ -32,7 +32,7 @@ typedef struct { extern PyTypeObject PyGMainContext_Type; -PyObject * pyglib_main_context_new(GMainContext *context); +PyObject* pyg_main_context_new(GMainContext *context); void pyglib_maincontext_register_types(PyObject *d); diff --git a/glib/pygmainloop.c b/glib/pygmainloop.c index d9f048c..219b6a3 100644 --- a/glib/pygmainloop.c +++ b/glib/pygmainloop.c @@ -158,8 +158,9 @@ pyg_signal_watch_check(GSource *source) PySignalWatchSource *real_source = (PySignalWatchSource *)source; GPollFD *poll_fd = &real_source->fd; unsigned char dummy; + gssize ret; if (poll_fd->revents & G_IO_IN) - read(poll_fd->fd, &dummy, 1); + ret = read(poll_fd->fd, &dummy, 1); #endif state = pyglib_gil_state_ensure(); @@ -285,18 +286,23 @@ pyg_main_loop_dealloc(PyGMainLoop *self) PyObject_Del(self); } -static int -pyg_main_loop_compare(PyGMainLoop *self, PyGMainLoop *v) +static PyObject* +pyg_main_loop_richcompare(PyObject *self, PyObject *other, int op) { - if (self->loop == v->loop) return 0; - if (self->loop > v->loop) return -1; - return 1; + if (Py_TYPE(self) == Py_TYPE(other) && Py_TYPE(self) == &PyGMainLoop_Type) + return _pyglib_generic_ptr_richcompare(((PyGMainLoop*)self)->loop, + ((PyGMainLoop*)other)->loop, + op); + else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static PyObject * _wrap_g_main_loop_get_context (PyGMainLoop *loop) { - return pyglib_main_context_new(g_main_loop_get_context(loop->loop)); + return pyg_main_context_new(g_main_loop_get_context(loop->loop)); } static PyObject * @@ -346,7 +352,7 @@ void pyglib_mainloop_register_types(PyObject *d) { PyGMainLoop_Type.tp_dealloc = (destructor)pyg_main_loop_dealloc; - PyGMainLoop_Type.tp_compare = (cmpfunc)pyg_main_loop_compare; + PyGMainLoop_Type.tp_richcompare = pyg_main_loop_richcompare; PyGMainLoop_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; PyGMainLoop_Type.tp_methods = _PyGMainLoop_methods; PyGMainLoop_Type.tp_init = (initproc)pyg_main_loop_init; diff --git a/glib/pygoptioncontext.c b/glib/pygoptioncontext.c index 92ba901..444625c 100644 --- a/glib/pygoptioncontext.c +++ b/glib/pygoptioncontext.c @@ -30,6 +30,27 @@ PYGLIB_DEFINE_TYPE("glib.OptionContext", PyGOptionContext_Type, PyGOptionContext) +/** + * pyg_option_context_new: + * @context: a GOptionContext + * + * Returns: A new GOptionContext wrapper. + */ +PyObject * +pyg_option_context_new (GOptionContext *context) +{ + PyGOptionContext *self; + + self = (PyGOptionContext *)PyObject_NEW(PyGOptionContext, &PyGOptionContext_Type); + if (self == NULL) + return NULL; + + self->context = context; + self->main_group = NULL; + + return (PyObject *)self; +} + static int pyg_option_context_init(PyGOptionContext *self, PyObject *args, @@ -98,7 +119,7 @@ pyg_option_context_parse(PyGOptionContext *self, for (pos = 0; pos < argv_length; pos++) { arg = PyList_GetItem(argv, pos); - argv_content[pos] = g_strdup(_PyUnicode_AsString(arg)); + argv_content[pos] = g_strdup(PYGLIB_PyUnicode_AsString(arg)); if (argv_content[pos] == NULL) { g_strfreev(argv_content); @@ -126,7 +147,7 @@ pyg_option_context_parse(PyGOptionContext *self, new_argv = PyList_New(g_strv_length(argv_content)); for (pos = 0; pos < argv_length; pos++) { - arg = _PyUnicode_FromString(argv_content[pos]); + arg = PYGLIB_PyUnicode_FromString(argv_content[pos]); PyList_SetItem(new_argv, pos, arg); } @@ -272,19 +293,23 @@ pyg_option_context_add_group(PyGOptionContext *self, return Py_None; } -static int -pyg_option_context_compare(PyGOptionContext *self, PyGOptionContext *context) +static PyObject* +pyg_option_context_richcompare(PyObject *self, PyObject *other, int op) { - if (self->context == context->context) return 0; - if (self->context > context->context) - return 1; - return -1; + if (Py_TYPE(self) == Py_TYPE(other) && Py_TYPE(self) == &PyGOptionContext_Type) + return _pyglib_generic_ptr_richcompare(((PyGOptionContext*)self)->context, + ((PyGOptionContext*)other)->context, + op); + else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static PyObject * pyg_option_get_context(PyGOptionContext *self) { - return PyCObject_FromVoidPtr(self->context, NULL); + return PYGLIB_CPointer_WrapPointer(self->context, "goption.context"); } static PyMethodDef pyg_option_context_methods[] = { @@ -304,7 +329,7 @@ void pyglib_option_context_register_types(PyObject *d) { PyGOptionContext_Type.tp_dealloc = (destructor)pyg_option_context_dealloc; - PyGOptionContext_Type.tp_compare = (cmpfunc)pyg_option_context_compare; + PyGOptionContext_Type.tp_richcompare = pyg_option_context_richcompare; PyGOptionContext_Type.tp_flags = Py_TPFLAGS_DEFAULT; PyGOptionContext_Type.tp_methods = pyg_option_context_methods; PyGOptionContext_Type.tp_init = (initproc)pyg_option_context_init; diff --git a/glib/pygoptioncontext.h b/glib/pygoptioncontext.h index 85d0a47..efe5ffa 100644 --- a/glib/pygoptioncontext.h +++ b/glib/pygoptioncontext.h @@ -32,6 +32,8 @@ typedef struct { GOptionContext *context; } PyGOptionContext; +PyObject* pyg_option_context_new(GOptionContext *context); + void pyglib_option_context_register_types(PyObject *d); #endif /* __PYG_OPTIONCONTEXT_H__ */ diff --git a/glib/pygoptiongroup.c b/glib/pygoptiongroup.c index 70e4529..2a69354 100644 --- a/glib/pygoptiongroup.c +++ b/glib/pygoptiongroup.c @@ -30,6 +30,32 @@ PYGLIB_DEFINE_TYPE("glib.OptionGroup", PyGOptionGroup_Type, PyGOptionGroup) +/** + * pyg_option_group_new: + * @group: a GOptionGroup + * + * The returned GOptionGroup can't be used to set any hooks, translation domains + * or add entries. It's only intend is, to use for GOptionContext.add_group(). + * + * Returns: the GOptionGroup wrapper. + */ +PyObject * +pyg_option_group_new (GOptionGroup *group) +{ + PyGOptionGroup *self; + + self = (PyGOptionGroup *)PyObject_NEW(PyGOptionGroup, + &PyGOptionGroup_Type); + if (self == NULL) + return NULL; + + self->group = group; + self->other_owner = TRUE; + self->is_in_context = FALSE; + + return (PyObject *)self; +} + static gboolean check_if_owned(PyGOptionGroup *self) { @@ -240,16 +266,18 @@ pyg_option_group_set_translation_domain(PyGOptionGroup *self, return Py_None; } -static int -pyg_option_group_compare(PyGOptionGroup *self, PyGOptionGroup *group) +static PyObject* +pyg_option_group_richcompare(PyObject *self, PyObject *other, int op) { - if (self->group == group->group) - return 0; - - if (self->group > group->group) - return 1; - - return -1; + if (Py_TYPE(self) == Py_TYPE(other) && + Py_TYPE(self) == &PyGOptionGroup_Type) { + return _pyglib_generic_ptr_richcompare(((PyGOptionGroup*)self)->group, + ((PyGOptionGroup*)other)->group, + op); + } else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static PyMethodDef pyg_option_group_methods[] = { @@ -262,7 +290,7 @@ void pyglib_option_group_register_types(PyObject *d) { PyGOptionGroup_Type.tp_dealloc = (destructor)pyg_option_group_dealloc; - PyGOptionGroup_Type.tp_compare = (cmpfunc)pyg_option_group_compare; + PyGOptionGroup_Type.tp_richcompare = pyg_option_group_richcompare; PyGOptionGroup_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; PyGOptionGroup_Type.tp_methods = pyg_option_group_methods; PyGOptionGroup_Type.tp_init = (initproc)pyg_option_group_init; diff --git a/glib/pygoptiongroup.h b/glib/pygoptiongroup.h index cba6a79..872b9c6 100644 --- a/glib/pygoptiongroup.h +++ b/glib/pygoptiongroup.h @@ -33,6 +33,8 @@ typedef struct { GOptionGroup.destroy() */ } PyGOptionGroup; +PyObject* pyg_option_group_new(GOptionGroup *group); + void pyglib_option_group_register_types(PyObject *d); #endif /* __PYG_OPTIONGROUP_H__ */ diff --git a/glib/pygsource.c b/glib/pygsource.c index 298b928..d0176ab 100644 --- a/glib/pygsource.c +++ b/glib/pygsource.c @@ -82,7 +82,7 @@ source_repr(PyGSource *self, const char *type) g_snprintf(buf, sizeof(buf), "<%s glib source at 0x%lx>", desc, (long) self); - return _PyUnicode_FromString(buf); + return PYGLIB_PyUnicode_FromString(buf); } static PyObject * @@ -109,7 +109,7 @@ pyg_source_attach(PyGSource *self, PyObject *args, PyObject *kwargs) } id = g_source_attach(self->source, context); - return _PyLong_FromLong(id); + return PYGLIB_PyLong_FromLong(id); } static PyObject * @@ -182,7 +182,7 @@ pyg_source_get_context(PyGSource *self) context = g_source_get_context(self->source); if (context) { - return pyglib_main_context_new(context); + return pyg_main_context_new(context); } else { Py_INCREF(Py_None); return Py_None; @@ -255,12 +255,12 @@ pyg_source_get_current_time(PyGSource *self) } static PyMethodDef pyg_source_methods[] = { - { "attach", (PyCFunction)pyg_source_attach, METH_KEYWORDS }, + { "attach", (PyCFunction)pyg_source_attach, METH_VARARGS|METH_KEYWORDS }, { "destroy", (PyCFunction)pyg_source_destroy, METH_NOARGS }, { "set_callback", (PyCFunction)pyg_source_set_callback, METH_VARARGS }, { "get_context", (PyCFunction)pyg_source_get_context, METH_NOARGS }, { "add_poll", (PyCFunction)pyg_source_add_poll, METH_KEYWORDS }, - { "remove_poll", (PyCFunction)pyg_source_remove_poll, METH_KEYWORDS }, + { "remove_poll", (PyCFunction)pyg_source_remove_poll, METH_VARARGS|METH_KEYWORDS }, { "get_current_time", (PyCFunction)pyg_source_get_current_time, METH_NOARGS }, { NULL, NULL, 0 } }; @@ -283,7 +283,7 @@ pyg_source_get_priority(PyGSource *self, void *closure) { CHECK_DESTROYED(self, NULL); - return _PyLong_FromLong(g_source_get_priority(self->source)); + return PYGLIB_PyLong_FromLong(g_source_get_priority(self->source)); } static int @@ -296,12 +296,12 @@ pyg_source_set_priority(PyGSource *self, PyObject *value, void *closure) return -1; } - if (!_PyLong_Check(value)) { + if (!PYGLIB_PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "type mismatch"); return -1; } - g_source_set_priority(self->source, _PyLong_AsLong(value)); + g_source_set_priority(self->source, PYGLIB_PyLong_AsLong(value)); return 0; } @@ -339,7 +339,7 @@ pyg_source_get_id(PyGSource *self, void *closure) return NULL; } - return _PyLong_FromLong(g_source_get_id(self->source)); + return PYGLIB_PyLong_FromLong(g_source_get_id(self->source)); } static PyGetSetDef pyg_source_getsets[] = { @@ -387,10 +387,12 @@ pyg_source_clear(PyGSource *self) static void pyg_source_dealloc(PyGSource *self) { - PyObject_ClearWeakRefs((PyObject *)self); - + /* Must be done first, so that there is no chance of Python's GC being + * called while tracking this half-deallocated object */ PyObject_GC_UnTrack((PyObject *)self); + PyObject_ClearWeakRefs((PyObject *)self); + pyg_source_clear(self); PyObject_GC_Del(self); @@ -426,7 +428,7 @@ pyg_source_prepare(GSource *source, gint *timeout) } ret = PyObject_IsTrue(PyTuple_GET_ITEM(t, 0)); - *timeout = _PyLong_AsLong(PyTuple_GET_ITEM(t, 1)); + *timeout = PYGLIB_PyLong_AsLong(PyTuple_GET_ITEM(t, 1)); if (*timeout == -1 && PyErr_Occurred()) { ret = FALSE; @@ -652,7 +654,7 @@ pyg_poll_fd_dealloc(PyGPollFD *self) static PyObject * pyg_poll_fd_repr(PyGPollFD *self) { - return _PyUnicode_FromFormat("", + return PYGLIB_PyUnicode_FromFormat("", self->pollfd.fd, self->pollfd.events, (long)self); } diff --git a/glib/pygspawn.c b/glib/pygspawn.c index cded501..75e2232 100644 --- a/glib/pygspawn.c +++ b/glib/pygspawn.c @@ -32,12 +32,12 @@ struct _PyGChildSetupData { PyObject *data; }; -PYGLIB_DEFINE_TYPE("glib.Pid", PyGPid_Type, _PyLongObject) +PYGLIB_DEFINE_TYPE("glib.Pid", PyGPid_Type, PYGLIB_PyLongObject) static PyObject * pyg_pid_close(PyObject *self, PyObject *args, PyObject *kwargs) { - g_spawn_close_pid(_PyLong_AsLong(self)); + g_spawn_close_pid(PYGLIB_PyLong_AsLong(self)); Py_INCREF(Py_None); return Py_None; } @@ -50,8 +50,8 @@ static PyMethodDef pyg_pid_methods[] = { static void pyg_pid_free(PyObject *gpid) { - g_spawn_close_pid((GPid) _PyLong_AsLong(gpid)); - _PyLong_Type.tp_free((void *) gpid); + g_spawn_close_pid((GPid) PYGLIB_PyLong_AsLong(gpid)); + PYGLIB_PyLong_Type.tp_free((void *) gpid); } static int @@ -64,14 +64,15 @@ pyg_pid_tp_init(PyObject *self, PyObject *args, PyObject *kwargs) PyObject * pyg_pid_new(GPid pid) { - _PyLongObject *pygpid; - pygpid = PyObject_NEW(_PyLongObject, &PyGPid_Type); + PYGLIB_PyLongObject *pygpid; #if PY_VERSION_HEX >= 0x03000000 -# warning "FIXME: figure out how to subclass long" + return PyObject_CallMethod((PyObject*)&PyGPid_Type, "__new__", "Oi", + &PyGPid_Type, pid); #else + pygpid = PyObject_NEW(PyIntObject, &PyGPid_Type); pygpid->ob_ival = pid; -#endif +#endif return (PyObject *) pygpid; } @@ -149,7 +150,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs) argv = g_new0(char *, len + 1); for (i = 0; i < len; ++i) { PyObject *tmp = PySequence_ITEM(pyargv, i); - if (!_PyUnicode_Check(tmp)) { + if (!PYGLIB_PyUnicode_Check(tmp)) { PyErr_SetString(PyExc_TypeError, "glib.spawn_async: " "first argument must be a sequence of strings"); @@ -157,7 +158,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs) Py_XDECREF(tmp); return NULL; } - argv[i] = _PyUnicode_AsString(tmp); + argv[i] = PYGLIB_PyUnicode_AsString(tmp); Py_DECREF(tmp); } @@ -174,7 +175,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs) envp = g_new0(char *, len + 1); for (i = 0; i < len; ++i) { PyObject *tmp = PySequence_ITEM(pyenvp, i); - if (!_PyUnicode_Check(tmp)) { + if (!PYGLIB_PyUnicode_Check(tmp)) { PyErr_SetString(PyExc_TypeError, "glib.spawn_async: " "second argument must be a sequence of strings"); @@ -183,7 +184,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs) g_free(argv); return NULL; } - envp[i] = _PyUnicode_AsString(tmp); + envp[i] = PYGLIB_PyUnicode_AsString(tmp); Py_DECREF(tmp); } } @@ -228,21 +229,21 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs) if (envp) g_free(envp); if (standard_input) - pystdin = _PyLong_FromLong(*standard_input); + pystdin = PYGLIB_PyLong_FromLong(*standard_input); else { Py_INCREF(Py_None); pystdin = Py_None; } if (standard_output) - pystdout = _PyLong_FromLong(*standard_output); + pystdout = PYGLIB_PyLong_FromLong(*standard_output); else { Py_INCREF(Py_None); pystdout = Py_None; } if (standard_error) - pystderr = _PyLong_FromLong(*standard_error); + pystderr = PYGLIB_PyLong_FromLong(*standard_error); else { Py_INCREF(Py_None); pystderr = Py_None; @@ -254,7 +255,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs) void pyglib_spawn_register_types(PyObject *d) { - PyGPid_Type.tp_base = &_PyLong_Type; + PyGPid_Type.tp_base = &PYGLIB_PyLong_Type; PyGPid_Type.tp_flags = Py_TPFLAGS_DEFAULT; PyGPid_Type.tp_methods = pyg_pid_methods; PyGPid_Type.tp_init = pyg_pid_tp_init; diff --git a/gobject/Makefile.am b/gobject/Makefile.am index aff1609..7208329 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -4,7 +4,7 @@ PLATFORM_VERSION = 2.0 pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION) pkginclude_HEADERS = pygobject.h -pkgpyexecdir = $(pyexecdir)/gtk-2.0 +pkgpyexecdir = $(pyexecdir) # gobject python scripts pygobjectdir = $(pkgpyexecdir)/gobject @@ -21,10 +21,16 @@ endif _gobject_la_CFLAGS = \ -I$(top_srcdir)/glib \ + -I$(top_srcdir)/gi \ $(PYTHON_INCLUDES) \ $(FFI_CFLAGS) \ $(GLIB_CFLAGS) \ -DPY_SSIZE_T_CLEAN + +if ENABLE_INTROSPECTION +_gobject_la_CFLAGS += $(GI_CFLAGS) +endif + _gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_gobject|PyInit__gobject" _gobject_la_LIBADD = \ $(GLIB_LIBS) \ @@ -48,8 +54,7 @@ _gobject_la_SOURCES = \ pygpointer.c \ pygpointer.h \ pygtype.c \ - pygtype.h \ - pygi-external.h + pygtype.h if HAVE_LIBFFI _gobject_la_SOURCES += ffi-marshaller.c ffi-marshaller.h @@ -61,7 +66,10 @@ endif all: $(pygobject_LTLIBRARIES:.la=.so) +check-local: $(pygobject_LTLIBRARIES:.la=.so) clean-local: rm -f $(pygobject_LTLIBRARIES:.la=.so) .la.so: $(LN_S) .libs/$@ $@ || true + +-include $(top_srcdir)/git.mk diff --git a/gobject/Makefile.in b/gobject/Makefile.in index ef997d9..be4bac8 100644 --- a/gobject/Makefile.in +++ b/gobject/Makefile.in @@ -35,8 +35,9 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @PLATFORM_WIN32_TRUE@am__append_1 = -no-undefined -@HAVE_LIBFFI_TRUE@am__append_2 = ffi-marshaller.c ffi-marshaller.h -@PLATFORM_WIN32_TRUE@am__append_3 = -DPLATFORM_WIN32 +@ENABLE_INTROSPECTION_TRUE@am__append_2 = $(GI_CFLAGS) +@HAVE_LIBFFI_TRUE@am__append_3 = ffi-marshaller.c ffi-marshaller.h +@PLATFORM_WIN32_TRUE@am__append_4 = -DPLATFORM_WIN32 subdir = gobject DIST_COMMON = $(pkginclude_HEADERS) $(pygobject_PYTHON) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in @@ -83,8 +84,7 @@ am___gobject_la_SOURCES_DIST = gobjectmodule.c pygboxed.c pygboxed.h \ pygenum.c pygenum.h pygflags.c pygflags.h pyginterface.c \ pyginterface.h pygobject.c pygobject.h pygobject-private.h \ pygparamspec.c pygparamspec.h pygpointer.c pygpointer.h \ - pygtype.c pygtype.h pygi-external.h ffi-marshaller.c \ - ffi-marshaller.h + pygtype.c pygtype.h ffi-marshaller.c ffi-marshaller.h @HAVE_LIBFFI_TRUE@am__objects_1 = _gobject_la-ffi-marshaller.lo am__gobject_la_OBJECTS = _gobject_la-gobjectmodule.lo \ _gobject_la-pygboxed.lo _gobject_la-pygenum.lo \ @@ -93,7 +93,10 @@ am__gobject_la_OBJECTS = _gobject_la-gobjectmodule.lo \ _gobject_la-pygpointer.lo _gobject_la-pygtype.lo \ $(am__objects_1) _gobject_la_OBJECTS = $(am__gobject_la_OBJECTS) -_gobject_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +_gobject_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gobject_la_CFLAGS) \ $(CFLAGS) $(_gobject_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) @@ -102,13 +105,26 @@ am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(_gobject_la_SOURCES) DIST_SOURCES = $(am___gobject_la_SOURCES_DIST) py_compile = $(top_srcdir)/py-compile @@ -120,6 +136,7 @@ pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -150,6 +167,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ @@ -161,6 +181,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_PC = @LIBFFI_PC@ @@ -170,7 +192,9 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -183,10 +207,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ @@ -209,6 +238,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -241,12 +271,11 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgpyexecdir = $(pyexecdir)/gtk-2.0 +pkgpyexecdir = $(pyexecdir) pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -275,9 +304,9 @@ pygobject_PYTHON = \ pygobject_LTLIBRARIES = _gobject.la common_ldflags = -module -avoid-version $(am__append_1) -_gobject_la_CFLAGS = -I$(top_srcdir)/glib $(PYTHON_INCLUDES) \ - $(FFI_CFLAGS) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN \ - $(am__append_3) +_gobject_la_CFLAGS = -I$(top_srcdir)/glib -I$(top_srcdir)/gi \ + $(PYTHON_INCLUDES) $(FFI_CFLAGS) $(GLIB_CFLAGS) \ + -DPY_SSIZE_T_CLEAN $(am__append_2) $(am__append_4) _gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_gobject|PyInit__gobject" _gobject_la_LIBADD = \ $(GLIB_LIBS) \ @@ -288,12 +317,12 @@ _gobject_la_SOURCES = gobjectmodule.c pygboxed.c pygboxed.h pygenum.c \ pygenum.h pygflags.c pygflags.h pyginterface.c pyginterface.h \ pygobject.c pygobject.h pygobject-private.h pygparamspec.c \ pygparamspec.h pygpointer.c pygpointer.h pygtype.c pygtype.h \ - pygi-external.h $(am__append_2) + $(am__append_3) all: all-am .SUFFIXES: .SUFFIXES: .c .la .lo .o .obj .so -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -302,9 +331,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gobject/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gobject/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu gobject/Makefile + $(AUTOMAKE) --foreign gobject/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -318,9 +347,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pygobjectLTLIBRARIES: $(pygobject_LTLIBRARIES) @@ -355,7 +384,7 @@ clean-pygobjectLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done _gobject.la: $(_gobject_la_OBJECTS) $(_gobject_la_DEPENDENCIES) - $(_gobject_la_LINK) -rpath $(pygobjectdir) $(_gobject_la_OBJECTS) $(_gobject_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(_gobject_la_LINK) -rpath $(pygobjectdir) $(_gobject_la_OBJECTS) $(_gobject_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -375,95 +404,108 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gobject_la-pygtype.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< _gobject_la-gobjectmodule.lo: gobjectmodule.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-gobjectmodule.lo -MD -MP -MF $(DEPDIR)/_gobject_la-gobjectmodule.Tpo -c -o _gobject_la-gobjectmodule.lo `test -f 'gobjectmodule.c' || echo '$(srcdir)/'`gobjectmodule.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-gobjectmodule.Tpo $(DEPDIR)/_gobject_la-gobjectmodule.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-gobjectmodule.lo -MD -MP -MF $(DEPDIR)/_gobject_la-gobjectmodule.Tpo -c -o _gobject_la-gobjectmodule.lo `test -f 'gobjectmodule.c' || echo '$(srcdir)/'`gobjectmodule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-gobjectmodule.Tpo $(DEPDIR)/_gobject_la-gobjectmodule.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gobjectmodule.c' object='_gobject_la-gobjectmodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-gobjectmodule.lo `test -f 'gobjectmodule.c' || echo '$(srcdir)/'`gobjectmodule.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-gobjectmodule.lo `test -f 'gobjectmodule.c' || echo '$(srcdir)/'`gobjectmodule.c _gobject_la-pygboxed.lo: pygboxed.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygboxed.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygboxed.Tpo -c -o _gobject_la-pygboxed.lo `test -f 'pygboxed.c' || echo '$(srcdir)/'`pygboxed.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pygboxed.Tpo $(DEPDIR)/_gobject_la-pygboxed.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygboxed.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygboxed.Tpo -c -o _gobject_la-pygboxed.lo `test -f 'pygboxed.c' || echo '$(srcdir)/'`pygboxed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pygboxed.Tpo $(DEPDIR)/_gobject_la-pygboxed.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygboxed.c' object='_gobject_la-pygboxed.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygboxed.lo `test -f 'pygboxed.c' || echo '$(srcdir)/'`pygboxed.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygboxed.lo `test -f 'pygboxed.c' || echo '$(srcdir)/'`pygboxed.c _gobject_la-pygenum.lo: pygenum.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygenum.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygenum.Tpo -c -o _gobject_la-pygenum.lo `test -f 'pygenum.c' || echo '$(srcdir)/'`pygenum.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pygenum.Tpo $(DEPDIR)/_gobject_la-pygenum.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygenum.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygenum.Tpo -c -o _gobject_la-pygenum.lo `test -f 'pygenum.c' || echo '$(srcdir)/'`pygenum.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pygenum.Tpo $(DEPDIR)/_gobject_la-pygenum.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygenum.c' object='_gobject_la-pygenum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygenum.lo `test -f 'pygenum.c' || echo '$(srcdir)/'`pygenum.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygenum.lo `test -f 'pygenum.c' || echo '$(srcdir)/'`pygenum.c _gobject_la-pygflags.lo: pygflags.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygflags.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygflags.Tpo -c -o _gobject_la-pygflags.lo `test -f 'pygflags.c' || echo '$(srcdir)/'`pygflags.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pygflags.Tpo $(DEPDIR)/_gobject_la-pygflags.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygflags.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygflags.Tpo -c -o _gobject_la-pygflags.lo `test -f 'pygflags.c' || echo '$(srcdir)/'`pygflags.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pygflags.Tpo $(DEPDIR)/_gobject_la-pygflags.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygflags.c' object='_gobject_la-pygflags.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygflags.lo `test -f 'pygflags.c' || echo '$(srcdir)/'`pygflags.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygflags.lo `test -f 'pygflags.c' || echo '$(srcdir)/'`pygflags.c _gobject_la-pyginterface.lo: pyginterface.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pyginterface.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pyginterface.Tpo -c -o _gobject_la-pyginterface.lo `test -f 'pyginterface.c' || echo '$(srcdir)/'`pyginterface.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pyginterface.Tpo $(DEPDIR)/_gobject_la-pyginterface.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pyginterface.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pyginterface.Tpo -c -o _gobject_la-pyginterface.lo `test -f 'pyginterface.c' || echo '$(srcdir)/'`pyginterface.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pyginterface.Tpo $(DEPDIR)/_gobject_la-pyginterface.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pyginterface.c' object='_gobject_la-pyginterface.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pyginterface.lo `test -f 'pyginterface.c' || echo '$(srcdir)/'`pyginterface.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pyginterface.lo `test -f 'pyginterface.c' || echo '$(srcdir)/'`pyginterface.c _gobject_la-pygobject.lo: pygobject.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygobject.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygobject.Tpo -c -o _gobject_la-pygobject.lo `test -f 'pygobject.c' || echo '$(srcdir)/'`pygobject.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pygobject.Tpo $(DEPDIR)/_gobject_la-pygobject.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygobject.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygobject.Tpo -c -o _gobject_la-pygobject.lo `test -f 'pygobject.c' || echo '$(srcdir)/'`pygobject.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pygobject.Tpo $(DEPDIR)/_gobject_la-pygobject.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygobject.c' object='_gobject_la-pygobject.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygobject.lo `test -f 'pygobject.c' || echo '$(srcdir)/'`pygobject.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygobject.lo `test -f 'pygobject.c' || echo '$(srcdir)/'`pygobject.c _gobject_la-pygparamspec.lo: pygparamspec.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygparamspec.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygparamspec.Tpo -c -o _gobject_la-pygparamspec.lo `test -f 'pygparamspec.c' || echo '$(srcdir)/'`pygparamspec.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pygparamspec.Tpo $(DEPDIR)/_gobject_la-pygparamspec.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygparamspec.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygparamspec.Tpo -c -o _gobject_la-pygparamspec.lo `test -f 'pygparamspec.c' || echo '$(srcdir)/'`pygparamspec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pygparamspec.Tpo $(DEPDIR)/_gobject_la-pygparamspec.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygparamspec.c' object='_gobject_la-pygparamspec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygparamspec.lo `test -f 'pygparamspec.c' || echo '$(srcdir)/'`pygparamspec.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygparamspec.lo `test -f 'pygparamspec.c' || echo '$(srcdir)/'`pygparamspec.c _gobject_la-pygpointer.lo: pygpointer.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygpointer.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygpointer.Tpo -c -o _gobject_la-pygpointer.lo `test -f 'pygpointer.c' || echo '$(srcdir)/'`pygpointer.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pygpointer.Tpo $(DEPDIR)/_gobject_la-pygpointer.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygpointer.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygpointer.Tpo -c -o _gobject_la-pygpointer.lo `test -f 'pygpointer.c' || echo '$(srcdir)/'`pygpointer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pygpointer.Tpo $(DEPDIR)/_gobject_la-pygpointer.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygpointer.c' object='_gobject_la-pygpointer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygpointer.lo `test -f 'pygpointer.c' || echo '$(srcdir)/'`pygpointer.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygpointer.lo `test -f 'pygpointer.c' || echo '$(srcdir)/'`pygpointer.c _gobject_la-pygtype.lo: pygtype.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygtype.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygtype.Tpo -c -o _gobject_la-pygtype.lo `test -f 'pygtype.c' || echo '$(srcdir)/'`pygtype.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-pygtype.Tpo $(DEPDIR)/_gobject_la-pygtype.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-pygtype.lo -MD -MP -MF $(DEPDIR)/_gobject_la-pygtype.Tpo -c -o _gobject_la-pygtype.lo `test -f 'pygtype.c' || echo '$(srcdir)/'`pygtype.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-pygtype.Tpo $(DEPDIR)/_gobject_la-pygtype.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygtype.c' object='_gobject_la-pygtype.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygtype.lo `test -f 'pygtype.c' || echo '$(srcdir)/'`pygtype.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-pygtype.lo `test -f 'pygtype.c' || echo '$(srcdir)/'`pygtype.c _gobject_la-ffi-marshaller.lo: ffi-marshaller.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-ffi-marshaller.lo -MD -MP -MF $(DEPDIR)/_gobject_la-ffi-marshaller.Tpo -c -o _gobject_la-ffi-marshaller.lo `test -f 'ffi-marshaller.c' || echo '$(srcdir)/'`ffi-marshaller.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/_gobject_la-ffi-marshaller.Tpo $(DEPDIR)/_gobject_la-ffi-marshaller.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -MT _gobject_la-ffi-marshaller.lo -MD -MP -MF $(DEPDIR)/_gobject_la-ffi-marshaller.Tpo -c -o _gobject_la-ffi-marshaller.lo `test -f 'ffi-marshaller.c' || echo '$(srcdir)/'`ffi-marshaller.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gobject_la-ffi-marshaller.Tpo $(DEPDIR)/_gobject_la-ffi-marshaller.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ffi-marshaller.c' object='_gobject_la-ffi-marshaller.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-ffi-marshaller.lo `test -f 'ffi-marshaller.c' || echo '$(srcdir)/'`ffi-marshaller.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gobject_la_CFLAGS) $(CFLAGS) -c -o _gobject_la-ffi-marshaller.lo `test -f 'ffi-marshaller.c' || echo '$(srcdir)/'`ffi-marshaller.c mostlyclean-libtool: -rm -f *.lo @@ -612,6 +654,7 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: @@ -716,32 +759,35 @@ ps-am: uninstall-am: uninstall-pkgincludeHEADERS \ uninstall-pygobjectLTLIBRARIES uninstall-pygobjectPYTHON -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-local clean-pygobjectLTLIBRARIES ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-pkgincludeHEADERS install-ps install-ps-am \ - install-pygobjectLTLIBRARIES install-pygobjectPYTHON \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-pkgincludeHEADERS uninstall-pygobjectLTLIBRARIES \ - uninstall-pygobjectPYTHON +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-generic clean-libtool clean-local \ + clean-pygobjectLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkgincludeHEADERS install-ps \ + install-ps-am install-pygobjectLTLIBRARIES \ + install-pygobjectPYTHON install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS \ + uninstall-pygobjectLTLIBRARIES uninstall-pygobjectPYTHON all: $(pygobject_LTLIBRARIES:.la=.so) +check-local: $(pygobject_LTLIBRARIES:.la=.so) clean-local: rm -f $(pygobject_LTLIBRARIES:.la=.so) .la.so: $(LN_S) .libs/$@ $@ || true +-include $(top_srcdir)/git.mk + # 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. .NOEXPORT: diff --git a/gobject/__init__.py b/gobject/__init__.py index d5aec45..a9522a6 100644 --- a/gobject/__init__.py +++ b/gobject/__init__.py @@ -29,7 +29,7 @@ from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \ filename_from_utf8, get_application_name, set_application_name, \ get_prgname, set_prgname, main_depth, Pid, GError, glib_version, \ MainLoop, MainContext, main_context_default, IOChannel, Source, Idle, \ - Timeout, PollFD, OptionGroup, OptionContext, option + Timeout, PollFD, OptionGroup, OptionContext, option, uri_list_extract_uris from glib import SPAWN_LEAVE_DESCRIPTORS_OPEN, SPAWN_DO_NOT_REAP_CHILD, \ SPAWN_SEARCH_PATH, SPAWN_STDOUT_TO_DEV_NULL, SPAWN_STDERR_TO_DEV_NULL, \ SPAWN_CHILD_INHERITS_STDIN, SPAWN_FILE_AND_ARGV_ZERO, PRIORITY_HIGH, \ @@ -101,17 +101,19 @@ class GObjectMeta(type): prop.setter(self, value) cls.do_set_property = obj_set_property - def _type_register(cls, namespace): + def _must_register_type(cls, namespace): ## don't register the class if already registered if '__gtype__' in namespace: - return + return False - if not ('__gproperties__' in namespace or + return ('__gproperties__' in namespace or '__gsignals__' in namespace or - '__gtype_name__' in namespace): - return + '__gtype_name__' in namespace) + + def _type_register(cls, namespace): + if cls._must_register_type(namespace): + type_register(cls, namespace.get('__gtype_name__')) - type_register(cls, namespace.get('__gtype_name__')) _gobject._install_metaclass(GObjectMeta) del _gobject diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 09244b8..2a84606 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -50,7 +50,7 @@ static gboolean log_handlers_disabled = FALSE; static void pyg_flags_add_constants(PyObject *module, GType flags_type, const gchar *strip_prefix); - + /* -------------- GDK threading hooks ---------------------------- */ /** @@ -109,14 +109,14 @@ pyg_type_name (PyObject *self, PyObject *args) "use GType.name instead")) return NULL; #endif - + if (!PyArg_ParseTuple(args, "O:gobject.type_name", >ype)) return NULL; if ((type = pyg_type_from_object(gtype)) == 0) return NULL; name = g_type_name(type); if (name) - return _PyUnicode_FromString(name); + return PYGLIB_PyUnicode_FromString(name); PyErr_SetString(PyExc_RuntimeError, "unknown typecode"); return NULL; } @@ -131,14 +131,14 @@ pyg_type_from_name (PyObject *self, PyObject *args) "gobject.type_from_name is deprecated; " "use GType.from_name instead")) return NULL; -#endif +#endif if (!PyArg_ParseTuple(args, "s:gobject.type_from_name", &name)) return NULL; type = _pyg_type_from_name(name); if (type != 0) return pyg_type_wrapper_new(type); PyErr_Format(PyExc_RuntimeError, "%s: unknown type name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } @@ -153,7 +153,7 @@ pyg_type_parent (PyObject *self, PyObject *args) "gobject.type_parent is deprecated; " "use GType.parent instead")) return NULL; -#endif +#endif if (!PyArg_ParseTuple(args, "O:gobject.type_parent", >ype)) return NULL; if ((type = pyg_type_from_object(gtype)) == 0) @@ -175,7 +175,7 @@ pyg_type_is_a (PyObject *self, PyObject *args) "gobject.type_is_a is deprecated; " "use GType.is_a instead")) return NULL; -#endif +#endif if (!PyArg_ParseTuple(args, "OO:gobject.type_is_a", >ype, &gparent)) return NULL; if ((type = pyg_type_from_object(gtype)) == 0) @@ -196,7 +196,7 @@ pyg_type_children (PyObject *self, PyObject *args) "gobject.type_children is deprecated; " "use GType.children instead")) return NULL; -#endif +#endif if (!PyArg_ParseTuple(args, "O:gobject.type_children", >ype)) return NULL; if ((type = pyg_type_from_object(gtype)) == 0) @@ -227,7 +227,7 @@ pyg_type_interfaces (PyObject *self, PyObject *args) "gobject.type_interfaces is deprecated; " "use GType.interfaces instead")) return NULL; -#endif +#endif if (!PyArg_ParseTuple(args, "O:gobject.type_interfaces", >ype)) return NULL; if ((type = pyg_type_from_object(gtype)) == 0) @@ -308,7 +308,7 @@ pyg_object_get_property (GObject *object, guint property_id, Py_DECREF(object_wrapper); Py_DECREF(py_pspec); Py_XDECREF(retval); - + pyglib_gil_state_release(state); } @@ -338,7 +338,7 @@ _pyg_signal_accumulator(GSignalInvocationHint *ihint, state = pyglib_gil_state_ensure(); if (ihint->detail) - py_detail = _PyUnicode_FromString(g_quark_to_string(ihint->detail)); + py_detail = PYGLIB_PyUnicode_FromString(g_quark_to_string(ihint->detail)); else { Py_INCREF(Py_None); py_detail = Py_None; @@ -497,17 +497,17 @@ add_signals (GType instance_type, PyObject *signals) const gchar *signal_name; gchar *signal_name_canon, *c; - if (!_PyUnicode_Check(key)) { + if (!PYGLIB_PyUnicode_Check(key)) { PyErr_SetString(PyExc_TypeError, "__gsignals__ keys must be strings"); ret = FALSE; break; } - signal_name = _PyUnicode_AsString (key); + signal_name = PYGLIB_PyUnicode_AsString (key); if (value == Py_None || - (_PyUnicode_Check(value) && - !strcmp(_PyUnicode_AsString(value), "override"))) + (PYGLIB_PyUnicode_Check(value) && + !strcmp(PYGLIB_PyUnicode_AsString(value), "override"))) { /* canonicalize signal name, replacing '-' with '_' */ signal_name_canon = g_strdup(signal_name); @@ -652,14 +652,14 @@ create_property (const gchar *prop_name, { gint default_value; PyObject *pydefault; - + if (!PyArg_ParseTuple(args, "O", &pydefault)) return NULL; - + if (pyg_enum_get_value(prop_type, pydefault, (gint *)&default_value)) return NULL; - + pspec = g_param_spec_enum (prop_name, nick, blurb, prop_type, default_value, flags); } @@ -671,11 +671,11 @@ create_property (const gchar *prop_name, if (!PyArg_ParseTuple(args, "O", &pydefault)) return NULL; - + if (pyg_flags_get_value(prop_type, pydefault, (gint *)&default_value)) return NULL; - + pspec = g_param_spec_flags (prop_name, nick, blurb, prop_type, default_value, flags); } @@ -745,7 +745,7 @@ create_property (const gchar *prop_name, PyErr_SetString(PyExc_TypeError, buf); return NULL; } - + return pspec; } @@ -764,27 +764,27 @@ pyg_param_spec_from_object (PyObject *tuple) PyErr_SetString(PyExc_TypeError, "paramspec tuples must be at least 4 elements long"); return NULL; - } + } slice = PySequence_GetSlice(tuple, 0, 4); if (!slice) { return NULL; } - + if (!PyArg_ParseTuple(slice, "sOzz", &prop_name, &py_prop_type, &nick, &blurb)) { Py_DECREF(slice); return NULL; } - + Py_DECREF(slice); - + prop_type = pyg_type_from_object(py_prop_type); if (!prop_type) { return NULL; } - + item = PyTuple_GetItem(tuple, val_length-1); - if (!_PyLong_Check(item)) { + if (!PYGLIB_PyLong_Check(item)) { PyErr_SetString(PyExc_TypeError, "last element in tuple must be an int"); return NULL; @@ -794,7 +794,7 @@ pyg_param_spec_from_object (PyObject *tuple) slice = PySequence_GetSlice(tuple, 4, val_length-1); pspec = create_property(prop_name, prop_type, nick, blurb, slice, - _PyLong_AsLong(item)); + PYGLIB_PyLong_AsLong(item)); return pspec; } @@ -816,16 +816,16 @@ add_properties (GType instance_type, PyObject *properties) gint val_length; PyObject *slice, *item, *py_prop_type; GParamSpec *pspec; - + /* values are of format (type,nick,blurb, type_specific_args, flags) */ - - if (!_PyUnicode_Check(key)) { + + if (!PYGLIB_PyUnicode_Check(key)) { PyErr_SetString(PyExc_TypeError, "__gproperties__ keys must be strings"); ret = FALSE; break; } - prop_name = _PyUnicode_AsString (key); + prop_name = PYGLIB_PyUnicode_AsString (key); if (!PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, @@ -839,7 +839,7 @@ add_properties (GType instance_type, PyObject *properties) "__gproperties__ values must be at least 4 elements long"); ret = FALSE; break; - } + } slice = PySequence_GetSlice(value, 0, 3); if (!slice) { @@ -858,40 +858,40 @@ add_properties (GType instance_type, PyObject *properties) break; } item = PyTuple_GetItem(value, val_length-1); - if (!_PyLong_Check(item)) { + if (!PYGLIB_PyLong_Check(item)) { PyErr_SetString(PyExc_TypeError, "last element in __gproperties__ value tuple must be an int"); ret = FALSE; break; } - flags = _PyLong_AsLong(item); + flags = PYGLIB_PyLong_AsLong(item); /* slice is the extra items in the tuple */ slice = PySequence_GetSlice(value, 3, val_length-1); pspec = create_property(prop_name, prop_type, nick, blurb, slice, flags); Py_DECREF(slice); - + if (pspec) { g_object_class_install_property(oclass, 1, pspec); } else { PyObject *type, *value, *traceback; ret = FALSE; PyErr_Fetch(&type, &value, &traceback); - if (_PyUnicode_Check(value)) { + if (PYGLIB_PyUnicode_Check(value)) { char msg[256]; g_snprintf(msg, 256, "%s (while registering property '%s' for GType '%s')", - _PyUnicode_AsString(value), + PYGLIB_PyUnicode_AsString(value), prop_name, g_type_name(instance_type)); Py_DECREF(value); - value = _PyUnicode_FromString(msg); + value = PYGLIB_PyUnicode_FromString(msg); } PyErr_Restore(type, value, traceback); break; } } - + g_type_class_unref(oclass); return ret; } @@ -920,7 +920,7 @@ pyg_run_class_init(GType gtype, gpointer gclass, PyTypeObject *pyclass) if (rv) return rv; } - + list = g_type_get_qdata(gtype, pygobject_class_init_key); for (; list; list = list->next) { class_init = list->data; @@ -928,7 +928,7 @@ pyg_run_class_init(GType gtype, gpointer gclass, PyTypeObject *pyclass) if (rv) return rv; } - + return 0; } @@ -954,7 +954,7 @@ _wrap_pyg_type_register(PyObject *self, PyObject *args) if (pyg_type_register(class, type_name)) return NULL; } - + Py_INCREF(class); return (PyObject *) class; } @@ -966,17 +966,17 @@ get_type_name_for_class(PyTypeObject *class) char name_serial_str[16]; PyObject *module; char *type_name = NULL; - + /* make name for new GType */ name_serial = 1; /* give up after 1000 tries, just in case.. */ - while (name_serial < 1000) + while (name_serial < 1000) { g_free(type_name); snprintf(name_serial_str, 16, "-v%i", name_serial); module = PyObject_GetAttrString((PyObject *)class, "__module__"); - if (module && _PyUnicode_Check(module)) { - type_name = g_strconcat(_PyUnicode_AsString(module), ".", + if (module && PYGLIB_PyUnicode_Check(module)) { + type_name = g_strconcat(PYGLIB_PyUnicode_AsString(module), ".", class->tp_name, name_serial > 1 ? name_serial_str : NULL, NULL); @@ -1003,18 +1003,18 @@ get_type_name_for_class(PyTypeObject *class) } -static GStaticPrivate pygobject_contruction_wrapper = G_STATIC_PRIVATE_INIT; +static GStaticPrivate pygobject_construction_wrapper = G_STATIC_PRIVATE_INIT; static inline void pygobject_init_wrapper_set(PyObject *wrapper) { - g_static_private_set(&pygobject_contruction_wrapper, wrapper, NULL); + g_static_private_set(&pygobject_construction_wrapper, wrapper, NULL); } static inline PyObject * pygobject_init_wrapper_get(void) { - return (PyObject *) g_static_private_get(&pygobject_contruction_wrapper); + return (PyObject *) g_static_private_get(&pygobject_construction_wrapper); } static void @@ -1028,7 +1028,7 @@ pygobject__g_instance_init(GTypeInstance *instance, pygobject_has_updated_constructor_key)) return; - wrapper = g_object_get_qdata(object, pygobject_wrapper_key); + wrapper = g_object_get_qdata(object, pygobject_wrapper_key); if (wrapper == NULL) { wrapper = pygobject_init_wrapper_get(); if (wrapper && ((PyGObject *) wrapper)->obj == NULL) { @@ -1048,6 +1048,7 @@ pygobject__g_instance_init(GTypeInstance *instance, kwargs = PyDict_New(); if (Py_TYPE(wrapper)->tp_init(wrapper, args, kwargs)) PyErr_Print(); + Py_DECREF(wrapper); Py_DECREF(args); Py_DECREF(kwargs); pyglib_gil_state_release(state); @@ -1160,10 +1161,10 @@ pyg_type_register(PyTypeObject *class, const char *type_name) if (type_name) /* care is taken below not to free this */ - new_type_name = (gchar *) type_name; + new_type_name = (gchar *) type_name; else new_type_name = get_type_name_for_class(class); - + /* set class_data that will be passed to the class_init function. */ type_info.class_data = class; @@ -1175,16 +1176,21 @@ pyg_type_register(PyTypeObject *class, const char *type_name) /* create new typecode */ instance_type = g_type_register_static(parent_type, new_type_name, &type_info, 0); - if (type_name == NULL) - g_free(new_type_name); if (instance_type == 0) { PyErr_Format(PyExc_RuntimeError, "could not create new GType: %s (subclass of %s)", new_type_name, g_type_name(parent_type)); + + if (type_name == NULL) + g_free(new_type_name); + return -1; } + if (type_name == NULL) + g_free(new_type_name); + /* store pointer to the class with the GType */ Py_INCREF(class); g_type_set_qdata(instance_type, g_quark_from_string("PyGObject::class"), @@ -1192,7 +1198,7 @@ pyg_type_register(PyTypeObject *class, const char *type_name) /* set new value of __gtype__ on class */ gtype = pyg_type_wrapper_new(instance_type); - PyDict_SetItemString(class->tp_dict, "__gtype__", gtype); + PyObject_SetAttrString((PyObject *)class, "__gtype__", gtype); Py_DECREF(gtype); /* propagate new constructor API compatility flag from parent to child type */ @@ -1334,7 +1340,7 @@ pyg_signal_new(PyObject *self, PyObject *args) "argument 2 must be an object type or interface type"); return NULL; } - + return_type = pyg_type_from_object(py_return_type); if (!return_type) return NULL; @@ -1368,7 +1374,7 @@ pyg_signal_new(PyObject *self, PyObject *args) return_type, n_params, param_types); g_free(param_types); if (signal_id != 0) - return _PyLong_FromLong(signal_id); + return PYGLIB_PyLong_FromLong(signal_id); PyErr_SetString(PyExc_RuntimeError, "could not create signal"); return NULL; } @@ -1406,16 +1412,16 @@ pyg_signal_list_names (PyObject *self, PyObject *args, PyObject *kwargs) } else { iface = g_type_default_interface_ref(itype); } - + ids = g_signal_list_ids(itype, &n); list = PyTuple_New((gint)n); if (list != NULL) { for (i = 0; i < n; i++) PyTuple_SetItem(list, i, - _PyUnicode_FromString(g_signal_name(ids[i]))); + PYGLIB_PyUnicode_FromString(g_signal_name(ids[i]))); } - + g_free(ids); if (class) g_type_class_unref(class); @@ -1458,7 +1464,7 @@ pyg_signal_list_ids (PyObject *self, PyObject *args, PyObject *kwargs) } else { iface = g_type_default_interface_ref(itype); } - + ids = g_signal_list_ids(itype, &n); list = PyTuple_New((gint)n); @@ -1469,7 +1475,7 @@ pyg_signal_list_ids (PyObject *self, PyObject *args, PyObject *kwargs) } for (i = 0; i < n; i++) - PyTuple_SetItem(list, i, _PyLong_FromLong(ids[i])); + PyTuple_SetItem(list, i, PYGLIB_PyLong_FromLong(ids[i])); g_free(ids); if (class) g_type_class_unref(class); @@ -1510,14 +1516,14 @@ pyg_signal_lookup (PyObject *self, PyObject *args, PyObject *kwargs) } else { iface = g_type_default_interface_ref(itype); } - + id = g_signal_lookup(signal_name, itype); if (class) g_type_class_unref(class); else g_type_default_interface_unref(iface); - return _PyLong_FromLong(id); + return PYGLIB_PyLong_FromLong(id); } static PyObject * @@ -1532,7 +1538,7 @@ pyg_signal_name (PyObject *self, PyObject *args, PyObject *kwargs) return NULL; signal_name = g_signal_name(id); if (signal_name) - return _PyUnicode_FromString(signal_name); + return PYGLIB_PyUnicode_FromString(signal_name); Py_INCREF(Py_None); return Py_None; @@ -1582,7 +1588,7 @@ pyg_signal_query (PyObject *self, PyObject *args, PyObject *kwargs) "Usage: one of:\n" " gobject.signal_query(name, type)\n" " gobject.signal_query(signal_id)"); - + return NULL; } } @@ -1605,10 +1611,10 @@ pyg_signal_query (PyObject *self, PyObject *args, PyObject *kwargs) goto done; } - PyTuple_SET_ITEM(py_query, 0, _PyLong_FromLong(query.signal_id)); - PyTuple_SET_ITEM(py_query, 1, _PyUnicode_FromString(query.signal_name)); + PyTuple_SET_ITEM(py_query, 0, PYGLIB_PyLong_FromLong(query.signal_id)); + PyTuple_SET_ITEM(py_query, 1, PYGLIB_PyUnicode_FromString(query.signal_name)); PyTuple_SET_ITEM(py_query, 2, pyg_type_wrapper_new(query.itype)); - PyTuple_SET_ITEM(py_query, 3, _PyLong_FromLong(query.signal_flags)); + PyTuple_SET_ITEM(py_query, 3, PYGLIB_PyLong_FromLong(query.signal_flags)); PyTuple_SET_ITEM(py_query, 4, pyg_type_wrapper_new(query.return_type)); for (i = 0; i < query.n_params; i++) { PyTuple_SET_ITEM(params_list, i, @@ -1663,7 +1669,7 @@ pyg_object_class_list_properties (PyObject *self, PyObject *args) "type must be derived from GObject or an interface"); return NULL; } - + list = PyTuple_New(nprops); if (list == NULL) { g_free(specs); @@ -1689,7 +1695,7 @@ pyg_object_new (PyGObject *self, PyObject *args, PyObject *kwargs) GType type; GObject *obj = NULL; GObjectClass *class; - int n_params = 0, i; + guint n_params = 0, i; GParameter *params = NULL; if (!PyArg_ParseTuple (args, "O:gobject.new", &pytype)) { @@ -1711,37 +1717,8 @@ pyg_object_new (PyGObject *self, PyObject *args, PyObject *kwargs) return NULL; } - if (kwargs) { - Py_ssize_t pos = 0; - PyObject *key; - PyObject *value; - - params = g_new0(GParameter, PyDict_Size(kwargs)); - while (PyDict_Next (kwargs, &pos, &key, &value)) { - GParamSpec *pspec; - const gchar *key_str = _PyUnicode_AsString (key); - - pspec = g_object_class_find_property (class, key_str); - if (!pspec) { - PyErr_Format(PyExc_TypeError, - "gobject `%s' doesn't support property `%s'", - g_type_name(type), key_str); - goto cleanup; - } - g_value_init(¶ms[n_params].value, - G_PARAM_SPEC_VALUE_TYPE(pspec)); - if (pyg_param_gvalue_from_pyobject(¶ms[n_params].value, - value, pspec) < 0) { - PyErr_Format(PyExc_TypeError, - "could not convert value for property `%s' from %s to %s", - key_str, Py_TYPE(value)->tp_name, - g_type_name(G_PARAM_SPEC_VALUE_TYPE(pspec))); - goto cleanup; - } - params[n_params].name = g_strdup(key_str); - n_params++; - } - } + if (!pygobject_prepare_construct_properties (class, kwargs, &n_params, ¶ms)) + goto cleanup; obj = g_object_newv(type, n_params, params); if (!obj) @@ -1754,7 +1731,7 @@ pyg_object_new (PyGObject *self, PyObject *args, PyObject *kwargs) } g_free(params); g_type_class_unref(class); - + if (obj) { self = (PyGObject *) pygobject_new_full((GObject *)obj, FALSE, NULL); g_object_unref(obj); @@ -1785,7 +1762,7 @@ pyg_handler_marshal(gpointer user_data) res = PyObject_IsTrue(ret); Py_DECREF(ret); } - + pyglib_gil_state_release(state); return res; @@ -1808,7 +1785,7 @@ pyg_threads_init (PyObject *unused, PyObject *args, PyObject *kwargs) { if (!pyglib_enable_threads()) return NULL; - + Py_INCREF(Py_None); return Py_None; } @@ -1857,7 +1834,7 @@ marshal_emission_hook(GSignalInvocationHint *ihint, for (i = 0; i < n_param_values; i++) { PyObject *item = pyg_value_as_pyobject(¶m_values[i], FALSE); - + /* error condition */ if (!item) { goto out; @@ -1877,7 +1854,7 @@ marshal_emission_hook(GSignalInvocationHint *ihint, if (retobj == NULL) { PyErr_Print(); } - + retval = (retobj == Py_True ? TRUE : FALSE); Py_XDECREF(retobj); out: @@ -1910,7 +1887,7 @@ pyg_add_emission_hook(PyGObject *self, PyObject *args) return NULL; } Py_DECREF(first); - + if ((gtype = pyg_type_from_object(pygtype)) == 0) { return NULL; } @@ -1921,7 +1898,7 @@ pyg_add_emission_hook(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, gtype, &sigid, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } @@ -1932,12 +1909,12 @@ pyg_add_emission_hook(PyGObject *self, PyObject *args) data = Py_BuildValue("(ON)", callback, extra_args); if (data == NULL) return NULL; - + hook_id = g_signal_add_emission_hook(sigid, detail, marshal_emission_hook, data, (GDestroyNotify)pyg_destroy_notify); - + return PyLong_FromUnsignedLong(hook_id); } @@ -1949,24 +1926,24 @@ pyg_remove_emission_hook(PyGObject *self, PyObject *args) guint signal_id; gulong hook_id; GType gtype; - + if (!PyArg_ParseTuple(args, "Osk:gobject.remove_emission_hook", &pygtype, &name, &hook_id)) return NULL; - + if ((gtype = pyg_type_from_object(pygtype)) == 0) { return NULL; } - + if (!g_signal_parse_name(name, gtype, &signal_id, NULL, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), - name); + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + name); return NULL; } g_signal_remove_emission_hook(signal_id, hook_id); - + Py_INCREF(Py_None); return Py_None; } @@ -2042,7 +2019,7 @@ pyg_constant_strip_prefix(const gchar *name, const gchar *strip_prefix) { gint prefix_len; guint i; - + prefix_len = strlen(strip_prefix); /* Check so name starts with strip_prefix, if it doesn't: @@ -2162,7 +2139,7 @@ pyg_error_check(GError **error) "pyg_error_check is deprecated, use " "pyglib_error_check instead")) return NULL; -#endif +#endif return pyglib_error_check(error); } @@ -2187,7 +2164,7 @@ pyg_gerror_exception_check(GError **error) "pyg_gerror_exception_check is deprecated, use " "pyglib_gerror_exception_check instead")) return NULL; -#endif +#endif return pyglib_gerror_exception_check(error); } @@ -2202,9 +2179,9 @@ pyg_gerror_exception_check(GError **error) * arguments/properties * @nparams: output parameter to contain actual number of arguments found * @py_args: array of PyObject* containing the actual constructor arguments - * + * * Parses an array of PyObject's and creates a GParameter array - * + * * Return value: %TRUE if all is successful, otherwise %FALSE and * python exception set. **/ @@ -2298,9 +2275,9 @@ pygobject_construct(PyGObject *self, const char *first_property_name, ...) if (!pspec) { - g_warning("%s: object class `%s' has no property named `%s'", - G_STRFUNC, - g_type_name(object_type), + g_warning("%s: object class `%s' has no property named `%s'", + G_STRFUNC, + g_type_name(object_type), name); break; } @@ -2347,12 +2324,12 @@ pyg_integer_richcompare(PyObject *v, PyObject *w, int op) gboolean t; switch (op) { - case Py_EQ: t = _PyLong_AS_LONG(v) == _PyLong_AS_LONG(w); break; - case Py_NE: t = _PyLong_AS_LONG(v) != _PyLong_AS_LONG(w); break; - case Py_LE: t = _PyLong_AS_LONG(v) <= _PyLong_AS_LONG(w); break; - case Py_GE: t = _PyLong_AS_LONG(v) >= _PyLong_AS_LONG(w); break; - case Py_LT: t = _PyLong_AS_LONG(v) < _PyLong_AS_LONG(w); break; - case Py_GT: t = _PyLong_AS_LONG(v) > _PyLong_AS_LONG(w); break; + case Py_EQ: t = PYGLIB_PyLong_AS_LONG(v) == PYGLIB_PyLong_AS_LONG(w); break; + case Py_NE: t = PYGLIB_PyLong_AS_LONG(v) != PYGLIB_PyLong_AS_LONG(w); break; + case Py_LE: t = PYGLIB_PyLong_AS_LONG(v) <= PYGLIB_PyLong_AS_LONG(w); break; + case Py_GE: t = PYGLIB_PyLong_AS_LONG(v) >= PYGLIB_PyLong_AS_LONG(w); break; + case Py_LT: t = PYGLIB_PyLong_AS_LONG(v) < PYGLIB_PyLong_AS_LONG(w); break; + case Py_GT: t = PYGLIB_PyLong_AS_LONG(v) > PYGLIB_PyLong_AS_LONG(w); break; default: g_assert_not_reached(); } @@ -2380,7 +2357,7 @@ _log_func(const gchar *log_domain, } static void -add_warning_redirection(const char *domain, +add_warning_redirection(const char *domain, PyObject *warning) { g_return_if_fail(domain != NULL); @@ -2390,7 +2367,7 @@ add_warning_redirection(const char *domain, { guint handler; gpointer old_handler; - + if (!log_handlers) log_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); @@ -2415,7 +2392,7 @@ static void disable_warning_redirections(void) { log_handlers_disabled = TRUE; - + if (log_handlers) { g_hash_table_foreach(log_handlers, remove_handler, NULL); @@ -2457,7 +2434,7 @@ struct _PyGObject_Functions pygobject_api_functions = { pyg_enum_add_constants, pyg_flags_add_constants, - + pyg_constant_strip_prefix, pyg_error_check, @@ -2478,7 +2455,7 @@ struct _PyGObject_Functions pygobject_api_functions = { &PyGEnum_Type, pyg_enum_add, pyg_enum_from_gtype, - + &PyGFlags_Type, pyg_flags_add, pyg_flags_from_gtype, @@ -2494,15 +2471,15 @@ struct _PyGObject_Functions pygobject_api_functions = { pygobject_constructv, pygobject_construct, pyg_set_object_has_new_constructor, - + add_warning_redirection, disable_warning_redirections, - + pyg_type_register_custom_callback, pyg_gerror_exception_check, - pyglib_option_group_new - + pyglib_option_group_new, + pyg_type_from_object_strict }; /* for addon libraries ... */ @@ -2510,8 +2487,8 @@ static void pygobject_register_api(PyObject *d) { PyObject *api; - - api = PyCObject_FromVoidPtr(&pygobject_api_functions,NULL); + + api = PYGLIB_CPointer_WrapPointer(&pygobject_api_functions, "gobject._PyGObject_API"); PyDict_SetItemString(d, "_PyGObject_API", api); Py_DECREF(api); } @@ -2548,8 +2525,8 @@ pygobject_register_constants(PyObject *m) PyModule_AddObject(m, "G_MAXSIZE", PyLong_FromUnsignedLongLong(G_MAXSIZE)); PyModule_AddObject(m, "G_MAXSSIZE", PyLong_FromUnsignedLongLong(G_MAXSSIZE)); #elif PY_VERSION_HEX < 0x02060000 /* 2.5 */ - PyModule_AddObject(m, "G_MAXSIZE", _PyLong_FromSize_t(G_MAXSIZE)); - PyModule_AddObject(m, "G_MAXSSIZE", _PyLong_FromSsize_t(G_MAXSSIZE)); + PyModule_AddObject(m, "G_MAXSIZE", PYGLIB_PyLong_FromSize_t(G_MAXSIZE)); + PyModule_AddObject(m, "G_MAXSSIZE", PYGLIB_PyLong_FromSsize_t(G_MAXSSIZE)); #else /* 2.6+ */ PyModule_AddObject(m, "G_MAXSIZE", PyLong_FromSize_t(G_MAXSIZE)); PyModule_AddObject(m, "G_MAXSSIZE", PyLong_FromSsize_t(G_MAXSSIZE)); @@ -2588,7 +2565,7 @@ static void pygobject_register_features(PyObject *d) { PyObject *features; - + features = PyDict_New(); #ifdef HAVE_FFI_H PyDict_SetItemString(features, "generic-c-marshaller", Py_True); @@ -2648,7 +2625,7 @@ PYGLIB_MODULE_START(_gobject, "gobject._gobject") pygobject_pointer_register_types(d); pygobject_enum_register_types(d); pygobject_flags_register_types(d); - + /* signal registration recognizes this special accumulator 'constant' */ _pyg_signal_accumulator_true_handled_func = \ PyDict_GetItemString(d, "signal_accumulator_true_handled"); diff --git a/gobject/propertyhelper.py b/gobject/propertyhelper.py index e299273..9643c82 100644 --- a/gobject/propertyhelper.py +++ b/gobject/propertyhelper.py @@ -36,6 +36,12 @@ from gobject.constants import \ G_MININT, G_MAXINT, G_MAXUINT, G_MINLONG, G_MAXLONG, \ G_MAXULONG +if sys.version_info >= (3, 0): + _basestring = str + _long = int +else: + _basestring = basestring + _long = long class property(object): """ @@ -107,11 +113,11 @@ class property(object): self.default = self._get_default(default) self._check_default() - if not isinstance(nick, basestring): + if not isinstance(nick, _basestring): raise TypeError("nick must be a string") self.nick = nick - if not isinstance(blurb, basestring): + if not isinstance(blurb, _basestring): raise TypeError("blurb must be a string") self.blurb = blurb @@ -138,7 +144,6 @@ class property(object): self.name = None - self._values = {} self._exc = None def __repr__(self): @@ -170,30 +175,30 @@ class property(object): self._exc = None raise exc - def _type_from_python(self, type): - if type == int: + def _type_from_python(self, type_): + if type_ == _long: + return TYPE_LONG + elif type_ == int: return TYPE_INT - elif type == bool: + elif type_ == bool: return TYPE_BOOLEAN - elif type == long: - return TYPE_LONG - elif type == float: + elif type_ == float: return TYPE_DOUBLE - elif type == str: + elif type_ == str: return TYPE_STRING - elif type == object: + elif type_ == object: return TYPE_PYOBJECT - elif type == _gobject.GObject: - return TYPE_OBJECT - elif type in [TYPE_NONE, TYPE_INTERFACE, TYPE_CHAR, TYPE_UCHAR, + elif isinstance(type_, type) and issubclass(type_, _gobject.GObject): + return type_.__gtype__ + elif type_ in [TYPE_NONE, TYPE_INTERFACE, TYPE_CHAR, TYPE_UCHAR, TYPE_INT, TYPE_UINT, TYPE_BOOLEAN, TYPE_LONG, TYPE_ULONG, TYPE_INT64, TYPE_UINT64, TYPE_ENUM, TYPE_FLAGS, TYPE_FLOAT, TYPE_DOUBLE, TYPE_POINTER, TYPE_BOXED, TYPE_PARAM, TYPE_OBJECT, TYPE_STRING, TYPE_PYOBJECT]: - return type + return type_ else: - raise TypeError("Unsupported type: %r" % (type,)) + raise TypeError("Unsupported type: %r" % (type_,)) def _get_default(self, default): ptype = self.type @@ -264,10 +269,10 @@ class property(object): # def _default_setter(self, instance, value): - self._values[instance] = value + setattr(instance, '_property_helper_'+self.name, value) def _default_getter(self, instance): - return self._values.get(instance, self.default) + return getattr(instance, '_property_helper_'+self.name, self.default) def _readonly_setter(self, instance, value): self._exc = TypeError("%s property of %s is read-only" % ( @@ -290,7 +295,7 @@ class property(object): args = (self.default,) elif ptype == TYPE_PYOBJECT: args = () - elif ptype == TYPE_OBJECT: + elif ptype.is_a(TYPE_OBJECT): args = () else: raise NotImplementedError(ptype) diff --git a/gobject/pygboxed.c b/gobject/pygboxed.c index 87695eb..a00386b 100644 --- a/gobject/pygboxed.c +++ b/gobject/pygboxed.c @@ -28,7 +28,7 @@ #include "pygobject-private.h" #include "pygboxed.h" -#include "pygi-external.h" +#include "pygi.h" GQuark pygboxed_type_key; GQuark pygboxed_marshal_key; @@ -47,14 +47,20 @@ pyg_boxed_dealloc(PyGBoxed *self) Py_TYPE(self)->tp_free((PyObject *)self); } -static int -pyg_boxed_compare(PyGBoxed *self, PyGBoxed *v) +static PyObject* +pyg_boxed_richcompare(PyObject *self, PyObject *other, int op) { - if (self->boxed == v->boxed) return 0; - if (self->boxed > v->boxed) return -1; - return 1; + if (Py_TYPE(self) == Py_TYPE(other) && Py_TYPE(self) == &PyGBoxed_Type) + return _pyglib_generic_ptr_richcompare(((PyGBoxed*)self)->boxed, + ((PyGBoxed*)other)->boxed, + op); + else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } + static long pyg_boxed_hash(PyGBoxed *self) { @@ -68,7 +74,7 @@ pyg_boxed_repr(PyGBoxed *self) g_snprintf(buf, sizeof(buf), "<%s at 0x%lx>", g_type_name(self->gtype), (long)self->boxed); - return _PyUnicode_FromString(buf); + return PYGLIB_PyUnicode_FromString(buf); } static int @@ -216,7 +222,7 @@ pygobject_boxed_register_types(PyObject *d) pygboxed_marshal_key = g_quark_from_static_string("PyGBoxed::marshal"); PyGBoxed_Type.tp_dealloc = (destructor)pyg_boxed_dealloc; - PyGBoxed_Type.tp_compare = (cmpfunc)pyg_boxed_compare; + PyGBoxed_Type.tp_richcompare = pyg_boxed_richcompare; PyGBoxed_Type.tp_repr = (reprfunc)pyg_boxed_repr; PyGBoxed_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; PyGBoxed_Type.tp_methods = pygboxed_methods; diff --git a/gobject/pygenum.c b/gobject/pygenum.c index 027dbd4..c0a51a9 100644 --- a/gobject/pygenum.c +++ b/gobject/pygenum.c @@ -28,18 +28,35 @@ #include #include "pygobject-private.h" -#include "pygi-external.h" +#include "pygi.h" GQuark pygenum_class_key; PYGLIB_DEFINE_TYPE("gobject.GEnum", PyGEnum_Type, PyGEnum); static PyObject * +pyg_enum_val_new(PyObject* subclass, GType gtype, PyObject *intval) +{ + PyObject *item; + +#if PY_VERSION_HEX >= 0x03000000 + item = PyObject_CallMethod((PyObject*)&PyLong_Type, "__new__", "OO", + subclass, intval); +#else + item = ((PyTypeObject *)subclass)->tp_alloc((PyTypeObject *)subclass, 0); + ((PyIntObject*)item)->ob_ival = PyInt_AS_LONG(intval); +#endif + ((PyGEnum*)item)->gtype = gtype; + + return item; +} + +static PyObject * pyg_enum_richcompare(PyGEnum *self, PyObject *other, int op) { static char warning[256]; - if (!_PyLong_Check(other)) { + if (!PYGLIB_PyLong_Check(other)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } @@ -61,22 +78,25 @@ pyg_enum_repr(PyGEnum *self) const char *value; guint index; static char tmp[256]; - + long l; + enum_class = g_type_class_ref(self->gtype); g_assert(G_IS_ENUM_CLASS(enum_class)); - for (index = 0; index < enum_class->n_values; index++) - if (_PyLong_AS_LONG(self) == enum_class->values[index].value) + l = PYGLIB_PyLong_AS_LONG(self); + for (index = 0; index < enum_class->n_values; index++) + if (l == enum_class->values[index].value) break; + value = enum_class->values[index].value_name; if (value) sprintf(tmp, "", value, g_type_name(self->gtype)); else - sprintf(tmp, "", _PyLong_AS_LONG(self), g_type_name(self->gtype)); + sprintf(tmp, "", PYGLIB_PyLong_AS_LONG(self), g_type_name(self->gtype)); g_type_class_unref(enum_class); - return _PyUnicode_FromString(tmp); + return PYGLIB_PyUnicode_FromString(tmp); } static PyObject * @@ -90,18 +110,18 @@ pyg_enum_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) if (!PyArg_ParseTupleAndKeywords(args, kwargs, "l", kwlist, &value)) return NULL; - + pytc = PyObject_GetAttrString((PyObject *)type, "__gtype__"); if (!pytc) return NULL; - + if (!PyObject_TypeCheck(pytc, &PyGTypeWrapper_Type)) { Py_DECREF(pytc); PyErr_SetString(PyExc_TypeError, "__gtype__ attribute not a typecode"); return NULL; } - + gtype = pyg_type_from_object(pytc); Py_DECREF(pytc); @@ -133,8 +153,8 @@ pyg_enum_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } g_type_class_unref(eclass); - - intvalue = _PyLong_FromLong(value); + + intvalue = PYGLIB_PyLong_FromLong(value); ret = PyDict_GetItem(values, intvalue); Py_DECREF(intvalue); Py_DECREF(values); @@ -142,7 +162,7 @@ pyg_enum_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) Py_INCREF(ret); else PyErr_Format(PyExc_ValueError, "invalid enum value: %ld", value); - + return ret; } @@ -164,28 +184,21 @@ pyg_enum_from_gtype (GType gtype, int value) if (!pyclass) pyclass = pyg_enum_add(NULL, g_type_name(gtype), NULL, gtype); if (!pyclass) - return _PyLong_FromLong(value); - + return PYGLIB_PyLong_FromLong(value); + values = PyDict_GetItemString(((PyTypeObject *)pyclass)->tp_dict, "__enum_values__"); - intvalue = _PyLong_FromLong(value); + intvalue = PYGLIB_PyLong_FromLong(value); retval = PyDict_GetItem(values, intvalue); - Py_DECREF(intvalue); - if (!retval) { + if (retval) { + Py_INCREF(retval); + } + else { PyErr_Clear(); - retval = ((PyTypeObject *)pyclass)->tp_alloc((PyTypeObject *)pyclass, 0); - g_assert(retval != NULL); - -#if PY_VERSION_HEX >= 0x03000000 -# warning "FIXME: figure out how to subclass long" -#else - ((_PyLongObject*)retval)->ob_ival = value; -#endif - ((PyGFlags*)retval)->gtype = gtype; - //return _PyLong_FromLong(value); + retval = pyg_enum_val_new(pyclass, gtype, intvalue); } - - Py_INCREF(retval); + Py_DECREF(intvalue); + return retval; } @@ -199,14 +212,14 @@ pyg_enum_add (PyObject * module, PyObject *instance_dict, *stub, *values, *o; GEnumClass *eclass; int i; - + g_return_val_if_fail(typename != NULL, NULL); if (!g_type_is_a(gtype, G_TYPE_ENUM)) { g_warning("Trying to register gtype '%s' as enum when in fact it is of type '%s'", g_type_name(gtype), g_type_name(G_TYPE_FUNDAMENTAL(gtype))); return NULL; } - + state = pyglib_gil_state_ensure(); instance_dict = PyDict_New(); @@ -226,8 +239,8 @@ pyg_enum_add (PyObject * module, if (module) PyDict_SetItemString(((PyTypeObject *)stub)->tp_dict, "__module__", - _PyUnicode_FromString(PyModule_GetName(module))); - + PYGLIB_PyUnicode_FromString(PyModule_GetName(module))); + g_type_set_qdata(gtype, pygenum_class_key, stub); o = pyg_type_wrapper_new(gtype); @@ -247,18 +260,11 @@ pyg_enum_add (PyObject * module, for (i = 0; i < eclass->n_values; i++) { PyObject *item, *intval; - item = ((PyTypeObject *)stub)->tp_alloc((PyTypeObject *)stub, 0); -#if PY_VERSION_HEX >= 0x03000000 -# warning "FIXME: figure out how to subclass long" -#else - ((_PyLongObject*)item)->ob_ival = eclass->values[i].value; -#endif - ((PyGEnum*)item)->gtype = gtype; - - intval = _PyLong_FromLong(eclass->values[i].value); + intval = PYGLIB_PyLong_FromLong(eclass->values[i].value); + item = pyg_enum_val_new(stub, gtype, intval); PyDict_SetItem(values, intval, item); Py_DECREF(intval); - + if (module) { char *prefix; @@ -269,13 +275,13 @@ pyg_enum_add (PyObject * module, Py_INCREF(item); } } - + PyDict_SetItemString(((PyTypeObject *)stub)->tp_dict, "__enum_values__", values); Py_DECREF(values); g_type_class_unref(eclass); - + pyglib_gil_state_release(state); return stub; } @@ -286,7 +292,7 @@ pyg_enum_reduce(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, ":GEnum.__reduce__")) return NULL; - return Py_BuildValue("(O(i)O)", Py_TYPE(self), _PyLong_AsLong(self), + return Py_BuildValue("(O(i)O)", Py_TYPE(self), PYGLIB_PyLong_AsLong(self), PyObject_GetAttrString(self, "__dict__")); } @@ -296,13 +302,13 @@ pyg_enum_get_value_name(PyGEnum *self, void *closure) GEnumClass *enum_class; GEnumValue *enum_value; PyObject *retval; - + enum_class = g_type_class_ref(self->gtype); g_assert(G_IS_ENUM_CLASS(enum_class)); - - enum_value = g_enum_get_value(enum_class, _PyLong_AS_LONG(self)); - retval = _PyUnicode_FromString(enum_value->value_name); + enum_value = g_enum_get_value(enum_class, PYGLIB_PyLong_AS_LONG(self)); + + retval = PYGLIB_PyUnicode_FromString(enum_value->value_name); g_type_class_unref(enum_class); return retval; @@ -314,13 +320,13 @@ pyg_enum_get_value_nick(PyGEnum *self, void *closure) GEnumClass *enum_class; GEnumValue *enum_value; PyObject *retval; - + enum_class = g_type_class_ref(self->gtype); g_assert(G_IS_ENUM_CLASS(enum_class)); - - enum_value = g_enum_get_value(enum_class, _PyLong_AS_LONG(self)); - retval = _PyUnicode_FromString(enum_value->value_nick); + enum_value = g_enum_get_value(enum_class, PYGLIB_PyLong_AS_LONG(self)); + + retval = PYGLIB_PyUnicode_FromString(enum_value->value_nick); g_type_class_unref(enum_class); return retval; @@ -343,14 +349,18 @@ pygobject_enum_register_types(PyObject *d) { pygenum_class_key = g_quark_from_static_string("PyGEnum::class"); - PyGEnum_Type.tp_base = &_PyLong_Type; + PyGEnum_Type.tp_base = &PYGLIB_PyLong_Type; +#if PY_VERSION_HEX < 0x03000000 + PyGEnum_Type.tp_new = pyg_enum_new; +#else + PyGEnum_Type.tp_new = PyLong_Type.tp_new; + PyGEnum_Type.tp_hash = PyLong_Type.tp_hash; +#endif PyGEnum_Type.tp_repr = (reprfunc)pyg_enum_repr; PyGEnum_Type.tp_str = (reprfunc)pyg_enum_repr; PyGEnum_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; PyGEnum_Type.tp_richcompare = (richcmpfunc)pyg_enum_richcompare; PyGEnum_Type.tp_methods = pyg_enum_methods; PyGEnum_Type.tp_getset = pyg_enum_getsets; - PyGEnum_Type.tp_new = pyg_enum_new; PYGOBJECT_REGISTER_GTYPE(d, PyGEnum_Type, "GEnum", G_TYPE_ENUM); - } diff --git a/gobject/pygflags.c b/gobject/pygflags.c index 1865abb..8c00f15 100644 --- a/gobject/pygflags.c +++ b/gobject/pygflags.c @@ -29,18 +29,35 @@ #include "pygobject-private.h" #include "pygflags.h" -#include "pygi-external.h" +#include "pygi.h" GQuark pygflags_class_key; PYGLIB_DEFINE_TYPE("gobject.GFlags", PyGFlags_Type, PyGFlags); static PyObject * +pyg_flags_val_new(PyObject* subclass, GType gtype, PyObject *intval) +{ + PyObject *item; + +#if PY_VERSION_HEX >= 0x03000000 + item = PyObject_CallMethod((PyObject*)&PyLong_Type, "__new__", "OO", + subclass, intval); +#else + item = ((PyTypeObject *)subclass)->tp_alloc((PyTypeObject *)subclass, 0); + ((PyIntObject*)item)->ob_ival = PyInt_AS_LONG(intval); +#endif + ((PyGFlags*)item)->gtype = gtype; + + return item; +} + +static PyObject * pyg_flags_richcompare(PyGFlags *self, PyObject *other, int op) { static char warning[256]; - if (!_PyLong_Check(other)) { + if (!PYGLIB_PyLong_Check(other)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } @@ -64,7 +81,7 @@ generate_repr(GType gtype, int value) flags_class = g_type_class_ref(gtype); g_assert(G_IS_FLAGS_CLASS(flags_class)); - + for (i = 0; i < flags_class->n_values; i++) { /* Some types (eg GstElementState in GStreamer 0.8) has flags with 0 values, * we're just ignore them for now otherwise they'll always show up @@ -82,31 +99,31 @@ generate_repr(GType gtype, int value) } } } - + g_type_class_unref(flags_class); return retval; } - + static PyObject * pyg_flags_repr(PyGFlags *self) { char *tmp, *retval; PyObject *pyretval; - - tmp = generate_repr(self->gtype, _PyLong_AS_LONG(self)); + + tmp = generate_repr(self->gtype, PYGLIB_PyLong_AS_LONG(self)); if (tmp) retval = g_strdup_printf("", tmp, g_type_name(self->gtype)); else - retval = g_strdup_printf("", _PyLong_AS_LONG(self), + retval = g_strdup_printf("", PYGLIB_PyLong_AS_LONG(self), g_type_name(self->gtype)); g_free(tmp); - - pyretval = _PyUnicode_FromString(retval); + + pyretval = PYGLIB_PyUnicode_FromString(retval); g_free(retval); - + return pyretval; } @@ -118,21 +135,21 @@ pyg_flags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) PyObject *pytc, *values, *ret, *pyint; GType gtype; GFlagsClass *eclass; - + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "l", kwlist, &value)) return NULL; - + pytc = PyObject_GetAttrString((PyObject *)type, "__gtype__"); if (!pytc) return NULL; - + if (!PyObject_TypeCheck(pytc, &PyGTypeWrapper_Type)) { Py_DECREF(pytc); PyErr_SetString(PyExc_TypeError, "__gtype__ attribute not a typecode"); return NULL; } - + gtype = pyg_type_from_object(pytc); Py_DECREF(pytc); @@ -143,8 +160,8 @@ pyg_flags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) g_type_class_unref(eclass); return NULL; } - - if (!PyDict_Check(values) || PyDict_Size(values) != eclass->n_values) { + + if (!PyDict_Check(values)) { PyErr_SetString(PyExc_TypeError, "__flags_values__ badly formed"); Py_DECREF(values); g_type_class_unref(eclass); @@ -152,16 +169,21 @@ pyg_flags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } g_type_class_unref(eclass); - - pyint = _PyLong_FromLong(value); + + pyint = PYGLIB_PyLong_FromLong(value); ret = PyDict_GetItem(values, pyint); + if (!ret) { + PyErr_Clear(); + + ret = pyg_flags_val_new((PyObject *)type, gtype, pyint); + g_assert(ret != NULL); + } else { + Py_INCREF(ret); + } + Py_DECREF(pyint); Py_DECREF(values); - if (ret) - Py_INCREF(ret); - else - PyErr_Format(PyExc_ValueError, "invalid flag value: %ld", value); return ret; } @@ -171,7 +193,7 @@ pyg_flags_from_gtype (GType gtype, int value) PyObject *pyclass, *values, *retval, *pyint; g_return_val_if_fail(gtype != G_TYPE_INVALID, NULL); - + /* Get a wrapper class by: * 1. check for one attached to the gtype * 2. lookup one in a typelib @@ -183,29 +205,22 @@ pyg_flags_from_gtype (GType gtype, int value) if (!pyclass) pyclass = pyg_flags_add(NULL, g_type_name(gtype), NULL, gtype); if (!pyclass) - return _PyLong_FromLong(value); - + return PYGLIB_PyLong_FromLong(value); + values = PyDict_GetItemString(((PyTypeObject *)pyclass)->tp_dict, "__flags_values__"); - pyint = _PyLong_FromLong(value); + pyint = PYGLIB_PyLong_FromLong(value); retval = PyDict_GetItem(values, pyint); - Py_DECREF(pyint); - if (!retval) { PyErr_Clear(); - retval = ((PyTypeObject *)pyclass)->tp_alloc((PyTypeObject *)pyclass, 0); + retval = pyg_flags_val_new(pyclass, gtype, pyint); g_assert(retval != NULL); - -#if PY_VERSION_HEX >= 0x03000000 -# warning "FIXME: figure out how to subclass long" -#else - ((_PyLongObject*)retval)->ob_ival = value; -#endif - ((PyGFlags*)retval)->gtype = gtype; } else { Py_INCREF(retval); } + Py_DECREF(pyint); + return retval; } @@ -226,7 +241,7 @@ pyg_flags_add (PyObject * module, g_type_name(gtype), g_type_name(G_TYPE_FUNDAMENTAL(gtype))); return NULL; } - + state = pyglib_gil_state_ensure(); instance_dict = PyDict_New(); @@ -239,15 +254,15 @@ pyg_flags_add (PyObject * module, pyglib_gil_state_release(state); return NULL; } - + ((PyTypeObject *)stub)->tp_flags &= ~Py_TPFLAGS_BASETYPE; ((PyTypeObject *)stub)->tp_new = pyg_flags_new; if (module) { PyDict_SetItemString(((PyTypeObject *)stub)->tp_dict, "__module__", - _PyUnicode_FromString(PyModule_GetName(module))); - + PYGLIB_PyUnicode_FromString(PyModule_GetName(module))); + /* Add it to the module name space */ PyModule_AddObject(module, (char*)typename, stub); Py_INCREF(stub); @@ -257,7 +272,7 @@ pyg_flags_add (PyObject * module, o = pyg_type_wrapper_new(gtype); PyDict_SetItemString(((PyTypeObject *)stub)->tp_dict, "__gtype__", o); Py_DECREF(o); - + /* Register flag values */ eclass = G_FLAGS_CLASS(g_type_class_ref(gtype)); @@ -265,29 +280,22 @@ pyg_flags_add (PyObject * module, for (i = 0; i < eclass->n_values; i++) { PyObject *item, *intval; - item = ((PyTypeObject *)stub)->tp_alloc((PyTypeObject *)stub, 0); -#if PY_VERSION_HEX >= 0x03000000 -# warning "FIXME: figure out how to subclass long" -#else - ((_PyLongObject*)item)->ob_ival = eclass->values[i].value; -#endif - ((PyGFlags*)item)->gtype = gtype; - - intval = _PyLong_FromLong(eclass->values[i].value); + intval = PYGLIB_PyLong_FromLong(eclass->values[i].value); + item = pyg_flags_val_new(stub, gtype, intval); PyDict_SetItem(values, intval, item); Py_DECREF(intval); if (module) { char *prefix; - + prefix = g_strdup(pyg_constant_strip_prefix(eclass->values[i].value_name, strip_prefix)); + Py_INCREF(item); PyModule_AddObject(module, prefix, item); g_free(prefix); - - Py_INCREF(item); } + Py_DECREF(item); } - + PyDict_SetItemString(((PyTypeObject *)stub)->tp_dict, "__flags_values__", values); Py_DECREF(values); @@ -303,32 +311,32 @@ static PyObject * pyg_flags_and(PyGFlags *a, PyGFlags *b) { if (!PyGFlags_Check(a) || !PyGFlags_Check(b)) - return _PyLong_Type.tp_as_number->nb_and((PyObject*)a, + return PYGLIB_PyLong_Type.tp_as_number->nb_and((PyObject*)a, (PyObject*)b); - + return pyg_flags_from_gtype(a->gtype, - _PyLong_AS_LONG(a) & _PyLong_AS_LONG(b)); + PYGLIB_PyLong_AS_LONG(a) & PYGLIB_PyLong_AS_LONG(b)); } static PyObject * pyg_flags_or(PyGFlags *a, PyGFlags *b) { if (!PyGFlags_Check(a) || !PyGFlags_Check(b)) - return _PyLong_Type.tp_as_number->nb_or((PyObject*)a, + return PYGLIB_PyLong_Type.tp_as_number->nb_or((PyObject*)a, (PyObject*)b); - return pyg_flags_from_gtype(a->gtype, _PyLong_AS_LONG(a) | _PyLong_AS_LONG(b)); + return pyg_flags_from_gtype(a->gtype, PYGLIB_PyLong_AS_LONG(a) | PYGLIB_PyLong_AS_LONG(b)); } static PyObject * pyg_flags_xor(PyGFlags *a, PyGFlags *b) { if (!PyGFlags_Check(a) || !PyGFlags_Check(b)) - return _PyLong_Type.tp_as_number->nb_xor((PyObject*)a, + return PYGLIB_PyLong_Type.tp_as_number->nb_xor((PyObject*)a, (PyObject*)b); return pyg_flags_from_gtype(a->gtype, - _PyLong_AS_LONG(a) ^ _PyLong_AS_LONG(b)); + PYGLIB_PyLong_AS_LONG(a) ^ PYGLIB_PyLong_AS_LONG(b)); } @@ -348,12 +356,12 @@ pyg_flags_get_first_value_name(PyGFlags *self, void *closure) GFlagsClass *flags_class; GFlagsValue *flags_value; PyObject *retval; - + flags_class = g_type_class_ref(self->gtype); g_assert(G_IS_FLAGS_CLASS(flags_class)); - flags_value = g_flags_get_first_value(flags_class, _PyLong_AS_LONG(self)); + flags_value = g_flags_get_first_value(flags_class, PYGLIB_PyLong_AS_LONG(self)); if (flags_value) - retval = _PyUnicode_FromString(flags_value->value_name); + retval = PYGLIB_PyUnicode_FromString(flags_value->value_name); else { retval = Py_None; Py_INCREF(Py_None); @@ -369,13 +377,13 @@ pyg_flags_get_first_value_nick(PyGFlags *self, void *closure) GFlagsClass *flags_class; GFlagsValue *flags_value; PyObject *retval; - + flags_class = g_type_class_ref(self->gtype); g_assert(G_IS_FLAGS_CLASS(flags_class)); - flags_value = g_flags_get_first_value(flags_class, _PyLong_AS_LONG(self)); + flags_value = g_flags_get_first_value(flags_class, PYGLIB_PyLong_AS_LONG(self)); if (flags_value) - retval = _PyUnicode_FromString(flags_value->value_nick); + retval = PYGLIB_PyUnicode_FromString(flags_value->value_nick); else { retval = Py_None; Py_INCREF(Py_None); @@ -391,14 +399,14 @@ pyg_flags_get_value_names(PyGFlags *self, void *closure) GFlagsClass *flags_class; PyObject *retval; int i; - + flags_class = g_type_class_ref(self->gtype); g_assert(G_IS_FLAGS_CLASS(flags_class)); - + retval = PyList_New(0); for (i = 0; i < flags_class->n_values; i++) - if ((_PyLong_AS_LONG(self) & flags_class->values[i].value) == flags_class->values[i].value) - PyList_Append(retval, _PyUnicode_FromString(flags_class->values[i].value_name)); + if ((PYGLIB_PyLong_AS_LONG(self) & flags_class->values[i].value) == flags_class->values[i].value) + PyList_Append(retval, PYGLIB_PyUnicode_FromString(flags_class->values[i].value_name)); g_type_class_unref(flags_class); @@ -411,14 +419,14 @@ pyg_flags_get_value_nicks(PyGFlags *self, void *closure) GFlagsClass *flags_class; PyObject *retval; int i; - + flags_class = g_type_class_ref(self->gtype); g_assert(G_IS_FLAGS_CLASS(flags_class)); - + retval = PyList_New(0); for (i = 0; i < flags_class->n_values; i++) - if ((_PyLong_AS_LONG(self) & flags_class->values[i].value) == flags_class->values[i].value) - PyList_Append(retval, _PyUnicode_FromString(flags_class->values[i].value_nick)); + if ((PYGLIB_PyLong_AS_LONG(self) & flags_class->values[i].value) == flags_class->values[i].value) + PyList_Append(retval, PYGLIB_PyUnicode_FromString(flags_class->values[i].value_nick)); g_type_class_unref(flags_class); @@ -439,7 +447,9 @@ static PyNumberMethods pyg_flags_as_number = { (binaryfunc)pyg_flags_warn, /* nb_multiply */ (binaryfunc)pyg_flags_warn, /* nb_divide */ (binaryfunc)pyg_flags_warn, /* nb_remainder */ - (binaryfunc)pyg_flags_warn, /* nb_divmod */ +#if PY_VERSION_HEX < 0x03000000 + (binaryfunc)pyg_flags_warn, /* nb_divmod */ +#endif (ternaryfunc)pyg_flags_warn, /* nb_power */ 0, /* nb_negative */ 0, /* nb_positive */ @@ -451,27 +461,6 @@ static PyNumberMethods pyg_flags_as_number = { (binaryfunc)pyg_flags_and, /* nb_and */ (binaryfunc)pyg_flags_xor, /* nb_xor */ (binaryfunc)pyg_flags_or, /* nb_or */ - 0, /* nb_coerce */ - 0, /* nb_int */ - 0, /* nb_long */ - 0, /* nb_float */ - 0, /* nb_oct */ - 0, /* nb_hex */ - 0, /* nb_inplace_add */ - 0, /* nb_inplace_subtract */ - 0, /* nb_inplace_multiply */ - 0, /* nb_inplace_divide */ - 0, /* nb_inplace_remainder */ - 0, /* nb_inplace_power */ - 0, /* nb_inplace_lshift */ - 0, /* nb_inplace_rshift */ - 0, /* nb_inplace_and */ - 0, /* nb_inplace_xor */ - 0, /* nb_inplace_or */ - 0, /* nb_floor_divide */ - 0, /* nb_true_divide */ - 0, /* nb_inplace_floor_divide */ - 0, /* nb_inplace_true_divide */ }; void @@ -479,13 +468,18 @@ pygobject_flags_register_types(PyObject *d) { pygflags_class_key = g_quark_from_static_string("PyGFlags::class"); - PyGFlags_Type.tp_base = &_PyLong_Type; + PyGFlags_Type.tp_base = &PYGLIB_PyLong_Type; +#if PY_VERSION_HEX < 0x03000000 + PyGFlags_Type.tp_new = pyg_flags_new; +#else + PyGFlags_Type.tp_new = PyLong_Type.tp_new; + PyGFlags_Type.tp_hash = PyLong_Type.tp_hash; +#endif PyGFlags_Type.tp_repr = (reprfunc)pyg_flags_repr; PyGFlags_Type.tp_as_number = &pyg_flags_as_number; PyGFlags_Type.tp_str = (reprfunc)pyg_flags_repr; PyGFlags_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; PyGFlags_Type.tp_richcompare = (richcmpfunc)pyg_flags_richcompare; PyGFlags_Type.tp_getset = pyg_flags_getsets; - PyGFlags_Type.tp_new = pyg_flags_new; PYGOBJECT_REGISTER_GTYPE(d, PyGFlags_Type, "GFlags", G_TYPE_FLAGS); } diff --git a/gobject/pygi-external.h b/gobject/pygi-external.h deleted file mode 100644 index b369dca..0000000 --- a/gobject/pygi-external.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- - * vim: tabstop=4 shiftwidth=4 expandtab - */ - -#ifndef _PYGI_EXTERNAL_H_ -#define _PYGI_EXTERNAL_H_ - -#include -#include - -struct PyGI_API { - PyObject* (*type_import_by_g_type) (GType g_type); -}; - -static struct PyGI_API *PyGI_API = NULL; - -static int -_pygi_import (void) -{ -#if ENABLE_PYGI - PyObject *module; - PyObject *api; - - if (PyGI_API != NULL) { - return 1; - } - - module = PyImport_ImportModule("gi"); - if (module == NULL) { - PyErr_Clear(); - return -1; - } - - api = PyObject_GetAttrString(module, "_API"); - if (api == NULL) { - PyErr_Clear(); - Py_DECREF(module); - return -1; - } - if (!PyCObject_Check(api)) { - Py_DECREF(module); - Py_DECREF(api); - PyErr_Format(PyExc_TypeError, "gi._API must be cobject, not %s", - api->ob_type->tp_name); - return -1; - } - - PyGI_API = (struct PyGI_API *)PyCObject_AsVoidPtr(api); - - Py_DECREF(module); - - return 0; -#else - return -1; -#endif /* ENABLE_PYGI */ -} - -static inline PyObject * -pygi_type_import_by_g_type (GType g_type) -{ - if (_pygi_import() < 0) { - return NULL; - } - return PyGI_API->type_import_by_g_type(g_type); -} - -#endif /* _PYGI_EXTERNAL_H_ */ diff --git a/gobject/pygobject-private.h b/gobject/pygobject-private.h index 2a09eed..6f3a25e 100644 --- a/gobject/pygobject-private.h +++ b/gobject/pygobject-private.h @@ -32,12 +32,18 @@ extern struct _PyGObject_Functions pygobject_api_functions; #define pyg_threads_enabled (pygobject_api_functions.threads_enabled) +#ifdef DISABLE_THREADING +#define pyg_gil_state_ensure() 0 +#define pyg_gil_state_release(state) G_STMT_START { \ + } G_STMT_END +#else #define pyg_gil_state_ensure() (pygobject_api_functions.threads_enabled? (PyGILState_Ensure()) : 0) #define pyg_gil_state_release(state) G_STMT_START { \ if (pygobject_api_functions.threads_enabled) \ PyGILState_Release(state); \ } G_STMT_END +#endif #define pyg_begin_allow_threads \ G_STMT_START { \ @@ -98,6 +104,7 @@ gboolean pyg_gerror_exception_check(GError **error); extern PyTypeObject PyGTypeWrapper_Type; PyObject *pyg_type_wrapper_new (GType type); +GType pyg_type_from_object_strict (PyObject *obj, gboolean strict); GType pyg_type_from_object (PyObject *obj); gint pyg_enum_get_value (GType enum_type, PyObject *obj, gint *val); @@ -113,10 +120,10 @@ void pyg_register_gtype_custom(GType gtype, int pyg_value_from_pyobject(GValue *value, PyObject *obj); PyObject *pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed); int pyg_param_gvalue_from_pyobject(GValue* value, - PyObject* py_obj, + PyObject* py_obj, const GParamSpec* pspec); PyObject *pyg_param_gvalue_as_pyobject(const GValue* gvalue, - gboolean copy_boxed, + gboolean copy_boxed, const GParamSpec* pspec); GClosure *pyg_closure_new(PyObject *callback, PyObject *extra_args, PyObject *swap_data); @@ -149,6 +156,7 @@ void pygobject_register_class (PyObject *dict, void pygobject_register_wrapper (PyObject *self); PyObject * pygobject_new (GObject *obj); PyObject * pygobject_new_full (GObject *obj, gboolean sink, gpointer g_class); +PyObject * pygobject_new_sunk (GObject *obj); void pygobject_sink (GObject *obj); PyTypeObject *pygobject_lookup_class (GType gtype); void pygobject_watch_closure (PyObject *self, GClosure *closure); @@ -175,14 +183,14 @@ const gchar * pyg_constant_strip_prefix(const gchar *name, const gchar *strip_pr /* pygflags */ typedef struct { - _PyLongObject parent; + PYGLIB_PyLongObject parent; GType gtype; } PyGFlags; extern PyTypeObject PyGFlags_Type; #define PyGFlags_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_FLAGS)) - + extern PyObject * pyg_flags_add (PyObject * module, const char * type_name, const char * strip_prefix, @@ -194,7 +202,7 @@ extern PyObject * pyg_flags_from_gtype (GType gtype, #define PyGEnum_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_ENUM)) typedef struct { - _PyLongObject parent; + PYGLIB_PyLongObject parent; GType gtype; } PyGEnum; @@ -221,9 +229,14 @@ extern PyTypeObject PyGObjectWeakRef_Type; static inline PyGObjectData * pyg_object_peek_inst_data(GObject *obj) { - return ((PyGObjectData *) + return ((PyGObjectData *) g_object_get_qdata(obj, pygobject_instance_data_key)); } +gboolean pygobject_prepare_construct_properties (GObjectClass *class, + PyObject *kwargs, + guint *n_params, + GParameter **params); + #endif diff --git a/gobject/pygobject.c b/gobject/pygobject.c index 2671fa9..6c2f06c 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -29,7 +29,7 @@ #include "pyginterface.h" #include "pygparamspec.h" -#include "pygi-external.h" +#include "pygi.h" static void pygobject_dealloc(PyGObject *self); @@ -50,6 +50,7 @@ GQuark pygobject_class_init_key; GQuark pygobject_wrapper_key; GQuark pygobject_has_updated_constructor_key; GQuark pygobject_instance_data_key; +GQuark pygobject_ref_sunk_key; /* -------------- class <-> wrapper manipulation --------------- */ @@ -135,6 +136,12 @@ PyTypeObject *PyGObject_MetaType = NULL; void pygobject_sink(GObject *obj) { + gboolean sunk = FALSE; + + /* We use a gobject data key to avoid running the sink funcs more than once. */ + if (g_object_get_qdata (obj, pygobject_ref_sunk_key)) + return; + if (sink_funcs) { gint i; @@ -142,18 +149,17 @@ pygobject_sink(GObject *obj) if (g_type_is_a(G_OBJECT_TYPE(obj), g_array_index(sink_funcs, SinkFunc, i).type)) { g_array_index(sink_funcs, SinkFunc, i).sinkfunc(obj); - return; + + sunk = TRUE; + break; } } } - if (G_IS_INITIALLY_UNOWNED(obj) && !g_object_is_floating(obj)) { - /* GtkWindow and GtkInvisible does not return a ref to caller of - * g_object_new. - */ - g_object_ref(obj); - } else if (g_object_is_floating(obj)) { + + if (!sunk && G_IS_INITIALLY_UNOWNED (obj)) g_object_ref_sink(obj); - } + + g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); } /** @@ -255,7 +261,7 @@ build_parameter_list(GObjectClass *class) name = g_strdup(g_param_spec_get_name(props[i])); /* hyphens cannot belong in identifiers */ g_strdelimit(name, "-", '_'); - prop_str = _PyUnicode_FromString(name); + prop_str = PYGLIB_PyUnicode_FromString(name); PyList_SetItem(props_list, i, prop_str); g_free(name); @@ -276,7 +282,7 @@ PyGProps_getattro(PyGProps *self, PyObject *attr) GValue value = { 0, }; PyObject *ret; - attr_name = _PyUnicode_AsString(attr); + attr_name = PYGLIB_PyUnicode_AsString(attr); if (!attr_name) { PyErr_Clear(); return PyObject_GenericGetAttr((PyObject *)self, attr); @@ -288,6 +294,12 @@ PyGProps_getattro(PyGProps *self, PyObject *attr) return build_parameter_list(class); } + if (self->pygobject != NULL) { + ret = pygi_get_property_value (self->pygobject, attr_name); + if (ret != NULL) + return ret; + } + pspec = g_object_class_find_property(class, attr_name); g_type_class_unref(class); @@ -361,6 +373,7 @@ PyGProps_setattro(PyGProps *self, PyObject *attr, PyObject *pvalue) GParamSpec *pspec; char *attr_name; GObject *obj; + int ret = -1; if (pvalue == NULL) { PyErr_SetString(PyExc_TypeError, "properties cannot be " @@ -368,7 +381,7 @@ PyGProps_setattro(PyGProps *self, PyObject *attr, PyObject *pvalue) return -1; } - attr_name = _PyUnicode_AsString(attr); + attr_name = PYGLIB_PyUnicode_AsString(attr); if (!attr_name) { PyErr_Clear(); return PyObject_GenericSetAttr((PyObject *)self, attr, pvalue); @@ -380,6 +393,13 @@ PyGProps_setattro(PyGProps *self, PyObject *attr, PyObject *pvalue) return -1; } + ret = pygi_set_property_value (self->pygobject, attr_name, pvalue); + if (ret == 0) + return 0; + else if (ret == -1) + if (PyErr_Occurred()) + return -1; + obj = self->pygobject->obj; pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(obj), attr_name); if (!pspec) { @@ -540,7 +560,7 @@ pygobject_register_class(PyObject *dict, const gchar *type_name, */ s = strrchr(type->tp_name, '.'); if (s != NULL) { - mod_name = _PyUnicode_FromStringAndSize(type->tp_name, (int)(s - type->tp_name)); + mod_name = PYGLIB_PyUnicode_FromStringAndSize(type->tp_name, (int)(s - type->tp_name)); PyDict_SetItemString(type->tp_dict, "__module__", mod_name); Py_DECREF(mod_name); } @@ -795,12 +815,15 @@ static void pygobject_inherit_slots(PyTypeObject *type, PyObject *bases, gboolean check_for_present) { static int slot_offsets[] = { offsetof(PyTypeObject, tp_richcompare), - offsetof(PyTypeObject, tp_compare), - offsetof(PyTypeObject, tp_hash), - offsetof(PyTypeObject, tp_iter), - offsetof(PyTypeObject, tp_repr), - offsetof(PyTypeObject, tp_str), - offsetof(PyTypeObject, tp_print) }; +#if PY_VERSION_HEX < 0x03000000 + offsetof(PyTypeObject, tp_compare), +#endif + offsetof(PyTypeObject, tp_richcompare), + offsetof(PyTypeObject, tp_hash), + offsetof(PyTypeObject, tp_iter), + offsetof(PyTypeObject, tp_repr), + offsetof(PyTypeObject, tp_str), + offsetof(PyTypeObject, tp_print) }; int i; /* Happens when registering gobject.GObject itself, at least. */ @@ -965,6 +988,13 @@ pygobject_new(GObject *obj) return pygobject_new_full(obj, TRUE, NULL); } +PyObject * +pygobject_new_sunk(GObject *obj) +{ + g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); + return pygobject_new_full(obj, TRUE, NULL); +} + static void pygobject_unwatch_closure(gpointer data, GClosure *closure) { @@ -1009,8 +1039,14 @@ PYGLIB_DEFINE_TYPE("gobject.GObject", PyGObject_Type, PyGObject); static void pygobject_dealloc(PyGObject *self) { - PyObject_ClearWeakRefs((PyObject *)self); + /* Untrack must be done first. This is because followup calls such as + * ClearWeakRefs could call into Python and cause new allocations to + * happen, which could in turn could trigger the garbage collector, + * which would then get confused as it is tracking this half-deallocated + * object. */ PyObject_GC_UnTrack((PyObject *)self); + + PyObject_ClearWeakRefs((PyObject *)self); /* this forces inst_data->type to be updated, which could prove * important if a new wrapper has to be created and it is of a * unregistered type */ @@ -1021,12 +1057,29 @@ pygobject_dealloc(PyGObject *self) PyObject_GC_Del(self); } -static int -pygobject_compare(PyGObject *self, PyGObject *v) +static PyObject* +pygobject_richcompare(PyObject *self, PyObject *other, int op) { - if (self->obj == v->obj) return 0; - if (self->obj > v->obj) return -1; - return 1; + int isinst; + + isinst = PyObject_IsInstance(self, (PyObject*)&PyGObject_Type); + if (isinst == -1) + return NULL; + if (!isinst) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + isinst = PyObject_IsInstance(other, (PyObject*)&PyGObject_Type); + if (isinst == -1) + return NULL; + if (!isinst) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + + return _pyglib_generic_ptr_richcompare(((PyGObject*)self)->obj, + ((PyGObject*)other)->obj, + op); } static long @@ -1046,7 +1099,7 @@ pygobject_repr(PyGObject *self) (long)self, self->obj ? G_OBJECT_TYPE_NAME(self->obj) : "uninitialized", (long)self->obj); - return _PyUnicode_FromString(buf); + return PYGLIB_PyUnicode_FromString(buf); } @@ -1103,6 +1156,45 @@ pygobject_free(PyObject *op) PyObject_GC_Del(op); } +gboolean +pygobject_prepare_construct_properties(GObjectClass *class, PyObject *kwargs, + guint *n_params, GParameter **params) +{ + *n_params = 0; + *params = NULL; + + if (kwargs) { + Py_ssize_t pos = 0; + PyObject *key; + PyObject *value; + + *params = g_new0(GParameter, PyDict_Size(kwargs)); + while (PyDict_Next(kwargs, &pos, &key, &value)) { + GParamSpec *pspec; + GParameter *param = &(*params)[*n_params]; + const gchar *key_str = PYGLIB_PyUnicode_AsString(key); + + pspec = g_object_class_find_property(class, key_str); + if (!pspec) { + PyErr_Format(PyExc_TypeError, + "gobject `%s' doesn't support property `%s'", + G_OBJECT_CLASS_NAME(class), key_str); + return FALSE; + } + g_value_init(¶m->value, G_PARAM_SPEC_VALUE_TYPE(pspec)); + if (pyg_param_gvalue_from_pyobject(¶m->value, value, pspec) < 0) { + PyErr_Format(PyExc_TypeError, + "could not convert value for property `%s' from %s to %s", + key_str, Py_TYPE(value)->tp_name, + g_type_name(G_PARAM_SPEC_VALUE_TYPE(pspec))); + return FALSE; + } + param->name = g_strdup(key_str); + ++(*n_params); + } + } + return TRUE; +} /* ---------------- PyGObject methods ----------------- */ @@ -1133,35 +1225,9 @@ pygobject_init(PyGObject *self, PyObject *args, PyObject *kwargs) return -1; } - if (kwargs) { - Py_ssize_t pos = 0; - PyObject *key; - PyObject *value; - - params = g_new0(GParameter, PyDict_Size(kwargs)); - while (PyDict_Next (kwargs, &pos, &key, &value)) { - GParamSpec *pspec; - gchar *key_str = _PyUnicode_AsString(key); - - pspec = g_object_class_find_property (class, key_str); - if (!pspec) { - PyErr_Format(PyExc_TypeError, - "object of type `%s' doesn't support property `%s'", - g_type_name(object_type), key_str); - goto cleanup; - } - g_value_init(¶ms[n_params].value, - G_PARAM_SPEC_VALUE_TYPE(pspec)); - if (pyg_value_from_pyobject(¶ms[n_params].value, value)) { - PyErr_Format(PyExc_TypeError, - "could not convert value for property `%s'", - key_str); - goto cleanup; - } - params[n_params].name = g_strdup(key_str); - n_params++; - } - } + if (!pygobject_prepare_construct_properties (class, kwargs, &n_params, ¶ms)) + goto cleanup; + if (pygobject_constructv(self, n_params, params)) PyErr_SetString(PyExc_RuntimeError, "could not create object"); @@ -1249,13 +1315,13 @@ pygobject_get_properties(PyGObject *self, PyObject *args) GValue value = { 0 }; PyObject *item; - if (!_PyUnicode_Check(py_property)) { + if (!PYGLIB_PyUnicode_Check(py_property)) { PyErr_SetString(PyExc_TypeError, "Expected string argument for property."); return NULL; } - property_name = _PyUnicode_AsString(py_property); + property_name = PYGLIB_PyUnicode_AsString(py_property); pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(self->obj), property_name); @@ -1331,7 +1397,7 @@ pygobject_set_properties(PyGObject *self, PyObject *args, PyObject *kwargs) pos = 0; while (kwargs && PyDict_Next (kwargs, &pos, &key, &value)) { - gchar *key_str = _PyUnicode_AsString(key); + gchar *key_str = PYGLIB_PyUnicode_AsString(key); GParamSpec *pspec; pspec = g_object_class_find_property(class, key_str); @@ -1468,14 +1534,18 @@ pygobject_connect(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, G_OBJECT_TYPE(self->obj), &sigid, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } extra_args = PySequence_GetSlice(args, 2, len); if (extra_args == NULL) return NULL; - closure = pyg_closure_new(callback, extra_args, NULL); + + closure = pygi_signal_closure_new(self, name, callback, extra_args, NULL); + if (closure == NULL) + closure = pyg_closure_new(callback, extra_args, NULL); + pygobject_watch_closure((PyObject *)self, closure); handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail, closure, FALSE); @@ -1517,14 +1587,18 @@ pygobject_connect_after(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, G_OBJECT_TYPE(self->obj), &sigid, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } extra_args = PySequence_GetSlice(args, 2, len); if (extra_args == NULL) return NULL; - closure = pyg_closure_new(callback, extra_args, NULL); + + closure = pygi_signal_closure_new(self, name, callback, extra_args, NULL); + if (closure == NULL) + closure = pyg_closure_new(callback, extra_args, NULL); + pygobject_watch_closure((PyObject *)self, closure); handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail, closure, TRUE); @@ -1566,14 +1640,18 @@ pygobject_connect_object(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, G_OBJECT_TYPE(self->obj), &sigid, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } extra_args = PySequence_GetSlice(args, 3, len); if (extra_args == NULL) return NULL; - closure = pyg_closure_new(callback, extra_args, object); + + closure = pygi_signal_closure_new(self, name, callback, extra_args, object); + if (closure == NULL) + closure = pyg_closure_new(callback, extra_args, object); + pygobject_watch_closure((PyObject *)self, closure); handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail, closure, FALSE); @@ -1615,14 +1693,18 @@ pygobject_connect_object_after(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, G_OBJECT_TYPE(self->obj), &sigid, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } extra_args = PySequence_GetSlice(args, 3, len); if (extra_args == NULL) return NULL; - closure = pyg_closure_new(callback, extra_args, object); + + closure = pygi_signal_closure_new(self, name, callback, extra_args, object); + if (closure == NULL) + closure = pyg_closure_new(callback, extra_args, object); + pygobject_watch_closure((PyObject *)self, closure); handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail, closure, TRUE); @@ -1714,7 +1796,7 @@ pygobject_emit(PyGObject *self, PyObject *args) if (!g_signal_parse_name(name, G_OBJECT_TYPE(self->obj), &signal_id, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), name); return NULL; } @@ -1790,7 +1872,7 @@ pygobject_stop_emission(PyGObject *self, PyObject *args) if (!g_signal_parse_name(signal, G_OBJECT_TYPE(self->obj), &signal_id, &detail, TRUE)) { PyErr_Format(PyExc_TypeError, "%s: unknown signal name: %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)self)), + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)self)), signal); return NULL; } @@ -1938,7 +2020,7 @@ pygobject_disconnect_by_func(PyGObject *self, PyObject *args) closure = gclosure_from_pyfunc(self, pyfunc); if (!closure) { PyErr_Format(PyExc_TypeError, "nothing connected to %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)pyfunc))); + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)pyfunc))); return NULL; } @@ -1947,7 +2029,7 @@ pygobject_disconnect_by_func(PyGObject *self, PyObject *args) 0, 0, closure, NULL, NULL); - return _PyLong_FromLong(retval); + return PYGLIB_PyLong_FromLong(retval); } static PyObject * @@ -1970,7 +2052,7 @@ pygobject_handler_block_by_func(PyGObject *self, PyObject *args) closure = gclosure_from_pyfunc(self, pyfunc); if (!closure) { PyErr_Format(PyExc_TypeError, "nothing connected to %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)pyfunc))); + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)pyfunc))); return NULL; } @@ -1979,7 +2061,7 @@ pygobject_handler_block_by_func(PyGObject *self, PyObject *args) 0, 0, closure, NULL, NULL); - return _PyLong_FromLong(retval); + return PYGLIB_PyLong_FromLong(retval); } static PyObject * @@ -2002,7 +2084,7 @@ pygobject_handler_unblock_by_func(PyGObject *self, PyObject *args) closure = gclosure_from_pyfunc(self, pyfunc); if (!closure) { PyErr_Format(PyExc_TypeError, "nothing connected to %s", - _PyUnicode_AsString(PyObject_Repr((PyObject*)pyfunc))); + PYGLIB_PyUnicode_AsString(PyObject_Repr((PyObject*)pyfunc))); return NULL; } @@ -2011,7 +2093,7 @@ pygobject_handler_unblock_by_func(PyGObject *self, PyObject *args) 0, 0, closure, NULL, NULL); - return _PyLong_FromLong(retval); + return PYGLIB_PyLong_FromLong(retval); } static PyMethodDef pygobject_methods[] = { @@ -2020,7 +2102,7 @@ static PyMethodDef pygobject_methods[] = { { "get_property", (PyCFunction)pygobject_get_property, METH_VARARGS }, { "get_properties", (PyCFunction)pygobject_get_properties, METH_VARARGS }, { "set_property", (PyCFunction)pygobject_set_property, METH_VARARGS }, - { "set_properties", (PyCFunction)pygobject_set_properties, METH_KEYWORDS }, + { "set_properties", (PyCFunction)pygobject_set_properties, METH_VARARGS|METH_KEYWORDS }, { "freeze_notify", (PyCFunction)pygobject_freeze_notify, METH_VARARGS }, { "notify", (PyCFunction)pygobject_notify, METH_VARARGS }, { "thaw_notify", (PyCFunction)pygobject_thaw_notify, METH_VARARGS }, @@ -2066,7 +2148,7 @@ pygobject_get_dict(PyGObject *self, void *closure) static PyObject * pygobject_get_refcount(PyGObject *self, void *closure) { - return _PyLong_FromLong(self->obj->ref_count); + return PYGLIB_PyLong_FromLong(self->obj->ref_count); } static int @@ -2252,6 +2334,7 @@ pygobject_object_register_types(PyObject *d) pygobject_has_updated_constructor_key = g_quark_from_static_string("PyGObject::has-updated-constructor"); pygobject_instance_data_key = g_quark_from_static_string("PyGObject::instance-data"); + pygobject_ref_sunk_key = g_quark_from_static_string("PyGObject::ref-sunk"); /* GObject */ if (!PY_TYPE_OBJECT) @@ -2259,7 +2342,7 @@ pygobject_object_register_types(PyObject *d) pyobject_copy, pyobject_free); PyGObject_Type.tp_dealloc = (destructor)pygobject_dealloc; - PyGObject_Type.tp_compare = (cmpfunc)pygobject_compare; + PyGObject_Type.tp_richcompare = pygobject_richcompare; PyGObject_Type.tp_repr = (reprfunc)pygobject_repr; PyGObject_Type.tp_hash = (hashfunc)pygobject_hash; PyGObject_Type.tp_setattro = (setattrofunc)pygobject_setattro; @@ -2302,7 +2385,7 @@ pygobject_object_register_types(PyObject *d) descr = PyObject_New(PyObject, &PyGPropsDescr_Type); PyDict_SetItemString(PyGObject_Type.tp_dict, "props", descr); PyDict_SetItemString(PyGObject_Type.tp_dict, "__module__", - o=_PyUnicode_FromString("gobject._gobject")); + o=PYGLIB_PyUnicode_FromString("gobject._gobject")); Py_DECREF(o); /* GPropsIter */ diff --git a/gobject/pygobject.h b/gobject/pygobject.h index 85d8bca..21743ba 100644 --- a/gobject/pygobject.h +++ b/gobject/pygobject.h @@ -198,6 +198,7 @@ struct _PyGObject_Functions { gpointer data); gboolean (*gerror_exception_check) (GError **error); PyObject* (*option_group_new) (GOptionGroup *group); + GType (* type_from_object_strict) (PyObject *obj, gboolean strict); }; #ifndef _INSIDE_PYGOBJECT_ @@ -218,6 +219,7 @@ struct _PyGObject_Functions *_PyGObject_API; #define pygobject_watch_closure (_PyGObject_API->object_watch_closure) #define pyg_closure_set_exception_handler (_PyGObject_API->closure_set_exception_handler) #define pyg_destroy_notify (_PyGObject_API->destroy_notify) +#define pyg_type_from_object_strict (_PyGObject_API->type_from_object_strict) #define pyg_type_from_object (_PyGObject_API->type_from_object) #define pyg_type_wrapper_new (_PyGObject_API->type_wrapper_new) #define pyg_enum_get_value (_PyGObject_API->enum_get_value) @@ -317,9 +319,32 @@ pygobject_init(int req_major, int req_minor, int req_micro) Py_XDECREF(type); Py_XDECREF(value); Py_XDECREF(traceback); + + +#if PY_VERSION_HEX < 0x03000000 PyErr_Format(PyExc_ImportError, "could not import gobject (error was: %s)", PyString_AsString(py_orig_exc)); +#else + { + /* Can not use PyErr_Format because it doesn't have + * a format string for dealing with PyUnicode objects + * like PyUnicode_FromFormat has + */ + PyObject *errmsg = PyUnicode_FromFormat("could not import gobject (error was: %U)", + py_orig_exc); + + if (errmsg) { + PyErr_SetObject(PyExc_ImportError, + errmsg); + Py_DECREF(errmsg); + } + /* if errmsg is NULL then we might have OOM + * PyErr should already be set and trying to + * return our own error would be futile + */ + } +#endif Py_DECREF(py_orig_exc); } else { PyErr_SetString(PyExc_ImportError, @@ -329,8 +354,14 @@ pygobject_init(int req_major, int req_minor, int req_micro) } cobject = PyObject_GetAttrString(gobject, "_PyGObject_API"); +#if PY_VERSION_HEX >= 0x03000000 + if (cobject && PyCapsule_CheckExact(cobject)) + _PyGObject_API = (struct _PyGObject_Functions *) PyCapsule_GetPointer(cobject, "gobject._PyGObject_API"); + +#else if (cobject && PyCObject_Check(cobject)) _PyGObject_API = (struct _PyGObject_Functions *) PyCObject_AsVoidPtr(cobject); +#endif else { PyErr_SetString(PyExc_ImportError, "could not import gobject (could not find _PyGObject_API object)"); diff --git a/gobject/pygparamspec.c b/gobject/pygparamspec.c index be3840b..7743629 100644 --- a/gobject/pygparamspec.c +++ b/gobject/pygparamspec.c @@ -32,12 +32,17 @@ PYGLIB_DEFINE_TYPE("gobject.GParamSpec", PyGParamSpec_Type, PyGParamSpec); -static int -pyg_param_spec_compare(PyGParamSpec *self, PyGParamSpec *v) +static PyObject* +pyg_param_spec_richcompare(PyObject *self, PyObject *other, int op) { - if (self->pspec == v->pspec) return 0; - if (self->pspec > v->pspec) return -1; - return 1; + if (Py_TYPE(self) == Py_TYPE(other) && Py_TYPE(self) == &PyGParamSpec_Type) + return _pyglib_generic_ptr_richcompare(((PyGParamSpec*)self)->pspec, + ((PyGParamSpec*)other)->pspec, + op); + else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static long @@ -54,7 +59,7 @@ pyg_param_spec_repr(PyGParamSpec *self) g_snprintf(buf, sizeof(buf), "<%s '%s'>", G_PARAM_SPEC_TYPE_NAME(self->pspec), g_param_spec_get_name(self->pspec)); - return _PyUnicode_FromString(buf); + return PYGLIB_PyUnicode_FromString(buf); } static void @@ -121,7 +126,7 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) } else if (!strcmp(attr, "blurb") || !strcmp(attr, "__doc__")) { return Py_BuildValue("s", g_param_spec_get_blurb(pspec)); } else if (!strcmp(attr, "flags")) { - return _PyLong_FromLong(pspec->flags); + return PYGLIB_PyLong_FromLong(pspec->flags); } else if (!strcmp(attr, "value_type")) { return pyg_type_wrapper_new(pspec->value_type); } else if (!strcmp(attr, "owner_type")) { @@ -135,12 +140,12 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) "maximum", "minimum", "name", "nick", "owner_type", "value_type"); } else if (!strcmp(attr, "default_value")) { - return _PyUnicode_FromFormat( + return PYGLIB_PyUnicode_FromFormat( "%c", G_PARAM_SPEC_CHAR(pspec)->default_value); } else if (!strcmp(attr, "minimum")) { - return _PyLong_FromLong(G_PARAM_SPEC_CHAR(pspec)->minimum); + return PYGLIB_PyLong_FromLong(G_PARAM_SPEC_CHAR(pspec)->minimum); } else if (!strcmp(attr, "maximum")) { - return _PyLong_FromLong(G_PARAM_SPEC_CHAR(pspec)->maximum); + return PYGLIB_PyLong_FromLong(G_PARAM_SPEC_CHAR(pspec)->maximum); } } else if (G_IS_PARAM_SPEC_UCHAR(pspec)) { if (!strcmp(attr, "__members__")) { @@ -150,12 +155,12 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) "name", "nick", "owner_type", "value_type"); } else if (!strcmp(attr, "default_value")) { - return _PyUnicode_FromFormat( + return PYGLIB_PyUnicode_FromFormat( "%c", G_PARAM_SPEC_UCHAR(pspec)->default_value); } else if (!strcmp(attr, "minimum")) { - return _PyLong_FromLong(G_PARAM_SPEC_UCHAR(pspec)->minimum); + return PYGLIB_PyLong_FromLong(G_PARAM_SPEC_UCHAR(pspec)->minimum); } else if (!strcmp(attr, "maximum")) { - return _PyLong_FromLong(G_PARAM_SPEC_UCHAR(pspec)->maximum); + return PYGLIB_PyLong_FromLong(G_PARAM_SPEC_UCHAR(pspec)->maximum); } } else if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) { if (!strcmp(attr, "__members__")) { @@ -173,11 +178,11 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) "flags", "maximum", "minimum", "name", "nick", "owner_type", "value_type"); } else if (!strcmp(attr, "default_value")) { - return _PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->default_value); + return PYGLIB_PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->default_value); } else if (!strcmp(attr, "minimum")) { - return _PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->minimum); + return PYGLIB_PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->minimum); } else if (!strcmp(attr, "maximum")) { - return _PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->maximum); + return PYGLIB_PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->maximum); } } else if (G_IS_PARAM_SPEC_UINT(pspec)) { if (!strcmp(attr, "__members__")) { @@ -253,7 +258,7 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) "flags", "name", "nick", "owner_type", "value_type"); } else if (!strcmp(attr, "default_value")) { - return _PyUnicode_FromFormat( + return PYGLIB_PyUnicode_FromFormat( "%c", G_PARAM_SPEC_UNICHAR(pspec)->default_value); } } else if (G_IS_PARAM_SPEC_ENUM(pspec)) { @@ -387,10 +392,12 @@ pygobject_paramspec_register_types(PyObject *d) Py_TYPE(&PyGParamSpec_Type) = &PyType_Type; PyGParamSpec_Type.tp_dealloc = (destructor)pyg_param_spec_dealloc; PyGParamSpec_Type.tp_getattr = (getattrfunc)pyg_param_spec_getattr; - PyGParamSpec_Type.tp_compare = (cmpfunc)pyg_param_spec_compare; + PyGParamSpec_Type.tp_richcompare = pyg_param_spec_richcompare; + PyGParamSpec_Type.tp_flags = Py_TPFLAGS_DEFAULT; PyGParamSpec_Type.tp_repr = (reprfunc)pyg_param_spec_repr; PyGParamSpec_Type.tp_hash = (hashfunc)pyg_param_spec_hash; + if (PyType_Ready(&PyGParamSpec_Type)) return; PyDict_SetItemString(d, "GParamSpec", (PyObject *)&PyGParamSpec_Type); diff --git a/gobject/pygpointer.c b/gobject/pygpointer.c index 5f6417f..575c751 100644 --- a/gobject/pygpointer.c +++ b/gobject/pygpointer.c @@ -28,7 +28,7 @@ #include "pygobject-private.h" #include "pygpointer.h" -#include "pygi-external.h" +#include "pygi.h" GQuark pygpointer_class_key; @@ -41,12 +41,17 @@ pyg_pointer_dealloc(PyGPointer *self) Py_TYPE(self)->tp_free((PyObject *)self); } -static int -pyg_pointer_compare(PyGPointer *self, PyGPointer *v) +static PyObject* +pyg_pointer_richcompare(PyObject *self, PyObject *other, int op) { - if (self->pointer == v->pointer) return 0; - if (self->pointer > v->pointer) return -1; - return 1; + if (Py_TYPE(self) == Py_TYPE(other)) + return _pyglib_generic_ptr_richcompare(((PyGPointer*)self)->pointer, + ((PyGPointer*)other)->pointer, + op); + else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static long @@ -62,7 +67,7 @@ pyg_pointer_repr(PyGPointer *self) g_snprintf(buf, sizeof(buf), "<%s at 0x%lx>", g_type_name(self->gtype), (long)self->pointer); - return _PyUnicode_FromString(buf); + return PYGLIB_PyUnicode_FromString(buf); } static int @@ -183,7 +188,7 @@ pygobject_pointer_register_types(PyObject *d) pygpointer_class_key = g_quark_from_static_string("PyGPointer::class"); PyGPointer_Type.tp_dealloc = (destructor)pyg_pointer_dealloc; - PyGPointer_Type.tp_compare = (cmpfunc)pyg_pointer_compare; + PyGPointer_Type.tp_richcompare = pyg_pointer_richcompare; PyGPointer_Type.tp_repr = (reprfunc)pyg_pointer_repr; PyGPointer_Type.tp_hash = (hashfunc)pyg_pointer_hash; PyGPointer_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; diff --git a/gobject/pygtype.c b/gobject/pygtype.c index 5550ce8..5ee54aa 100644 --- a/gobject/pygtype.c +++ b/gobject/pygtype.c @@ -39,12 +39,17 @@ typedef struct { PYGLIB_DEFINE_TYPE("gobject.GType", PyGTypeWrapper_Type, PyGTypeWrapper); -static int -pyg_type_wrapper_compare(PyGTypeWrapper *self, PyGTypeWrapper *v) +static PyObject* +pyg_type_wrapper_richcompare(PyObject *self, PyObject *other, int op) { - if (self->type == v->type) return 0; - if (self->type > v->type) return -1; - return 1; + if (Py_TYPE(self) == Py_TYPE(other) && Py_TYPE(self) == &PyGTypeWrapper_Type) + return _pyglib_generic_long_richcompare(((PyGTypeWrapper*)self)->type, + ((PyGTypeWrapper*)other)->type, + op); + else { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } } static long @@ -61,7 +66,7 @@ pyg_type_wrapper_repr(PyGTypeWrapper *self) g_snprintf(buf, sizeof(buf), "", name?name:"invalid", (unsigned long int) self->type); - return _PyUnicode_FromString(buf); + return PYGLIB_PyUnicode_FromString(buf); } static void @@ -134,7 +139,7 @@ static PyObject * _wrap_g_type_wrapper__get_name(PyGTypeWrapper *self, void *closure) { const char *name = g_type_name(self->type); - return _PyUnicode_FromString(name ? name : "invalid"); + return PYGLIB_PyUnicode_FromString(name ? name : "invalid"); } static PyObject * @@ -155,14 +160,14 @@ _wrap_g_type_wrapper__get_children(PyGTypeWrapper *self, void *closure) guint n_children, i; GType *children; PyObject *retval; - + children = g_type_children(self->type, &n_children); retval = PyList_New(n_children); for (i = 0; i < n_children; i++) PyList_SetItem(retval, i, pyg_type_wrapper_new(children[i])); g_free(children); - + return retval; } @@ -172,21 +177,21 @@ _wrap_g_type_wrapper__get_interfaces(PyGTypeWrapper *self, void *closure) guint n_interfaces, i; GType *interfaces; PyObject *retval; - + interfaces = g_type_interfaces(self->type, &n_interfaces); retval = PyList_New(n_interfaces); for (i = 0; i < n_interfaces; i++) PyList_SetItem(retval, i, pyg_type_wrapper_new(interfaces[i])); g_free(interfaces); - + return retval; } static PyObject * _wrap_g_type_wrapper__get_depth(PyGTypeWrapper *self, void *closure) { - return _PyLong_FromLong(g_type_depth(self->type)); + return PYGLIB_PyLong_FromLong(g_type_depth(self->type)); } static PyGetSetDef _PyGTypeWrapper_getsets[] = { @@ -259,7 +264,7 @@ _wrap_g_type_from_name(PyGTypeWrapper *_, PyObject *args) { char *type_name; GType type; - + if (!PyArg_ParseTuple(args, "s:GType.from_name", &type_name)) return NULL; @@ -282,7 +287,7 @@ _wrap_g_type_is_a(PyGTypeWrapper *self, PyObject *args) return NULL; else if ((parent = pyg_type_from_object(gparent)) == 0) return NULL; - + return PyBool_FromLong(g_type_is_a(self->type, parent)); } @@ -300,14 +305,14 @@ static PyMethodDef _PyGTypeWrapper_methods[] = { { "is_a", (PyCFunction)_wrap_g_type_is_a, METH_VARARGS }, { NULL, 0, 0 } }; - + static int pyg_type_wrapper_init(PyGTypeWrapper *self, PyObject *args, PyObject *kwargs) { static char *kwlist[] = { "object", NULL }; PyObject *py_object; GType type; - + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GType.__init__", kwlist, &py_object)) @@ -344,16 +349,20 @@ pyg_type_wrapper_new(GType type) } /** - * pyg_type_from_object: + * pyg_type_from_object_strict: * obj: a Python object + * strict: if set to TRUE, raises an exception if it can't perform the + * conversion * - * converts a python object to a GType. Raises an exception if it - * can't perform the conversion. + * converts a python object to a GType. If strict is set, raises an + * exception if it can't perform the conversion, otherwise returns + * PY_TYPE_OBJECT. * * Returns: the corresponding GType, or 0 on error. */ + GType -pyg_type_from_object(PyObject *obj) +pyg_type_from_object_strict(PyObject *obj, gboolean strict) { PyObject *gtype; GType type; @@ -370,7 +379,7 @@ pyg_type_from_object(PyObject *obj) if (PyType_Check(obj)) { PyTypeObject *tp = (PyTypeObject *)obj; - if (tp == &_PyLong_Type) + if (tp == &PYGLIB_PyLong_Type) return G_TYPE_INT; else if (tp == &PyBool_Type) return G_TYPE_BOOLEAN; @@ -378,7 +387,7 @@ pyg_type_from_object(PyObject *obj) return G_TYPE_LONG; else if (tp == &PyFloat_Type) return G_TYPE_DOUBLE; - else if (tp == &_PyUnicode_Type) + else if (tp == &PYGLIB_PyUnicode_Type) return G_TYPE_STRING; else if (tp == &PyBaseObject_Type) return PY_TYPE_OBJECT; @@ -389,9 +398,9 @@ pyg_type_from_object(PyObject *obj) } /* handle strings */ - if (_PyUnicode_Check(obj)) { - gchar *name = _PyUnicode_AsString(obj); - + if (PYGLIB_PyUnicode_Check(obj)) { + gchar *name = PYGLIB_PyUnicode_AsString(obj); + type = _pyg_type_from_name(name); if (type != 0) { return type; @@ -411,10 +420,35 @@ pyg_type_from_object(PyObject *obj) } PyErr_Clear(); + + /* Some API like those that take GValues can hold a python object as + * a pointer. This is potentially dangerous becuase everything is + * passed in as a PyObject so we can't actually type check it. Only + * fallback to PY_TYPE_OBJECT if strict checking is disabled + */ + if (!strict) + return PY_TYPE_OBJECT; + PyErr_SetString(PyExc_TypeError, "could not get typecode from object"); return 0; } +/** + * pyg_type_from_object: + * obj: a Python object + * + * converts a python object to a GType. Raises an exception if it + * can't perform the conversion. + * + * Returns: the corresponding GType, or 0 on error. + */ +GType +pyg_type_from_object(PyObject *obj) +{ + /* Legacy call always defaults to strict type checking */ + return pyg_type_from_object_strict(obj, TRUE); +} + /* -------------- GValue marshalling ------------------ */ /** @@ -440,8 +474,8 @@ pyg_enum_get_value(GType enum_type, PyObject *obj, gint *val) if (!obj) { *val = 0; res = 0; - } else if (_PyLong_Check(obj)) { - *val = _PyLong_AsLong(obj); + } else if (PYGLIB_PyLong_Check(obj)) { + *val = PYGLIB_PyLong_AsLong(obj); res = 0; if (PyObject_TypeCheck(obj, &PyGEnum_Type) && ((PyGEnum *) obj)->gtype != enum_type) { @@ -459,10 +493,10 @@ pyg_enum_get_value(GType enum_type, PyObject *obj, gint *val) g_type_name(enum_type), g_type_name(((PyGEnum *) obj)->gtype)); } - } else if (_PyUnicode_Check(obj)) { + } else if (PYGLIB_PyUnicode_Check(obj)) { GEnumValue *info; - char *str = _PyUnicode_AsString(obj); - + char *str = PYGLIB_PyUnicode_AsString(obj); + if (enum_type != G_TYPE_NONE) eclass = G_ENUM_CLASS(g_type_class_ref(enum_type)); else { @@ -513,15 +547,15 @@ pyg_flags_get_value(GType flag_type, PyObject *obj, gint *val) if (!obj) { *val = 0; res = 0; - } else if (_PyLong_Check(obj)) { - *val = _PyLong_AsLong(obj); + } else if (PYGLIB_PyLong_Check(obj)) { + *val = PYGLIB_PyLong_AsLong(obj); res = 0; } else if (PyLong_Check(obj)) { *val = PyLong_AsLongLong(obj); res = 0; - } else if (_PyUnicode_Check(obj)) { + } else if (PYGLIB_PyUnicode_Check(obj)) { GFlagsValue *info; - char *str = _PyUnicode_AsString(obj); + char *str = PYGLIB_PyUnicode_AsString(obj); if (flag_type != G_TYPE_NONE) fclass = G_FLAGS_CLASS(g_type_class_ref(flag_type)); @@ -531,7 +565,7 @@ pyg_flags_get_value(GType flag_type, PyObject *obj, gint *val) } info = g_flags_get_value_by_name(fclass, str); g_type_class_unref(fclass); - + if (!info) info = g_flags_get_value_by_nick(fclass, str); if (info) { @@ -557,7 +591,7 @@ pyg_flags_get_value(GType flag_type, PyObject *obj, gint *val) for (i = 0; i < len; i++) { PyObject *item = PyTuple_GetItem(obj, i); - char *str = _PyUnicode_AsString(item); + char *str = PYGLIB_PyUnicode_AsString(item); GFlagsValue *info = g_flags_get_value_by_name(fclass, str); if (!info) @@ -644,7 +678,7 @@ pyg_value_array_from_pyobject(GValue *value, if (pspec && pspec->fixed_n_elements > 0 && len != pspec->fixed_n_elements) return -1; - + value_array = g_value_array_new(len); for (i = 0; i < len; ++i) { @@ -731,24 +765,36 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) } break; case G_TYPE_CHAR: - if ((tmp = PyObject_Str(obj))) - g_value_set_char(value, _PyUnicode_AsString(tmp)[0]); - else { +#if PY_VERSION_HEX < 0x03000000 + if (PyString_Check(obj)) { + g_value_set_char(value, PyString_AsString(obj)[0]); + } else +#endif + if (PyUnicode_Check(obj)) { + tmp = PyUnicode_AsUTF8String(obj); + g_value_set_char(value, PYGLIB_PyBytes_AsString(tmp)[0]); + Py_DECREF(tmp); + } else { PyErr_Clear(); return -1; } - Py_DECREF(tmp); + break; case G_TYPE_UCHAR: - if (_PyLong_Check(obj)) { - glong val; - val = _PyLong_AsLong(obj); + if (PYGLIB_PyLong_Check(obj)) { + glong val; + val = PYGLIB_PyLong_AsLong(obj); if (val >= 0 && val <= 255) - g_value_set_uchar(value, (guchar)_PyLong_AsLong (obj)); + g_value_set_uchar(value, (guchar)PYGLIB_PyLong_AsLong (obj)); else return -1; - } else if ((tmp = PyObject_Str(obj))) { - g_value_set_uchar(value, _PyUnicode_AsString(tmp)[0]); +#if PY_VERSION_HEX < 0x03000000 + } else if (PyString_Check(obj)) { + g_value_set_uchar(value, PyString_AsString(obj)[0]); +#endif + } else if (PyUnicode_Check(obj)) { + tmp = PyUnicode_AsUTF8String(obj); + g_value_set_uchar(value, PYGLIB_PyBytes_AsString(tmp)[0]); Py_DECREF(tmp); } else { PyErr_Clear(); @@ -759,14 +805,14 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) g_value_set_boolean(value, PyObject_IsTrue(obj)); break; case G_TYPE_INT: - g_value_set_int(value, _PyLong_AsLong(obj)); + g_value_set_int(value, PYGLIB_PyLong_AsLong(obj)); break; case G_TYPE_UINT: { - if (_PyLong_Check(obj)) { + if (PYGLIB_PyLong_Check(obj)) { glong val; - val = _PyLong_AsLong(obj); + val = PYGLIB_PyLong_AsLong(obj); if (val >= 0 && val <= G_MAXUINT) g_value_set_uint(value, (guint)val); else @@ -777,23 +823,26 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) } break; case G_TYPE_LONG: - g_value_set_long(value, _PyLong_AsLong(obj)); + g_value_set_long(value, PYGLIB_PyLong_AsLong(obj)); break; case G_TYPE_ULONG: - { - if (_PyLong_Check(obj)) { - glong val; +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(obj)) { + long val; - val = _PyLong_AsLong(obj); - if (val >= 0) - g_value_set_ulong(value, (gulong)val); - else - return -1; - } else { - g_value_set_ulong(value, PyLong_AsUnsignedLong(obj)); - } - } - break; + val = PYGLIB_PyLong_AsLong(obj); + if (val < 0) { + PyErr_SetString(PyExc_OverflowError, "negative value not allowed for uint64 property"); + return -1; + } + g_value_set_ulong(value, (gulong)val); + } else +#endif + if (PyLong_Check(obj)) + g_value_set_ulong(value, PyLong_AsUnsignedLong(obj)); + else + return -1; + break; case G_TYPE_INT64: g_value_set_int64(value, PyLong_AsLongLong(obj)); break; @@ -840,14 +889,29 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) g_value_set_double(value, PyFloat_AsDouble(obj)); break; case G_TYPE_STRING: - if (obj == Py_None) + if (obj == Py_None) { g_value_set_string(value, NULL); - else if ((tmp = PyObject_Str(obj))) { - g_value_set_string(value, _PyUnicode_AsString(tmp)); - Py_DECREF(tmp); } else { - PyErr_Clear(); - return -1; + PyObject* tmp_str = PyObject_Str(obj); + if (tmp_str == NULL) { + PyErr_Clear(); + if (PyUnicode_Check(obj)) { + tmp = PyUnicode_AsUTF8String(obj); + g_value_set_string(value, PYGLIB_PyBytes_AsString(tmp)); + Py_DECREF(tmp); + } else { + return -1; + } + } else { +#if PY_VERSION_HEX < 0x03000000 + g_value_set_string(value, PyString_AsString(tmp_str)); +#else + tmp = PyUnicode_AsUTF8String(tmp_str); + g_value_set_string(value, PyBytes_AsString(tmp)); + Py_DECREF(tmp); +#endif + } + Py_XDECREF(tmp_str); } break; case G_TYPE_POINTER: @@ -856,8 +920,8 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) else if (PyObject_TypeCheck(obj, &PyGPointer_Type) && G_VALUE_HOLDS(value, ((PyGPointer *)obj)->gtype)) g_value_set_pointer(value, pyg_pointer_get(obj, gpointer)); - else if (PyCObject_Check(obj)) - g_value_set_pointer(value, PyCObject_AsVoidPtr(obj)); + else if (PYGLIB_CPointer_Check(obj)) + g_value_set_pointer(value, PYGLIB_CPointer_GetPointer(obj, NULL)); else return -1; break; @@ -873,8 +937,8 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) g_value_set_boxed(value, pyg_boxed_get(obj, gpointer)); else if (G_VALUE_HOLDS(value, G_TYPE_VALUE)) { GType type; - GValue *n_value; - + GValue *n_value; + type = pyg_type_from_object((PyObject*)Py_TYPE(obj)); if (G_UNLIKELY (! type)) { PyErr_Clear(); @@ -888,12 +952,12 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) else if (PySequence_Check(obj) && G_VALUE_HOLDS(value, G_TYPE_VALUE_ARRAY)) return pyg_value_array_from_pyobject(value, obj, NULL); - else if (_PyUnicode_Check(obj) && + else if (PYGLIB_PyUnicode_Check(obj) && G_VALUE_HOLDS(value, G_TYPE_GSTRING)) { GString *string; char *buffer; Py_ssize_t len; - if (_PyUnicode_AsStringAndSize(obj, &buffer, &len)) + if (PYGLIB_PyUnicode_AsStringAndSize(obj, &buffer, &len)) return -1; string = g_string_new_len(buffer, len); g_value_set_boxed(value, string); @@ -902,15 +966,15 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) } else if ((bm = pyg_type_lookup(G_VALUE_TYPE(value))) != NULL) return bm->tovalue(value, obj); - else if (PyCObject_Check(obj)) - g_value_set_boxed(value, PyCObject_AsVoidPtr(obj)); + else if (PYGLIB_CPointer_Check(obj)) + g_value_set_boxed(value, PYGLIB_CPointer_GetPointer(obj, NULL)); else return -1; break; } case G_TYPE_PARAM: if (PyGParamSpec_Check(obj)) - g_value_set_param(value, PyCObject_AsVoidPtr(obj)); + g_value_set_param(value, PYGLIB_CPointer_GetPointer(obj, NULL)); else return -1; break; @@ -958,22 +1022,22 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) switch (G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value))) { case G_TYPE_INTERFACE: if (g_type_is_a(G_VALUE_TYPE(value), G_TYPE_OBJECT)) - return pygobject_new(g_value_get_object(value)); + return pygobject_new_sunk(g_value_get_object(value)); else break; case G_TYPE_CHAR: { gint8 val = g_value_get_char(value); - return _PyUnicode_FromStringAndSize((char *)&val, 1); + return PYGLIB_PyUnicode_FromStringAndSize((char *)&val, 1); } case G_TYPE_UCHAR: { guint8 val = g_value_get_uchar(value); - return _PyUnicode_FromStringAndSize((char *)&val, 1); + return PYGLIB_PyBytes_FromStringAndSize((char *)&val, 1); } case G_TYPE_BOOLEAN: { return PyBool_FromLong(g_value_get_boolean(value)); } case G_TYPE_INT: - return _PyLong_FromLong(g_value_get_int(value)); + return PYGLIB_PyLong_FromLong(g_value_get_int(value)); case G_TYPE_UINT: { /* in Python, the Int object is backed by a long. If a @@ -981,19 +1045,19 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) an Int. Otherwise, use a Long object to avoid overflow. This matches the ULongArg behavior in codegen/argtypes.h */ #if (G_MAXUINT <= G_MAXLONG) - return _PyLong_FromLong((glong) g_value_get_uint(value)); + return PYGLIB_PyLong_FromLong((glong) g_value_get_uint(value)); #else return PyLong_FromUnsignedLong((gulong) g_value_get_uint(value)); #endif } case G_TYPE_LONG: - return _PyLong_FromLong(g_value_get_long(value)); + return PYGLIB_PyLong_FromLong(g_value_get_long(value)); case G_TYPE_ULONG: { gulong val = g_value_get_ulong(value); if (val <= G_MAXLONG) - return _PyLong_FromLong((glong) val); + return PYGLIB_PyLong_FromLong((glong) val); else return PyLong_FromUnsignedLong(val); } @@ -1002,7 +1066,7 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) gint64 val = g_value_get_int64(value); if (G_MINLONG <= val && val <= G_MAXLONG) - return _PyLong_FromLong((glong) val); + return PYGLIB_PyLong_FromLong((glong) val); else return PyLong_FromLongLong(val); } @@ -1011,7 +1075,7 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) guint64 val = g_value_get_uint64(value); if (val <= G_MAXLONG) - return _PyLong_FromLong((glong) val); + return PYGLIB_PyLong_FromLong((glong) val); else return PyLong_FromUnsignedLongLong(val); } @@ -1028,7 +1092,7 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) const gchar *str = g_value_get_string(value); if (str) - return _PyUnicode_FromString(str); + return PYGLIB_PyUnicode_FromString(str); Py_INCREF(Py_None); return Py_None; } @@ -1058,9 +1122,9 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) return ret; } else if (G_VALUE_HOLDS(value, G_TYPE_GSTRING)) { GString *string = (GString *) g_value_get_boxed(value); - PyObject *ret = _PyUnicode_FromStringAndSize(string->str, string->len); + PyObject *ret = PYGLIB_PyUnicode_FromStringAndSize(string->str, string->len); return ret; - } + } bm = pyg_type_lookup(G_VALUE_TYPE(value)); if (bm) { return bm->fromvalue(value); @@ -1076,7 +1140,7 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) case G_TYPE_PARAM: return pyg_param_spec_new(g_value_get_param(value)); case G_TYPE_OBJECT: - return pygobject_new(g_value_get_object(value)); + return pygobject_new_sunk(g_value_get_object(value)); default: { PyGTypeMarshal *bm; @@ -1157,18 +1221,18 @@ pyg_closure_marshal(GClosure *closure, PyErr_Print(); goto out; } - + if (return_value && pyg_value_from_pyobject(return_value, ret) != 0) { PyErr_SetString(PyExc_TypeError, "can't convert return value to desired type"); - + if (pc->exception_handler) pc->exception_handler(return_value, n_param_values, param_values); else PyErr_Print(); } Py_DECREF(ret); - + out: Py_DECREF(params); pyglib_gil_state_release(state); @@ -1220,7 +1284,7 @@ pyg_closure_new(PyObject *callback, PyObject *extra_args, PyObject *swap_data) * @handler: the handler to call when an exception occurs or NULL for none * * Sets the handler to call when an exception occurs during closure invocation. - * The handler is responsible for providing a proper return value to the + * The handler is responsible for providing a proper return value to the * closure invocation. If @handler is %NULL, the default handler will be used. * The default handler prints the exception to stderr and doesn't touch the * closure's return value. @@ -1230,7 +1294,7 @@ pyg_closure_set_exception_handler(GClosure *closure, PyClosureExceptionHandler handler) { PyGClosure *pygclosure; - + g_return_if_fail(closure != NULL); pygclosure = (PyGClosure *)closure; @@ -1265,14 +1329,14 @@ pyg_signal_class_closure_marshal(GClosure *closure, guint i, len; state = pyglib_gil_state_ensure(); - + g_return_if_fail(invocation_hint != NULL); /* get the object passed as the first argument to the closure */ object = g_value_get_object(¶m_values[0]); g_return_if_fail(object != NULL && G_IS_OBJECT(object)); /* get the wrapper for this object */ - object_wrapper = pygobject_new(object); + object_wrapper = pygobject_new_sunk(object); g_return_if_fail(object_wrapper != NULL); /* construct method name for this class closure */ @@ -1311,10 +1375,10 @@ pyg_signal_class_closure_marshal(GClosure *closure, } ret = PyObject_CallObject(method, params); - + /* Copy boxed values if others ref them, this needs to be done regardless of exception status. */ - len = PyTuple_Size(params); + len = PyTuple_Size(params); for (i = 0; i < len; i++) { PyObject *item = PyTuple_GetItem(params, i); if (item != NULL && PyObject_TypeCheck(item, &PyGBoxed_Type) @@ -1372,13 +1436,13 @@ gclosure_from_pyfunc(PyGObject *object, PyObject *func) GSList *l; PyGObjectData *inst_data; inst_data = pyg_object_peek_inst_data(object->obj); - if (inst_data) - { + if (inst_data) { for (l = inst_data->closures; l; l = l->next) { PyGClosure *pyclosure = l->data; - int res; - PyObject_Cmp(pyclosure->callback, func, &res); - if (!res) { + int res = PyObject_RichCompareBool(pyclosure->callback, func, Py_EQ); + if (res == -1) { + PyErr_Clear(); // Is there anything else to do? + } else if (res) { return (GClosure*)pyclosure; } } @@ -1464,7 +1528,7 @@ add_property_docs(GType gtype, GString *string) g_type_name(props[i]->value_type), g_param_spec_get_nick(props[i])); - /* g_string_append_printf crashes on win32 if the third + /* g_string_append_printf crashes on win32 if the third argument is NULL. */ blurb=g_param_spec_get_blurb(props[i]); if (blurb) @@ -1514,7 +1578,7 @@ object_doc_descr_get(PyObject *self, PyObject *obj, PyObject *type) g_array_append_val(parents, parent); parent = g_type_next_base(gtype, parent); } - + for (iparent = parents->len - 1; iparent >= 0; --iparent) { GType *interfaces; guint n_interfaces, i; @@ -1532,7 +1596,7 @@ object_doc_descr_get(PyObject *self, PyObject *obj, PyObject *type) g_array_free(parents, TRUE); } - pystring = _PyUnicode_FromStringAndSize(string->str, string->len); + pystring = PYGLIB_PyUnicode_FromStringAndSize(string->str, string->len); g_string_free(string, TRUE); return pystring; } @@ -1582,7 +1646,7 @@ int pyg_pyobj_to_unichar_conv(PyObject* py_obj, void* ptr) gunichar* u = ptr; const Py_UNICODE* uni_buffer; PyObject* tmp_uni = NULL; - + if (PyUnicode_Check(py_obj)) { tmp_uni = py_obj; Py_INCREF(tmp_uni); @@ -1592,7 +1656,7 @@ int pyg_pyobj_to_unichar_conv(PyObject* py_obj, void* ptr) if (tmp_uni == NULL) goto failure; } - + if ( PyUnicode_GetSize(tmp_uni) != 1) { PyErr_SetString(PyExc_ValueError, "unicode character value must be 1 character uniode string"); goto failure; @@ -1601,24 +1665,24 @@ int pyg_pyobj_to_unichar_conv(PyObject* py_obj, void* ptr) if ( uni_buffer == NULL) goto failure; *u = uni_buffer[0]; - + Py_DECREF(tmp_uni); return 1; - + failure: Py_XDECREF(tmp_uni); return 0; } -int -pyg_param_gvalue_from_pyobject(GValue* value, - PyObject* py_obj, +int +pyg_param_gvalue_from_pyobject(GValue* value, + PyObject* py_obj, const GParamSpec* pspec) { if (G_IS_PARAM_SPEC_UNICHAR(pspec)) { gunichar u; - + if (!pyg_pyobj_to_unichar_conv(py_obj, &u)) { PyErr_Clear(); return -1; @@ -1634,15 +1698,15 @@ pyg_param_gvalue_from_pyobject(GValue* value, } } -PyObject* +PyObject* pyg_param_gvalue_as_pyobject(const GValue* gvalue, - gboolean copy_boxed, + gboolean copy_boxed, const GParamSpec* pspec) { if (G_IS_PARAM_SPEC_UNICHAR(pspec)) { gunichar u; Py_UNICODE uni_buffer[2] = { 0, 0 }; - + u = g_value_get_uint(gvalue); uni_buffer[0] = u; return PyUnicode_FromUnicode(uni_buffer, 1); @@ -1663,7 +1727,7 @@ typedef struct { gpointer data; } CustomTypeData; -void +void pyg_type_register_custom_callback(const gchar *typename, PyGTypeRegistrationFunction callback, gpointer user_data) @@ -1688,7 +1752,7 @@ pyg_type_get_custom(const gchar *name) { CustomTypeData *data; PyTypeObject *retval; - + if (!custom_type_registration) return NULL; @@ -1713,7 +1777,7 @@ _pyg_type_from_name(const gchar *name) pyg_type_get_custom(name); type = g_type_from_name(name); } - + return type; } @@ -1730,7 +1794,7 @@ _pyg_strv_from_gvalue(const GValue *value) } py_argv = PyList_New(argc); for (i = 0; i < argc; ++i) - PyList_SET_ITEM(py_argv, i, _PyUnicode_FromString(argv[i])); + PyList_SET_ITEM(py_argv, i, PYGLIB_PyUnicode_FromString(argv[i])); return py_argv; } @@ -1745,11 +1809,11 @@ _pyg_strv_to_gvalue(GValue *value, PyObject *obj) argc = PySequence_Length(obj); for (i = 0; i < argc; ++i) - if (!_PyUnicode_Check(PySequence_Fast_GET_ITEM(obj, i))) + if (!PYGLIB_PyUnicode_Check(PySequence_Fast_GET_ITEM(obj, i))) return -1; argv = g_new(gchar *, argc + 1); for (i = 0; i < argc; ++i) - argv[i] = g_strdup(_PyUnicode_AsString(PySequence_Fast_GET_ITEM(obj, i))); + argv[i] = g_strdup(PYGLIB_PyUnicode_AsString(PySequence_Fast_GET_ITEM(obj, i))); argv[i] = NULL; g_value_take_boxed(value, argv); return 0; @@ -1759,7 +1823,7 @@ void pygobject_type_register_types(PyObject *d) { PyGTypeWrapper_Type.tp_dealloc = (destructor)pyg_type_wrapper_dealloc; - PyGTypeWrapper_Type.tp_compare = (cmpfunc)pyg_type_wrapper_compare; + PyGTypeWrapper_Type.tp_richcompare = pyg_type_wrapper_richcompare; PyGTypeWrapper_Type.tp_repr = (reprfunc)pyg_type_wrapper_repr; PyGTypeWrapper_Type.tp_hash = (hashfunc)pyg_type_wrapper_hash; PyGTypeWrapper_Type.tp_flags = Py_TPFLAGS_DEFAULT; @@ -1772,7 +1836,7 @@ pygobject_type_register_types(PyObject *d) PyGObjectDoc_Type.tp_dealloc = (destructor)object_doc_dealloc; PyGObjectDoc_Type.tp_flags = Py_TPFLAGS_DEFAULT; PyGObjectDoc_Type.tp_descr_get = (descrgetfunc)object_doc_descr_get; - + pyg_register_gtype_custom(G_TYPE_STRV, _pyg_strv_from_gvalue, _pyg_strv_to_gvalue); diff --git a/ltmain.sh b/ltmain.sh index a72f2fd..aa5624c 100755 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,9 +1,9 @@ -# Generated from ltmain.m4sh. -# ltmain.sh (GNU libtool) 2.2.6b +# libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 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. @@ -32,50 +32,56 @@ # # Provide generalized library-building support services. # -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long help message +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory # -# MODE-ARGS vary depending on the MODE. +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . -PROGRAM=ltmain.sh +PROGRAM=libtool PACKAGE=libtool -VERSION=2.2.6b +VERSION=2.4 TIMESTAMP="" -package_revision=1.3017 +package_revision=1.3293 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -91,10 +97,15 @@ fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + # NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -107,15 +118,24 @@ do lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL $lt_unset CDPATH +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" : ${CP="cp -f"} -: ${ECHO="echo"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} @@ -144,6 +164,27 @@ IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -158,33 +199,183 @@ basename="s,^.*/,," # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } -# Generated shell functions inserted here. +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} # The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -215,6 +406,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -243,7 +443,7 @@ opt_warning=: # name if it has been set yet. func_echo () { - $ECHO "$progname${mode+: }$mode: $*" + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... @@ -258,18 +458,25 @@ func_verbose () : } +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + # func_error arg... # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -326,9 +533,9 @@ func_mkdir_p () case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -378,7 +585,7 @@ func_mktempdir () func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "X$my_tmpdir" | $Xsed + $ECHO "$my_tmpdir" } @@ -392,7 +599,7 @@ func_quote_for_eval () { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -419,7 +626,7 @@ func_quote_for_expand () { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ + my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -488,15 +695,39 @@ func_show_eval_locale () fi } - - +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} # func_version # Echo version message to standard output and exit. func_version () { - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ @@ -509,22 +740,28 @@ func_version () # Echo short help message to standard output and exit. func_usage () { - $SED -n '/^# Usage:/,/# -h/ { + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - $ECHO + echo $ECHO "run \`$progname --help | more' for full usage" exit $? } -# func_help -# Echo long help message to standard output and exit. +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. func_help () { + $opt_debug + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -537,8 +774,15 @@ func_help () s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p - }' < "$progpath" - exit $? + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi } # func_missing_arg argname @@ -546,63 +790,106 @@ func_help () # exit_cmd. func_missing_arg () { - func_error "missing argument for $1" + $opt_debug + + func_error "missing argument for $1." exit_cmd=exit } -exit_cmd=: +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -636,16 +923,16 @@ func_config () # Display the features supported by this script. func_features () { - $ECHO "host: $host" + echo "host: $host" if test "$build_libtool_libs" = yes; then - $ECHO "enable shared libraries" + echo "enable shared libraries" else - $ECHO "disable shared libraries" + echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - $ECHO "enable static libraries" + echo "enable static libraries" else - $ECHO "disable static libraries" + echo "disable static libraries" fi exit $? @@ -692,117 +979,204 @@ func_enable_tag () esac } -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () { + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_verbose=: +opt_silent=false +opt_verbose=false - # Parse non-mode specific arguments: - while test "$#" -gt 0; do + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do opt="$1" shift - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" + --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" - opt_debug='set -x' $opt_debug ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift + --dry-run|--dryrun|-n) + opt_dry_run=: ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" shift ;; - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: + opt_preserve_dup_deps=: ;; - - --verbose| -v) preserve_args="$preserve_args $opt" + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) opt_silent=false +func_append preserve_args " $opt" ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" shift ;; + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -810,82 +1184,44 @@ func_enable_tag () opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} + $opt_help || { + # Sanity checks first: + func_check_version_match -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" fi - exit $EXIT_MISMATCH - fi -} - - -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi - test -z "$mode" && func_fatal_error "error: you must specify a MODE." + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} +## ----------- ## +## Main. ## +## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. @@ -950,12 +1286,9 @@ func_ltwrapper_executable_p () # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -1001,6 +1334,37 @@ func_source () } +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1013,13 +1377,15 @@ func_infer_tag () if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) @@ -1030,11 +1396,13 @@ func_infer_tag () CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. @@ -1097,6 +1465,486 @@ EOF } } + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $opt_debug + func_convert_core_file_wine_to_w32_result="$1" + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + # func_mode_compile arg... func_mode_compile () { @@ -1137,12 +1985,12 @@ func_mode_compile () ;; -pie | -fpie | -fPIE) - pie_flag="$pie_flag $arg" + func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" + func_append later " $arg" continue ;; @@ -1163,15 +2011,14 @@ func_mode_compile () save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" + func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" + func_append base_compile " $lastarg" continue ;; @@ -1187,8 +2034,7 @@ func_mode_compile () esac # case $arg_mode # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" + func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in @@ -1213,7 +2059,7 @@ func_mode_compile () *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx) + *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1288,7 +2134,7 @@ func_mode_compile () # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -1319,17 +2165,16 @@ compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - removelist="$removelist $output_obj" + func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" + func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -1349,7 +2194,7 @@ compiler." if test -z "$output_obj"; then # Place PIC objects in $objdir - command="$command -o $lobj" + func_append command " -o $lobj" fi func_show_eval_locale "$command" \ @@ -1396,11 +2241,11 @@ compiler." command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - command="$command -o $obj" + func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" + func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -1445,13 +2290,13 @@ compiler." } $opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $mode in + case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -1482,10 +2327,11 @@ This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -1538,7 +2384,7 @@ either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: - -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." @@ -1558,6 +2404,8 @@ The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) @@ -1586,6 +2434,11 @@ The following components of LINK-COMMAND are treated specially: -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. @@ -1619,18 +2472,44 @@ Otherwise, only FILE itself is deleted using RM." ;; *) - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac - $ECHO + echo $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? } - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi # func_mode_execute arg... @@ -1643,13 +2522,16 @@ func_mode_execute () func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do + for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -1671,7 +2553,7 @@ func_mode_execute () dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" + func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -1712,7 +2594,7 @@ func_mode_execute () for file do case $file in - -*) ;; + -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then @@ -1728,8 +2610,7 @@ func_mode_execute () ;; esac # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" + func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then @@ -1754,29 +2635,66 @@ func_mode_execute () # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" + echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } -test "$mode" = execute && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libdirs="$nonopt" - admincmds= + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -1786,7 +2704,7 @@ func_mode_finish () if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done @@ -1795,53 +2713,55 @@ func_mode_finish () # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - $ECHO - $ECHO "If you ever happen to want to link against installed libraries" - $ECHO "in a given directory, LIBDIR, you must either use libtool, and" - $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" - $ECHO "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" - $ECHO " during execution" - fi - if test -n "$runpath_var"; then - $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" - $ECHO " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $ECHO + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo - $ECHO "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" - $ECHO "pages." - ;; - *) - $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - $ECHO "X----------------------------------------------------------------------" | $Xsed + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi exit $EXIT_SUCCESS } -test "$mode" = finish && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -1852,7 +2772,7 @@ func_mode_install () # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -1866,7 +2786,12 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac # We need to accept at least all the BSD install flags. dest= @@ -1876,10 +2801,12 @@ func_mode_install () install_type= isdir=no stripme= + no_mode=: for arg do + arg2= if test -n "$dest"; then - files="$files $dest" + func_append files " $dest" dest=$arg continue fi @@ -1887,10 +2814,9 @@ func_mode_install () case $arg in -d) isdir=yes ;; -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac + if $install_cp; then :; else + prev=$arg + fi ;; -g | -m | -o) prev=$arg @@ -1904,6 +2830,10 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi prev= else dest=$arg @@ -1914,7 +2844,11 @@ func_mode_install () # Aesthetically quote the argument. func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -1923,6 +2857,13 @@ func_mode_install () test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" @@ -1977,10 +2918,13 @@ func_mode_install () case $file in *.$libext) # Do the static libraries later. - staticlibs="$staticlibs $file" + func_append staticlibs " $file" ;; *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -1994,23 +2938,23 @@ func_mode_install () if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; + *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; + *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - dir="$dir$objdir" + func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -2023,9 +2967,9 @@ func_mode_install () if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2043,7 +2987,7 @@ func_mode_install () test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. - func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in @@ -2083,7 +3027,7 @@ func_mode_install () func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) @@ -2183,7 +3127,7 @@ func_mode_install () if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no @@ -2202,7 +3146,7 @@ func_mode_install () file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -2221,7 +3165,7 @@ func_mode_install () } else # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -2280,7 +3224,7 @@ func_mode_install () fi } -test "$mode" = install && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2323,6 +3267,22 @@ func_generate_dlsyms () extern \"C\" { #endif +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + /* External symbol declarations for the compiler. */\ " @@ -2332,10 +3292,11 @@ extern \"C\" { $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2371,7 +3332,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -2384,10 +3345,52 @@ extern \"C\" { func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac done $opt_dry_run || { @@ -2415,36 +3418,19 @@ extern \"C\" { if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist +extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist +LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -2457,7 +3443,7 @@ lt_${my_prefix}_LTX_preloaded_symbols[] = eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -2500,7 +3486,7 @@ static const void *lt_preloaded_setup() { for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; + *) func_append symtab_cflags " $arg" ;; esac done @@ -2515,16 +3501,16 @@ static const void *lt_preloaded_setup() { case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -2538,8 +3524,8 @@ static const void *lt_preloaded_setup() { # really was required. # Nullify the symbol file. - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } @@ -2549,6 +3535,7 @@ static const void *lt_preloaded_setup() { # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug @@ -2559,9 +3546,11 @@ func_win32_libid () win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ @@ -2590,6 +3579,131 @@ func_win32_libid () $ECHO "$win32_libid_type" } +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} # func_extract_an_archive dir oldlib @@ -2598,7 +3712,18 @@ func_extract_an_archive () $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else @@ -2669,7 +3794,7 @@ func_extract_archives () darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -2684,25 +3809,30 @@ func_extract_archives () func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } - -# func_emit_wrapper_part1 [arg=no] +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. # -# Emit the first part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part1 () +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () { - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 - fi + func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL @@ -2718,7 +3848,6 @@ func_emit_wrapper_part1 () # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible @@ -2749,31 +3878,132 @@ if test \"\$libtool_install_magic\" = \"$magic\"; then else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ " - $ECHO "\ + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -2783,30 +4013,13 @@ else esac fi - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done -" -} -# end: func_emit_wrapper_part1 - -# func_emit_wrapper_part2 [arg=no] -# -# Emit the second part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part2 () -{ - func_emit_wrapper_part2_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part2_arg1=$1 - fi - - $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -2814,7 +4027,7 @@ func_emit_wrapper_part2 () fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -2869,6 +4082,18 @@ func_emit_wrapper_part2 () if test -f \"\$progdir/\$program\"; then" + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -2877,253 +4102,28 @@ func_emit_wrapper_part2 () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 + func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } -# end: func_emit_wrapper_part2 - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - # split this up so that func_emit_cwrapperexe_src - # can call each part independently. - func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" - func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" -} - - -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_path_tmp1=`( cmd //c echo "$1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_tmp1=`cygpath -w "$1"` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result="" - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_to_host_pathlist_tmp2="$1" - # Once set for this call, this variable should not be - # reassigned. It is used in tha fallback case. - func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e 's|^:*||' -e 's|:*$||'` - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" - fi - fi - fi - IFS=: - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result" ; then - func_error "Could not determine the host path(s) corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout @@ -3141,31 +4141,23 @@ func_emit_cwrapperexe_src () This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "$SHELL $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. */ EOF cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif #include #include #ifdef _MSC_VER # include # include # include -# define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include -# define HAVE_SETENV -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif # endif #endif #include @@ -3177,6 +4169,44 @@ int setenv (const char *, const char *, int); #include #include +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) @@ -3192,14 +4222,7 @@ int setenv (const char *, const char *, int); # define S_IXGRP 0 #endif -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - +/* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -3230,10 +4253,6 @@ int setenv (const char *, const char *, int); # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -3246,22 +4265,13 @@ int setenv (const char *, const char *, int); if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; #else -# define LTWRAPPER_DEBUGPRINTF(args) +static int lt_debug = 0; #endif -const char *program_name = NULL; +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -3271,41 +4281,27 @@ char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_fatal (const char *message, ...); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_opt_process_env_set (const char *arg); -void lt_opt_process_env_prepend (const char *arg); -void lt_opt_process_env_append (const char *arg); -int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); - -static const char *script_text_part1 = -EOF - - func_emit_wrapper_part1 yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - cat <"))); + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", + nonnull (lt_argv_zero)); for (i = 0; i < newargc; i++) { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", + i, nonnull (newargz[i])); } EOF @@ -3560,11 +4517,14 @@ EOF mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + lt_debugprintf (__FILE__, __LINE__, + "(main) failed to launch target \"%s\": %s\n", + lt_argv_zero, nonnull (strerror (errno))); return 127; } return rval; @@ -3586,7 +4546,7 @@ xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) - lt_fatal ("Memory exhausted"); + lt_fatal (__FILE__, __LINE__, "memory exhausted"); return p; } @@ -3620,8 +4580,8 @@ check_executable (const char *path) { struct stat st; - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3638,8 +4598,8 @@ make_executable (const char *path) int rval = 0; struct stat st; - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3665,8 +4625,8 @@ find_executable (const char *wrapper) int tmp_len; char *concat_name; - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; @@ -3719,7 +4679,8 @@ find_executable (const char *wrapper) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -3744,7 +4705,8 @@ find_executable (const char *wrapper) } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -3770,8 +4732,9 @@ chase_symlinks (const char *pathspec) int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", - tmp_pathspec)); + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -3793,8 +4756,9 @@ chase_symlinks (const char *pathspec) } else { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); @@ -3807,7 +4771,8 @@ chase_symlinks (const char *pathspec) tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal ("Could not follow symlinks for %s", pathspec); + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -3833,11 +4798,25 @@ strendzap (char *str, const char *pat) return str; } +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + static void -lt_error_core (int exit_status, const char *mode, +lt_error_core (int exit_status, const char *file, + int line, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s: %s: ", program_name, mode); + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -3846,20 +4825,32 @@ lt_error_core (int exit_status, const char *mode, } void -lt_fatal (const char *message, ...) +lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + void lt_setenv (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ @@ -3904,95 +4895,12 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) return new_value; } -int -lt_split_name_value (const char *arg, char** name, char** value) -{ - const char *p; - int len; - if (!arg || !*arg) - return 1; - - p = strchr (arg, (int)'='); - - if (!p) - return 1; - - *value = xstrdup (++p); - - len = strlen (arg) - strlen (*value); - *name = XMALLOC (char, len); - strncpy (*name, arg, len-1); - (*name)[len - 1] = '\0'; - - return 0; -} - -void -lt_opt_process_env_set (const char *arg) -{ - char *name = NULL; - char *value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); - } - - lt_setenv (name, value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_prepend (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_append (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 1); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - void lt_update_exe_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4011,9 +4919,9 @@ lt_update_exe_path (const char *name, const char *value) void lt_update_lib_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4023,11 +4931,152 @@ lt_update_lib_path (const char *name, const char *value) } } +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + cat <<"EOF" +} EOF } # end: func_emit_cwrapperexe_src +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + # func_mode_link arg... func_mode_link () { @@ -4072,6 +5121,7 @@ func_mode_link () new_inherited_linker_flags= avoid_version=no + bindir= dlfiles= dlprefiles= dlself=no @@ -4164,6 +5214,11 @@ func_mode_link () esac case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -4195,9 +5250,9 @@ func_mode_link () ;; *) if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" + func_append dlfiles " $arg" else - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $arg" fi prev= continue @@ -4221,7 +5276,7 @@ func_mode_link () *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; @@ -4240,7 +5295,7 @@ func_mode_link () moreargs= for fil in `cat "$save_arg"` do -# moreargs="$moreargs $fil" +# func_append moreargs " $fil" arg=$fil # A libtool-controlled object. @@ -4269,7 +5324,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4281,7 +5336,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4351,12 +5406,12 @@ func_mode_link () if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) rpath="$rpath $arg" ;; + *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; + *) func_append xrpath " $arg" ;; esac fi prev= @@ -4368,28 +5423,28 @@ func_mode_link () continue ;; weak) - weak_libs="$weak_libs $arg" + func_append weak_libs " $arg" prev= continue ;; xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - compiler_flags="$compiler_flags $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -4425,6 +5480,11 @@ func_mode_link () continue ;; + -bindir) + prev=bindir + continue + ;; + -dlopen) prev=dlfiles continue @@ -4475,15 +5535,16 @@ func_mode_link () ;; -L*) - func_stripname '-L' '' "$arg" - dir=$func_stripname_result - if test -z "$dir"; then + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4495,24 +5556,30 @@ func_mode_link () ;; esac case "$deplibs " in - *" -L$dir "*) ;; + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) dllsearchpath="$dllsearchpath:$dir";; + *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -4522,7 +5589,7 @@ func_mode_link () -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -4536,7 +5603,7 @@ func_mode_link () ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -4556,7 +5623,7 @@ func_mode_link () ;; esac fi - deplibs="$deplibs $arg" + func_append deplibs " $arg" continue ;; @@ -4568,8 +5635,8 @@ func_mode_link () # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot) - compiler_flags="$compiler_flags $arg" + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler @@ -4577,12 +5644,12 @@ func_mode_link () ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - compiler_flags="$compiler_flags $arg" + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; @@ -4649,13 +5716,17 @@ func_mode_link () # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac continue ;; @@ -4708,8 +5779,8 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $func_quote_for_eval_result" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4724,9 +5795,9 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$linker_flags $func_quote_for_eval_result" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4754,23 +5825,27 @@ func_mode_link () arg="$func_quote_for_eval_result" ;; - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" + func_append compiler_flags " $arg" continue ;; @@ -4782,7 +5857,7 @@ func_mode_link () *.$objext) # A standard object. - objs="$objs $arg" + func_append objs " $arg" ;; *.lo) @@ -4813,7 +5888,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4825,7 +5900,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4870,24 +5945,25 @@ func_mode_link () *.$libext) # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" + func_append deplibs " $arg" + func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. + func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" + func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $func_resolve_sysroot_result" prev= else - deplibs="$deplibs $arg" + func_append deplibs " $func_resolve_sysroot_result" fi continue ;; @@ -4925,7 +6001,7 @@ func_mode_link () if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -4934,6 +6010,8 @@ func_mode_link () func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -4954,12 +6032,12 @@ func_mode_link () # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - libs="$libs $deplib" + func_append libs " $deplib" done if test "$linkmode" = lib; then @@ -4972,9 +6050,9 @@ func_mode_link () if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac - pre_post_deps="$pre_post_deps $pre_post_dep" + func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= @@ -5041,17 +6119,19 @@ func_mode_link () for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= + func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$lib" ;; + *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + func_basename "$deplib" + deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; + *) func_append deplibs " $deplib" ;; esac done done @@ -5072,11 +6152,11 @@ func_mode_link () compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - compiler_flags="$compiler_flags $deplib" + func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5161,7 +6241,7 @@ func_mode_link () if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5174,7 +6254,8 @@ func_mode_link () test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then @@ -5188,7 +6269,8 @@ func_mode_link () finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" @@ -5199,17 +6281,21 @@ func_mode_link () -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" - dir=$func_stripname_result + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) lib="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" @@ -5227,7 +6313,7 @@ func_mode_link () match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -5237,15 +6323,15 @@ func_mode_link () ;; esac if test "$valid_a_lib" != yes; then - $ECHO + echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because the file extensions .$libext of this argument makes me believe" - $ECHO "*** that it is just a static archive that I should not use here." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -5272,11 +6358,11 @@ func_mode_link () if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - newdlprefiles="$newdlprefiles $deplib" + func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - newdlfiles="$newdlfiles $deplib" + func_append newdlfiles " $deplib" fi fi continue @@ -5318,20 +6404,20 @@ func_mode_link () # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then @@ -5342,20 +6428,20 @@ func_mode_link () func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" 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_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done continue fi # $pass = conv @@ -5363,9 +6449,15 @@ func_mode_link () # Get the name of the library we link against. linklib= - for l in $old_library $library_names; do - linklib="$l" - done + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi @@ -5382,9 +6474,9 @@ func_mode_link () # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" + func_append dlprefiles " $lib $dependency_libs" else - newdlfiles="$newdlfiles $lib" + func_append newdlfiles " $lib" fi continue fi # $pass = dlopen @@ -5406,14 +6498,14 @@ func_mode_link () # Find the relevant object directory and library name. if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else - dir="$libdir" - absdir="$libdir" + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else @@ -5421,12 +6513,12 @@ func_mode_link () dir="$ladir" absdir="$abs_ladir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" @@ -5437,20 +6529,46 @@ func_mode_link () if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac fi # $pass = dlpreopen if test -z "$libdir"; then @@ -5468,7 +6586,7 @@ func_mode_link () if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" + func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no @@ -5481,7 +6599,8 @@ func_mode_link () for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? @@ -5492,12 +6611,12 @@ func_mode_link () # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... @@ -5512,7 +6631,7 @@ func_mode_link () # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; + *) func_append temp_rpath "$absdir:" ;; esac fi @@ -5524,7 +6643,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5533,7 +6652,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5558,12 +6677,12 @@ func_mode_link () case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=yes fi ;; @@ -5580,7 +6699,7 @@ func_mode_link () fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO + echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -5598,7 +6717,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5607,7 +6726,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5661,7 +6780,7 @@ func_mode_link () linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$mode" != relink; then + if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= @@ -5683,9 +6802,9 @@ func_mode_link () if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then - $ECHO - $ECHO "*** And there doesn't seem to be a static archive available" - $ECHO "*** The link will probably fail, sorry" + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi @@ -5717,7 +6836,7 @@ func_mode_link () if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5739,7 +6858,7 @@ func_mode_link () if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then @@ -5753,13 +6872,13 @@ func_mode_link () test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi - if test "$linkmode" = prog || test "$mode" = relink; then + if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= @@ -5773,7 +6892,7 @@ func_mode_link () elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then @@ -5790,7 +6909,7 @@ func_mode_link () if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5825,21 +6944,21 @@ func_mode_link () # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - $ECHO + echo $ECHO "*** Warning: This system can not link to static lib archive $lib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - $ECHO "*** But as you try to build a module library, libtool will still create " - $ECHO "*** a static module, that should work as long as the dlopening application" - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -5867,37 +6986,46 @@ func_mode_link () temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; + *) func_append xrpath " $temp_xrpath";; esac;; - *) temp_deplibs="$temp_deplibs $libdir";; + *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi - newlib_search_path="$newlib_search_path $absdir" + func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - if $opt_duplicate_deps ; then + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do + path= case $deplib in -L*) path="$deplib" ;; *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; @@ -5924,8 +7052,8 @@ func_mode_link () if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi @@ -5958,7 +7086,7 @@ func_mode_link () compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -5975,7 +7103,7 @@ func_mode_link () for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; + *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= @@ -6033,10 +7161,10 @@ func_mode_link () -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" @@ -6052,7 +7180,7 @@ func_mode_link () ;; esac if test -n "$i" ; then - tmp_libs="$tmp_libs $i" + func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs @@ -6093,7 +7221,7 @@ func_mode_link () # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" - objs="$objs$old_deplibs" + func_append objs "$old_deplibs" ;; lib) @@ -6126,10 +7254,10 @@ func_mode_link () if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - libobjs="$libobjs $objs" + func_append libobjs " $objs" fi fi @@ -6194,7 +7322,7 @@ func_mode_link () age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|sunos) + freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" @@ -6327,7 +7455,7 @@ func_mode_link () done # Make executables depend on our current version. - verstring="$verstring:${current}.0" + func_append verstring ":${current}.0" ;; qnx) @@ -6395,10 +7523,10 @@ func_mode_link () fi func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" + func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= - if test "$mode" != relink; then + if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -6414,7 +7542,7 @@ func_mode_link () continue fi fi - removelist="$removelist $p" + func_append removelist " $p" ;; *) ;; esac @@ -6425,27 +7553,28 @@ func_mode_link () # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" + func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -6459,7 +7588,7 @@ func_mode_link () for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; + *) func_append dlfiles " $lib" ;; esac done @@ -6469,19 +7598,19 @@ func_mode_link () for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; + *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -6498,7 +7627,7 @@ func_mode_link () *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" + func_append deplibs " -lc" fi ;; esac @@ -6547,7 +7676,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6558,21 +7687,21 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which I believe you do not have" - $ECHO "*** because a test_compile did reveal that the linker did not use it for" - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6590,7 +7719,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6601,29 +7730,29 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because a test_compile did reveal that the linker did not use this one" - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - $ECHO "*** make it link in! You will probably need to install it or some" - $ECHO "*** library that it depends on before this library will be fully" - $ECHO "*** functional. Installing it before continuing would be even better." + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6640,15 +7769,27 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + if test "$want_nocaseglob" = yes; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -6665,13 +7806,13 @@ EOF potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6680,12 +7821,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else @@ -6696,7 +7837,7 @@ EOF ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -6712,7 +7853,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac @@ -6723,9 +7864,9 @@ EOF potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6734,12 +7875,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else @@ -6750,32 +7891,32 @@ EOF ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO + case $tmp_deplibs in + *[!\ \ ]*) + echo if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + echo "*** Warning: inter-library dependencies are not supported in this platform." else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." + echo "*** Warning: inter-library dependencies are not known to be supported." fi - $ECHO "*** All declared inter-library dependencies are being dropped." + echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - fi + ;; + esac ;; esac versuffix=$versuffix_save @@ -6787,23 +7928,23 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then - $ECHO - $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - $ECHO "*** a static module, that should work as long as the dlopening" - $ECHO "*** application is linked with the -dlopen flag." + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -6813,16 +7954,16 @@ EOF build_libtool_libs=no fi else - $ECHO "*** The inter-library dependencies that have been dropped here will be" - $ECHO "*** automatically added whenever a program is linked with this library" - $ECHO "*** or is declared to -dlopen it." + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then - $ECHO - $ECHO "*** Since this library must not contain undefined symbols," - $ECHO "*** because either the platform does not support them or" - $ECHO "*** it was explicitly requested with -no-undefined," - $ECHO "*** libtool will only create a static version of it." + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module @@ -6839,9 +7980,9 @@ EOF # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -6854,7 +7995,7 @@ EOF *) case " $deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -6864,10 +8005,10 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" @@ -6884,10 +8025,12 @@ EOF hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -6896,18 +8039,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" + func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_apped perm_rpath " $libdir" ;; esac fi done @@ -6925,7 +8068,7 @@ EOF # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -6933,7 +8076,7 @@ EOF fi shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -6959,18 +8102,18 @@ EOF linknames= for link do - linknames="$linknames $link" + func_append linknames " $link" done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" + func_append delfiles " $export_symbols" fi orig_export_symbols= @@ -7001,13 +8144,45 @@ EOF $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd1 in $cmds; do IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -7029,7 +8204,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then @@ -7041,7 +8216,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7051,7 +8226,7 @@ EOF case " $convenience " in *" $test_deplib "*) ;; *) - tmp_deplibs="$tmp_deplibs $test_deplib" + func_append tmp_deplibs " $test_deplib" ;; esac done @@ -7071,21 +8246,21 @@ EOF test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" + func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -7130,7 +8305,8 @@ EOF save_libobjs=$libobjs fi save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + func_basename "$output" + output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. @@ -7143,13 +8319,16 @@ EOF if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" - $ECHO 'INPUT (' > $output + echo 'INPUT (' > $output for obj in $save_libobjs do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - $ECHO ')' >> $output - delfiles="$delfiles $output" + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -7163,10 +8342,12 @@ EOF fi for obj do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -7190,17 +8371,19 @@ EOF # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext - objlist=$obj + objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -7210,11 +8393,12 @@ EOF # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - delfiles="$delfiles $output" + func_append delfiles " $output" else output= @@ -7248,7 +8432,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7269,7 +8453,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -7281,7 +8465,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7322,10 +8506,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -7341,7 +8525,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7353,7 +8537,7 @@ EOF IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7434,18 +8618,21 @@ EOF if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' @@ -7505,8 +8692,8 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac @@ -7517,14 +8704,14 @@ EOF if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -7538,7 +8725,7 @@ EOF *) case " $compile_deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7548,17 +8735,17 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -7566,7 +8753,7 @@ EOF # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done fi @@ -7585,18 +8772,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi case $host in @@ -7605,12 +8792,12 @@ EOF case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; + *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -7636,18 +8823,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + *) func_append finalize_perm_rpath " $libdir" ;; esac fi done @@ -7661,8 +8848,8 @@ EOF if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" @@ -7674,15 +8861,15 @@ EOF wrappers_required=yes case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; - *cegcc) - # Disable wrappers for cegcc, we are cross compiling anyway. - wrappers_required=no - ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no @@ -7691,13 +8878,19 @@ EOF esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -7720,7 +8913,7 @@ EOF # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7728,7 +8921,7 @@ EOF # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7738,11 +8931,18 @@ EOF # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + exit $EXIT_SUCCESS fi @@ -7757,7 +8957,7 @@ EOF if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -7769,13 +8969,19 @@ EOF fi # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Now create the wrapper script. func_verbose "creating $output" @@ -7793,18 +8999,7 @@ EOF fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -7884,7 +9079,7 @@ EOF else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" + func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" @@ -7892,10 +9087,10 @@ EOF if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. @@ -7906,10 +9101,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -7925,9 +9120,9 @@ EOF done | sort | sort -uc >/dev/null 2>&1); then : else - $ECHO "copying selected object files to avoid basename conflicts..." + echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -7951,9 +9146,9 @@ EOF esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" ;; - *) oldobjs="$oldobjs $obj" ;; + *) func_append oldobjs " $obj" ;; esac done fi @@ -7963,6 +9158,16 @@ EOF len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -8036,7 +9241,7 @@ EOF done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -8059,9 +9264,19 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -8075,9 +9290,9 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdlfiles="$newdlfiles $lib" ;; + *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" @@ -8094,7 +9309,7 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done @@ -8106,7 +9321,7 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlfiles="$newdlfiles $abs" + func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -8115,15 +9330,33 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlprefiles="$newdlprefiles $abs" + func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; esac $ECHO > $output "\ # $outputname - a libtool library file @@ -8182,7 +9415,7 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -{ test "$mode" = link || test "$mode" = relink; } && +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} @@ -8202,9 +9435,9 @@ func_mode_uninstall () for arg do case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; esac done @@ -8213,24 +9446,23 @@ func_mode_uninstall () rmdirs= - origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - objdir="$origobjdir" + odir="$objdir" else - objdir="$dir/$origobjdir" + odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" + test "$opt_mode" = uninstall && odir="$dir" - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; esac fi @@ -8256,18 +9488,17 @@ func_mode_uninstall () # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" + func_append rmfiles " $odir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$mode" in + case "$opt_mode" in clean) - case " $library_names " in - # " " in the beginning catches empty $dlname + case " $library_names " in *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -8295,19 +9526,19 @@ func_mode_uninstall () # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" + func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" + func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$mode" = clean ; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -8317,7 +9548,7 @@ func_mode_uninstall () noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - rmfiles="$rmfiles $file" + func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. @@ -8326,7 +9557,7 @@ func_mode_uninstall () func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -8334,12 +9565,12 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -8347,7 +9578,6 @@ func_mode_uninstall () esac func_show_eval "$RM $rmfiles" 'exit_status=1' done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -8359,16 +9589,16 @@ func_mode_uninstall () exit $exit_status } -{ test "$mode" = uninstall || test "$mode" = clean; } && +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$mode" && { +test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 671cde1..88de383 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1,7 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,7 +11,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -66,6 +68,7 @@ esac # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -82,6 +85,8 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -118,7 +123,7 @@ m4_defun([_LT_CC_BASENAME], *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -138,6 +143,9 @@ m4_defun([_LT_FILEUTILS_DEFAULTS], m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -160,10 +168,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -179,7 +190,6 @@ fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -193,23 +203,6 @@ aix3*) ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -250,6 +243,28 @@ _LT_CONFIG_COMMANDS ])# _LT_SETUP +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -408,7 +423,7 @@ m4_define([_lt_decl_all_varnames], # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -418,7 +433,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE], # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -517,12 +532,20 @@ LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -533,9 +556,9 @@ done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -543,16 +566,38 @@ for var in lt_decl_all_varnames([[ \ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -562,20 +607,11 @@ _LT_OUTPUT_LIBTOOL_INIT AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -601,7 +637,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -646,15 +682,13 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -717,15 +751,12 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - _LT_PROG_XSI_SHELLFNS + _LT_PROG_REPLACE_SHELLFNS - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -831,11 +862,13 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -940,6 +973,31 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -967,7 +1025,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -987,7 +1045,11 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -995,7 +1057,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1011,203 +1073,142 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1236,7 +1237,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1354,14 +1355,47 @@ need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1388,10 +1422,19 @@ if test -n "$RANLIB"; then esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1416,15 +1459,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1464,7 +1507,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1527,6 +1570,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1591,8 +1639,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1643,7 +1691,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1684,7 +1732,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1693,7 +1747,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1869,16 +1927,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2037,6 +2095,7 @@ m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2045,16 +2104,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2067,7 +2133,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2087,7 +2153,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2175,7 +2247,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2206,8 +2278,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2228,36 +2301,83 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2344,6 +2464,19 @@ gnu*) hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -2386,8 +2519,10 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) @@ -2445,7 +2580,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -2454,16 +2589,21 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2475,8 +2615,9 @@ linux* | k*bsd*-gnu) # 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;/^$/d' | tr '\n' ' '` + 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="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2708,6 +2849,8 @@ _LT_DECL([], [library_names_spec], [1], The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2820,6 +2963,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -2941,6 +3085,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -2949,8 +3098,8 @@ case $host_os in fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3002,16 +3151,18 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3041,6 +3192,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3049,11 +3204,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3075,7 +3230,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3153,6 +3308,21 @@ tpf*) ;; esac ]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3160,7 +3330,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3217,7 +3391,19 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3230,13 +3416,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3251,6 +3437,67 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + # LT_LIB_M # -------- @@ -3259,7 +3506,7 @@ AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3287,7 +3534,12 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3304,6 +3556,7 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3371,8 +3624,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3408,6 +3661,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3429,7 +3683,7 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3441,6 +3695,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3452,7 +3718,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3478,15 +3744,15 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3519,6 +3785,13 @@ else AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3529,6 +3802,8 @@ _LT_DECL([global_symbol_to_c_name_address], _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3540,7 +3815,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3591,6 +3865,11 @@ m4_if([$1], [CXX], [ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3640,6 +3919,12 @@ m4_if([$1], [CXX], [ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3696,7 +3981,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3729,8 +4014,8 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3792,7 +4077,7 @@ m4_if([$1], [CXX], [ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3896,6 +4181,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -3938,6 +4229,13 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -3980,7 +4278,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4001,7 +4299,13 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4013,25 +4317,25 @@ m4_if([$1], [CXX], [ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; @@ -4063,7 +4367,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4120,9 +4424,11 @@ case $host_os in _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4141,6 +4447,8 @@ fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4161,6 +4469,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4169,27 +4478,35 @@ m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4252,7 +4569,33 @@ dnl Note also adjust exclude_expsyms for C++ above. esac _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4270,6 +4613,7 @@ dnl Note also adjust exclude_expsyms for C++ above. fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4285,11 +4629,12 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4325,10 +4670,12 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4346,6 +4693,11 @@ _LT_EOF fi ;; + 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 + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4361,7 +4713,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4371,15 +4723,16 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4390,13 +4743,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4412,17 +4769,17 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4436,8 +4793,8 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4455,8 +4812,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4502,8 +4859,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4543,8 +4900,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4631,9 +4990,9 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4642,14 +5001,19 @@ _LT_EOF else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4681,20 +5045,63 @@ _LT_EOF # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4732,7 +5139,7 @@ _LT_EOF # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4740,7 +5147,7 @@ _LT_EOF hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4755,8 +5162,8 @@ _LT_EOF ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -4774,16 +5181,16 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4795,7 +5202,14 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4823,19 +5237,34 @@ _LT_EOF irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4897,17 +5326,17 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4917,13 +5346,13 @@ _LT_EOF osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -4936,9 +5365,9 @@ _LT_EOF _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5114,36 +5543,38 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5208,8 +5639,6 @@ _LT_TAGDECL([], [inherit_rpath], [0], to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5220,6 +5649,8 @@ _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5313,37 +5744,22 @@ CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5365,6 +5781,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5396,6 +5814,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5413,6 +5832,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5434,8 +5854,8 @@ if test "$_lt_caught_CXX_error" != yes; then # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5467,7 +5887,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5576,10 +5996,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5588,14 +6008,19 @@ if test "$_lt_caught_CXX_error" != yes; then else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5625,28 +6050,75 @@ if test "$_lt_caught_CXX_error" != yes; then ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5688,6 +6160,11 @@ if test "$_lt_caught_CXX_error" != yes; then 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 + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5712,11 +6189,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5777,7 +6254,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5787,10 +6264,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5820,7 +6297,7 @@ if test "$_lt_caught_CXX_error" != yes; then case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5831,9 +6308,9 @@ if test "$_lt_caught_CXX_error" != yes; then *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5844,7 +6321,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5862,7 +6339,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5899,26 +6376,26 @@ if test "$_lt_caught_CXX_error" != yes; then pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5926,7 +6403,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -5945,9 +6422,9 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5967,13 +6444,13 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6042,7 +6519,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6077,15 +6554,15 @@ if test "$_lt_caught_CXX_error" != yes; then case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6101,17 +6578,17 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6121,7 +6598,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6157,7 +6634,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6178,7 +6655,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6198,14 +6675,14 @@ if test "$_lt_caught_CXX_error" != yes; then if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6216,7 +6693,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6270,6 +6747,10 @@ if test "$_lt_caught_CXX_error" != yes; then CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6325,6 +6806,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6339,6 +6821,29 @@ AC_LANG_POP ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6347,6 +6852,7 @@ AC_LANG_POP # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6397,6 +6903,13 @@ public class foo { }; _LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6408,7 +6921,7 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6417,13 +6930,22 @@ if AC_TRY_EVAL(ac_compile); then test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6443,8 +6965,10 @@ if AC_TRY_EVAL(ac_compile); then _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6480,6 +7004,7 @@ else fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6516,7 +7041,7 @@ linux*) solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6560,32 +7085,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6604,6 +7113,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6643,7 +7154,9 @@ if test "$_lt_disable_F77" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6697,38 +7210,24 @@ if test "$_lt_disable_F77" != yes; then GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6747,6 +7246,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6786,7 +7287,9 @@ if test "$_lt_disable_FC" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6842,7 +7345,8 @@ if test "$_lt_disable_FC" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6879,10 +7383,12 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -6892,6 +7398,8 @@ _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6911,7 +7419,8 @@ fi AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG @@ -6946,9 +7455,11 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6961,7 +7472,8 @@ fi GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -7020,6 +7532,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7113,8 +7634,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES], # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7153,208 +7674,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) -_LT_EOF -esac + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac ;; - esac + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac ]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index 34151a3..17cfd51 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 @@ -1,13 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -125,7 +126,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -133,13 +134,13 @@ case $host in esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index f3c5309..9c7b5d4 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -7,17 +7,17 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# Generated from ltversion.in. +# @configure_input@ -# serial 3017 ltversion.m4 +# serial 3293 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6b]) -m4_define([LT_PACKAGE_REVISION], [1.3017]) +m4_define([LT_PACKAGE_VERSION], [2.4]) +m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6b' -macro_revision='1.3017' +[macro_version='2.4' +macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index 637bb20..c573da9 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,13 +1,13 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -77,7 +77,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -90,3 +89,10 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/m4/python.m4 b/m4/python.m4 index bdc8ee6..523e45a 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -45,13 +45,14 @@ AC_MSG_CHECKING(for headers required to compile python extensions) dnl deduce PYTHON_INCLUDES py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` -if test -x "$PYTHON-config"; then -PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` +PYTHON_CONFIG=`which $PYTHON`-config +if test -x "$PYTHON_CONFIG"; then +PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` else PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" if test "$py_prefix" != "$py_exec_prefix"; then PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" ->fi +fi fi AC_SUBST(PYTHON_INCLUDES) dnl check if the headers exist: @@ -196,7 +197,7 @@ python2.1 python2.0]) dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], - [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX'))" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) @@ -213,7 +214,7 @@ python2.1 python2.0]) dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], - [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX'))" 2>/dev/null || echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) @@ -226,32 +227,3 @@ python2.1 python2.0]) fi ]) - -dnl a macro to check for ability to create python extensions -dnl JD_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) -dnl function also defines PYTHON_INCLUDES -AC_DEFUN([JD_CHECK_PYTHON_HEADERS], -[AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING(for headers required to compile python extensions) -dnl deduce PYTHON_INCLUDES -py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` -py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` -if test -x "$PYTHON-config"; then -PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` -else -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" -fi -fi -AC_SUBST(PYTHON_INCLUDES) -dnl check if the headers exist: -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" -AC_TRY_CPP([#include ],dnl -[AC_MSG_RESULT(found) -$1],dnl -[AC_MSG_RESULT(not found) -$2]) -CPPFLAGS="$save_CPPFLAGS" -]) diff --git a/packaging/pygobject-rpmlintrc b/packaging/pygobject-rpmlintrc deleted file mode 100644 index 5e73e43..0000000 --- a/packaging/pygobject-rpmlintrc +++ /dev/null @@ -1,3 +0,0 @@ -# This line is mandatory to access the configuration functions -from Config import * -addFilter("pygobject2.* devel-file-in-non-devel-package") diff --git a/packaging/pygobject.spec b/packaging/pygobject.spec index b75e029..d62a4a5 100644 --- a/packaging/pygobject.spec +++ b/packaging/pygobject.spec @@ -1,28 +1,29 @@ -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} - -# Last updated for version 2.19.0 -%define glib2_version 2.16.0 -%define python2_version 2.3.5 +# Last updated for version 2.21.0 +%define glib2_version 2.22.4 +%define python2_version 2.3.5 ### Abstract ### -Name: pygobject -Version: 2.21.3 -Release: 1.1 +Name: pygobject2 +Version: 2.28.6 +Release: 3%{?dist} License: LGPLv2+ Group: Development/Languages -Summary: Python bindings for GObject +Summary: Python 2 bindings for GObject URL: http://www.pygtk.org/ -Source0: %{name}-%{version}.tar.bz2 -Source101: %{name}-rpmlintrc +BuildRoot: %{_tmppath}/%{name}-%{version}-root +#VCS: git:git://git.gnome.org/pygobject +Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-%{version}.tar.bz2 +### Patches ### ### Build Dependencies ### -BuildRequires: automake BuildRequires: glib2-devel >= %{glib2_version} -BuildRequires: libtool -BuildRequires: python-devel >= %{python2_version} +BuildRequires: python2-devel >= %{python2_version} + +# Bootstrap requirements +BuildRequires: automake autoconf libtool %description The %{name} package provides a convenient wrapper for the GObject library @@ -56,43 +57,39 @@ Group: Development/Languages This package contains documentation files for %{name}. %prep -%setup -q +%setup -q -n pygobject-%{version} + +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' %build -%configure --enable-thread -export tagname=CC -make LIBTOOL=/usr/bin/libtool +PYTHON=%{__python} +export PYTHON +%configure --disable-introspection +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -export tagname=CC -make LIBTOOL=/usr/bin/libtool DESTDIR=$RPM_BUILD_ROOT install -find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f - -rm examples/Makefile* - -%clean -rm -fr $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install +find $RPM_BUILD_ROOT -name '*.la' -delete +find $RPM_BUILD_ROOT -name '*.a' -delete -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig +rm examples/Makefile* %files %defattr(644, root, root, 755) %doc AUTHORS NEWS README +%doc examples %{_libdir}/libpyglib-2.0-python.so* %dir %{python_sitearch}/gtk-2.0 -%{python_sitearch}/gtk-2.0/dsextras.* -%{python_sitearch}/pygtk.* +%dir %{python_sitearch}/gobject +%dir %{python_sitearch}/glib -%defattr(755, root, root, 755) -%{python_sitearch}/gtk-2.0/gio -#%{python_sitearch}/gtk-2.0/girepository -%{python_sitearch}/gtk-2.0/glib -%{python_sitearch}/gtk-2.0/gobject +%{python_sitearch}/gtk-2.0/* +%{python_sitearch}/pygtk.* +%{python_sitearch}/gobject/* +%{python_sitearch}/glib/* %files codegen %defattr(755, root, root, 755) @@ -106,14 +103,299 @@ rm -fr $RPM_BUILD_ROOT %dir %{_datadir}/pygobject %dir %{_includedir}/pygtk-2.0 %{_datadir}/pygobject/2.0/defs -#%{_includedir}/pygobject/bank.h %{_includedir}/pygtk-2.0/pyglib.h %{_includedir}/pygtk-2.0/pygobject.h %{_libdir}/pkgconfig/pygobject-2.0.pc %files doc %defattr(644, root, root, 755) -%doc examples %{_datadir}/gtk-doc/html/pygobject %{_datadir}/pygobject/xsl +%changelog +* Sat Jan 14 2012 Fedora Release Engineering - 2.28.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Aug 18 2011 John (J5) Palmieri - 2.28.6-2 +- disable introspection in anticipation of pygobject3 +- https://bugzilla.redhat.com/show_bug.cgi?id=731851 +- pygobject2 now becomes legacy for static binding support (e.g. PyGTK) + +* Mon Jun 13 2011 John (J5) Palmieri - 2.28.6-1 +- update to upstream 2.28.6 +- closure: avoid double free crash +- GVariantType is a boxed struct in newer versions of glib +- Revert back to a GVariant workaround since the fix hasn't migrated to + Fedora's version of glib yet (workaround works in both cases) +- closure: Check the out arg is not null. +- Fix GC-related crash during PyGObject deallocation (remove patch from + previous spec) + +* Mon Jun 06 2011 Daniel Drake - 2.28.4-3 +- add upstream patch to solve Python GC crash during gobject deallocation + +* Thu Apr 21 2011 John (J5) Palmieri - 2.28.4-2 +- require gobject-introspection version 0.10.8 + +* Thu Apr 21 2011 John (J5) Palmieri - 2.28.4-1 +- update to upstream 2.28.4 + +* Tue Mar 22 2011 John (J5) Palmieri - 2.28.3-1 +- update to upstream 2.28.3 + +* Mon Mar 21 2011 John (J5) Palmieri - 2.28.2-1 +- update to upstream version 2.28.2 stable +- fixes issue in bug - https://bugzilla.redhat.com/show_bug.cgi?id=682543 + +* Mon Mar 21 2011 John (J5) Palmieri - 2.28.1-1 +- update to upstream version 2.28.1 stable +- fix the spec file's sources line to point to the correct ftp directory + +* Tue Mar 08 2011 John (J5) Palmieri - 2.28.0-1 +- update to upstream version 2.28.0 stable + +* Mon Feb 28 2011 John (J5) Palmieri - 2.27.91-1 +- update to upstream version 2.27.91 + +* Fri Feb 09 2011 John (J5) Palmieri - 2.27.90-2 +- update files manifest to reflect files that moved around + +* Fri Feb 09 2011 John (J5) Palmieri - 2.27.90-1 +- update to upstream version 2.27.90 + +* Tue Feb 08 2011 Fedora Release Engineering - 2.27.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Nov 10 2010 John (J5) Palmieri - 2.27.0-1 +- update to upstream version 2.27.0 + +* Thu Sep 30 2010 John (J5) Palmieri - 2.26.0-4 +- Edit PyCapsule patch to only use PyCapsule in Python 3.x + since this effects header files which require other modules to + be recompiled. There is actually discussion upstream to undeprecate it + for the 2.x series + +* Tue Sep 28 2010 John (J5) Palmieri - 2.26.0-3 +- add patch to work with PyCapsule since PyCObject is removed from + Python 3.2 which we ship in rawhide + +* Tue Sep 28 2010 John (J5) Palmieri - 2.26.0-2 +- add another py3k patch so that we compile correctly under python 3 +- fixes a couple of print syntax and a try, except syntax + +* Tue Sep 28 2010 John (J5) Palmieri - 2.26.0-1 +- Update to upstream 2.26.0 +- package python3-gobject module + +* Wed Jul 21 2010 David Malcolm - 2.21.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Wed Jul 14 2010 Colin Walters - 2.21.5-2 +- Rebuild against new gobject-introspection +- Strip noarch docs hack, seems obsolete now + +* Mon Jul 12 2010 Colin Walters - 2.21.5-1 +- New upstream version + +* Mon Jul 12 2010 Colin Walters - 2.21.4-5 +- Require g-i 0.9.0 + +* Wed Jul 7 2010 Colin Walters - 2.21.4-4 +- Update to latest upstream +- Drop upstreamed patches +- Require pycairo, since we have a module that uses it +- Drop libtool overriding; was not commented and seems fine + without +- Drop --enable-thread, it's default now +- Drop --enable-pygi, it's default now +- Drop clean section, no longer needed in F-14 +- Drop python-sitearch copy&paste, no longer needed in F-14 +- Add SMP flags to make + +* Thu May 27 2010 Colin Walters - 2.21.1-9 +- Readd my patch to not blow up mysteriously + Resolves: #596392 + +* Mon May 24 2010 Colin Walters - 2.21.1-7 +- Reenable pygi in preparation for getting it packaged + +* Wed May 05 2010 Colin Walters - 2.21.1-6 +- Switch to disabling pygi, remove my patch for now. See commentary + https://bugzilla.redhat.com/show_bug.cgi?id=569885#c38 + +* Wed May 05 2010 Colin Walters - 2.21.1-5 +- Another patch to clear error when we've enabled pygi + Should really fix bug #569885 + +* Fri Mar 26 2010 Colin Walters - 2.21.1-4 +- Cherrypick patch from HEAD to fix pygi imports + Hopefully fixes bug #569885 + +* Sat Jan 23 2010 Thomas Spura - 2.21.1-3 +- add --enable-pygi (fixes bug #558003) +- replace global with define + +* Fri Jan 08 2010 Matthew Barnes - 2.21.1-2.fc13 +- Provide a complete URI for the Source field. + +* Sat Jan 02 2010 Matthew Barnes - 2.21.1-1.fc13 +- Update to 2.21.1 + +* Sun Dec 20 2009 Matthew Barnes - 2.21.0-1.fc13 +- Update to 2.21.0 + +* Wed Sep 23 2009 Matthew Barnes - 2.20.0-1.fc12 +- Update to 2.20.0 + +* Tue Aug 11 2009 Matthew Barnes - 2.19.0-1.fc12 +- Update to 2.19.0 + +* Sun Jul 26 2009 Fedora Release Engineering - 2.18.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon May 25 2009 Matthew Barnes - 2.18.0-1.fc12 +- Update to 2.18.0 + +* Thu Apr 30 2009 Matthew Barnes - 2.17.1-1.fc12 +- Update to 2.17.0 +- Remove patch for GNOME bug #566571 (fixed upstream). + +* Wed Apr 22 2009 Matthew Barnes - 2.16.1-4.fc11 +- Add patch for GNOME bug #566571 (classic vs new-style inheritance crash). + +* Thu Feb 26 2009 Fedora Release Engineering - 2.16.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Feb 24 2009 Matthias Clasen - 2.16.1-2 +- Make -doc noarch + +* Sun Feb 22 2009 - Matthew Barnes - 2.16.1-1.fc11 +- Update to 2.16.1 + +* Sun Jan 04 2009 - Matthew Barnes - 2.16.0-1.fc11 +- Update to 2.16.0 +- Remove patch for RH bug #457502 (fixed upstream). +- Remove patch for GNOME bug #551059 and #551212 (fixed upstream). + +* Sat Nov 29 2008 - Ignacio Vazquez-Abrams - 2.15.4-4 +- Rebuild for Python 2.6 + +* Tue Oct 21 2008 - Bastien Nocera - 2.15.4-3.fc10 +- Add patch to fix typos breaking compilation + +* Tue Oct 21 2008 - Bastien Nocera - 2.15.4-2.fc10 +- Add 2-liner fixing the load_contents functions not working appropriately + +* Wed Sep 03 2008 Matthew Barnes - 2.15.4-1.fc10 +- Update to 2.15.4 + +* Sun Aug 31 2008 Matthew Barnes - 2.15.3-1.fc10 +- Update to 2.15.3 + +* Tue Aug 12 2008 Matthew Barnes - 2.15.2-3.fc10 +- Modify thread initialization patch to fix RH bug #458522. + +* Thu Aug 07 2008 Matthew Barnes - 2.15.2-2.fc10 +- Add patch for RH bug #457502 (error on gtk.gdk.threads_init). + +* Sat Jul 26 2008 Matthew Barnes - 2.15.2-1.fc10 +- Update to 2.15.2 + +* Sun Jul 20 2008 Matthew Barnes - 2.15.1-2.fc10 +- Fix directory ownership. (RH bug #455974, patch by Robert Scheck). + +* Wed Jul 16 2008 Matthew Barnes - 2.15.1-1.fc10 +- Update to 2.15.1 +- Bump glib2_version to 2.16.0. +- Remove ancient automake_version. +- Add a pygobject2-codegen subpackage. + +* Fri May 23 2008 Matthew Barnes - 2.14.2-1.fc10 +- Update to 2.14.2 + +* Sun Feb 17 2008 Matthew Barnes - 2.14.1-2.fc9 +- Rebuild with GCC 4.3 + +* Thu Jan 03 2008 Matthew Barnes - 2.14.1-1.fc9 +- Update to 2.14.1 + +* Fri Oct 26 2007 Matthew Barnes - 2.14.0-2.fc9 +- Remove redundant requirements. +- Use name tag where appropriate. + +* Sun Sep 16 2007 Matthew Barnes - 2.14.0-1.fc8 +- Update to 2.14.0 + +* Wed Aug 29 2007 Fedora Release Engineering - 2.13.2-3 +- Rebuild for selinux ppc32 issue. + +* Wed Aug 8 2007 Matthias Clasen - 2.13.2-2 +- Update the license field + +* Sat Jul 07 2007 Matthew Barnes - 2.13.2-1.fc8 +- Update to 2.13.2 + +* Fri May 18 2007 Matthew Barnes - 2.13.1-1.fc8 +- Update to 2.13.1 +- Remove patch for RH bug #237179 (fixed upstream). + +* Thu May 03 2007 Matthew Barnes - 2.12.3-5.fc7 +- Fix devel subpackage dependency (RH bug #238793). + +* Thu Apr 19 2007 Matthew Barnes - 2.12.3-3.fc7 +- Add patch for RH bug #237179 (memory leak). + +* Thu Dec 7 2006 Jeremy Katz - 2.12.3-2 +- rebuild against python 2.5 + +* Sat Nov 18 2006 Matthew Barnes - 2.12.3-1.fc7 +- Update to 2.12.3 + +* Thu Oct 26 2006 Matthew Barnes - 2.12.2-3.fc7 +- Add subpackage pygobject2-doc (bug #205231). + +* Tue Oct 24 2006 Matthew Barnes - 2.12.2-2.fc7 +- Use python_sitearch instead of python_sitelib. + +* Sun Oct 15 2006 Matthew Barnes - 2.12.2-1.fc7 +- Update to 2.12.2 + +* Sun Sep 24 2006 Matthew Barnes - 2.12.1-3.fc6 +- Require glib2-devel for the -devel package. + +* Fri Sep 22 2006 Matthew Barnes - 2.12.1-2.fc6 +- Define a python_sitelib macro for files under site_packages. +- Spec file cleanups. + +* Tue Sep 5 2006 Matthias Clasen - 2.12.1-1.fc6 +- Update to 2.12.1 +- Require pkgconfig for the -devel package + +* Sun Aug 27 2006 Matthias Clasen - 2.11.4-1.fc6 +- Update to 2.11.4 +- Use pre-built docs + +* Mon Aug 21 2006 Matthias Clasen - 2.11.3-1.fc6 +- Update to 2.11.3 + +* Sun Aug 13 2006 Matthias Clasen - 2.11.2-2.fc6 +- BR libxslt + +* Sun Aug 13 2006 Matthias Clasen - 2.11.2-1.fc6 +- Update to 2.11.2 + +* Wed Jul 19 2006 Jesse Keating - 2.11.0-2 +- rebuild + +* Wed Jul 12 2006 Matthias Clasen - 2.11.0-1 +- Update to 2.11.0 + +* Wed Jul 12 2006 Jesse Keating - 2.10.1-3 +- rebuild +- Add missing br libtool + +* Fri May 19 2006 John (J5) Palmieri - 2.10.1-2 +- Cleanup + +* Fri May 12 2006 John (J5) Palmieri - 2.10.1-1 +- Initial package diff --git a/pygobject-2.0.pc.in b/pygobject-2.0.pc.in index 5188a12..a47b685 100644 --- a/pygobject-2.0.pc.in +++ b/pygobject-2.0.pc.in @@ -13,6 +13,7 @@ fixxref=${datadir}/pygobject/xsl/fixxref.py pygdocs=${datadir}/gtk-doc/html/pygobject defsdir=${datadir}/pygobject/2.0/defs codegendir=${datadir}/pygobject/2.0/codegen +overridesdir=@pyexecdir@/gi/overrides Name: PyGObject Description: Python bindings for GObject diff --git a/pygobject_postinstall.py b/pygobject_postinstall.py index 487828e..bd546bf 100644 --- a/pygobject_postinstall.py +++ b/pygobject_postinstall.py @@ -1,72 +1,9 @@ +# -*- coding: utf-8 -*- -"""pygobject is now installed on your machine. -Local configuration files were successfully updated.""" +import sys -import os, re, sys - -pkgconfig_file = os.path.normpath( - os.path.join(sys.prefix, - 'lib/pkgconfig/pygobject-2.0.pc')) - -prefix_pattern=re.compile("^prefix=.*") -version_pattern=re.compile("Version: ([0-9]+\.[0-9]+\.[0-9]+)") - -def replace_prefix(s): - if prefix_pattern.match(s): - s='prefix='+sys.prefix.replace("\\","/")+'\n' - s=s.replace("@DATADIR@", - os.path.join(sys.prefix,'share').replace("\\","/")) - - return s - -def get_doc_url(pkgconfig_file, base_url): - try: - f = open(pkgconfig_file).read() - ver = version_pattern.search(f).groups()[0] - majv,minv,micv = ver.split('.') - doc_url = "%s/%s.%s/" % (base_url,majv,minv) - except: - doc_url = base_url + "/stable/" - return doc_url - -# TODO : Check that shortcuts are created system-wide when the user -# has admin rights (hint: see pywin32 postinstall) -def create_shortcuts(): - progs_folder= get_special_folder_path("CSIDL_COMMON_PROGRAMS") - site_packages_dir = os.path.join(sys.prefix , 'lib','site-packages') - - pygtk_shortcuts = os.path.join(progs_folder, 'PyGTK') - if not os.path.isdir(pygtk_shortcuts): - os.mkdir(pygtk_shortcuts) - - # link to specific documentation version by parsing the - # pkgconfig file - doc_url = get_doc_url(pkgconfig_file, - "http://library.gnome.org/devel/pygobject") - pygobject_doc_link=os.path.join(pygtk_shortcuts, - 'PyGObject Documentation.lnk') - if os.path.isfile(pygobject_doc_link): - os.remove(pygobject_doc_link) - create_shortcut(doc_url,'PyGObject Documentation',pygobject_doc_link) - -def remove_shortcuts(): - pygtk_shortcuts = os.path.join( - get_special_folder_path('CSIDL_COMMON_PROGRAMS'), 'PyGTK') - os.remove(os.path.join(pygtk_shortcuts,'PyGObject Documentation.lnk')) - try: - os.rmdir(pygtk_shortcuts) - except OSError, e: - # Directory is not empty, so leave it like that ! - pass if len(sys.argv) == 2: - if sys.argv[1] == "-install": - # fixup the pkgconfig file - lines=open(pkgconfig_file).readlines() - open(pkgconfig_file, 'w').writelines(map(replace_prefix,lines)) - # TODO: Add an installer option for shortcut creation - create_shortcuts() - print __doc__ - elif sys.argv[1] == "-remove": - remove_shortcuts() + if sys.argv[1] == '-install': + print ('pygobject is now installed on your machine.\n') diff --git a/setup.py b/setup.py index 0999c00..74b9141 100755 --- a/setup.py +++ b/setup.py @@ -1,100 +1,132 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # # setup.py - distutils configuration for pygobject -# -"""Python Bindings for GObject.""" + + +'''Python Bindings for GObject. + +PyGObject is a set of bindings for the glib, gobject and gio libraries. +It provides an object oriented interface that is slightly higher level than +the C one. It automatically does all the type casting and reference +counting that you would have to do normally with the C API. You can +find out more on the official homepage, http://www.pygtk.org/''' + + +import os +import sys +import glob from distutils.command.build import build from distutils.command.build_clib import build_clib +from distutils.command.build_scripts import build_scripts from distutils.sysconfig import get_python_inc +from distutils.extension import Extension from distutils.core import setup -import glob -import os -import sys -from dsextras import get_m4_define, getoutput, have_pkgconfig, \ - GLOBAL_INC, GLOBAL_MACROS, InstallLib, InstallData, BuildExt, \ - PkgConfigExtension, TemplateExtension, \ - pkgc_get_libraries, pkgc_get_library_dirs, pkgc_get_include_dirs +from dsextras import GLOBAL_MACROS, GLOBAL_INC, get_m4_define, getoutput, \ + have_pkgconfig, pkgc_get_libraries, \ + pkgc_get_library_dirs, pkgc_get_include_dirs, \ + PkgConfigExtension, TemplateExtension, \ + BuildExt, InstallLib, InstallData -if '--yes-i-know-its-not-supported' in sys.argv: - sys.argv.remove('--yes-i-know-its-not-supported') -else: - print '*'*70 - print 'Building PyGObject using distutils is NOT SUPPORTED.' - print "It's mainly included to be able to easily build win32 installers" - print "You may continue, but only if you agree to not ask any questions" - print "To build PyGObject in a supported way, read the INSTALL file" - print - print "Build fixes are of course welcome and should be filed in bugzilla" - print '*'*70 - input = raw_input('Not supported, ok [y/N]? ') - if not input.startswith('y'): - raise SystemExit("Aborted") - -MIN_PYTHON_VERSION = (2, 3, 5) -MAJOR_VERSION = int(get_m4_define('pygobject_major_version')) -MINOR_VERSION = int(get_m4_define('pygobject_minor_version')) -MICRO_VERSION = int(get_m4_define('pygobject_micro_version')) +if sys.platform != 'win32': + msg = '*' * 68 + '\n' + msg += '* Building PyGObject using distutils is only supported on windows. *\n' + msg += '* To build PyGObject in a supported way, read the INSTALL file. *\n' + msg += '*' * 68 + raise SystemExit(msg) + +MIN_PYTHON_VERSION = (2, 6, 0) -VERSION = "%d.%d.%d" % (MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION) +if sys.version_info[:3] < MIN_PYTHON_VERSION: + raise SystemExit('ERROR: Python %s or higher is required, %s found.' % ( + '.'.join(map(str, MIN_PYTHON_VERSION)), + '.'.join(map(str, sys.version_info[:3])))) + +if not have_pkgconfig(): + raise SystemExit('ERROR: Could not find pkg-config: ' + 'Please check your PATH environment variable.') -GLIB_REQUIRED = get_m4_define('glib_required_version') -PYGOBJECT_SUFFIX = '2.0' -PYGOBJECT_SUFFIX_LONG = 'gtk-' + PYGOBJECT_SUFFIX +PYGTK_SUFFIX = '2.0' +PYGTK_SUFFIX_LONG = 'gtk-' + PYGTK_SUFFIX + +GLIB_REQUIRED = get_m4_define('glib_required_version') + +MAJOR_VERSION = int(get_m4_define('pygobject_major_version')) +MINOR_VERSION = int(get_m4_define('pygobject_minor_version')) +MICRO_VERSION = int(get_m4_define('pygobject_micro_version')) +VERSION = '%d.%d.%d' % (MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION) GLOBAL_INC += ['gobject'] GLOBAL_MACROS += [('PYGOBJECT_MAJOR_VERSION', MAJOR_VERSION), ('PYGOBJECT_MINOR_VERSION', MINOR_VERSION), - ('PYGOBJECT_MICRO_VERSION', MICRO_VERSION)] - -if sys.platform == 'win32': - GLOBAL_MACROS.append(('VERSION', '"""%s"""' % VERSION)) -else: - raise SystemExit("Error: distutils build only supported on windows") - -if sys.version_info[:3] < MIN_PYTHON_VERSION: - raise SystemExit("Python %s or higher is required, %s found" % ( - ".".join(map(str,MIN_PYTHON_VERSION)), - ".".join(map(str,sys.version_info[:3])))) + ('PYGOBJECT_MICRO_VERSION', MICRO_VERSION), + ('VERSION', '\\"%s\\"' % VERSION)] -if not have_pkgconfig(): - raise SystemExit("Error, could not find pkg-config") +BIN_DIR = os.path.join('Scripts') +INCLUDE_DIR = os.path.join('include', 'pygtk-%s' % PYGTK_SUFFIX) +DEFS_DIR = os.path.join('share', 'pygobject', PYGTK_SUFFIX, 'defs') +XSL_DIR = os.path.join('share', 'pygobject','xsl') +HTML_DIR = os.path.join('share', 'gtk-doc', 'html', 'pygobject') -DEFS_DIR = os.path.join('share', 'pygobject', PYGOBJECT_SUFFIX, 'defs') -INCLUDE_DIR = os.path.join('include', 'pygtk-%s' % PYGOBJECT_SUFFIX) class PyGObjectInstallLib(InstallLib): def run(self): - # Install pygtk.pth, pygtk.py[c] and templates self.install_pth() self.install_pygtk() # Modify the base installation dir - install_dir = os.path.join(self.install_dir, PYGOBJECT_SUFFIX_LONG) + install_dir = os.path.join(self.install_dir, PYGTK_SUFFIX_LONG) self.set_install_dir(install_dir) + # Install tests + self.install_tests() + InstallLib.run(self) def install_pth(self): - """Write the pygtk.pth file""" + '''Create the pygtk.pth file''' file = os.path.join(self.install_dir, 'pygtk.pth') self.mkpath(self.install_dir) - open(file, 'w').write(PYGOBJECT_SUFFIX_LONG) + open(file, 'w').write(PYGTK_SUFFIX_LONG) self.local_outputs.append(file) self.local_inputs.append('pygtk.pth') def install_pygtk(self): - """install pygtk.py in the right place.""" + '''Install pygtk.py in the right place.''' self.copy_file('pygtk.py', self.install_dir) pygtk = os.path.join(self.install_dir, 'pygtk.py') self.byte_compile([pygtk]) self.local_outputs.append(pygtk) self.local_inputs.append('pygtk.py') + def copy_test(self, srcfile, dstfile=None): + if dstfile is None: + dstfile = os.path.join(self.test_dir, srcfile) + else: + dstfile = os.path.join(self.test_dir, dstfile) + + srcfile = os.path.join('tests', srcfile) + + self.copy_file(srcfile, os.path.abspath(dstfile)) + self.local_outputs.append(dstfile) + self.local_inputs.append('srcfile') + + def install_tests(self): + self.test_dir = os.path.join(self.install_dir, 'tests', 'pygobject') + self.mkpath(self.test_dir) + + self.copy_test('runtests-windows.py', 'runtests.py') + self.copy_test('compathelper.py') + + for testfile in glob.glob('tests/test*.py'): + self.copy_test(os.path.basename(testfile)) + + class PyGObjectInstallData(InstallData): def run(self): self.add_template_option('VERSION', VERSION) @@ -108,18 +140,46 @@ class PyGObjectInstallData(InstallData): InstallData.run(self) def install_templates(self): - self.install_template('pygobject-2.0.pc.in', - os.path.join(self.install_dir, - 'lib', 'pkgconfig')) + self.install_template('pygobject-%s.pc.in' % PYGTK_SUFFIX, + os.path.join(self.install_dir, 'lib', 'pkgconfig')) + + self.install_template('docs/xsl/fixxref.py.in', + os.path.join(self.install_dir, XSL_DIR)) + class PyGObjectBuild(build): - enable_threading = 1 + enable_threading = True + PyGObjectBuild.user_options.append(('enable-threading', None, - 'enable threading support')) + 'enable threading support')) + + +class PyGObjectBuildScripts(build_scripts): + ''' + Overrides distutils' build_script command so we can generate + a valid pygobject-codegen script that works on windows. + ''' + + def run(self): + self.mkpath(self.build_dir) + self.install_codegen_script() + build_scripts.run(self) + + def install_codegen_script(self): + '''Create pygobject-codegen''' + script = ('#!/bin/sh\n\n' + 'codegendir=`pkg-config pygobject-%s --variable=codegendir`\n\n' + 'PYTHONPATH=$codegendir\n' + 'export PYTHONPATH\n\n' + 'exec pythonw.exe "$codegendir/codegen.py" "$@"\n' % PYGTK_SUFFIX) + + outfile = os.path.join(self.build_dir, 'pygobject-codegen-%s' % PYGTK_SUFFIX) + open(outfile, 'w').write(script) + # glib glib = PkgConfigExtension(name='glib._glib', - pkc_name='glib-2.0', + pkc_name='glib-%s' % PYGTK_SUFFIX, pkc_version=GLIB_REQUIRED, pygobject_pkc=None, include_dirs=['glib'], @@ -136,10 +196,10 @@ glib = PkgConfigExtension(name='glib._glib', # GObject gobject = PkgConfigExtension(name='gobject._gobject', - pkc_name='gobject-2.0', + pkc_name='gobject-%s' % PYGTK_SUFFIX, pkc_version=GLIB_REQUIRED, pygobject_pkc=None, - include_dirs=['glib'], + include_dirs=['glib','gi'], libraries=['pyglib'], sources=['gobject/gobjectmodule.c', 'gobject/pygboxed.c', @@ -154,24 +214,23 @@ gobject = PkgConfigExtension(name='gobject._gobject', # gio gio = TemplateExtension(name='gio', - pkc_name='gio-2.0', + pkc_name='gio-%s' % PYGTK_SUFFIX, pkc_version=GLIB_REQUIRED, output='gio._gio', - defs=('gio/gio.defs', ['gio/gio-types.defs']), + defs='gio/gio.defs', include_dirs=['glib'], libraries=['pyglib'], sources=['gio/giomodule.c', 'gio/gio.c', 'gio/pygio-utils.c'], - register=[('gio/gio.defs', ['gio/gio-types.defs'])], + register=['gio/gio-types.defs'], override='gio/gio.override') clibs = [] data_files = [] ext_modules = [] -#Install dsextras and codegen so that the pygtk installer -#can find them +#Install dsextras and codegen so that the pygtk installer can find them py_modules = ['dsextras'] packages = ['codegen'] @@ -183,33 +242,52 @@ if glib.can_build(): #subclass # #So we are stuck with this ugly thing - clibs.append(( - 'pyglib',{ - 'sources':['glib/pyglib.c'], - 'macros':GLOBAL_MACROS, - 'include_dirs': - ['glib', get_python_inc()]+pkgc_get_include_dirs('glib-2.0')})) - #this library is not installed, so probbably should not include its header + clibs.append(('pyglib', {'sources': ['glib/pyglib.c'], + 'macros': GLOBAL_MACROS, + 'include_dirs': ['glib', get_python_inc()] + + pkgc_get_include_dirs('glib-%s' % PYGTK_SUFFIX)})) + #this library is not installed, so probably should not include its header #data_files.append((INCLUDE_DIR, ('glib/pyglib.h',))) - + ext_modules.append(glib) py_modules += ['glib.__init__', 'glib.option'] else: - raise SystemExit("ERROR: Nothing to do, glib could not be found and is essential.") + raise SystemExit('ERROR: Nothing to do, glib could not be found and is essential.') if gobject.can_build(): ext_modules.append(gobject) data_files.append((INCLUDE_DIR, ('gobject/pygobject.h',))) + data_files.append((HTML_DIR, glob.glob('docs/html/*.html'))) + data_files.append((HTML_DIR, ['docs/style.css'])) + data_files.append((XSL_DIR, glob.glob('docs/xsl/*.xsl'))) py_modules += ['gobject.__init__', 'gobject.propertyhelper', 'gobject.constants'] else: - raise SystemExit("ERROR: Nothing to do, gobject could not be found and is essential.") + raise SystemExit('ERROR: Nothing to do, gobject could not be found and is essential.') if gio.can_build(): ext_modules.append(gio) py_modules += ['gio.__init__'] - data_files.append((DEFS_DIR,('gio/gio-types.defs',))) + data_files.append((DEFS_DIR,('gio/gio.defs', 'gio/gio-types.defs',))) else: - raise SystemExit("ERROR: Nothing to do, gio could not be found and is essential.") + raise SystemExit, 'ERROR: Nothing to do, gio could not be found and is essential.' + +# Build testhelper library +testhelper = Extension(name='testhelper', + sources=['tests/testhelpermodule.c', + 'tests/test-floating.c', + 'tests/test-thread.c', + 'tests/test-unknown.c'], + libraries=['pyglib'] + + pkgc_get_libraries('glib-%s' % PYGTK_SUFFIX) + + pkgc_get_libraries('gobject-%s' % PYGTK_SUFFIX), + include_dirs=['tests', 'glib', + 'gobject', get_python_inc()] + + pkgc_get_include_dirs('glib-%s' % PYGTK_SUFFIX) + + pkgc_get_include_dirs('gobject-%s' % PYGTK_SUFFIX), + library_dirs=pkgc_get_library_dirs('glib%s' % PYGTK_SUFFIX) + + pkgc_get_library_dirs('gobject-%s' % PYGTK_SUFFIX)) + +ext_modules.append(testhelper) # Threading support if '--disable-threading' in sys.argv: @@ -221,13 +299,13 @@ else: try: import thread except ImportError: - print "Warning: Could not import thread module, disabling threading" + print ('* Could not import thread module, disabling threading') enable_threading = False else: enable_threading = True if enable_threading: - name = 'gthread-2.0' + name = 'gthread-%s' % PYGTK_SUFFIX for module in ext_modules: raw = getoutput('pkg-config --libs-only-l %s' % name) for arg in raw.split(): @@ -244,29 +322,30 @@ if enable_threading: else: GLOBAL_MACROS.append(('DISABLE_THREADING', 1)) +doclines = __doc__.split('\n') +options = {'bdist_wininst': {'install_script': 'pygobject_postinstall.py', + 'user_access_control': 'auto'}} -doclines = __doc__.split("\n") - -options = {"bdist_wininst": {"install_script": "pygobject_postinstall.py"}} - -setup(name="pygobject", +setup(name='pygobject', url='http://www.pygtk.org/', version=VERSION, license='LGPL', - platforms=['yes'], - maintainer="Johan Dahlin", - maintainer_email="johan@gnome.org", - description = doclines[0], - long_description = "\n".join(doclines[2:]), + platforms=['MS Windows'], + maintainer='Johan Dahlin', + maintainer_email='johan@gnome.org', + description=doclines[0], + long_description='\n'.join(doclines[2:]), + provides=['codegen', 'dsextras', 'gio', 'glib', 'gobject'], py_modules=py_modules, packages=packages, ext_modules=ext_modules, libraries=clibs, data_files=data_files, - scripts = ["pygobject_postinstall.py"], + scripts=['pygobject_postinstall.py'], options=options, cmdclass={'install_lib': PyGObjectInstallLib, 'install_data': PyGObjectInstallData, + 'build_scripts': PyGObjectBuildScripts, 'build_clib' : build_clib, 'build_ext': BuildExt, 'build': PyGObjectBuild}) diff --git a/tests/Makefile.am b/tests/Makefile.am index fcdffe1..bad15f0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,63 +1,137 @@ -INCLUDES = \ - -I$(top_srcdir)/gobject \ - $(PYTHON_INCLUDES) \ - $(GLIB_CFLAGS) +CLEANFILES = +noinst_LTLIBRARIES = +if ENABLE_INTROSPECTION +noinst_LTLIBRARIES += libregress.la libgimarshallingtests.la -EXTRA_DIST = \ - $(tests) \ - common.py \ - runtests.py \ - testmodule.py \ - test-floating.h \ - test-thread.h \ - test-unknown.h +nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h +libregress_la_CFLAGS = $(GIO_CFLAGS) $(PYCAIRO_CFLAGS) +libregress_la_LDFLAGS = -module -avoid-version $(GIO_LIBS) $(PYCAIRO_LIBS) +nodist_libgimarshallingtests_la_SOURCES = $(GI_DATADIR)/tests/gimarshallingtests.c $(GI_DATADIR)/tests/gimarshallingtests.h +libgimarshallingtests_la_CFLAGS = $(GLIB_CFLAGS) +libgimarshallingtests_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) + +# This is a hack to make sure a shared library is built +libregress.la: $(libregress_la_OBJECTS) $(libregress_la_DEPENDENCIES) + $(LINK) -rpath $(pkgpyexecdir) $(libregress_la_LDFLAGS) $(libregress_la_OBJECTS) $(libregress_la_LIBADD) $(LIBS) + +libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES) + $(LINK) -rpath $(pkgpyexecdir) $(libgimarshallingtests_la_LDFLAGS) $(libgimarshallingtests_la_OBJECTS) $(libgimarhallingtests_la_LIBADD) $(LIBS) + +# g-i doesn't ship these as shared libraries anymore; we build them here +Regress-1.0.gir: libregress.la Makefile + $(AM_V_GEN) g-ir-scanner --include=cairo-1.0 --include=Gio-2.0 \ + --namespace=Regress --nsversion=1.0 \ + --warn-all --warn-error \ + --library=libregress.la \ + --libtool="$(top_builddir)/libtool" \ + --output $@ \ + $(nodist_libregress_la_SOURCES) +Regress-1.0.typelib: Regress-1.0.gir Makefile + $(AM_V_GEN) g-ir-compiler $< -o $@ + +GIMarshallingTests-1.0.gir: libgimarshallingtests.la Makefile + $(AM_V_GEN) g-ir-scanner --include=Gio-2.0 \ + --namespace=GIMarshallingTests --nsversion=1.0 --symbol-prefix=gi_marshalling_tests \ + --warn-all --warn-error \ + --library=libgimarshallingtests.la \ + --libtool="$(top_builddir)/libtool" \ + --output $@ \ + $(nodist_libgimarshallingtests_la_SOURCES) +GIMarshallingTests-1.0.typelib: GIMarshallingTests-1.0.gir Makefile + $(AM_V_GEN) g-ir-compiler $< -o $@ + +gschemas.compiled: org.gnome.test.gschema.xml + glib-compile-schemas --targetdir=. --schema-file=$< -noinst_LTLIBRARIES = testhelper.la -linked_LIBS = testhelper.la +CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib gschemas.compiled +endif +noinst_LTLIBRARIES += testhelper.la + +testhelper_la_CFLAGS = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS) testhelper_la_LDFLAGS = -module -avoid-version testhelper_la_LIBADD = $(GLIB_LIBS) testhelper_la_SOURCES = \ testhelpermodule.c \ test-floating.c \ test-thread.c \ - test-unknown.c + test-unknown.c -tests = \ - test_gicon.py \ - test_gio.py \ +# This is a hack to make sure a shared library is built +testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES) + $(LINK) -rpath $(pkgpyexecdir) $(testhelper_la_LDFLAGS) $(testhelper_la_OBJECTS) $(testhelper_la_LIBADD) $(LIBS) + + +.la.so: + test -L $@ || $(LN_S) .libs/$@ $@ + + +all: $(LTLIBRARIES:.la=.so) + +TEST_FILES_STATIC = \ test_gobject.py \ test_interface.py \ test_mainloop.py \ + test_option.py \ test_properties.py \ test_signal.py \ + test_source.py \ test_subprocess.py \ - test_unknown.py \ - test_source.py + test_thread.py \ + test_uris.py -# This is a hack to make sure a shared library is built -testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES) - $(LINK) -rpath $(pkgpyexecdir) $(testhelper_la_LDFLAGS) $(testhelper_la_OBJECTS) $(testhelper_la_LIBADD) $(LIBS) +if BUILD_GIO +TEST_FILES_GIO = \ + test_gio.py \ + test_gresolver.py \ + test_gsocket.py \ + test_gicon.py \ + test_gcancellable.py +endif -check-local: $(top_srcdir)/glib/__init__.py $(top_srcdir)/gobject/__init__.py $(top_srcdir)/gio/__init__.py - @if test "$(top_builddir)" != "$(top_srcdir)"; then \ - cp $(top_srcdir)/glib/*.py $(top_builddir)/glib; \ - cp $(top_srcdir)/gobject/*.py $(top_builddir)/gobject; \ - cp $(top_srcdir)/gio/*.py $(top_builddir)/gio; \ - fi - @$(PYTHON) $(srcdir)/runtests.py $(top_builddir) $(top_srcdir) - @if test "$(top_builddir)" != "$(top_srcdir)"; then \ - rm -f $(top_builddir)/glib/*.py; \ - rm -f $(top_builddir)/gobject/*.py; \ - rm -f $(top_builddir)/gio/*.py; \ - fi - @rm -fr $(top_builddir)/glib/*.pyc - @rm -fr $(top_builddir)/gobject/*.pyc - @rm -fr $(top_builddir)/gio/*.pyc +if ENABLE_INTROSPECTION +TEST_FILES_GI = \ + test_everything.py \ + test_gi.py \ + test_gdbus.py \ + test_overrides.py +endif +EXTRA_DIST = \ + compathelper.py \ + runtests.py \ + testmodule.py \ + test-floating.h \ + test-thread.h \ + test-unknown.h \ + org.gnome.test.gschema.xml + +EXTRA_DIST += $(TEST_FILES_STATIC) $(TEST_FILES_GI) $(TEST_FILES_GIO) -all: $(LTLIBRARIES:.la=.so) clean-local: - rm -f $(LTLIBRARIES:.la=.so) -.la.so: - $(LN_S) .libs/$@ $@ || true + rm -f $(LTLIBRARIES:.la=.so) file.txt~ + +DBUS_LAUNCH=$(shell which dbus-launch) +RUN_TESTS_ENV_VARS= \ + PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \ + LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \ + GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \ + XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \ + TESTS_BUILDDIR=$(builddir) +RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py + +# run tests in separately to avoid loading static and introspection bindings in the same process +check-local: $(LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled + TEST_FILES="$(TEST_FILES_STATIC)" $(RUN_TESTS_LAUNCH) + TEST_FILES="$(TEST_FILES_GI)" $(RUN_TESTS_LAUNCH) +if BUILD_GIO + TEST_FILES="$(TEST_FILES_GIO)" $(RUN_TESTS_LAUNCH) +endif + +check.gdb: + EXEC_NAME="gdb --args" $(MAKE) check + +check.valgrind: + EXEC_NAME="valgrind --suppressions=python.supp" G_SLICE=always-malloc G_DEBUG=gc-friendly $(MAKE) check + +-include $(top_srcdir)/git.mk diff --git a/tests/Makefile.in b/tests/Makefile.in index 7e77581..a695412 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -34,6 +34,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@ENABLE_INTROSPECTION_TRUE@am__append_1 = libregress.la libgimarshallingtests.la +@ENABLE_INTROSPECTION_TRUE@am__append_2 = Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib gschemas.compiled subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -49,28 +51,63 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) +libgimarshallingtests_la_LIBADD = +@ENABLE_INTROSPECTION_TRUE@nodist_libgimarshallingtests_la_OBJECTS = libgimarshallingtests_la-gimarshallingtests.lo +libgimarshallingtests_la_OBJECTS = \ + $(nodist_libgimarshallingtests_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libgimarshallingtests_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libgimarshallingtests_la_CFLAGS) $(CFLAGS) \ + $(libgimarshallingtests_la_LDFLAGS) $(LDFLAGS) -o $@ +@ENABLE_INTROSPECTION_TRUE@am_libgimarshallingtests_la_rpath = +libregress_la_LIBADD = +@ENABLE_INTROSPECTION_TRUE@nodist_libregress_la_OBJECTS = \ +@ENABLE_INTROSPECTION_TRUE@ libregress_la-regress.lo +libregress_la_OBJECTS = $(nodist_libregress_la_OBJECTS) +libregress_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libregress_la_CFLAGS) \ + $(CFLAGS) $(libregress_la_LDFLAGS) $(LDFLAGS) -o $@ +@ENABLE_INTROSPECTION_TRUE@am_libregress_la_rpath = am__DEPENDENCIES_1 = testhelper_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_testhelper_la_OBJECTS = testhelpermodule.lo test-floating.lo \ - test-thread.lo test-unknown.lo +am_testhelper_la_OBJECTS = testhelper_la-testhelpermodule.lo \ + testhelper_la-test-floating.lo testhelper_la-test-thread.lo \ + testhelper_la-test-unknown.lo testhelper_la_OBJECTS = $(am_testhelper_la_OBJECTS) -testhelper_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testhelper_la_LDFLAGS) $(LDFLAGS) -o $@ +testhelper_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testhelper_la_CFLAGS) \ + $(CFLAGS) $(testhelper_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(testhelper_la_SOURCES) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(nodist_libgimarshallingtests_la_SOURCES) \ + $(nodist_libregress_la_SOURCES) $(testhelper_la_SOURCES) DIST_SOURCES = $(testhelper_la_SOURCES) ETAGS = etags CTAGS = ctags @@ -78,6 +115,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -108,6 +146,9 @@ GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@ GIOUNIX_LIBS = @GIOUNIX_LIBS@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ +GI_CFLAGS = @GI_CFLAGS@ +GI_DATADIR = @GI_DATADIR@ +GI_LIBS = @GI_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ @@ -119,6 +160,8 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_PC = @LIBFFI_PC@ @@ -128,7 +171,9 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -141,10 +186,15 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLATFORM = @PLATFORM@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ @@ -167,6 +217,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -199,7 +250,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -220,47 +270,65 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -INCLUDES = \ - -I$(top_srcdir)/gobject \ - $(PYTHON_INCLUDES) \ - $(GLIB_CFLAGS) - -EXTRA_DIST = \ - $(tests) \ - common.py \ - runtests.py \ - testmodule.py \ - test-floating.h \ - test-thread.h \ - test-unknown.h - -noinst_LTLIBRARIES = testhelper.la -linked_LIBS = testhelper.la +CLEANFILES = $(am__append_2) +noinst_LTLIBRARIES = $(am__append_1) testhelper.la +@ENABLE_INTROSPECTION_TRUE@nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h +@ENABLE_INTROSPECTION_TRUE@libregress_la_CFLAGS = $(GIO_CFLAGS) $(PYCAIRO_CFLAGS) +@ENABLE_INTROSPECTION_TRUE@libregress_la_LDFLAGS = -module -avoid-version $(GIO_LIBS) $(PYCAIRO_LIBS) +@ENABLE_INTROSPECTION_TRUE@nodist_libgimarshallingtests_la_SOURCES = $(GI_DATADIR)/tests/gimarshallingtests.c $(GI_DATADIR)/tests/gimarshallingtests.h +@ENABLE_INTROSPECTION_TRUE@libgimarshallingtests_la_CFLAGS = $(GLIB_CFLAGS) +@ENABLE_INTROSPECTION_TRUE@libgimarshallingtests_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) +testhelper_la_CFLAGS = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS) testhelper_la_LDFLAGS = -module -avoid-version testhelper_la_LIBADD = $(GLIB_LIBS) testhelper_la_SOURCES = \ testhelpermodule.c \ test-floating.c \ test-thread.c \ - test-unknown.c + test-unknown.c -tests = \ - test_gicon.py \ - test_gio.py \ +TEST_FILES_STATIC = \ test_gobject.py \ test_interface.py \ test_mainloop.py \ + test_option.py \ test_properties.py \ test_signal.py \ + test_source.py \ test_subprocess.py \ - test_unknown.py \ - test_source.py - + test_thread.py \ + test_uris.py + +@BUILD_GIO_TRUE@TEST_FILES_GIO = \ +@BUILD_GIO_TRUE@ test_gio.py \ +@BUILD_GIO_TRUE@ test_gresolver.py \ +@BUILD_GIO_TRUE@ test_gsocket.py \ +@BUILD_GIO_TRUE@ test_gicon.py \ +@BUILD_GIO_TRUE@ test_gcancellable.py + +@ENABLE_INTROSPECTION_TRUE@TEST_FILES_GI = \ +@ENABLE_INTROSPECTION_TRUE@ test_everything.py \ +@ENABLE_INTROSPECTION_TRUE@ test_gi.py \ +@ENABLE_INTROSPECTION_TRUE@ test_gdbus.py \ +@ENABLE_INTROSPECTION_TRUE@ test_overrides.py + +EXTRA_DIST = compathelper.py runtests.py testmodule.py test-floating.h \ + test-thread.h test-unknown.h org.gnome.test.gschema.xml \ + $(TEST_FILES_STATIC) $(TEST_FILES_GI) $(TEST_FILES_GIO) +DBUS_LAUNCH = $(shell which dbus-launch) +RUN_TESTS_ENV_VARS = \ + PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \ + LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \ + GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \ + XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \ + TESTS_BUILDDIR=$(builddir) + +RUN_TESTS_LAUNCH = $(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py all: all-am .SUFFIXES: .SUFFIXES: .c .la .lo .o .obj .so -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -269,9 +337,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu tests/Makefile + $(AUTOMAKE) --foreign tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -285,9 +353,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -299,6 +367,10 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done +@ENABLE_INTROSPECTION_FALSE@libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES) +@ENABLE_INTROSPECTION_FALSE@ $(AM_V_CCLD)$(libgimarshallingtests_la_LINK) $(am_libgimarshallingtests_la_rpath) $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_LIBADD) $(LIBS) +@ENABLE_INTROSPECTION_FALSE@libregress.la: $(libregress_la_OBJECTS) $(libregress_la_DEPENDENCIES) +@ENABLE_INTROSPECTION_FALSE@ $(AM_V_CCLD)$(libregress_la_LINK) $(am_libregress_la_rpath) $(libregress_la_OBJECTS) $(libregress_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -306,32 +378,85 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-floating.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unknown.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhelpermodule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgimarshallingtests_la-gimarshallingtests.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libregress_la-regress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhelper_la-test-floating.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhelper_la-test-thread.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhelper_la-test-unknown.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testhelper_la-testhelpermodule.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +libgimarshallingtests_la-gimarshallingtests.lo: $(GI_DATADIR)/tests/gimarshallingtests.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgimarshallingtests_la_CFLAGS) $(CFLAGS) -MT libgimarshallingtests_la-gimarshallingtests.lo -MD -MP -MF $(DEPDIR)/libgimarshallingtests_la-gimarshallingtests.Tpo -c -o libgimarshallingtests_la-gimarshallingtests.lo `test -f '$(GI_DATADIR)/tests/gimarshallingtests.c' || echo '$(srcdir)/'`$(GI_DATADIR)/tests/gimarshallingtests.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgimarshallingtests_la-gimarshallingtests.Tpo $(DEPDIR)/libgimarshallingtests_la-gimarshallingtests.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(GI_DATADIR)/tests/gimarshallingtests.c' object='libgimarshallingtests_la-gimarshallingtests.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgimarshallingtests_la_CFLAGS) $(CFLAGS) -c -o libgimarshallingtests_la-gimarshallingtests.lo `test -f '$(GI_DATADIR)/tests/gimarshallingtests.c' || echo '$(srcdir)/'`$(GI_DATADIR)/tests/gimarshallingtests.c + +libregress_la-regress.lo: $(GI_DATADIR)/tests/regress.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libregress_la_CFLAGS) $(CFLAGS) -MT libregress_la-regress.lo -MD -MP -MF $(DEPDIR)/libregress_la-regress.Tpo -c -o libregress_la-regress.lo `test -f '$(GI_DATADIR)/tests/regress.c' || echo '$(srcdir)/'`$(GI_DATADIR)/tests/regress.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libregress_la-regress.Tpo $(DEPDIR)/libregress_la-regress.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(GI_DATADIR)/tests/regress.c' object='libregress_la-regress.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libregress_la_CFLAGS) $(CFLAGS) -c -o libregress_la-regress.lo `test -f '$(GI_DATADIR)/tests/regress.c' || echo '$(srcdir)/'`$(GI_DATADIR)/tests/regress.c + +testhelper_la-testhelpermodule.lo: testhelpermodule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -MT testhelper_la-testhelpermodule.lo -MD -MP -MF $(DEPDIR)/testhelper_la-testhelpermodule.Tpo -c -o testhelper_la-testhelpermodule.lo `test -f 'testhelpermodule.c' || echo '$(srcdir)/'`testhelpermodule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testhelper_la-testhelpermodule.Tpo $(DEPDIR)/testhelper_la-testhelpermodule.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testhelpermodule.c' object='testhelper_la-testhelpermodule.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -c -o testhelper_la-testhelpermodule.lo `test -f 'testhelpermodule.c' || echo '$(srcdir)/'`testhelpermodule.c + +testhelper_la-test-floating.lo: test-floating.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -MT testhelper_la-test-floating.lo -MD -MP -MF $(DEPDIR)/testhelper_la-test-floating.Tpo -c -o testhelper_la-test-floating.lo `test -f 'test-floating.c' || echo '$(srcdir)/'`test-floating.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testhelper_la-test-floating.Tpo $(DEPDIR)/testhelper_la-test-floating.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-floating.c' object='testhelper_la-test-floating.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -c -o testhelper_la-test-floating.lo `test -f 'test-floating.c' || echo '$(srcdir)/'`test-floating.c + +testhelper_la-test-thread.lo: test-thread.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -MT testhelper_la-test-thread.lo -MD -MP -MF $(DEPDIR)/testhelper_la-test-thread.Tpo -c -o testhelper_la-test-thread.lo `test -f 'test-thread.c' || echo '$(srcdir)/'`test-thread.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testhelper_la-test-thread.Tpo $(DEPDIR)/testhelper_la-test-thread.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-thread.c' object='testhelper_la-test-thread.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -c -o testhelper_la-test-thread.lo `test -f 'test-thread.c' || echo '$(srcdir)/'`test-thread.c + +testhelper_la-test-unknown.lo: test-unknown.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -MT testhelper_la-test-unknown.lo -MD -MP -MF $(DEPDIR)/testhelper_la-test-unknown.Tpo -c -o testhelper_la-test-unknown.lo `test -f 'test-unknown.c' || echo '$(srcdir)/'`test-unknown.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testhelper_la-test-unknown.Tpo $(DEPDIR)/testhelper_la-test-unknown.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-unknown.c' object='testhelper_la-test-unknown.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testhelper_la_CFLAGS) $(CFLAGS) -c -o testhelper_la-test-unknown.lo `test -f 'test-unknown.c' || echo '$(srcdir)/'`test-unknown.c + mostlyclean-libtool: -rm -f *.lo @@ -442,6 +567,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -539,30 +665,63 @@ uninstall-am: # This is a hack to make sure a shared library is built +@ENABLE_INTROSPECTION_TRUE@libregress.la: $(libregress_la_OBJECTS) $(libregress_la_DEPENDENCIES) +@ENABLE_INTROSPECTION_TRUE@ $(LINK) -rpath $(pkgpyexecdir) $(libregress_la_LDFLAGS) $(libregress_la_OBJECTS) $(libregress_la_LIBADD) $(LIBS) + +@ENABLE_INTROSPECTION_TRUE@libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES) +@ENABLE_INTROSPECTION_TRUE@ $(LINK) -rpath $(pkgpyexecdir) $(libgimarshallingtests_la_LDFLAGS) $(libgimarshallingtests_la_OBJECTS) $(libgimarhallingtests_la_LIBADD) $(LIBS) + +# g-i doesn't ship these as shared libraries anymore; we build them here +@ENABLE_INTROSPECTION_TRUE@Regress-1.0.gir: libregress.la Makefile +@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN) g-ir-scanner --include=cairo-1.0 --include=Gio-2.0 \ +@ENABLE_INTROSPECTION_TRUE@ --namespace=Regress --nsversion=1.0 \ +@ENABLE_INTROSPECTION_TRUE@ --warn-all --warn-error \ +@ENABLE_INTROSPECTION_TRUE@ --library=libregress.la \ +@ENABLE_INTROSPECTION_TRUE@ --libtool="$(top_builddir)/libtool" \ +@ENABLE_INTROSPECTION_TRUE@ --output $@ \ +@ENABLE_INTROSPECTION_TRUE@ $(nodist_libregress_la_SOURCES) +@ENABLE_INTROSPECTION_TRUE@Regress-1.0.typelib: Regress-1.0.gir Makefile +@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN) g-ir-compiler $< -o $@ + +@ENABLE_INTROSPECTION_TRUE@GIMarshallingTests-1.0.gir: libgimarshallingtests.la Makefile +@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN) g-ir-scanner --include=Gio-2.0 \ +@ENABLE_INTROSPECTION_TRUE@ --namespace=GIMarshallingTests --nsversion=1.0 --symbol-prefix=gi_marshalling_tests \ +@ENABLE_INTROSPECTION_TRUE@ --warn-all --warn-error \ +@ENABLE_INTROSPECTION_TRUE@ --library=libgimarshallingtests.la \ +@ENABLE_INTROSPECTION_TRUE@ --libtool="$(top_builddir)/libtool" \ +@ENABLE_INTROSPECTION_TRUE@ --output $@ \ +@ENABLE_INTROSPECTION_TRUE@ $(nodist_libgimarshallingtests_la_SOURCES) +@ENABLE_INTROSPECTION_TRUE@GIMarshallingTests-1.0.typelib: GIMarshallingTests-1.0.gir Makefile +@ENABLE_INTROSPECTION_TRUE@ $(AM_V_GEN) g-ir-compiler $< -o $@ + +@ENABLE_INTROSPECTION_TRUE@gschemas.compiled: org.gnome.test.gschema.xml +@ENABLE_INTROSPECTION_TRUE@ glib-compile-schemas --targetdir=. --schema-file=$< + +# This is a hack to make sure a shared library is built testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES) $(LINK) -rpath $(pkgpyexecdir) $(testhelper_la_LDFLAGS) $(testhelper_la_OBJECTS) $(testhelper_la_LIBADD) $(LIBS) -check-local: $(top_srcdir)/glib/__init__.py $(top_srcdir)/gobject/__init__.py $(top_srcdir)/gio/__init__.py - @if test "$(top_builddir)" != "$(top_srcdir)"; then \ - cp $(top_srcdir)/glib/*.py $(top_builddir)/glib; \ - cp $(top_srcdir)/gobject/*.py $(top_builddir)/gobject; \ - cp $(top_srcdir)/gio/*.py $(top_builddir)/gio; \ - fi - @$(PYTHON) $(srcdir)/runtests.py $(top_builddir) $(top_srcdir) - @if test "$(top_builddir)" != "$(top_srcdir)"; then \ - rm -f $(top_builddir)/glib/*.py; \ - rm -f $(top_builddir)/gobject/*.py; \ - rm -f $(top_builddir)/gio/*.py; \ - fi - @rm -fr $(top_builddir)/glib/*.pyc - @rm -fr $(top_builddir)/gobject/*.pyc - @rm -fr $(top_builddir)/gio/*.pyc +.la.so: + test -L $@ || $(LN_S) .libs/$@ $@ all: $(LTLIBRARIES:.la=.so) + clean-local: - rm -f $(LTLIBRARIES:.la=.so) -.la.so: - $(LN_S) .libs/$@ $@ || true + rm -f $(LTLIBRARIES:.la=.so) file.txt~ + +# run tests in separately to avoid loading static and introspection bindings in the same process +check-local: $(LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled + TEST_FILES="$(TEST_FILES_STATIC)" $(RUN_TESTS_LAUNCH) + TEST_FILES="$(TEST_FILES_GI)" $(RUN_TESTS_LAUNCH) +@BUILD_GIO_TRUE@ TEST_FILES="$(TEST_FILES_GIO)" $(RUN_TESTS_LAUNCH) + +check.gdb: + EXEC_NAME="gdb --args" $(MAKE) check + +check.valgrind: + EXEC_NAME="valgrind --suppressions=python.supp" G_SLICE=always-malloc G_DEBUG=gc-friendly $(MAKE) check + +-include $(top_srcdir)/git.mk # 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/tests/common.py b/tests/common.py deleted file mode 100644 index a6fa73d..0000000 --- a/tests/common.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import sys - -def importModules(buildDir, srcDir): - # Be very careful when you change this code, it's - # fragile and the order is really significant - - sys.path.insert(0, srcDir) - sys.path.insert(0, buildDir) - sys.path.insert(0, os.path.join(buildDir, 'glib')) - sys.path.insert(0, os.path.join(buildDir, 'gobject')) - sys.path.insert(0, os.path.join(buildDir, 'gio')) - - # testhelper - sys.path.insert(0, os.path.join(buildDir, 'tests')) - sys.argv.append('--g-fatal-warnings') - - testhelper = importModule('testhelper', '.') - glib = importModule('glib', buildDir, 'glib') - gobject = importModule('gobject', buildDir, 'gobject') - gio = importModule('gio', buildDir, 'gio') - - globals().update(locals()) - - os.environ['PYGTK_USE_GIL_STATE_API'] = '' - gobject.threads_init() - -def importModule(module, directory, name=None): - global isDistCheck - - origName = module - if not name: - name = module + '.la' - - try: - obj = __import__(module, {}, {}, '') - except ImportError, e: - raise SystemExit('%s could not be imported: %s' % (origName, e)) - - location = obj.__file__ - - current = os.getcwd() - expected = os.path.abspath(os.path.join(current, location)) - current = os.path.abspath(location) - if current != expected: - raise AssertionError('module %s imported from wrong location. Expected %s, got %s' % ( - module, expected, current)) - return obj diff --git a/tests/compathelper.py b/tests/compathelper.py new file mode 100644 index 0000000..2465747 --- /dev/null +++ b/tests/compathelper.py @@ -0,0 +1,69 @@ +import sys + +if sys.version_info >= (3, 0): + ''' + for tests that need to test long values in python 2 + + python 3 does not differentiate between long and int + and does not supply a long keyword + + instead of testing longs by using values such as 10L + test writters should do this: + + from compathelper import _long + _long(10) + ''' + _long = int + + ''' + for tests that need to test string values in python 2 + + python 3 does differentiate between str and bytes + and does not supply a basestring keyword + + any tests that use basestring should do this: + + from compathelper import _basestring + isinstance(_basestring, "hello") + ''' + _basestring = str + + ''' + for tests that need to write to intefaces that take bytes in + python 3 + + python 3 has a seperate bytes type for low level functions like os.write + + python 2 treats these as strings + + any tests that need to write a string of bytes should do something like + this: + + from compathelper import _bytes + os.write(_bytes("hello")) + ''' + + _bytes = lambda s: s.encode() + + ''' + for tests that need to write to intefaces that take unicode in + python 2 + + python 3 strings are unicode encoded as UTF-8 so the unicode object + doesn't exist + + python 2 differs between a string an unicode string and you must specify + an encoding. This macro will specify UTF-8 in python 2 + + any tests that need to use unicode should do this + + from compathelper import _unicode + unicode_string = _unicode('this is a unicode string') + ''' + + _unicode = lambda s: str(s) +else: + _long = long + _basestring = basestring + _bytes = str + _unicode = lambda s: unicode(s, 'UTF-8') diff --git a/tests/org.gnome.test.gschema.xml b/tests/org.gnome.test.gschema.xml new file mode 100644 index 0000000..221b87a --- /dev/null +++ b/tests/org.gnome.test.gschema.xml @@ -0,0 +1,25 @@ + + + + true + + + "Hello" + + + (1,2) + + + [1,2] + + + + + + 42 + + + + + + diff --git a/tests/runtests.py b/tests/runtests.py index da5ade0..2bb8637 100644 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -1,44 +1,34 @@ -#!/usr/bin/env python -import glob +# -*- Mode: Python -*- + import os +import glob import sys -import unittest - -import common -program = None -if len(sys.argv) == 3: - buildDir = sys.argv[1] - srcDir = sys.argv[2] -else: - if len(sys.argv) == 2: - program = sys.argv[1] - if program.endswith('.py'): - program = program[:-3] - buildDir = '..' - srcDir = '.' - -common.importModules(buildDir=buildDir, - srcDir=srcDir) +import unittest -SKIP_FILES = ['common', 'runtests'] -dir = os.path.split(os.path.abspath(__file__))[0] -os.chdir(dir) +# force untranslated messages, as we check for them in some tests +os.environ['LC_MESSAGES'] = 'C' -def gettestnames(): - files = glob.glob('*.py') - names = map(lambda x: x[:-3], files) - map(names.remove, SKIP_FILES) - return names +# Load tests. +if 'TEST_NAMES' in os.environ: + names = os.environ['TEST_NAMES'].split() +elif 'TEST_FILES' in os.environ: + names = [] + for filename in os.environ['TEST_FILES'].split(): + names.append(filename[:-3]) +else: + names = [] + for filename in glob.iglob("test_*.py"): + names.append(filename[:-3]) -suite = unittest.TestSuite() loader = unittest.TestLoader() +suite = loader.loadTestsFromNames(names) + -for name in gettestnames(): - if program and program not in name: - continue - suite.addTest(loader.loadTestsFromName(name)) +# Run tests. +runner = unittest.TextTestRunner(verbosity=2) +result = runner.run(suite) +if not result.wasSuccessful(): + sys.exit(1) # exit code so "make check" reports error -testRunner = unittest.TextTestRunner() -testRunner.run(suite) diff --git a/tests/test-floating.c b/tests/test-floating.c index 918a42d..8e8ba5d 100644 --- a/tests/test-floating.c +++ b/tests/test-floating.c @@ -93,3 +93,69 @@ test_floating_without_sink_func_init (TestFloatingWithoutSinkFunc *self) { } +/* TestOwnedByLibrary */ + +G_DEFINE_TYPE(TestOwnedByLibrary, test_owned_by_library, G_TYPE_OBJECT) + +static GSList *obl_instance_list = NULL; + +static void +test_owned_by_library_class_init (TestOwnedByLibraryClass *klass) +{ +} + +static void +test_owned_by_library_init (TestOwnedByLibrary *self) +{ + g_object_ref (self); + obl_instance_list = g_slist_prepend (obl_instance_list, self); +} + +void +test_owned_by_library_release (TestOwnedByLibrary *self) +{ + obl_instance_list = g_slist_remove (obl_instance_list, self); + g_object_unref (self); +} + +GSList * +test_owned_by_library_get_instance_list (void) +{ + return obl_instance_list; +} + +/* TestFloatingAndSunk + * This object is mimicking the GtkWindow behaviour, ie a GInitiallyUnowned subclass + * whose floating reference has already been sunk when g_object_new() returns it. + * The reference is already sunk because the instance is already owned by the instance + * list. + */ + +G_DEFINE_TYPE(TestFloatingAndSunk, test_floating_and_sunk, G_TYPE_INITIALLY_UNOWNED) + +static GSList *fas_instance_list = NULL; + +static void +test_floating_and_sunk_class_init (TestFloatingAndSunkClass *klass) +{ +} + +static void +test_floating_and_sunk_init (TestFloatingAndSunk *self) +{ + g_object_ref_sink (self); + fas_instance_list = g_slist_prepend (fas_instance_list, self); +} + +void +test_floating_and_sunk_release (TestFloatingAndSunk *self) +{ + fas_instance_list = g_slist_remove (fas_instance_list, self); + g_object_unref (self); +} + +GSList * +test_floating_and_sunk_get_instance_list (void) +{ + return fas_instance_list; +} diff --git a/tests/test-floating.h b/tests/test-floating.h index e53df32..bf4e101 100644 --- a/tests/test-floating.h +++ b/tests/test-floating.h @@ -58,3 +58,44 @@ typedef struct { GType test_floating_without_sink_func_get_type (void); +/* TestOwnedByLibrary */ + +typedef struct { + GObject parent; +} TestOwnedByLibrary; + +typedef struct { + GObjectClass parent_class; +} TestOwnedByLibraryClass; + +#define TEST_TYPE_OWNED_BY_LIBRARY (test_owned_by_library_get_type()) +#define TEST_OWNED_BY_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_OWNED_BY_LIBRARY, TestOwnedByLibrary)) +#define TEST_OWNED_BY_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_OWNED_BY_LIBRARY, TestOwnedByLibraryClass)) +#define TEST_IS_OWNED_BY_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_OWNED_BY_LIBRARY)) +#define TEST_IS_OWNED_BY_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TEST_TYPE_OWNED_BY_LIBRARY)) +#define TEST_OWNED_BY_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_OWNED_BY_LIBRARY, TestOwnedByLibraryClass)) + +GType test_owned_by_library_get_type (void); +void test_owned_by_library_release (TestOwnedByLibrary *self); +GSList *test_owned_by_library_get_instance_list (void); + +/* TestFloatingAndSunk */ + +typedef struct { + GInitiallyUnowned parent; +} TestFloatingAndSunk; + +typedef struct { + GInitiallyUnownedClass parent_class; +} TestFloatingAndSunkClass; + +#define TEST_TYPE_FLOATING_AND_SUNK (test_floating_and_sunk_get_type()) +#define TEST_FLOATING_AND_SUNK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_FLOATING_AND_SUNK, TestFloatingAndSunk)) +#define TEST_FLOATING_AND_SUNK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_FLOATING_AND_SUNK, TestFloatingAndSunkClass)) +#define TEST_IS_FLOATING_AND_SUNK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_FLOATING_AND_SUNK)) +#define TEST_IS_FLOATING_AND_SUNK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TEST_TYPE_FLOATING_AND_SUNK)) +#define TEST_FLOATING_AND_SUNK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_FLOATING_AND_SUNK, TestFloatingAndSunkClass)) + +GType test_floating_and_sunk_get_type (void); +void test_floating_and_sunk_release (TestFloatingAndSunk *self); +GSList *test_floating_and_sunk_get_instance_list (void); diff --git a/tests/test_everything.py b/tests/test_everything.py new file mode 100644 index 0000000..5fadc36 --- /dev/null +++ b/tests/test_everything.py @@ -0,0 +1,467 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# coding=utf-8 +# vim: tabstop=4 shiftwidth=4 expandtab + +import unittest + +import sys +sys.path.insert(0, "../") +from sys import getrefcount + +import cairo + +from gi.repository import GObject +from gi.repository import Regress as Everything + +if sys.version_info < (3, 0): + UNICHAR = "\xe2\x99\xa5" + PY2_UNICODE_UNICHAR = unicode(UNICHAR, 'UTF-8') +else: + UNICHAR = "♥" + + +class TestEverything(unittest.TestCase): + + def test_cairo_context(self): + context = Everything.test_cairo_context_full_return() + self.assertTrue(isinstance(context, cairo.Context)) + + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 10, 10) + context = cairo.Context(surface) + Everything.test_cairo_context_none_in(context) + + def test_cairo_surface(self): + surface = Everything.test_cairo_surface_none_return() + self.assertTrue(isinstance(surface, cairo.ImageSurface)) + self.assertTrue(isinstance(surface, cairo.Surface)) + self.assertEquals(surface.get_format(), cairo.FORMAT_ARGB32) + self.assertEquals(surface.get_width(), 10) + self.assertEquals(surface.get_height(), 10) + + surface = Everything.test_cairo_surface_full_return() + self.assertTrue(isinstance(surface, cairo.ImageSurface)) + self.assertTrue(isinstance(surface, cairo.Surface)) + self.assertEquals(surface.get_format(), cairo.FORMAT_ARGB32) + self.assertEquals(surface.get_width(), 10) + self.assertEquals(surface.get_height(), 10) + + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 10, 10) + Everything.test_cairo_surface_none_in(surface) + + surface = Everything.test_cairo_surface_full_out() + self.assertTrue(isinstance(surface, cairo.ImageSurface)) + self.assertTrue(isinstance(surface, cairo.Surface)) + self.assertEquals(surface.get_format(), cairo.FORMAT_ARGB32) + self.assertEquals(surface.get_width(), 10) + self.assertEquals(surface.get_height(), 10) + + def test_unichar(self): + self.assertEquals("c", Everything.test_unichar("c")) + + if sys.version_info < (3, 0): + self.assertEquals(UNICHAR, Everything.test_unichar(PY2_UNICODE_UNICHAR)) + self.assertEquals(UNICHAR, Everything.test_unichar(UNICHAR)) + self.assertRaises(TypeError, Everything.test_unichar, "") + self.assertRaises(TypeError, Everything.test_unichar, "morethanonechar") + + + def test_floating(self): + e = Everything.TestFloating() + self.assertEquals(e.__grefcount__, 1) + + e = GObject.new(Everything.TestFloating) + self.assertEquals(e.__grefcount__, 1) + + e = Everything.TestFloating.new() + self.assertEquals(e.__grefcount__, 1) + + def test_caller_allocates(self): + struct_a = Everything.TestStructA() + struct_a.some_int = 10 + struct_a.some_int8 = 21 + struct_a.some_double = 3.14 + struct_a.some_enum = Everything.TestEnum.VALUE3 + + struct_a_clone = struct_a.clone() + self.assertTrue(struct_a != struct_a_clone) + self.assertEquals(struct_a.some_int, struct_a_clone.some_int) + self.assertEquals(struct_a.some_int8, struct_a_clone.some_int8) + self.assertEquals(struct_a.some_double, struct_a_clone.some_double) + self.assertEquals(struct_a.some_enum, struct_a_clone.some_enum) + + struct_b = Everything.TestStructB() + struct_b.some_int8 = 8 + struct_b.nested_a.some_int = 20 + struct_b.nested_a.some_int8 = 12 + struct_b.nested_a.some_double = 333.3333 + struct_b.nested_a.some_enum = Everything.TestEnum.VALUE2 + + struct_b_clone = struct_b.clone() + self.assertTrue(struct_b != struct_b_clone) + self.assertEquals(struct_b.some_int8, struct_b_clone.some_int8) + self.assertEquals(struct_b.nested_a.some_int, struct_b_clone.nested_a.some_int) + self.assertEquals(struct_b.nested_a.some_int8, struct_b_clone.nested_a.some_int8) + self.assertEquals(struct_b.nested_a.some_double, struct_b_clone.nested_a.some_double) + self.assertEquals(struct_b.nested_a.some_enum, struct_b_clone.nested_a.some_enum) + + def test_wrong_type_of_arguments(self): + try: + Everything.test_int8() + except TypeError: + (e_type, e) = sys.exc_info()[:2] + self.assertEquals(e.args, ("test_int8() takes exactly 1 argument(s) (0 given)",)) + + def test_gtypes(self): + gchararray_gtype = GObject.type_from_name('gchararray') + gtype = Everything.test_gtype(str) + self.assertEquals(gchararray_gtype, gtype) + gtype = Everything.test_gtype('gchararray') + self.assertEquals(gchararray_gtype, gtype) + gobject_gtype = GObject.GObject.__gtype__ + gtype = Everything.test_gtype(GObject.GObject) + self.assertEquals(gobject_gtype, gtype) + gtype = Everything.test_gtype('GObject') + self.assertEquals(gobject_gtype, gtype) + self.assertRaises(TypeError, Everything.test_gtype, 'invalidgtype') + + class NotARegisteredClass(object): + pass + + self.assertRaises(TypeError, Everything.test_gtype, NotARegisteredClass) + + class ARegisteredClass(GObject.GObject): + __gtype_name__ = 'EverythingTestsARegisteredClass' + + gtype = Everything.test_gtype('EverythingTestsARegisteredClass') + self.assertEquals(ARegisteredClass.__gtype__, gtype) + gtype = Everything.test_gtype(ARegisteredClass) + self.assertEquals(ARegisteredClass.__gtype__, gtype) + self.assertRaises(TypeError, Everything.test_gtype, 'ARegisteredClass') + + def test_dir(self): + attr_list = dir(Everything) + + # test that typelib attributes are listed + self.assertTrue('TestStructA' in attr_list) + + # test that class attributes and methods are listed + self.assertTrue('__class__' in attr_list) + self.assertTrue('__dir__' in attr_list) + self.assertTrue('__repr__' in attr_list) + + # test that instance members are listed + self.assertTrue('_namespace' in attr_list) + self.assertTrue('_version' in attr_list) + + # test that there are no duplicates returned + self.assertEqual(len(attr_list), len(set(attr_list))) + +class TestNullableArgs(unittest.TestCase): + def test_in_nullable_hash(self): + Everything.test_ghash_null_in(None) + + def test_in_nullable_list(self): + Everything.test_gslist_null_in(None) + Everything.test_glist_null_in(None) + Everything.test_gslist_null_in([]) + Everything.test_glist_null_in([]) + + def test_in_nullable_array(self): + Everything.test_array_int_null_in(None) + Everything.test_array_int_null_in([]) + + def test_in_nullable_string(self): + Everything.test_utf8_null_in(None) + + def test_in_nullable_object(self): + Everything.func_obj_null_in(None) + + def test_out_nullable_hash(self): + self.assertEqual(None, Everything.test_ghash_null_out()) + + def test_out_nullable_list(self): + self.assertEqual([], Everything.test_gslist_null_out()) + self.assertEqual([], Everything.test_glist_null_out()) + + def test_out_nullable_array(self): + self.assertEqual([], Everything.test_array_int_null_out()) + + def test_out_nullable_string(self): + self.assertEqual(None, Everything.test_utf8_null_out()) + + def test_out_nullable_object(self): + self.assertEqual(None, Everything.TestObj.null_out()) + + +class TestCallbacks(unittest.TestCase): + called = False + main_loop = GObject.MainLoop() + + def testCallback(self): + TestCallbacks.called = False + def callback(): + TestCallbacks.called = True + + Everything.test_simple_callback(callback) + self.assertTrue(TestCallbacks.called) + + def testCallbackException(self): + """ + This test ensures that we get errors from callbacks correctly + and in particular that we do not segv when callbacks fail + """ + def callback(): + x = 1 / 0 + + try: + Everything.test_simple_callback(callback) + except ZeroDivisionError: + pass + + def testDoubleCallbackException(self): + """ + This test ensures that we get errors from callbacks correctly + and in particular that we do not segv when callbacks fail + """ + def badcallback(): + x = 1 / 0 + + def callback(): + Everything.test_boolean(True) + Everything.test_boolean(False) + Everything.test_simple_callback(badcallback()) + + try: + Everything.test_simple_callback(callback) + except ZeroDivisionError: + pass + + def testReturnValueCallback(self): + TestCallbacks.called = False + def callback(): + TestCallbacks.called = True + return 44 + + self.assertEquals(Everything.test_callback(callback), 44) + self.assertTrue(TestCallbacks.called) + + def testCallbackAsync(self): + TestCallbacks.called = False + def callback(foo): + TestCallbacks.called = True + return foo + + Everything.test_callback_async(callback, 44); + i = Everything.test_callback_thaw_async(); + self.assertEquals(44, i); + self.assertTrue(TestCallbacks.called) + + def testCallbackScopeCall(self): + TestCallbacks.called = 0 + def callback(): + TestCallbacks.called += 1 + return 0 + + Everything.test_multi_callback(callback) + self.assertEquals(TestCallbacks.called, 2) + + def testCallbackUserdata(self): + TestCallbacks.called = 0 + def callback(userdata): + self.assertEquals(userdata, "Test%d" % TestCallbacks.called) + TestCallbacks.called += 1 + return TestCallbacks.called + + for i in range(100): + val = Everything.test_callback_user_data(callback, "Test%d" % i) + self.assertEquals(val, i+1) + + self.assertEquals(TestCallbacks.called, 100) + + def testCallbackUserdataRefCount(self): + TestCallbacks.called = False + def callback(userdata): + TestCallbacks.called = True + return 1 + + ud = "Test User Data" + + start_ref_count = getrefcount(ud) + for i in range(100): + Everything.test_callback_destroy_notify(callback, ud) + + Everything.test_callback_thaw_notifications() + end_ref_count = getrefcount(ud) + + self.assertEquals(start_ref_count, end_ref_count) + + def testAsyncReadyCallback(self): + TestCallbacks.called = False + TestCallbacks.main_loop = GObject.MainLoop() + + def callback(obj, result, user_data): + TestCallbacks.main_loop.quit() + TestCallbacks.called = True + + Everything.test_async_ready_callback(callback) + + TestCallbacks.main_loop.run() + + self.assertTrue(TestCallbacks.called) + + def testCallbackDestroyNotify(self): + def callback(user_data): + TestCallbacks.called = True + return 42 + + TestCallbacks.called = False + self.assertEquals(Everything.test_callback_destroy_notify(callback, 42), 42) + self.assertTrue(TestCallbacks.called) + self.assertEquals(Everything.test_callback_thaw_notifications(), 42) + + def testCallbackInMethods(self): + object_ = Everything.TestObj() + + def callback(): + TestCallbacks.called = True + return 42 + + TestCallbacks.called = False + object_.instance_method_callback(callback) + self.assertTrue(TestCallbacks.called) + + TestCallbacks.called = False + Everything.TestObj.static_method_callback(callback) + self.assertTrue(TestCallbacks.called) + + def callbackWithUserData(user_data): + TestCallbacks.called = True + return 42 + + TestCallbacks.called = False + obj_ = Everything.TestObj.new_callback(callbackWithUserData, None) + self.assertTrue(TestCallbacks.called) + + def testCallbackNone(self): + # make sure this doesn't assert or crash + Everything.test_simple_callback(None) + + +class TestProperties(unittest.TestCase): + + def test_basic(self): + object_ = Everything.TestObj() + + self.assertEquals(object_.props.int, 0) + object_.props.int = 42 + self.assertTrue(isinstance(object_.props.int, int)) + self.assertEquals(object_.props.int, 42) + + self.assertEquals(object_.props.float, 0.0) + object_.props.float = 42.42 + self.assertTrue(isinstance(object_.props.float, float)) + self.assertAlmostEquals(object_.props.float, 42.42, places=5) + + self.assertEquals(object_.props.double, 0.0) + object_.props.double = 42.42 + self.assertTrue(isinstance(object_.props.double, float)) + self.assertAlmostEquals(object_.props.double, 42.42, places=5) + + self.assertEquals(object_.props.string, None) + object_.props.string = 'mec' + self.assertTrue(isinstance(object_.props.string, str)) + self.assertEquals(object_.props.string, 'mec') + + def test_hash_table(self): + object_ = Everything.TestObj() + self.assertEquals(object_.props.hash_table, None) + + object_.props.hash_table = {'mec': 56} + self.assertTrue(isinstance(object_.props.hash_table, dict)) + self.assertEquals(list(object_.props.hash_table.items())[0], ('mec', 56)) + + def test_list(self): + object_ = Everything.TestObj() + self.assertEquals(object_.props.list, []) + + object_.props.list = ['1', '2', '3'] + self.assertTrue(isinstance(object_.props.list, list)) + self.assertEquals(object_.props.list, ['1', '2', '3']) + + def test_boxed(self): + object_ = Everything.TestObj() + self.assertEquals(object_.props.boxed, None) + + boxed = Everything.TestBoxed() + boxed.some_int8 = 42 + object_.props.boxed = boxed + + self.assertTrue(isinstance(object_.props.boxed, Everything.TestBoxed)) + self.assertEquals(object_.props.boxed.some_int8, 42) + +class TestTortureProfile(unittest.TestCase): + def test_torture_profile(self): + import time + total_time = 0 + print("") + object_ = Everything.TestObj() + sys.stdout.write("\ttorture test 1 (10000 iterations): ") + + start_time = time.clock() + for i in range(10000): + (y,z,q) = object_.torture_signature_0(5000, + "Torture Test 1", + 12345) + + end_time = time.clock() + delta_time = end_time - start_time + total_time += delta_time + print("%f secs" % delta_time) + + sys.stdout.write("\ttorture test 2 (10000 iterations): ") + + start_time = time.clock() + for i in range(10000): + (y,z,q) = Everything.TestObj().torture_signature_0(5000, + "Torture Test 2", + 12345) + + end_time = time.clock() + delta_time = end_time - start_time + total_time += delta_time + print("%f secs" % delta_time) + + + sys.stdout.write("\ttorture test 3 (10000 iterations): ") + start_time = time.clock() + for i in range(10000): + try: + (y,z,q) = object_.torture_signature_1(5000, + "Torture Test 3", + 12345) + except: + pass + end_time = time.clock() + delta_time = end_time - start_time + total_time += delta_time + print("%f secs" % delta_time) + + sys.stdout.write("\ttorture test 4 (10000 iterations): ") + def callback(userdata): + pass + + userdata = [1,2,3,4] + start_time = time.clock() + for i in range(10000): + (y,z,q) = Everything.test_torture_signature_2(5000, + callback, + userdata, + "Torture Test 4", + 12345) + end_time = time.clock() + delta_time = end_time - start_time + total_time += delta_time + print("%f secs" % delta_time) + print("\t====") + print("\tTotal: %f sec" % total_time) + diff --git a/tests/test_gcancellable.py b/tests/test_gcancellable.py new file mode 100644 index 0000000..f911572 --- /dev/null +++ b/tests/test_gcancellable.py @@ -0,0 +1,15 @@ +# -*- Mode: Python -*- + +import unittest + +import glib +import gio + + +class TestResolver(unittest.TestCase): + def setUp(self): + self.cancellable = gio.Cancellable() + + def test_make_poll_fd(self): + poll = self.cancellable.make_pollfd() + self.failUnless(isinstance(poll, glib.PollFD)) diff --git a/tests/test_gdbus.py b/tests/test_gdbus.py new file mode 100644 index 0000000..a9442fe --- /dev/null +++ b/tests/test_gdbus.py @@ -0,0 +1,218 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab + +import unittest + +import sys +sys.path.insert(0, "../") + +import gobject +from gi.repository import GLib +from gi.repository import Gio + +class TestGDBusClient(unittest.TestCase): + def setUp(self): + self.bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) + + self.dbus_proxy = Gio.DBusProxy.new_sync(self.bus, + Gio.DBusProxyFlags.NONE, None, + 'org.freedesktop.DBus', + '/org/freedesktop/DBus', + 'org.freedesktop.DBus', None) + + def test_native_calls_sync(self): + result = self.dbus_proxy.call_sync('ListNames', None, + Gio.DBusCallFlags.NO_AUTO_START, 500, None) + self.assertTrue(isinstance(result, GLib.Variant)) + result = result.unpack()[0] # result is always a tuple + self.assertTrue(len(result) > 1) + self.assertTrue('org.freedesktop.DBus' in result) + + result = self.dbus_proxy.call_sync('GetNameOwner', + GLib.Variant('(s)', ('org.freedesktop.DBus',)), + Gio.DBusCallFlags.NO_AUTO_START, 500, None) + self.assertTrue(isinstance(result, GLib.Variant)) + self.assertEqual(type(result.unpack()[0]), type('')) + + def test_native_calls_sync_errors(self): + # error case: invalid argument types + try: + self.dbus_proxy.call_sync('GetConnectionUnixProcessID', None, + Gio.DBusCallFlags.NO_AUTO_START, 500, None) + self.fail('call with invalid arguments should raise an exception') + except Exception: + etype, e = sys.exc_info()[:2] + self.assertTrue('InvalidArgs' in str(e)) + + # error case: invalid argument + try: + self.dbus_proxy.call_sync('GetConnectionUnixProcessID', + GLib.Variant('(s)', (' unknown',)), + Gio.DBusCallFlags.NO_AUTO_START, 500, None) + self.fail('call with invalid arguments should raise an exception') + except Exception: + etype, e = sys.exc_info()[:2] + + self.assertTrue('NameHasNoOwner' in str(e)) + + # error case: unknown method + try: + self.dbus_proxy.call_sync('UnknownMethod', None, + Gio.DBusCallFlags.NO_AUTO_START, 500, None) + self.fail('call for unknown method should raise an exception') + except Exception: + etype, e = sys.exc_info()[:2] + + self.assertTrue('UnknownMethod' in str(e)) + + def test_native_calls_async(self): + def call_done(obj, result, user_data): + user_data['result'] = obj.call_finish(result) + user_data['main_loop'].quit() + + main_loop = gobject.MainLoop() + data = {'main_loop': main_loop} + self.dbus_proxy.call('ListNames', None, + Gio.DBusCallFlags.NO_AUTO_START, 500, None, + call_done, data) + main_loop.run() + + self.assertTrue(isinstance(data['result'], GLib.Variant)) + result = data['result'].unpack()[0] # result is always a tuple + self.assertTrue(len(result) > 1) + self.assertTrue('org.freedesktop.DBus' in result) + + def test_native_calls_async_errors(self): + def call_done(obj, result, user_data): + try: + obj.call_finish(result) + self.fail('call_finish() for unknown method should raise an exception') + except Exception: + etype, e = sys.exc_info()[:2] + + self.assertTrue('UnknownMethod' in str(e)) + finally: + user_data['main_loop'].quit() + + main_loop = gobject.MainLoop() + data = {'main_loop': main_loop} + self.dbus_proxy.call('UnknownMethod', None, + Gio.DBusCallFlags.NO_AUTO_START, 500, None, call_done, data) + main_loop.run() + + def test_python_calls_sync(self): + # single value return tuples get unboxed to the one element + result = self.dbus_proxy.ListNames('()') + self.assertTrue(isinstance(result, list)) + self.assertTrue(len(result) > 1) + self.assertTrue('org.freedesktop.DBus' in result) + + result = self.dbus_proxy.GetNameOwner('(s)', 'org.freedesktop.DBus') + self.assertEqual(type(result), type('')) + + # empty return tuples get unboxed to None + self.assertEqual(self.dbus_proxy.ReloadConfig('()'), None) + + # multiple return values remain a tuple; unfortunately D-BUS itself + # does not have any method returning multiple results, so try talking + # to notification-daemon (and don't fail the test if it does not exist) + try: + notification_daemon = Gio.DBusProxy.new_sync(self.bus, + Gio.DBusProxyFlags.NONE, None, + 'org.freedesktop.Notifications', + '/org/freedesktop/Notifications', + 'org.freedesktop.Notifications', None) + result = notification_daemon.GetServerInformation('()') + self.assertTrue(isinstance(result, tuple)) + self.assertEqual(len(result), 4) + for i in result: + self.assertEqual(type(i), type('')) + except Exception: + etype, e = sys.exc_info()[:2] + + if 'Error.ServiceUnknown' not in str(e): + raise + + # test keyword argument; timeout=0 will fail immediately + try: + self.dbus_proxy.GetConnectionUnixProcessID('()', timeout=0) + self.fail('call with timeout=0 should raise an exception') + except Exception: + etype, e = sys.exc_info()[:2] + + self.assertTrue('Timeout' in str(e), str(e)) + + def test_python_calls_sync_noargs(self): + # methods without arguments don't need an explicit signature + result = self.dbus_proxy.ListNames() + self.assertTrue(isinstance(result, list)) + self.assertTrue(len(result) > 1) + self.assertTrue('org.freedesktop.DBus' in result) + + def test_python_calls_sync_errors(self): + # error case: invalid argument types + try: + self.dbus_proxy.GetConnectionUnixProcessID('()') + self.fail('call with invalid arguments should raise an exception') + except Exception: + etype, e = sys.exc_info()[:2] + + self.assertTrue('InvalidArgs' in str(e), str(e)) + + try: + self.dbus_proxy.GetConnectionUnixProcessID(None, 'foo') + self.fail('call with None signature should raise an exception') + except TypeError as e: + self.assertTrue('signature' in str(e), str(e)) + + def test_python_calls_async(self): + def call_done(obj, result, user_data): + user_data['result'] = result + user_data['main_loop'].quit() + + main_loop = gobject.MainLoop() + data = {'main_loop': main_loop} + self.dbus_proxy.ListNames('()', result_handler=call_done, + user_data=data) + main_loop.run() + + result = data['result'] + self.assertEqual(type(result), type([])) + self.assertTrue(len(result) > 1) + self.assertTrue('org.freedesktop.DBus' in result) + + def test_python_calls_async_error_result(self): + # when only specifying a result handler, this will get the error + def call_done(obj, result, user_data): + user_data['result'] = result + user_data['main_loop'].quit() + + main_loop = gobject.MainLoop() + data = {'main_loop': main_loop} + self.dbus_proxy.ListNames('(s)', 'invalid_argument', + result_handler=call_done, user_data=data) + main_loop.run() + + self.assertTrue(isinstance(data['result'], Exception)) + self.assertTrue('InvalidArgs' in str(data['result']), str(data['result'])) + + def test_python_calls_async_error(self): + # when specifying an explicit error handler, this will get the error + def call_done(obj, result, user_data): + user_data['main_loop'].quit() + self.fail('result handler should not be called') + + def call_error(obj, error, user_data): + user_data['error'] = error + user_data['main_loop'].quit() + + main_loop = gobject.MainLoop() + data = {'main_loop': main_loop} + self.dbus_proxy.ListNames('(s)', 'invalid_argument', + result_handler=call_done, error_handler=call_error, + user_data=data) + main_loop.run() + + self.assertTrue(isinstance(data['error'], Exception)) + self.assertTrue('InvalidArgs' in str(data['error']), str(data['error'])) + diff --git a/tests/test_gi.py b/tests/test_gi.py new file mode 100644 index 0000000..6990225 --- /dev/null +++ b/tests/test_gi.py @@ -0,0 +1,1752 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# coding=utf-8 +# vim: tabstop=4 shiftwidth=4 expandtab + +import sys + +import unittest +import tempfile +import shutil +import os +import locale +import subprocess +from gi.repository import GObject + +import gobject +from gi.repository import GIMarshallingTests + +from compathelper import _bytes + +if sys.version_info < (3, 0): + CONSTANT_UTF8 = "const \xe2\x99\xa5 utf8" + PY2_UNICODE_UTF8 = unicode(CONSTANT_UTF8, 'UTF-8') + CHAR_255='\xff' +else: + CONSTANT_UTF8 = "const ♥ utf8" + CHAR_255=bytes([255]) + +CONSTANT_NUMBER = 42 + + +class Number(object): + + def __init__(self, value): + self.value = value + + def __int__(self): + return int(self.value) + + def __float__(self): + return float(self.value) + + +class Sequence(object): + + def __init__(self, sequence): + self.sequence = sequence + + def __len__(self): + return len(self.sequence) + + def __getitem__(self, key): + return self.sequence[key] + + +class TestConstant(unittest.TestCase): + +# Blocked by https://bugzilla.gnome.org/show_bug.cgi?id=595773 +# def test_constant_utf8(self): +# self.assertEquals(CONSTANT_UTF8, GIMarshallingTests.CONSTANT_UTF8) + + def test_constant_number(self): + self.assertEquals(CONSTANT_NUMBER, GIMarshallingTests.CONSTANT_NUMBER) + + +class TestBoolean(unittest.TestCase): + + def test_boolean_return(self): + self.assertEquals(True, GIMarshallingTests.boolean_return_true()) + self.assertEquals(False, GIMarshallingTests.boolean_return_false()) + + def test_boolean_in(self): + GIMarshallingTests.boolean_in_true(True) + GIMarshallingTests.boolean_in_false(False) + + GIMarshallingTests.boolean_in_true(1) + GIMarshallingTests.boolean_in_false(0) + + def test_boolean_out(self): + self.assertEquals(True, GIMarshallingTests.boolean_out_true()) + self.assertEquals(False, GIMarshallingTests.boolean_out_false()) + + def test_boolean_inout(self): + self.assertEquals(False, GIMarshallingTests.boolean_inout_true_false(True)) + self.assertEquals(True, GIMarshallingTests.boolean_inout_false_true(False)) + + +class TestInt8(unittest.TestCase): + + MAX = GObject.G_MAXINT8 + MIN = GObject.G_MININT8 + + def test_int8_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.int8_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int8_return_min()) + + def test_int8_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.int8_in_max(max) + GIMarshallingTests.int8_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.int8_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.int8_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.int8_in_max, "self.MAX") + + def test_int8_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.int8_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int8_out_min()) + + def test_int8_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.int8_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.int8_inout_min_max(Number(self.MIN))) + + +class TestUInt8(unittest.TestCase): + + MAX = GObject.G_MAXUINT8 + + def test_uint8_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint8_return()) + + def test_uint8_in(self): + number = Number(self.MAX) + + GIMarshallingTests.uint8_in(number) + GIMarshallingTests.uint8_in(CHAR_255) + + number.value += 1 + self.assertRaises(ValueError, GIMarshallingTests.uint8_in, number) + self.assertRaises(ValueError, GIMarshallingTests.uint8_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.uint8_in, "self.MAX") + + def test_uint8_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint8_out()) + + def test_uint8_inout(self): + self.assertEquals(0, GIMarshallingTests.uint8_inout(Number(self.MAX))) + + +class TestInt16(unittest.TestCase): + + MAX = GObject.G_MAXINT16 + MIN = GObject.G_MININT16 + + def test_int16_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.int16_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int16_return_min()) + + def test_int16_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.int16_in_max(max) + GIMarshallingTests.int16_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.int16_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.int16_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.int16_in_max, "self.MAX") + + def test_int16_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.int16_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int16_out_min()) + + def test_int16_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.int16_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.int16_inout_min_max(Number(self.MIN))) + + +class TestUInt16(unittest.TestCase): + + MAX = GObject.G_MAXUINT16 + + def test_uint16_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint16_return()) + + def test_uint16_in(self): + number = Number(self.MAX) + + GIMarshallingTests.uint16_in(number) + + number.value += 1 + + self.assertRaises(ValueError, GIMarshallingTests.uint16_in, number) + self.assertRaises(ValueError, GIMarshallingTests.uint16_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.uint16_in, "self.MAX") + + def test_uint16_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint16_out()) + + def test_uint16_inout(self): + self.assertEquals(0, GIMarshallingTests.uint16_inout(Number(self.MAX))) + + +class TestInt32(unittest.TestCase): + + MAX = GObject.G_MAXINT32 + MIN = GObject.G_MININT32 + + def test_int32_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.int32_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int32_return_min()) + + def test_int32_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.int32_in_max(max) + GIMarshallingTests.int32_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.int32_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.int32_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.int32_in_max, "self.MAX") + + def test_int32_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.int32_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int32_out_min()) + + def test_int32_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.int32_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.int32_inout_min_max(Number(self.MIN))) + + +class TestUInt32(unittest.TestCase): + + MAX = GObject.G_MAXUINT32 + + def test_uint32_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint32_return()) + + def test_uint32_in(self): + number = Number(self.MAX) + + GIMarshallingTests.uint32_in(number) + + number.value += 1 + + self.assertRaises(ValueError, GIMarshallingTests.uint32_in, number) + self.assertRaises(ValueError, GIMarshallingTests.uint32_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.uint32_in, "self.MAX") + + def test_uint32_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint32_out()) + + def test_uint32_inout(self): + self.assertEquals(0, GIMarshallingTests.uint32_inout(Number(self.MAX))) + + +class TestInt64(unittest.TestCase): + + MAX = 2 ** 63 - 1 + MIN = - (2 ** 63) + + def test_int64_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.int64_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int64_return_min()) + + def test_int64_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.int64_in_max(max) + GIMarshallingTests.int64_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.int64_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.int64_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.int64_in_max, "self.MAX") + + def test_int64_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.int64_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int64_out_min()) + + def test_int64_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.int64_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.int64_inout_min_max(Number(self.MIN))) + + +class TestUInt64(unittest.TestCase): + + MAX = 2 ** 64 - 1 + + def test_uint64_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint64_return()) + + def test_uint64_in(self): + number = Number(self.MAX) + + GIMarshallingTests.uint64_in(number) + + number.value += 1 + + self.assertRaises(ValueError, GIMarshallingTests.uint64_in, number) + self.assertRaises(ValueError, GIMarshallingTests.uint64_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.uint64_in, "self.MAX") + + def test_uint64_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint64_out()) + + def test_uint64_inout(self): + self.assertEquals(0, GIMarshallingTests.uint64_inout(Number(self.MAX))) + + +class TestShort(unittest.TestCase): + + MAX = GObject.constants.G_MAXSHORT + MIN = GObject.constants.G_MINSHORT + + def test_short_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.short_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.short_return_min()) + + def test_short_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.short_in_max(max) + GIMarshallingTests.short_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.short_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.short_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.short_in_max, "self.MAX") + + def test_short_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.short_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.short_out_min()) + + def test_short_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.short_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.short_inout_min_max(Number(self.MIN))) + + +class TestUShort(unittest.TestCase): + + MAX = GObject.constants.G_MAXUSHORT + + def test_ushort_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.ushort_return()) + + def test_ushort_in(self): + number = Number(self.MAX) + + GIMarshallingTests.ushort_in(number) + + number.value += 1 + + self.assertRaises(ValueError, GIMarshallingTests.ushort_in, number) + self.assertRaises(ValueError, GIMarshallingTests.ushort_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.ushort_in, "self.MAX") + + def test_ushort_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.ushort_out()) + + def test_ushort_inout(self): + self.assertEquals(0, GIMarshallingTests.ushort_inout(Number(self.MAX))) + + +class TestInt(unittest.TestCase): + + MAX = GObject.constants.G_MAXINT + MIN = GObject.constants.G_MININT + + def test_int_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.int_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int_return_min()) + + def test_int_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.int_in_max(max) + GIMarshallingTests.int_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.int_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.int_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.int_in_max, "self.MAX") + + def test_int_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.int_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.int_out_min()) + + def test_int_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.int_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.int_inout_min_max(Number(self.MIN))) + self.assertRaises(TypeError, GIMarshallingTests.int_inout_min_max, Number(self.MIN), CONSTANT_NUMBER) + + +class TestUInt(unittest.TestCase): + + MAX = GObject.constants.G_MAXUINT + + def test_uint_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint_return()) + + def test_uint_in(self): + number = Number(self.MAX) + + GIMarshallingTests.uint_in(number) + + number.value += 1 + + self.assertRaises(ValueError, GIMarshallingTests.uint_in, number) + self.assertRaises(ValueError, GIMarshallingTests.uint_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.uint_in, "self.MAX") + + def test_uint_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.uint_out()) + + def test_uint_inout(self): + self.assertEquals(0, GIMarshallingTests.uint_inout(Number(self.MAX))) + + +class TestLong(unittest.TestCase): + + MAX = GObject.constants.G_MAXLONG + MIN = GObject.constants.G_MINLONG + + def test_long_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.long_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.long_return_min()) + + def test_long_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.long_in_max(max) + GIMarshallingTests.long_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.long_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.long_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.long_in_max, "self.MAX") + + def test_long_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.long_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.long_out_min()) + + def test_long_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.long_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.long_inout_min_max(Number(self.MIN))) + + +class TestULong(unittest.TestCase): + + MAX = GObject.constants.G_MAXULONG + + def test_ulong_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.ulong_return()) + + def test_ulong_in(self): + number = Number(self.MAX) + + GIMarshallingTests.ulong_in(number) + + number.value += 1 + + self.assertRaises(ValueError, GIMarshallingTests.ulong_in, number) + self.assertRaises(ValueError, GIMarshallingTests.ulong_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.ulong_in, "self.MAX") + + def test_ulong_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.ulong_out()) + + def test_ulong_inout(self): + self.assertEquals(0, GIMarshallingTests.ulong_inout(Number(self.MAX))) + + +class TestSSize(unittest.TestCase): + + MAX = GObject.constants.G_MAXLONG + MIN = GObject.constants.G_MINLONG + + def test_ssize_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.ssize_return_max()) + self.assertEquals(self.MIN, GIMarshallingTests.ssize_return_min()) + + def test_ssize_in(self): + max = Number(self.MAX) + min = Number(self.MIN) + + GIMarshallingTests.ssize_in_max(max) + GIMarshallingTests.ssize_in_min(min) + + max.value += 1 + min.value -= 1 + + self.assertRaises(ValueError, GIMarshallingTests.ssize_in_max, max) + self.assertRaises(ValueError, GIMarshallingTests.ssize_in_min, min) + + self.assertRaises(TypeError, GIMarshallingTests.ssize_in_max, "self.MAX") + + def test_ssize_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.ssize_out_max()) + self.assertEquals(self.MIN, GIMarshallingTests.ssize_out_min()) + + def test_ssize_inout(self): + self.assertEquals(self.MIN, GIMarshallingTests.ssize_inout_max_min(Number(self.MAX))) + self.assertEquals(self.MAX, GIMarshallingTests.ssize_inout_min_max(Number(self.MIN))) + + +class TestSize(unittest.TestCase): + + MAX = GObject.constants.G_MAXULONG + + def test_size_return(self): + self.assertEquals(self.MAX, GIMarshallingTests.size_return()) + + def test_size_in(self): + number = Number(self.MAX) + + GIMarshallingTests.size_in(number) + + number.value += 1 + + self.assertRaises(ValueError, GIMarshallingTests.size_in, number) + self.assertRaises(ValueError, GIMarshallingTests.size_in, Number(-1)) + + self.assertRaises(TypeError, GIMarshallingTests.size_in, "self.MAX") + + def test_size_out(self): + self.assertEquals(self.MAX, GIMarshallingTests.size_out()) + + def test_size_inout(self): + self.assertEquals(0, GIMarshallingTests.size_inout(Number(self.MAX))) + + +class TestFloat(unittest.TestCase): + + MAX = GObject.constants.G_MAXFLOAT + MIN = GObject.constants.G_MINFLOAT + + def test_float_return(self): + self.assertAlmostEquals(self.MAX, GIMarshallingTests.float_return()) + + def test_float_in(self): + GIMarshallingTests.float_in(Number(self.MAX)) + + self.assertRaises(TypeError, GIMarshallingTests.float_in, "self.MAX") + + def test_float_out(self): + self.assertAlmostEquals(self.MAX, GIMarshallingTests.float_out()) + + def test_float_inout(self): + self.assertAlmostEquals(self.MIN, GIMarshallingTests.float_inout(Number(self.MAX))) + + +class TestDouble(unittest.TestCase): + + MAX = GObject.constants.G_MAXDOUBLE + MIN = GObject.constants.G_MINDOUBLE + + def test_double_return(self): + self.assertAlmostEquals(self.MAX, GIMarshallingTests.double_return()) + + def test_double_in(self): + GIMarshallingTests.double_in(Number(self.MAX)) + + self.assertRaises(TypeError, GIMarshallingTests.double_in, "self.MAX") + + def test_double_out(self): + self.assertAlmostEquals(self.MAX, GIMarshallingTests.double_out()) + + def test_double_inout(self): + self.assertAlmostEquals(self.MIN, GIMarshallingTests.double_inout(Number(self.MAX))) + + +class TestGType(unittest.TestCase): + + def test_gtype_return(self): + self.assertEquals(GObject.TYPE_NONE, GIMarshallingTests.gtype_return()) + + def test_gtype_in(self): + GIMarshallingTests.gtype_in(GObject.TYPE_NONE) + + self.assertRaises(TypeError, GIMarshallingTests.gtype_in, "GObject.TYPE_NONE") + + def test_gtype_out(self): + self.assertEquals(GObject.TYPE_NONE, GIMarshallingTests.gtype_out()) + + def test_gtype_inout(self): + self.assertEquals(GObject.TYPE_INT, GIMarshallingTests.gtype_inout(GObject.TYPE_NONE)) + + +class TestUtf8(unittest.TestCase): + + def test_utf8_none_return(self): + self.assertEquals(CONSTANT_UTF8, GIMarshallingTests.utf8_none_return()) + + def test_utf8_full_return(self): + self.assertEquals(CONSTANT_UTF8, GIMarshallingTests.utf8_full_return()) + + def test_utf8_none_in(self): + GIMarshallingTests.utf8_none_in(CONSTANT_UTF8) + if sys.version_info < (3, 0): + GIMarshallingTests.utf8_none_in(PY2_UNICODE_UTF8) + + self.assertRaises(TypeError, GIMarshallingTests.utf8_none_in, CONSTANT_NUMBER) + self.assertRaises(TypeError, GIMarshallingTests.utf8_none_in, None) + + def test_utf8_none_out(self): + self.assertEquals(CONSTANT_UTF8, GIMarshallingTests.utf8_none_out()) + + def test_utf8_full_out(self): + self.assertEquals(CONSTANT_UTF8, GIMarshallingTests.utf8_full_out()) + + def test_utf8_dangling_out(self): + GIMarshallingTests.utf8_dangling_out() + + def test_utf8_none_inout(self): + self.assertEquals("", GIMarshallingTests.utf8_none_inout(CONSTANT_UTF8)) + + def test_utf8_full_inout(self): + self.assertEquals("", GIMarshallingTests.utf8_full_inout(CONSTANT_UTF8)) + + +class TestArray(unittest.TestCase): + + def test_array_fixed_int_return(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.array_fixed_int_return()) + + def test_array_fixed_short_return(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.array_fixed_short_return()) + + def test_array_fixed_int_in(self): + GIMarshallingTests.array_fixed_int_in(Sequence([-1, 0, 1, 2])) + + self.assertRaises(TypeError, GIMarshallingTests.array_fixed_int_in, Sequence([-1, '0', 1, 2])) + + self.assertRaises(TypeError, GIMarshallingTests.array_fixed_int_in, 42) + self.assertRaises(TypeError, GIMarshallingTests.array_fixed_int_in, None) + + def test_array_fixed_short_in(self): + GIMarshallingTests.array_fixed_short_in(Sequence([-1, 0, 1, 2])) + + def test_array_fixed_out(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.array_fixed_out()) + + def test_array_fixed_inout(self): + self.assertEquals([2, 1, 0, -1], GIMarshallingTests.array_fixed_inout([-1, 0, 1, 2])) + + + def test_array_return(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.array_return()) + + def test_array_in(self): + GIMarshallingTests.array_in(Sequence([-1, 0, 1, 2])) + + def test_array_uint8_in(self): + GIMarshallingTests.array_uint8_in(Sequence([97, 98, 99, 100])) + GIMarshallingTests.array_uint8_in(_bytes("abcd")) + + def test_array_out(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.array_out()) + + def test_array_inout(self): + self.assertEquals([-2, -1, 0, 1, 2], GIMarshallingTests.array_inout(Sequence([-1, 0, 1, 2]))) + + def test_method_array_in(self): + object_ = GIMarshallingTests.Object() + object_.method_array_in(Sequence([-1, 0, 1, 2])) + + def test_method_array_out(self): + object_ = GIMarshallingTests.Object() + self.assertEquals([-1, 0, 1, 2], object_.method_array_out()) + + def test_method_array_inout(self): + object_ = GIMarshallingTests.Object() + self.assertEquals([-2, -1, 0, 1, 2], object_.method_array_inout(Sequence([-1, 0, 1, 2]))) + + def test_method_array_return(self): + object_ = GIMarshallingTests.Object() + self.assertEquals([-1, 0, 1, 2], object_.method_array_return()) + + def test_array_fixed_out_struct(self): + struct1, struct2 = GIMarshallingTests.array_fixed_out_struct() + + self.assertEquals(7, struct1.long_) + self.assertEquals(6, struct1.int8) + self.assertEquals(6, struct2.long_) + self.assertEquals(7, struct2.int8) + + def test_array_zero_terminated_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.array_zero_terminated_return()) + + def test_array_zero_terminated_in(self): + GIMarshallingTests.array_zero_terminated_in(Sequence(['0', '1', '2'])) + + def test_array_zero_terminated_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.array_zero_terminated_out()) + + def test_array_zero_terminated_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.array_zero_terminated_out()) + + def test_array_zero_terminated_inout(self): + self.assertEquals(['-1', '0', '1', '2'], GIMarshallingTests.array_zero_terminated_inout(['0', '1', '2'])) + + def test_gstrv_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gstrv_return()) + + def test_gstrv_in(self): + GIMarshallingTests.gstrv_in(Sequence(['0', '1', '2'])) + + def test_gstrv_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gstrv_out()) + + def test_gstrv_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gstrv_out()) + + def test_gstrv_inout(self): + self.assertEquals(['-1', '0', '1', '2'], GIMarshallingTests.gstrv_inout(['0', '1', '2'])) + + +class TestGArray(unittest.TestCase): + + def test_garray_int_none_return(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.garray_int_none_return()) + + def test_garray_utf8_none_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.garray_utf8_none_return()) + + def test_garray_utf8_container_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.garray_utf8_container_return()) + + def test_garray_utf8_full_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.garray_utf8_full_return()) + + def test_garray_int_none_in(self): + GIMarshallingTests.garray_int_none_in(Sequence([-1, 0, 1, 2])) + + self.assertRaises(TypeError, GIMarshallingTests.garray_int_none_in, Sequence([-1, '0', 1, 2])) + + self.assertRaises(TypeError, GIMarshallingTests.garray_int_none_in, 42) + self.assertRaises(TypeError, GIMarshallingTests.garray_int_none_in, None) + + def test_garray_utf8_none_in(self): + GIMarshallingTests.garray_utf8_none_in(Sequence(['0', '1', '2'])) + + def test_garray_utf8_none_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.garray_utf8_none_out()) + + def test_garray_utf8_container_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.garray_utf8_container_out()) + + def test_garray_utf8_full_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.garray_utf8_full_out()) + + def test_garray_utf8_none_inout(self): + self.assertEquals(['-2', '-1', '0', '1'], GIMarshallingTests.garray_utf8_none_inout(Sequence(('0', '1', '2')))) + + def test_garray_utf8_container_inout(self): + self.assertEquals(['-2', '-1','0', '1'], GIMarshallingTests.garray_utf8_container_inout(['0', '1', '2'])) + + def test_garray_utf8_full_inout(self): + self.assertEquals(['-2', '-1','0', '1'], GIMarshallingTests.garray_utf8_full_inout(['0', '1', '2'])) + + +class TestGList(unittest.TestCase): + + def test_glist_int_none_return(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.glist_int_none_return()) + + def test_glist_utf8_none_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.glist_utf8_none_return()) + + def test_glist_utf8_container_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.glist_utf8_container_return()) + + def test_glist_utf8_full_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.glist_utf8_full_return()) + + def test_glist_int_none_in(self): + GIMarshallingTests.glist_int_none_in(Sequence((-1, 0, 1, 2))) + + self.assertRaises(TypeError, GIMarshallingTests.glist_int_none_in, Sequence((-1, '0', 1, 2))) + + self.assertRaises(TypeError, GIMarshallingTests.glist_int_none_in, 42) + self.assertRaises(TypeError, GIMarshallingTests.glist_int_none_in, None) + + def test_glist_utf8_none_in(self): + GIMarshallingTests.glist_utf8_none_in(Sequence(('0', '1', '2'))) + + def test_glist_utf8_none_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.glist_utf8_none_out()) + + def test_glist_utf8_container_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.glist_utf8_container_out()) + + def test_glist_utf8_full_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.glist_utf8_full_out()) + + def test_glist_utf8_none_inout(self): + self.assertEquals(['-2', '-1', '0', '1'], GIMarshallingTests.glist_utf8_none_inout(Sequence(('0', '1', '2')))) + + def test_glist_utf8_container_inout(self): + self.assertEquals(['-2', '-1','0', '1'], GIMarshallingTests.glist_utf8_container_inout(('0', '1', '2'))) + + def test_glist_utf8_full_inout(self): + self.assertEquals(['-2', '-1','0', '1'], GIMarshallingTests.glist_utf8_full_inout(('0', '1', '2'))) + + +class TestGSList(unittest.TestCase): + + def test_gslist_int_none_return(self): + self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.gslist_int_none_return()) + + def test_gslist_utf8_none_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gslist_utf8_none_return()) + + def test_gslist_utf8_container_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gslist_utf8_container_return()) + + def test_gslist_utf8_full_return(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gslist_utf8_full_return()) + + def test_gslist_int_none_in(self): + GIMarshallingTests.gslist_int_none_in(Sequence((-1, 0, 1, 2))) + + self.assertRaises(TypeError, GIMarshallingTests.gslist_int_none_in, Sequence((-1, '0', 1, 2))) + + self.assertRaises(TypeError, GIMarshallingTests.gslist_int_none_in, 42) + self.assertRaises(TypeError, GIMarshallingTests.gslist_int_none_in, None) + + def test_gslist_utf8_none_in(self): + GIMarshallingTests.gslist_utf8_none_in(Sequence(('0', '1', '2'))) + + def test_gslist_utf8_none_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gslist_utf8_none_out()) + + def test_gslist_utf8_container_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gslist_utf8_container_out()) + + def test_gslist_utf8_full_out(self): + self.assertEquals(['0', '1', '2'], GIMarshallingTests.gslist_utf8_full_out()) + + def test_gslist_utf8_none_inout(self): + self.assertEquals(['-2', '-1', '0', '1'], GIMarshallingTests.gslist_utf8_none_inout(Sequence(('0', '1', '2')))) + + def test_gslist_utf8_container_inout(self): + self.assertEquals(['-2', '-1','0', '1'], GIMarshallingTests.gslist_utf8_container_inout(('0', '1', '2'))) + + def test_gslist_utf8_full_inout(self): + self.assertEquals(['-2', '-1','0', '1'], GIMarshallingTests.gslist_utf8_full_inout(('0', '1', '2'))) + + +class TestGHashTable(unittest.TestCase): + + def test_ghashtable_int_none_return(self): + self.assertEquals({-1: 1, 0: 0, 1: -1, 2: -2}, GIMarshallingTests.ghashtable_int_none_return()) + + def test_ghashtable_int_none_return(self): + self.assertEquals({'-1': '1', '0': '0', '1': '-1', '2': '-2'}, GIMarshallingTests.ghashtable_utf8_none_return()) + + def test_ghashtable_int_container_return(self): + self.assertEquals({'-1': '1', '0': '0', '1': '-1', '2': '-2'}, GIMarshallingTests.ghashtable_utf8_container_return()) + + def test_ghashtable_int_full_return(self): + self.assertEquals({'-1': '1', '0': '0', '1': '-1', '2': '-2'}, GIMarshallingTests.ghashtable_utf8_full_return()) + + def test_ghashtable_int_none_in(self): + GIMarshallingTests.ghashtable_int_none_in({-1: 1, 0: 0, 1: -1, 2: -2}) + + self.assertRaises(TypeError, GIMarshallingTests.ghashtable_int_none_in, {-1: 1, '0': 0, 1: -1, 2: -2}) + self.assertRaises(TypeError, GIMarshallingTests.ghashtable_int_none_in, {-1: 1, 0: '0', 1: -1, 2: -2}) + + self.assertRaises(TypeError, GIMarshallingTests.ghashtable_int_none_in, '{-1: 1, 0: 0, 1: -1, 2: -2}') + self.assertRaises(TypeError, GIMarshallingTests.ghashtable_int_none_in, None) + + def test_ghashtable_utf8_none_in(self): + GIMarshallingTests.ghashtable_utf8_none_in({'-1': '1', '0': '0', '1': '-1', '2': '-2'}) + + def test_ghashtable_utf8_none_out(self): + self.assertEquals({'-1': '1', '0': '0', '1': '-1', '2': '-2'}, GIMarshallingTests.ghashtable_utf8_none_out()) + + def test_ghashtable_utf8_container_out(self): + self.assertEquals({'-1': '1', '0': '0', '1': '-1', '2': '-2'}, GIMarshallingTests.ghashtable_utf8_container_out()) + + def test_ghashtable_utf8_full_out(self): + self.assertEquals({'-1': '1', '0': '0', '1': '-1', '2': '-2'}, GIMarshallingTests.ghashtable_utf8_full_out()) + + def test_ghashtable_utf8_none_inout(self): + self.assertEquals({'-1': '1', '0': '0', '1': '1'}, + GIMarshallingTests.ghashtable_utf8_none_inout({'-1': '1', '0': '0', '1': '-1', '2': '-2'})) + + def test_ghashtable_utf8_container_inout(self): + self.assertEquals({'-1': '1', '0': '0', '1': '1'}, + GIMarshallingTests.ghashtable_utf8_container_inout({'-1': '1', '0': '0', '1': '-1', '2': '-2'})) + + def test_ghashtable_utf8_full_inout(self): + self.assertEquals({'-1': '1', '0': '0', '1': '1'}, + GIMarshallingTests.ghashtable_utf8_full_inout({'-1': '1', '0': '0', '1': '-1', '2': '-2'})) + + +class TestGValue(unittest.TestCase): + + def test_gvalue_return(self): + self.assertEquals(42, GIMarshallingTests.gvalue_return()) + + def test_gvalue_in(self): + GIMarshallingTests.gvalue_in(42) + value = GObject.Value() + value.init(GObject.TYPE_INT) + value.set_int(42) + GIMarshallingTests.gvalue_in(value) + + def test_gvalue_out(self): + self.assertEquals(42, GIMarshallingTests.gvalue_out()) + + def test_gvalue_inout(self): + self.assertEquals('42', GIMarshallingTests.gvalue_inout(42)) + value = GObject.Value() + value.init(GObject.TYPE_INT) + value.set_int(42) + self.assertEquals('42', GIMarshallingTests.gvalue_inout(value)) + +class TestGClosure(unittest.TestCase): + + def test_gclosure_in(self): + GIMarshallingTests.gclosure_in(lambda: 42) + + # test passing a closure between two C calls + closure = GIMarshallingTests.gclosure_return() + GIMarshallingTests.gclosure_in(closure) + + self.assertRaises(TypeError, GIMarshallingTests.gclosure_in, 42) + self.assertRaises(TypeError, GIMarshallingTests.gclosure_in, None) + + +class TestPointer(unittest.TestCase): + def test_pointer_in_return(self): + self.assertEquals(GIMarshallingTests.pointer_in_return(42), 42) + + +class TestEnum(unittest.TestCase): + + @classmethod + def setUpClass(cls): + '''Run tests under a test locale. + + Upper case conversion of member names should not be locale specific; + e. g. in Turkish, "i".upper() == "i", which gives results like "iNVALiD" + + Run test under a locale which defines toupper('a') == 'a' + ''' + cls.locale_dir = tempfile.mkdtemp() + subprocess.check_call(['localedef', '-i', + os.path.join(os.path.dirname(os.path.realpath(__file__)), 'te_ST@nouppera'), + '-c', '-f', 'UTF-8', os.path.join(cls.locale_dir, 'te_ST.UTF-8@nouppera')]) + os.environ['LOCPATH'] = cls.locale_dir + locale.setlocale(locale.LC_ALL, 'te_ST.UTF-8@nouppera') + + @classmethod + def tearDownClass(cls): + locale.setlocale(locale.LC_ALL, 'C') + shutil.rmtree(cls.locale_dir) + try: + del os.environ['LOCPATH'] + except KeyError: + pass + + def test_enum(self): + self.assertTrue(issubclass(GIMarshallingTests.Enum, int)) + self.assertTrue(isinstance(GIMarshallingTests.Enum.VALUE1, GIMarshallingTests.Enum)) + self.assertTrue(isinstance(GIMarshallingTests.Enum.VALUE2, GIMarshallingTests.Enum)) + self.assertTrue(isinstance(GIMarshallingTests.Enum.VALUE3, GIMarshallingTests.Enum)) + self.assertEquals(42, GIMarshallingTests.Enum.VALUE3) + + def test_value_nick_and_name(self): + self.assertEqual(GIMarshallingTests.Enum.VALUE1.value_nick, 'value1') + self.assertEqual(GIMarshallingTests.Enum.VALUE2.value_nick, 'value2') + self.assertEqual(GIMarshallingTests.Enum.VALUE3.value_nick, 'value3') + + self.assertEqual(GIMarshallingTests.Enum.VALUE1.value_name, 'GI_MARSHALLING_TESTS_ENUM_VALUE1') + self.assertEqual(GIMarshallingTests.Enum.VALUE2.value_name, 'GI_MARSHALLING_TESTS_ENUM_VALUE2') + self.assertEqual(GIMarshallingTests.Enum.VALUE3.value_name, 'GI_MARSHALLING_TESTS_ENUM_VALUE3') + + def test_enum_in(self): + GIMarshallingTests.enum_in(GIMarshallingTests.Enum.VALUE3) + GIMarshallingTests.enum_in(42) + + self.assertRaises(TypeError, GIMarshallingTests.enum_in, 43) + self.assertRaises(TypeError, GIMarshallingTests.enum_in, 'GIMarshallingTests.Enum.VALUE3') + + def test_enum_out(self): + enum = GIMarshallingTests.enum_out() + self.assertTrue(isinstance(enum, GIMarshallingTests.Enum)) + self.assertEquals(enum, GIMarshallingTests.Enum.VALUE3) + + def test_enum_inout(self): + enum = GIMarshallingTests.enum_inout(GIMarshallingTests.Enum.VALUE3) + self.assertTrue(isinstance(enum, GIMarshallingTests.Enum)) + self.assertEquals(enum, GIMarshallingTests.Enum.VALUE1) + + def test_enum_second(self): + # check for the bug where different non-gtype enums share the same class + self.assertNotEqual(GIMarshallingTests.Enum, GIMarshallingTests.SecondEnum) + + # check that values are not being shared between different enums + self.assertTrue(hasattr(GIMarshallingTests.SecondEnum, "SECONDVALUE1")) + self.assertRaises(AttributeError, getattr, GIMarshallingTests.Enum, "SECONDVALUE1") + self.assertTrue(hasattr(GIMarshallingTests.Enum, "VALUE1")) + self.assertRaises(AttributeError, getattr, GIMarshallingTests.SecondEnum, "VALUE1") + + +class TestGEnum(unittest.TestCase): + + def test_genum(self): + self.assertTrue(issubclass(GIMarshallingTests.GEnum, GObject.GEnum)) + self.assertTrue(isinstance(GIMarshallingTests.GEnum.VALUE1, GIMarshallingTests.GEnum)) + self.assertTrue(isinstance(GIMarshallingTests.GEnum.VALUE2, GIMarshallingTests.GEnum)) + self.assertTrue(isinstance(GIMarshallingTests.GEnum.VALUE3, GIMarshallingTests.GEnum)) + self.assertEquals(42, GIMarshallingTests.GEnum.VALUE3) + + def test_value_nick_and_name(self): + self.assertEqual(GIMarshallingTests.GEnum.VALUE1.value_nick, 'value1') + self.assertEqual(GIMarshallingTests.GEnum.VALUE2.value_nick, 'value2') + self.assertEqual(GIMarshallingTests.GEnum.VALUE3.value_nick, 'value3') + + self.assertEqual(GIMarshallingTests.GEnum.VALUE1.value_name, 'GI_MARSHALLING_TESTS_GENUM_VALUE1') + self.assertEqual(GIMarshallingTests.GEnum.VALUE2.value_name, 'GI_MARSHALLING_TESTS_GENUM_VALUE2') + self.assertEqual(GIMarshallingTests.GEnum.VALUE3.value_name, 'GI_MARSHALLING_TESTS_GENUM_VALUE3') + + def test_genum_in(self): + GIMarshallingTests.genum_in(GIMarshallingTests.GEnum.VALUE3) + GIMarshallingTests.genum_in(42) + + self.assertRaises(TypeError, GIMarshallingTests.genum_in, 43) + self.assertRaises(TypeError, GIMarshallingTests.genum_in, 'GIMarshallingTests.GEnum.VALUE3') + + def test_genum_out(self): + genum = GIMarshallingTests.genum_out() + self.assertTrue(isinstance(genum, GIMarshallingTests.GEnum)) + self.assertEquals(genum, GIMarshallingTests.GEnum.VALUE3) + + def test_genum_inout(self): + genum = GIMarshallingTests.genum_inout(GIMarshallingTests.GEnum.VALUE3) + self.assertTrue(isinstance(genum, GIMarshallingTests.GEnum)) + self.assertEquals(genum, GIMarshallingTests.GEnum.VALUE1) + + +class TestGFlags(unittest.TestCase): + + def test_flags(self): + self.assertTrue(issubclass(GIMarshallingTests.Flags, GObject.GFlags)) + self.assertTrue(isinstance(GIMarshallingTests.Flags.VALUE1, GIMarshallingTests.Flags)) + self.assertTrue(isinstance(GIMarshallingTests.Flags.VALUE2, GIMarshallingTests.Flags)) + self.assertTrue(isinstance(GIMarshallingTests.Flags.VALUE3, GIMarshallingTests.Flags)) + # __or__() operation should still return an instance, not an int. + self.assertTrue(isinstance(GIMarshallingTests.Flags.VALUE1 | GIMarshallingTests.Flags.VALUE2, + GIMarshallingTests.Flags)) + self.assertEquals(1 << 1, GIMarshallingTests.Flags.VALUE2) + + def test_value_nick_and_name(self): + self.assertEqual(GIMarshallingTests.Flags.VALUE1.first_value_nick, 'value1') + self.assertEqual(GIMarshallingTests.Flags.VALUE2.first_value_nick, 'value2') + self.assertEqual(GIMarshallingTests.Flags.VALUE3.first_value_nick, 'value3') + + self.assertEqual(GIMarshallingTests.Flags.VALUE1.first_value_name, 'GI_MARSHALLING_TESTS_FLAGS_VALUE1') + self.assertEqual(GIMarshallingTests.Flags.VALUE2.first_value_name, 'GI_MARSHALLING_TESTS_FLAGS_VALUE2') + self.assertEqual(GIMarshallingTests.Flags.VALUE3.first_value_name, 'GI_MARSHALLING_TESTS_FLAGS_VALUE3') + + def test_flags_in(self): + GIMarshallingTests.flags_in(GIMarshallingTests.Flags.VALUE2) + # result of __or__() operation should still be valid instance, not an int. + GIMarshallingTests.flags_in(GIMarshallingTests.Flags.VALUE2 | GIMarshallingTests.Flags.VALUE2) + GIMarshallingTests.flags_in_zero(Number(0)) + + self.assertRaises(TypeError, GIMarshallingTests.flags_in, 1 << 1) + self.assertRaises(TypeError, GIMarshallingTests.flags_in, 'GIMarshallingTests.Flags.VALUE2') + + def test_flags_out(self): + flags = GIMarshallingTests.flags_out() + self.assertTrue(isinstance(flags, GIMarshallingTests.Flags)) + self.assertEquals(flags, GIMarshallingTests.Flags.VALUE2) + + def test_flags_inout(self): + flags = GIMarshallingTests.flags_inout(GIMarshallingTests.Flags.VALUE2) + self.assertTrue(isinstance(flags, GIMarshallingTests.Flags)) + self.assertEquals(flags, GIMarshallingTests.Flags.VALUE1) + +class TestNoTypeFlags(unittest.TestCase): + + def test_flags(self): + self.assertTrue(issubclass(GIMarshallingTests.NoTypeFlags, GObject.GFlags)) + self.assertTrue(isinstance(GIMarshallingTests.NoTypeFlags.VALUE1, GIMarshallingTests.NoTypeFlags)) + self.assertTrue(isinstance(GIMarshallingTests.NoTypeFlags.VALUE2, GIMarshallingTests.NoTypeFlags)) + self.assertTrue(isinstance(GIMarshallingTests.NoTypeFlags.VALUE3, GIMarshallingTests.NoTypeFlags)) + # __or__() operation should still return an instance, not an int. + self.assertTrue(isinstance(GIMarshallingTests.NoTypeFlags.VALUE1 | GIMarshallingTests.NoTypeFlags.VALUE2, + GIMarshallingTests.NoTypeFlags)) + self.assertEquals(1 << 1, GIMarshallingTests.NoTypeFlags.VALUE2) + + def test_value_nick_and_name(self): + self.assertEqual(GIMarshallingTests.NoTypeFlags.VALUE1.first_value_nick, 'value1') + self.assertEqual(GIMarshallingTests.NoTypeFlags.VALUE2.first_value_nick, 'value2') + self.assertEqual(GIMarshallingTests.NoTypeFlags.VALUE3.first_value_nick, 'value3') + + self.assertEqual(GIMarshallingTests.NoTypeFlags.VALUE1.first_value_name, 'GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE1') + self.assertEqual(GIMarshallingTests.NoTypeFlags.VALUE2.first_value_name, 'GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE2') + self.assertEqual(GIMarshallingTests.NoTypeFlags.VALUE3.first_value_name, 'GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE3') + + def test_flags_in(self): + GIMarshallingTests.no_type_flags_in(GIMarshallingTests.NoTypeFlags.VALUE2) + GIMarshallingTests.no_type_flags_in(GIMarshallingTests.NoTypeFlags.VALUE2 | GIMarshallingTests.NoTypeFlags.VALUE2) + GIMarshallingTests.no_type_flags_in_zero(Number(0)) + + self.assertRaises(TypeError, GIMarshallingTests.no_type_flags_in, 1 << 1) + self.assertRaises(TypeError, GIMarshallingTests.no_type_flags_in, 'GIMarshallingTests.NoTypeFlags.VALUE2') + + def test_flags_out(self): + flags = GIMarshallingTests.no_type_flags_out() + self.assertTrue(isinstance(flags, GIMarshallingTests.NoTypeFlags)) + self.assertEquals(flags, GIMarshallingTests.NoTypeFlags.VALUE2) + + def test_flags_inout(self): + flags = GIMarshallingTests.no_type_flags_inout(GIMarshallingTests.NoTypeFlags.VALUE2) + self.assertTrue(isinstance(flags, GIMarshallingTests.NoTypeFlags)) + self.assertEquals(flags, GIMarshallingTests.NoTypeFlags.VALUE1) + + +class TestStructure(unittest.TestCase): + + def test_simple_struct(self): + self.assertTrue(issubclass(GIMarshallingTests.SimpleStruct, GObject.GPointer)) + + struct = GIMarshallingTests.SimpleStruct() + self.assertTrue(isinstance(struct, GIMarshallingTests.SimpleStruct)) + + self.assertEquals(0, struct.long_) + self.assertEquals(0, struct.int8) + + struct.long_ = 6 + struct.int8 = 7 + + self.assertEquals(6, struct.long_) + self.assertEquals(7, struct.int8) + + del struct + + def test_nested_struct(self): + struct = GIMarshallingTests.NestedStruct() + + self.assertTrue(isinstance(struct.simple_struct, GIMarshallingTests.SimpleStruct)) + + struct.simple_struct.long_ = 42 + self.assertEquals(42, struct.simple_struct.long_) + + del struct + + def test_not_simple_struct(self): + struct = GIMarshallingTests.NotSimpleStruct() + self.assertEquals(None, struct.pointer) + + def test_simple_struct_return(self): + struct = GIMarshallingTests.simple_struct_returnv() + + self.assertTrue(isinstance(struct, GIMarshallingTests.SimpleStruct)) + self.assertEquals(6, struct.long_) + self.assertEquals(7, struct.int8) + + del struct + + def test_simple_struct_in(self): + struct = GIMarshallingTests.SimpleStruct() + struct.long_ = 6 + struct.int8 = 7 + + GIMarshallingTests.SimpleStruct.inv(struct) + + del struct + + struct = GIMarshallingTests.NestedStruct() + + self.assertRaises(TypeError, GIMarshallingTests.SimpleStruct.inv, struct) + + del struct + + self.assertRaises(TypeError, GIMarshallingTests.SimpleStruct.inv, None) + + def test_simple_struct_method(self): + struct = GIMarshallingTests.SimpleStruct() + struct.long_ = 6 + struct.int8 = 7 + + struct.method() + + del struct + + self.assertRaises(TypeError, GIMarshallingTests.SimpleStruct.method) + + + def test_pointer_struct(self): + self.assertTrue(issubclass(GIMarshallingTests.PointerStruct, GObject.GPointer)) + + struct = GIMarshallingTests.PointerStruct() + self.assertTrue(isinstance(struct, GIMarshallingTests.PointerStruct)) + + del struct + + def test_pointer_struct_return(self): + struct = GIMarshallingTests.pointer_struct_returnv() + + self.assertTrue(isinstance(struct, GIMarshallingTests.PointerStruct)) + self.assertEquals(42, struct.long_) + + del struct + + def test_pointer_struct_in(self): + struct = GIMarshallingTests.PointerStruct() + struct.long_ = 42 + + struct.inv() + + del struct + + def test_boxed_struct(self): + self.assertTrue(issubclass(GIMarshallingTests.BoxedStruct, GObject.GBoxed)) + + struct = GIMarshallingTests.BoxedStruct() + self.assertTrue(isinstance(struct, GIMarshallingTests.BoxedStruct)) + + self.assertEquals(0, struct.long_) + self.assertEquals([], struct.g_strv) + + del struct + + def test_boxed_struct_new(self): + struct = GIMarshallingTests.BoxedStruct.new() + self.assertTrue(isinstance(struct, GIMarshallingTests.BoxedStruct)) + + del struct + + def test_boxed_struct_copy(self): + struct = GIMarshallingTests.BoxedStruct() + + new_struct = struct.copy() + self.assertTrue(isinstance(new_struct, GIMarshallingTests.BoxedStruct)) + + del new_struct + del struct + + def test_boxed_struct_return(self): + struct = GIMarshallingTests.boxed_struct_returnv() + + self.assertTrue(isinstance(struct, GIMarshallingTests.BoxedStruct)) + self.assertEquals(42, struct.long_) + self.assertEquals(['0', '1', '2'], struct.g_strv) + + del struct + + def test_boxed_struct_in(self): + struct = GIMarshallingTests.BoxedStruct() + struct.long_ = 42 + + struct.inv() + + del struct + + def test_boxed_struct_out(self): + struct = GIMarshallingTests.boxed_struct_out() + + self.assertTrue(isinstance(struct, GIMarshallingTests.BoxedStruct)) + self.assertEquals(42, struct.long_) + + del struct + + def test_boxed_struct_inout(self): + in_struct = GIMarshallingTests.BoxedStruct() + in_struct.long_ = 42 + + out_struct = GIMarshallingTests.boxed_struct_inout(in_struct) + + self.assertTrue(isinstance(out_struct, GIMarshallingTests.BoxedStruct)) + self.assertEquals(0, out_struct.long_) + + del in_struct + del out_struct + + def test_union(self): + union = GIMarshallingTests.Union() + + self.assertTrue(isinstance(union, GIMarshallingTests.Union)) + + new_union = union.copy() + self.assertTrue(isinstance(new_union, GIMarshallingTests.Union)) + + del union + del new_union + + def test_union_return(self): + union = GIMarshallingTests.union_returnv() + + self.assertTrue(isinstance(union, GIMarshallingTests.Union)) + self.assertEquals(42, union.long_) + + del union + + def test_union_in(self): + union = GIMarshallingTests.Union() + union.long_ = 42 + + union.inv() + + del union + + def test_union_method(self): + union = GIMarshallingTests.Union() + union.long_ = 42 + + union.method() + + del union + + self.assertRaises(TypeError, GIMarshallingTests.Union.method) + +class TestGObject(unittest.TestCase): + + def test_object(self): + self.assertTrue(issubclass(GIMarshallingTests.Object, GObject.GObject)) + + object_ = GIMarshallingTests.Object() + self.assertTrue(isinstance(object_, GIMarshallingTests.Object)) + self.assertEquals(object_.__grefcount__, 1) + + def test_object_new(self): + object_ = GIMarshallingTests.Object.new(42) + self.assertTrue(isinstance(object_, GIMarshallingTests.Object)) + self.assertEquals(object_.__grefcount__, 1) + + def test_object_int(self): + object_ = GIMarshallingTests.Object(int = 42) + self.assertEquals(object_.int_, 42) +# FIXME: Don't work yet. +# object_.int_ = 0 +# self.assertEquals(object_.int_, 0) + + def test_object_static_method(self): + GIMarshallingTests.Object.static_method() + + def test_object_method(self): + GIMarshallingTests.Object(int = 42).method() + self.assertRaises(TypeError, GIMarshallingTests.Object.method, GObject.GObject()) + self.assertRaises(TypeError, GIMarshallingTests.Object.method) + + + def test_sub_object(self): + self.assertTrue(issubclass(GIMarshallingTests.SubObject, GIMarshallingTests.Object)) + + object_ = GIMarshallingTests.SubObject() + self.assertTrue(isinstance(object_, GIMarshallingTests.SubObject)) + + def test_sub_object_new(self): + self.assertRaises(TypeError, GIMarshallingTests.SubObject.new, 42) + + def test_sub_object_static_method(self): + object_ = GIMarshallingTests.SubObject() + object_.static_method() + + def test_sub_object_method(self): + object_ = GIMarshallingTests.SubObject(int = 42) + object_.method() + + def test_sub_object_sub_method(self): + object_ = GIMarshallingTests.SubObject() + object_.sub_method() + + def test_sub_object_overwritten_method(self): + object_ = GIMarshallingTests.SubObject() + object_.overwritten_method() + + self.assertRaises(TypeError, GIMarshallingTests.SubObject.overwritten_method, GIMarshallingTests.Object()) + + def test_sub_object_int(self): + object_ = GIMarshallingTests.SubObject() + self.assertEquals(object_.int_, 0) +# FIXME: Don't work yet. +# object_.int_ = 42 +# self.assertEquals(object_.int_, 42) + + def test_object_none_return(self): + object_ = GIMarshallingTests.Object.none_return() + self.assertTrue(isinstance(object_, GIMarshallingTests.Object)) + self.assertEquals(object_.__grefcount__, 2) + + def test_object_full_return(self): + object_ = GIMarshallingTests.Object.full_return() + self.assertTrue(isinstance(object_, GIMarshallingTests.Object)) + self.assertEquals(object_.__grefcount__, 1) + + def test_object_none_in(self): + object_ = GIMarshallingTests.Object(int = 42) + GIMarshallingTests.Object.none_in(object_) + self.assertEquals(object_.__grefcount__, 1) + + object_ = GIMarshallingTests.SubObject(int = 42) + GIMarshallingTests.Object.none_in(object_) + + object_ = GObject.GObject() + self.assertRaises(TypeError, GIMarshallingTests.Object.none_in, object_) + + self.assertRaises(TypeError, GIMarshallingTests.Object.none_in, None) + + def test_object_none_out(self): + object_ = GIMarshallingTests.Object.none_out() + self.assertTrue(isinstance(object_, GIMarshallingTests.Object)) + self.assertEquals(object_.__grefcount__, 2) + + new_object = GIMarshallingTests.Object.none_out() + self.assertTrue(new_object is object_) + + def test_object_full_out(self): + object_ = GIMarshallingTests.Object.full_out() + self.assertTrue(isinstance(object_, GIMarshallingTests.Object)) + self.assertEquals(object_.__grefcount__, 1) + + def test_object_none_inout(self): + object_ = GIMarshallingTests.Object(int = 42) + new_object = GIMarshallingTests.Object.none_inout(object_) + + self.assertTrue(isinstance(new_object, GIMarshallingTests.Object)) + + self.assertFalse(object_ is new_object) + + self.assertEquals(object_.__grefcount__, 1) + self.assertEquals(new_object.__grefcount__, 2) + + new_new_object = GIMarshallingTests.Object.none_inout(object_) + self.assertTrue(new_new_object is new_object) + + GIMarshallingTests.Object.none_inout(GIMarshallingTests.SubObject(int = 42)) + + def test_object_full_inout(self): + object_ = GIMarshallingTests.Object(int = 42) + new_object = GIMarshallingTests.Object.full_inout(object_) + + self.assertTrue(isinstance(new_object, GIMarshallingTests.Object)) + + self.assertFalse(object_ is new_object) + + self.assertEquals(object_.__grefcount__, 2) + self.assertEquals(new_object.__grefcount__, 1) + +# FIXME: Doesn't actually return the same object. +# def test_object_inout_same(self): +# object_ = GIMarshallingTests.Object() +# new_object = GIMarshallingTests.object_full_inout(object_) +# self.assertTrue(object_ is new_object) +# self.assertEquals(object_.__grefcount__, 1) + + +class TestPythonGObject(unittest.TestCase): + + class Object(GIMarshallingTests.Object): + def __init__(self, int): + GIMarshallingTests.Object.__init__(self) + self.val = None + + def method(self): + # Don't call super, which asserts that self.int == 42. + pass + + def do_method_int8_in(self, int8): + self.val = int8 + + def do_method_int8_out(self): + return 42 + + def do_method_with_default_implementation(self, int8): + GIMarshallingTests.Object.do_method_with_default_implementation(self, int8) + self.props.int += int8 + + class SubObject(GIMarshallingTests.SubObject): + def __init__(self, int): + GIMarshallingTests.SubObject.__init__(self) + self.val = None + + def do_method_with_default_implementation(self, int8): + self.val = int8 + + def test_object(self): + self.assertTrue(issubclass(self.Object, GIMarshallingTests.Object)) + + object_ = self.Object(int = 42) + self.assertTrue(isinstance(object_, self.Object)) + + def test_object_method(self): + self.Object(int = 0).method() + + def test_object_vfuncs(self): + object_ = self.Object(int = 42) + object_.method_int8_in(84) + self.assertEqual(object_.val, 84) + self.assertEqual(object_.method_int8_out(), 42) + + object_.method_with_default_implementation(42) + self.assertEqual(object_.props.int, 84) + + class ObjectWithoutVFunc(GIMarshallingTests.Object): + def __init__(self, int): + GIMarshallingTests.Object.__init__(self) + + object_ = ObjectWithoutVFunc(int = 42) + object_.method_with_default_implementation(84) + self.assertEqual(object_.props.int, 84) + + def test_subobject_parent_vfunc(self): + object_ = self.SubObject(int = 81) + object_.method_with_default_implementation(87) + self.assertEquals(object_.val, 87) + + def test_dynamic_module(self): + from gi.module import DynamicGObjectModule + self.assertTrue(isinstance(GObject, DynamicGObjectModule)) + # compare the same enum from both the pygobject attrs and gi GObject attrs + self.assertEquals(GObject.SIGNAL_ACTION, GObject.SignalFlags.ACTION) + # compare a static gobject attr with a dynamic GObject attr + self.assertEquals(GObject.GObject, gobject.GObject) + + def test_subobject_non_vfunc_do_method(self): + class PythonObjectWithNonVFuncDoMethod: + def do_not_a_vfunc(self): + return 5 + + class ObjectOverrideNonVFuncDoMethod(GIMarshallingTests.Object, PythonObjectWithNonVFuncDoMethod): + def do_not_a_vfunc(self): + value = super(ObjectOverrideNonVFuncDoMethod, self).do_not_a_vfunc() + return 13 + value + + object_ = ObjectOverrideNonVFuncDoMethod() + self.assertEquals(18, object_.do_not_a_vfunc()) + + def test_native_function_not_set_in_subclass_dict(self): + # Previously, GI was setting virtual functions on the class as well + # as any *native* class that subclasses it. Here we check that it is only + # set on the class that the method is originally from. + self.assertTrue('do_method_with_default_implementation' in GIMarshallingTests.Object.__dict__) + self.assertTrue('do_method_with_default_implementation' not in GIMarshallingTests.SubObject.__dict__) + + # Here we check that accessing a vfunc from the subclass returns the same wrapper object, + # meaning that multiple wrapper objects have not been created for the same vfunc. + func1 = GIMarshallingTests.Object.do_method_with_default_implementation + func2 = GIMarshallingTests.SubObject.do_method_with_default_implementation + if sys.version_info < (3,0): + func1 = func1.im_func + func2 = func2.im_func + + self.assertTrue(func1 is func2) + + def test_subobject_with_interface_and_non_vfunc_do_method(self): + # There was a bug for searching for vfuncs in interfaces. It was + # triggered by having a do_* method that wasn't overriding + # a native vfunc, as well as inheriting from an interface. + class GObjectSubclassWithInterface(GObject.GObject, GIMarshallingTests.Interface): + def do_method_not_a_vfunc(self): + pass + +class TestMultiOutputArgs(unittest.TestCase): + + def test_int_out_out(self): + self.assertEquals((6, 7), GIMarshallingTests.int_out_out()) + + def test_int_return_out(self): + self.assertEquals((6, 7), GIMarshallingTests.int_return_out()) + +class TestGErrorException(unittest.TestCase): + def test_gerror_exception(self): + self.assertRaises(GObject.GError, GIMarshallingTests.gerror) + try: + GIMarshallingTests.gerror() + except Exception: + etype, e = sys.exc_info()[:2] + self.assertEquals(e.domain, GIMarshallingTests.CONSTANT_GERROR_DOMAIN) + self.assertEquals(e.code, GIMarshallingTests.CONSTANT_GERROR_CODE) + self.assertEquals(e.message, GIMarshallingTests.CONSTANT_GERROR_MESSAGE) + + +# Interface + +class TestInterfaces(unittest.TestCase): + + def test_wrapper(self): + self.assertTrue(issubclass(GIMarshallingTests.Interface, GObject.GInterface)) + self.assertEquals(GIMarshallingTests.Interface.__gtype__.name, 'GIMarshallingTestsInterface') + self.assertRaises(NotImplementedError, GIMarshallingTests.Interface) + + def test_implementation(self): + + class TestInterfaceImpl(GObject.GObject, GIMarshallingTests.Interface): + def __init__(self): + GObject.GObject.__init__(self) + self.val = None + + def do_test_int8_in(self, int8): + self.val = int8 + + self.assertTrue(issubclass(TestInterfaceImpl, GIMarshallingTests.Interface)) + + instance = TestInterfaceImpl() + self.assertTrue(isinstance(instance, GIMarshallingTests.Interface)) + + GIMarshallingTests.test_interface_test_int8_in(instance, 42) + self.assertEquals(instance.val, 42) + + class TestInterfaceImplA(TestInterfaceImpl): + pass + + class TestInterfaceImplB(TestInterfaceImplA): + pass + + instance = TestInterfaceImplA() + GIMarshallingTests.test_interface_test_int8_in(instance, 42) + self.assertEquals(instance.val, 42) + + def test_mro(self): + # there was a problem with Python bailing out because of + # http://en.wikipedia.org/wiki/Diamond_problem with interfaces, + # which shouldn't really be a problem. + + class TestInterfaceImpl(GObject.GObject, GIMarshallingTests.Interface): + pass + + class TestInterfaceImpl2(GIMarshallingTests.Interface, + TestInterfaceImpl): + pass + + class TestInterfaceImpl3(TestInterfaceImpl, + GIMarshallingTests.Interface2): + pass + + +class TestInterfaceClash(unittest.TestCase): + + def test_clash(self): + def create_clash(): + class TestClash(GObject.GObject, GIMarshallingTests.Interface, GIMarshallingTests.Interface2): + def do_test_int8_in(self, int8): + pass + TestClash() + + self.assertRaises(TypeError, create_clash) + + +class TestOverrides(unittest.TestCase): + + def test_constant(self): + self.assertEquals(GIMarshallingTests.OVERRIDES_CONSTANT, 7) + + def test_struct(self): + # Test that the constructor has been overridden. + struct = GIMarshallingTests.OverridesStruct(42) + + self.assertTrue(isinstance(struct, GIMarshallingTests.OverridesStruct)) + + # Test that the method has been overridden. + self.assertEquals(6, struct.method()) + + del struct + + # Test that the overrides wrapper has been registered. + struct = GIMarshallingTests.overrides_struct_returnv() + + self.assertTrue(isinstance(struct, GIMarshallingTests.OverridesStruct)) + + del struct + + def test_object(self): + # Test that the constructor has been overridden. + object_ = GIMarshallingTests.OverridesObject(42) + + self.assertTrue(isinstance(object_, GIMarshallingTests.OverridesObject)) + + # Test that the alternate constructor has been overridden. + object_ = GIMarshallingTests.OverridesObject.new(42) + + self.assertTrue(isinstance(object_, GIMarshallingTests.OverridesObject)) + + # Test that the method has been overridden. + self.assertEquals(6, object_.method()) + + # Test that the overrides wrapper has been registered. + object_ = GIMarshallingTests.OverridesObject.returnv() + + self.assertTrue(isinstance(object_, GIMarshallingTests.OverridesObject)) + + def test_module_name(self): + self.assertEquals(GIMarshallingTests.OverridesStruct.__module__, 'gi.overrides.GIMarshallingTests') + self.assertEquals(GObject.InitiallyUnowned.__module__, 'gi.repository.GObject') + +class TestDir(unittest.TestCase): + def test_members_list(self): + list = dir(GIMarshallingTests) + self.assertTrue('OverridesStruct' in list) + self.assertTrue('BoxedStruct' in list) + self.assertTrue('OVERRIDES_CONSTANT' in list) + self.assertTrue('GEnum' in list) + self.assertTrue('int32_return_max' in list) + + def test_modules_list(self): + import gi.repository + list = dir(gi.repository) + self.assertTrue('GIMarshallingTests' in list) + + # FIXME: test to see if a module which was not imported is in the list + # we should be listing every typelib we find, not just the ones + # which are imported + # + # to test this I recommend we compile a fake module which + # our tests would never import and check to see if it is + # in the list: + # + # self.assertTrue('DoNotImportDummyTests' in list) + +class TestGErrorArrayInCrash(unittest.TestCase): + # Previously there was a bug in invoke, in which C arrays were unwrapped + # from inside GArrays to be passed to the C function. But when a GError was + # set, invoke would attempt to free the C array as if it were a GArray. + # This crash is only for C arrays. It does not happen for C functions which + # take in GArrays. See https://bugzilla.gnome.org/show_bug.cgi?id=642708 + def test_gerror_array_in_crash(self): + self.assertRaises(GObject.GError, GIMarshallingTests.gerror_array_in, [1, 2, 3]) diff --git a/tests/test_gicon.py b/tests/test_gicon.py index 5ce7ece..b9af6ff 100644 --- a/tests/test_gicon.py +++ b/tests/test_gicon.py @@ -3,7 +3,8 @@ import os import unittest -from common import gio, glib +import glib +import gio class TestIcon(unittest.TestCase): diff --git a/tests/test_gio.py b/tests/test_gio.py index feafc70..e14eddf 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -3,7 +3,8 @@ import os import unittest -from common import gio, glib +import glib +import gio class TestFile(unittest.TestCase): @@ -515,13 +516,13 @@ class TestFile(unittest.TestCase): class TestGFileEnumerator(unittest.TestCase): def setUp(self): - self.file = gio.File(".") + self.file = gio.File(os.path.dirname(__file__)) def testEnumerateChildren(self): enumerator = self.file.enumerate_children( "standard::*", gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) for file_info in enumerator: - if file_info.get_name() == 'test_gio.py': + if file_info.get_name() == os.path.basename(__file__): break else: raise AssertionError @@ -530,7 +531,7 @@ class TestGFileEnumerator(unittest.TestCase): def callback(gfile, result): try: for file_info in gfile.enumerate_children_finish(result): - if file_info.get_name() == 'test_gio.py': + if file_info.get_name() == __file__: break else: raise AssertionError @@ -546,7 +547,7 @@ class TestGFileEnumerator(unittest.TestCase): def callback(enumerator, result): try: for file_info in enumerator.next_files_finish(result): - if file_info.get_name() == 'test_gio.py': + if file_info.get_name() == __file__: break else: raise AssertionError @@ -593,7 +594,7 @@ class TestInputStream(unittest.TestCase): self.assertEquals(self.stream.read(), '') self.stream = gio.MemoryInputStream() - some_data = open("test_gio.py", "rb").read() + some_data = open(__file__, "rb").read() self.stream.add_data(some_data) self.assertEquals(self.stream.read(), some_data) @@ -630,7 +631,7 @@ class TestInputStream(unittest.TestCase): 'testing') stream = gio.MemoryInputStream() - some_data = open('test_gio.py', 'rb').read() + some_data = open(__file__, 'rb').read() stream.add_data(some_data) self.assertEquals(self._read_in_loop(stream, lambda: stream.read_part(50), @@ -806,7 +807,7 @@ class TestOutputStream(unittest.TestCase): def test_write_part(self): stream = gio.MemoryOutputStream() - some_data = open('test_gio.py', 'rb').read() + some_data = open(__file__, 'rb').read() buffer = some_data # In fact this makes only one looping (memory stream is fast, @@ -962,7 +963,7 @@ class TestContentTypeGuess(unittest.TestCase): class TestFileInfo(unittest.TestCase): def setUp(self): - self.fileinfo = gio.File("test_gio.py").query_info("*") + self.fileinfo = gio.File(__file__).query_info("*") def testListAttributes(self): attributes = self.fileinfo.list_attributes("standard") diff --git a/tests/test_gobject.py b/tests/test_gobject.py index d91f3ad..d628b0e 100644 --- a/tests/test_gobject.py +++ b/tests/test_gobject.py @@ -2,7 +2,9 @@ import unittest -from common import gobject, testhelper +import gobject +import sys +import testhelper class TestGObjectAPI(unittest.TestCase): @@ -10,10 +12,16 @@ class TestGObjectAPI(unittest.TestCase): obj = gobject.GObject() self.assertEquals(obj.__module__, 'gobject._gobject') + + +class TestReferenceCounting(unittest.TestCase): + def testRegularObject(self): + obj = gobject.GObject() self.assertEquals(obj.__grefcount__, 1) + obj = gobject.new(gobject.GObject) + self.assertEquals(obj.__grefcount__, 1) -class TestFloating(unittest.TestCase): def testFloatingWithSinkFunc(self): obj = testhelper.FloatingWithSinkFunc() self.assertEquals(obj.__grefcount__, 1) @@ -27,3 +35,152 @@ class TestFloating(unittest.TestCase): obj = gobject.new(testhelper.FloatingWithoutSinkFunc) self.assertEquals(obj.__grefcount__, 1) + + def testOwnedByLibrary(self): + # Upon creation, the refcount of the object should be 2: + # - someone already has a reference on the new object. + # - the python wrapper should hold its own reference. + obj = testhelper.OwnedByLibrary() + self.assertEquals(obj.__grefcount__, 2) + + # We ask the library to release its reference, so the only + # remaining ref should be our wrapper's. Once the wrapper + # will run out of scope, the object will get finalized. + obj.release() + self.assertEquals(obj.__grefcount__, 1) + + def testOwnedByLibraryOutOfScope(self): + obj = testhelper.OwnedByLibrary() + self.assertEquals(obj.__grefcount__, 2) + + # We are manually taking the object out of scope. This means + # that our wrapper has been freed, and its reference dropped. We + # cannot check it but the refcount should now be 1 (the ref held + # by the library is still there, we didn't call release() + obj = None + + # When we get the object back from the lib, the wrapper is + # re-created, so our refcount will be 2 once again. + obj = testhelper.owned_by_library_get_instance_list()[0] + self.assertEquals(obj.__grefcount__, 2) + + obj.release() + self.assertEquals(obj.__grefcount__, 1) + + def testOwnedByLibraryUsingGObjectNew(self): + # Upon creation, the refcount of the object should be 2: + # - someone already has a reference on the new object. + # - the python wrapper should hold its own reference. + obj = gobject.new(testhelper.OwnedByLibrary) + self.assertEquals(obj.__grefcount__, 2) + + # We ask the library to release its reference, so the only + # remaining ref should be our wrapper's. Once the wrapper + # will run out of scope, the object will get finalized. + obj.release() + self.assertEquals(obj.__grefcount__, 1) + + def testOwnedByLibraryOutOfScopeUsingGobjectNew(self): + obj = gobject.new(testhelper.OwnedByLibrary) + self.assertEquals(obj.__grefcount__, 2) + + # We are manually taking the object out of scope. This means + # that our wrapper has been freed, and its reference dropped. We + # cannot check it but the refcount should now be 1 (the ref held + # by the library is still there, we didn't call release() + obj = None + + # When we get the object back from the lib, the wrapper is + # re-created, so our refcount will be 2 once again. + obj = testhelper.owned_by_library_get_instance_list()[0] + self.assertEquals(obj.__grefcount__, 2) + + obj.release() + self.assertEquals(obj.__grefcount__, 1) + + def testFloatingAndSunk(self): + # Upon creation, the refcount of the object should be 2: + # - someone already has a reference on the new object. + # - the python wrapper should hold its own reference. + obj = testhelper.FloatingAndSunk() + self.assertEquals(obj.__grefcount__, 2) + + # We ask the library to release its reference, so the only + # remaining ref should be our wrapper's. Once the wrapper + # will run out of scope, the object will get finalized. + obj.release() + self.assertEquals(obj.__grefcount__, 1) + + def testFloatingAndSunkOutOfScope(self): + obj = testhelper.FloatingAndSunk() + self.assertEquals(obj.__grefcount__, 2) + + # We are manually taking the object out of scope. This means + # that our wrapper has been freed, and its reference dropped. We + # cannot check it but the refcount should now be 1 (the ref held + # by the library is still there, we didn't call release() + obj = None + + # When we get the object back from the lib, the wrapper is + # re-created, so our refcount will be 2 once again. + obj = testhelper.floating_and_sunk_get_instance_list()[0] + self.assertEquals(obj.__grefcount__, 2) + + obj.release() + self.assertEquals(obj.__grefcount__, 1) + + + def testFloatingAndSunkUsingGObjectNew(self): + # Upon creation, the refcount of the object should be 2: + # - someone already has a reference on the new object. + # - the python wrapper should hold its own reference. + obj = gobject.new(testhelper.FloatingAndSunk) + self.assertEquals(obj.__grefcount__, 2) + + # We ask the library to release its reference, so the only + # remaining ref should be our wrapper's. Once the wrapper + # will run out of scope, the object will get finalized. + obj.release() + self.assertEquals(obj.__grefcount__, 1) + + def testFloatingAndSunkOutOfScopeUsingGObjectNew(self): + obj = gobject.new(testhelper.FloatingAndSunk) + self.assertEquals(obj.__grefcount__, 2) + + # We are manually taking the object out of scope. This means + # that our wrapper has been freed, and its reference dropped. We + # cannot check it but the refcount should now be 1 (the ref held + # by the library is still there, we didn't call release() + obj = None + + # When we get the object back from the lib, the wrapper is + # re-created, so our refcount will be 2 once again. + obj = testhelper.floating_and_sunk_get_instance_list()[0] + self.assertEquals(obj.__grefcount__, 2) + + obj.release() + self.assertEquals(obj.__grefcount__, 1) + +class A(gobject.GObject): + def __init__(self): + super(A, self).__init__() + +class TestPythonReferenceCounting(unittest.TestCase): + # Newly created instances should alwayshave two references: one for + # the GC, and one for the bound variable in the local scope. + + def testNewInstanceHasTwoRefs(self): + obj = gobject.GObject() + self.assertEquals(sys.getrefcount(obj), 2) + + def testNewInstanceHasTwoRefsUsingGObjectNew(self): + obj = gobject.new(gobject.GObject) + self.assertEquals(sys.getrefcount(obj), 2) + + def testNewSubclassInstanceHasTwoRefs(self): + obj = A() + self.assertEquals(sys.getrefcount(obj), 2) + + def testNewSubclassInstanceHasTwoRefsUsingGObjectNew(self): + obj = gobject.new(A) + self.assertEquals(sys.getrefcount(obj), 2) diff --git a/tests/test_gresolver.py b/tests/test_gresolver.py new file mode 100644 index 0000000..4238df7 --- /dev/null +++ b/tests/test_gresolver.py @@ -0,0 +1,68 @@ +# -*- Mode: Python -*- + +import unittest + +import glib +import gio + + +class TestResolver(unittest.TestCase): + def setUp(self): + self.resolver = gio.resolver_get_default() + + def test_resolver_lookup_by_name(self): + addresses = self.resolver.lookup_by_name("pygtk.org", cancellable=None) + self.failUnless(isinstance(addresses[0], gio.InetAddress)) + + def test_resolver_lookup_by_address(self): + address = gio.inet_address_new_from_string("8.8.8.8") + dns = self.resolver.lookup_by_address(address, cancellable=None) + self.failUnlessEqual(dns, "google-public-dns-a.google.com") + + def test_resolver_lookup_by_name_async(self): + def callback(resolver, result): + try: + addresses = resolver.lookup_by_name_finish(result) + self.failUnless(isinstance(addresses[0], gio.InetAddress)) + finally: + loop.quit() + + self.resolver.lookup_by_name_async(callback, "pygtk.org") + + loop = glib.MainLoop() + loop.run() + + def test_resolver_lookup_by_address_async(self): + def callback(resolver, result): + try: + dns = resolver.lookup_by_address_finish(result) + self.failUnlessEqual(dns, "google-public-dns-b.google.com") + finally: + loop.quit() + + address = gio.inet_address_new_from_string("8.8.4.4") + self.resolver.lookup_by_address_async(callback, address) + + loop = glib.MainLoop() + loop.run() + +""" Commented out because this requires an active internet connection and a + router that supports SRV lookups + + def test_resolver_lookup_service(self): + targets = self.resolver.lookup_service("xmpp-client", "tcp", "google.com") + self.failUnless(isinstance(targets[0], gio.SrvTarget)) + + def test_resolver_lookup_service_async(self): + def callback(resolver, result): + try: + targets = resolver.lookup_service_finish(result) + self.failUnless(isinstance(targets[0], gio.SrvTarget)) + finally: + loop.quit() + + self.resolver.lookup_service_async(callback, "xmpp-client", "tcp", "google.com") + + loop = glib.MainLoop() + loop.run() +""" diff --git a/tests/test_gsocket.py b/tests/test_gsocket.py new file mode 100644 index 0000000..627f6fd --- /dev/null +++ b/tests/test_gsocket.py @@ -0,0 +1,126 @@ +# -*- Mode: Python -*- + +import os +import unittest + +import glib +import gobject +import gio + + +class TestSocket(unittest.TestCase): + def setUp(self): + self.sock = gio.Socket(gio.SOCKET_FAMILY_IPV4, + gio.SOCKET_TYPE_STREAM, + gio.SOCKET_PROTOCOL_TCP) + + def test_socket_condition_check(self): + check = self.sock.condition_check(glib.IO_OUT) + self.failUnless(isinstance(check, gobject.GFlags)) + self.failUnlessEqual(check, glib.IO_OUT | glib.IO_HUP) + + def test_socket_condition_wait(self): + res = self.sock.condition_wait(glib.IO_OUT) + self.failUnless(res) + + def tearDown(self): + self.sock.close() + +class TestSocketAddress(unittest.TestCase): + def test_socket_address_enumerator_next_async(self): + def callback(enumerator, result): + try: + address = enumerator.next_finish(result) + self.failUnless(isinstance(address, gio.SocketAddress)) + finally: + loop.quit() + + socket = gio.NetworkAddress("www.pygtk.org", 80) + enumerator = socket.enumerate() + enumerator.next_async(callback) + + loop = glib.MainLoop() + loop.run() + +class TestSocketListener(unittest.TestCase): + def test_socket_listener_add_address(self): + address = gio.inet_address_new_from_string("127.0.0.1") + inetsock = gio.InetSocketAddress(address, 1024) + + listener = gio.SocketListener() + effective = listener.add_address(inetsock, gio.SOCKET_TYPE_STREAM, gio.SOCKET_PROTOCOL_TCP) + self.failUnless(isinstance(effective, gio.InetSocketAddress)) + + def test_socket_listener_accept(self): + address = gio.inet_address_new_from_string("127.0.0.1") + inetsock = gio.InetSocketAddress(address, 1024) + + listener = gio.SocketListener() + listener.add_address(inetsock, gio.SOCKET_TYPE_STREAM, gio.SOCKET_PROTOCOL_TCP) + + client = gio.SocketClient() + client.connect_to_host("127.0.0.1:1024", 1024) + + connection, source = listener.accept(cancellable=None) + self.failUnless(isinstance(connection, gio.TcpConnection)) + + def test_socket_listener_accept_socket(self): + address = gio.inet_address_new_from_string("127.0.0.1") + inetsock = gio.InetSocketAddress(address, 1024) + + listener = gio.SocketListener() + listener.add_address(inetsock, gio.SOCKET_TYPE_STREAM, gio.SOCKET_PROTOCOL_TCP) + + client = gio.SocketClient() + client.connect_to_host("127.0.0.1:1024", 1024) + + socket, source = listener.accept_socket(cancellable=None) + self.failUnless(isinstance(socket, gio.Socket)) + + def test_socket_listener_accept_async(self): + def callback(listener, result): + try: + connection, source = listener.accept_finish(result) + self.failUnless(isinstance(connection, gio.TcpConnection)) + finally: + loop.quit() + + address = gio.inet_address_new_from_string("127.0.0.1") + inetsock = gio.InetSocketAddress(address, 1024) + + listener = gio.SocketListener() + listener.add_address(inetsock, + gio.SOCKET_TYPE_STREAM, + gio.SOCKET_PROTOCOL_TCP) + + client = gio.SocketClient() + client.connect_to_host("127.0.0.1:1024", 1024) + + listener.accept_async(callback) + + loop = glib.MainLoop() + loop.run() + + def test_socket_listener_accept_socket_async(self): + def callback(listener, result): + try: + socket, source = listener.accept_socket_finish(result) + self.failUnless(isinstance(socket, gio.Socket)) + finally: + loop.quit() + + address = gio.inet_address_new_from_string("127.0.0.1") + inetsock = gio.InetSocketAddress(address, 1024) + + listener = gio.SocketListener() + listener.add_address(inetsock, + gio.SOCKET_TYPE_STREAM, + gio.SOCKET_PROTOCOL_TCP) + + client = gio.SocketClient() + client.connect_to_host("127.0.0.1:1024", 1024) + + listener.accept_socket_async(callback) + + loop = glib.MainLoop() + loop.run() diff --git a/tests/test_interface.py b/tests/test_interface.py index d959791..fbc0586 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -1,6 +1,10 @@ +# -*- Mode: Python -*- + import unittest -from common import gobject, testhelper +import gobject +import testhelper + GUnknown = gobject.type_from_name("TestUnknown") Unknown = GUnknown.pytype diff --git a/tests/test_mainloop.py b/tests/test_mainloop.py index 95e5f78..80e2aec 100644 --- a/tests/test_mainloop.py +++ b/tests/test_mainloop.py @@ -1,12 +1,13 @@ -#!/usr/bin/env python +# -*- Mode: Python -*- -import exceptions import os import sys import select import unittest -from common import glib +import glib + +from compathelper import _bytes class TestMainLoop(unittest.TestCase): def testExceptionHandling(self): @@ -27,11 +28,11 @@ class TestMainLoop(unittest.TestCase): glib.child_watch_add(pid, child_died, loop) os.close(pipe_r) - os.write(pipe_w, "Y") + os.write(pipe_w, _bytes("Y")) os.close(pipe_w) def excepthook(type, value, traceback): - assert type is exceptions.Exception + assert type is Exception assert value.args[0] == "deadbabe" sys.excepthook = excepthook @@ -48,6 +49,3 @@ class TestMainLoop(unittest.TestCase): # sys.excepthook = sys.__excepthook__ assert not got_exception - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_option.py b/tests/test_option.py new file mode 100644 index 0000000..a6ecc98 --- /dev/null +++ b/tests/test_option.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python + +import unittest +import sys + +# py3k has StringIO in a different module +try: + from StringIO import StringIO +except ImportError: + from io import StringIO + +from glib.option import OptionParser, OptionGroup, OptionValueError, \ + make_option, BadOptionError + +from compathelper import _bytes + +class TestOption(unittest.TestCase): + EXCEPTION_MESSAGE = "This callback fails" + + def setUp(self): + self.parser = OptionParser("NAMES...", + description="Option unit test") + self.parser.add_option("-t", "--test", help="Unit test option", + action="store_false", dest="test", default=True) + self.parser.add_option("--g-fatal-warnings", + action="store_true", + dest="fatal_warnings", + help="dummy"), + + def _create_group(self): + def option_callback(option, opt, value, parser): + raise Exception(self.EXCEPTION_MESSAGE) + + group = OptionGroup( + "unittest", "Unit test options", "Show all unittest options", + option_list = [ + make_option("-f", "-u", "--file", "--unit-file", + type="filename", + dest="unit_file", + help="Unit test option"), + make_option("--test-integer", + type="int", + dest="test_integer", + help="Unit integer option"), + make_option("--callback-failure-test", + action="callback", + callback=option_callback, + dest="test_integer", + help="Unit integer option"), + ]) + group.add_option("-t", "--test", + action="store_false", + dest="test", + default=True, + help="Unit test option") + self.parser.add_option_group(group) + return group + + def testParseArgs(self): + options, args = self.parser.parse_args( + ["test_option.py"]) + self.failIf(args) + + options, args = self.parser.parse_args( + ["test_option.py", "foo"]) + self.assertEquals(args, ["foo"]) + + options, args = self.parser.parse_args( + ["test_option.py", "foo", "bar"]) + self.assertEquals(args, ["foo", "bar"]) + + def testParseArgsDoubleDash(self): + options, args = self.parser.parse_args( + ["test_option.py", "--", "-xxx"]) + #self.assertEquals(args, ["-xxx"]) + + def testParseArgs(self): + options, args = self.parser.parse_args() + + def testParseArgsGroup(self): + group = self._create_group() + + options, args = self.parser.parse_args( + ["test_option.py", "--test", "-f", "test"]) + + self.failIf(options.test) + self.assertEqual(options.unit_file, "test") + + self.failUnless(group.values.test) + self.failIf(self.parser.values.test) + self.assertEqual(group.values.unit_file, "test") + self.failIf(args) + + def testOptionValueError(self): + self._create_group() + self.assertRaises(OptionValueError, self.parser.parse_args, + ["test_option.py", "--test-integer=text"]) + + def testBadOptionError(self): + self.assertRaises(BadOptionError, + self.parser.parse_args, + ["test_option.py", "--unknwon-option"]) + + def testOptionGroupConstructor(self): + self.assertRaises(TypeError, OptionGroup) + + def testStandardError(self): + self._create_group() + sio = StringIO() + old_stderr = sys.stderr + sys.stderr = sio + try: + self.parser.parse_args( + ["test_option.py", "--callback-failure-test"]) + finally: + sys.stderr = old_stderr + + assert (sio.getvalue().split('\n')[-2] == + "Exception: " + self.EXCEPTION_MESSAGE) + diff --git a/tests/test_overrides.py b/tests/test_overrides.py new file mode 100644 index 0000000..47f38a3 --- /dev/null +++ b/tests/test_overrides.py @@ -0,0 +1,1505 @@ +# -*- Mode: Python; py-indent-offset: 4 -*- +# vim: tabstop=4 shiftwidth=4 expandtab + +import unittest + +import sys +import os +sys.path.insert(0, "../") + +from compathelper import _long, _unicode, _bytes + +from gi.repository import GLib +from gi.repository import GObject +from gi.repository import Gdk +from gi.repository import Gtk +from gi.repository import Gio +from gi.repository import Pango +from gi.repository import GdkPixbuf +import gi.overrides as overrides +import gi.types + +class TestGLib(unittest.TestCase): + + def test_gvariant_create(self): + # simple values + + variant = GLib.Variant('i', 42) + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertEquals(variant.get_int32(), 42) + + variant = GLib.Variant('s', '') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertEquals(variant.get_string(), '') + + variant = GLib.Variant('s', 'hello') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertEquals(variant.get_string(), 'hello') + + # boxed variant + variant = GLib.Variant('v', GLib.Variant('i', 42)) + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertTrue(isinstance(variant.get_variant(), GLib.Variant)) + self.assertEqual(variant.get_type_string(), 'v') + self.assertEqual(variant.get_variant().get_type_string(), 'i') + self.assertEquals(variant.get_variant().get_int32(), 42) + + variant = GLib.Variant('v', GLib.Variant('v', GLib.Variant('i', 42))) + self.assertEqual(variant.get_type_string(), 'v') + self.assertEqual(variant.get_variant().get_type_string(), 'v') + self.assertEqual(variant.get_variant().get_variant().get_type_string(), 'i') + self.assertEquals(variant.get_variant().get_variant().get_int32(), 42) + + # tuples + + variant = GLib.Variant('()', ()) + self.assertEqual(variant.get_type_string(), '()') + self.assertEquals(variant.n_children(), 0) + + variant = GLib.Variant('(i)', (3,)) + self.assertEqual(variant.get_type_string(), '(i)') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertEquals(variant.n_children(), 1) + self.assertTrue(isinstance(variant.get_child_value(0), GLib.Variant)) + self.assertEquals(variant.get_child_value(0).get_int32(), 3) + + variant = GLib.Variant('(ss)', ('mec', 'mac')) + self.assertEqual(variant.get_type_string(), '(ss)') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(0), GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(1), GLib.Variant)) + self.assertEquals(variant.get_child_value(0).get_string(), 'mec') + self.assertEquals(variant.get_child_value(1).get_string(), 'mac') + + # nested tuples + variant = GLib.Variant('((si)(ub))', (('hello', -1), (42, True))) + self.assertEqual(variant.get_type_string(), '((si)(ub))') + self.assertEqual(variant.unpack(), (('hello', -1), (_long(42), True))) + + # dictionaries + + variant = GLib.Variant('a{si}', {}) + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertEqual(variant.get_type_string(), 'a{si}') + self.assertEquals(variant.n_children(), 0) + + variant = GLib.Variant('a{si}', {'': 1, 'key1': 2, 'key2': 3}) + self.assertEqual(variant.get_type_string(), 'a{si}') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(0), GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(1), GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(2), GLib.Variant)) + self.assertEqual(variant.unpack(), {'': 1, 'key1': 2, 'key2': 3}) + + # nested dictionaries + variant = GLib.Variant('a{sa{si}}', {}) + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertEqual(variant.get_type_string(), 'a{sa{si}}') + self.assertEquals(variant.n_children(), 0) + + d = {'': {'': 1, 'keyn1': 2}, + 'key1': {'key11': 11, 'key12': 12}} + variant = GLib.Variant('a{sa{si}}', d) + self.assertEqual(variant.get_type_string(), 'a{sa{si}}') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertEqual(variant.unpack(), d) + + # arrays + + variant = GLib.Variant('ai', []) + self.assertEqual(variant.get_type_string(), 'ai') + self.assertEquals(variant.n_children(), 0) + + variant = GLib.Variant('ai', [1, 2]) + self.assertEqual(variant.get_type_string(), 'ai') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(0), GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(1), GLib.Variant)) + self.assertEquals(variant.get_child_value(0).get_int32(), 1) + self.assertEquals(variant.get_child_value(1).get_int32(), 2) + + variant = GLib.Variant('as', []) + self.assertEqual(variant.get_type_string(), 'as') + self.assertEquals(variant.n_children(), 0) + + variant = GLib.Variant('as', ['']) + self.assertEqual(variant.get_type_string(), 'as') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(0), GLib.Variant)) + self.assertEquals(variant.get_child_value(0).get_string(), '') + + variant = GLib.Variant('as', ['hello', 'world']) + self.assertEqual(variant.get_type_string(), 'as') + self.assertTrue(isinstance(variant, GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(0), GLib.Variant)) + self.assertTrue(isinstance(variant.get_child_value(1), GLib.Variant)) + self.assertEquals(variant.get_child_value(0).get_string(), 'hello') + self.assertEquals(variant.get_child_value(1).get_string(), 'world') + + # nested arrays + variant = GLib.Variant('aai', []) + self.assertEqual(variant.get_type_string(), 'aai') + self.assertEquals(variant.n_children(), 0) + + variant = GLib.Variant('aai', [[]]) + self.assertEqual(variant.get_type_string(), 'aai') + self.assertEquals(variant.n_children(), 1) + self.assertEquals(variant.get_child_value(0).n_children(), 0) + + variant = GLib.Variant('aai', [[1, 2], [3, 4, 5]]) + self.assertEqual(variant.get_type_string(), 'aai') + self.assertEquals(variant.unpack(), [[1, 2], [3, 4, 5]]) + + # + # complex types + # + + variant = GLib.Variant('(as)', ([],)) + self.assertEqual(variant.get_type_string(), '(as)') + self.assertEquals(variant.n_children(), 1) + self.assertEquals(variant.get_child_value(0).n_children(), 0) + + variant = GLib.Variant('(as)', ([''],)) + self.assertEqual(variant.get_type_string(), '(as)') + self.assertEquals(variant.n_children(), 1) + self.assertEquals(variant.get_child_value(0).n_children(), 1) + self.assertEquals(variant.get_child_value(0).get_child_value(0).get_string(), '') + + variant = GLib.Variant('(as)', (['hello'],)) + self.assertEqual(variant.get_type_string(), '(as)') + self.assertEquals(variant.n_children(), 1) + self.assertEquals(variant.get_child_value(0).n_children(), 1) + self.assertEquals(variant.get_child_value(0).get_child_value(0).get_string(), 'hello') + + obj = {'a1': (1, True), 'a2': (2, False)} + variant = GLib.Variant('a{s(ib)}', obj) + self.assertEqual(variant.get_type_string(), 'a{s(ib)}') + self.assertEqual(variant.unpack(), obj) + + obj = {'a1': (1, GLib.Variant('b', True)), 'a2': (2, GLib.Variant('y', 255))} + variant = GLib.Variant('a{s(iv)}', obj) + self.assertEqual(variant.get_type_string(), 'a{s(iv)}') + self.assertEqual(variant.unpack(), {'a1': (1, True), 'a2': (2, 255)}) + + obj = (1, {'a': {'a1': True, 'a2': False}, + 'b': {'b1': False}, + 'c': {} + }, + 'foo') + variant = GLib.Variant('(ia{sa{sb}}s)', obj) + self.assertEqual(variant.get_type_string(), '(ia{sa{sb}}s)') + self.assertEqual(variant.unpack(), obj) + + obj = {"frequency": GLib.Variant('t', 738000000), + "hierarchy": GLib.Variant('i', 0), + "bandwidth": GLib.Variant('x', 8), + "code-rate-hp": GLib.Variant('d', 2.0/3.0), + "constellation": GLib.Variant('s', "QAM16"), + "guard-interval": GLib.Variant('u', 4),} + variant = GLib.Variant('a{sv}', obj) + self.assertEqual(variant.get_type_string(), 'a{sv}') + self.assertEqual(variant.unpack(), {"frequency": 738000000, + "hierarchy": 0, + "bandwidth": 8, + "code-rate-hp": 2.0/3.0, + "constellation": "QAM16", + "guard-interval": 4}) + + def test_gvariant_create_errors(self): + # excess arguments + self.assertRaises(TypeError, GLib.Variant, 'i', 42, 3) + self.assertRaises(TypeError, GLib.Variant, '(i)', (42, 3)) + + # not enough arguments + self.assertRaises(TypeError, GLib.Variant, '(ii)', (42,)) + + # data type mismatch + self.assertRaises(TypeError, GLib.Variant, 'i', 'hello') + self.assertRaises(TypeError, GLib.Variant, 's', 42) + self.assertRaises(TypeError, GLib.Variant, '(ss)', 'mec', 'mac') + + # unimplemented data type + self.assertRaises(NotImplementedError, GLib.Variant, 'Q', 1) + + def test_gvariant_unpack(self): + # simple values + res = GLib.Variant.new_int32(-42).unpack() + self.assertEqual(res, -42) + + res = GLib.Variant.new_uint64(34359738368).unpack() + self.assertEqual(res, 34359738368) + + res = GLib.Variant.new_boolean(True).unpack() + self.assertEqual(res, True) + + res = GLib.Variant.new_object_path('/foo/Bar').unpack() + self.assertEqual(res, '/foo/Bar') + + # variant + res = GLib.Variant('v', GLib.Variant.new_int32(-42)).unpack() + self.assertEqual(res, -42) + + variant = GLib.Variant('v', GLib.Variant('v', GLib.Variant('i', 42))) + self.assertEqual(res, -42) + + # tuple + res = GLib.Variant.new_tuple(GLib.Variant.new_int32(-1), + GLib.Variant.new_string('hello')).unpack() + self.assertEqual(res, (-1, 'hello')) + + # array + vb = GLib.VariantBuilder() + vb.init(gi._gi.variant_type_from_string('ai')) + vb.add_value(GLib.Variant.new_int32(-1)) + vb.add_value(GLib.Variant.new_int32(3)) + res = vb.end().unpack() + self.assertEqual(res, [-1, 3]) + + # dictionary + res = GLib.Variant('a{si}', {'key1': 1, 'key2': 2}).unpack() + self.assertEqual(res, {'key1': 1, 'key2': 2}) + + def test_gvariant_iteration(self): + # array index access + vb = GLib.VariantBuilder() + vb.init(gi._gi.variant_type_from_string('ai')) + vb.add_value(GLib.Variant.new_int32(-1)) + vb.add_value(GLib.Variant.new_int32(3)) + v = vb.end() + + self.assertEqual(len(v), 2) + self.assertEqual(v[0], -1) + self.assertEqual(v[1], 3) + self.assertEqual(v[-1], 3) + self.assertEqual(v[-2], -1) + self.assertRaises(IndexError, v.__getitem__, 2) + self.assertRaises(IndexError, v.__getitem__, -3) + self.assertRaises(ValueError, v.__getitem__, 'a') + + # array iteration + self.assertEqual([x for x in v], [-1, 3]) + self.assertEqual(list(v), [-1, 3]) + + # tuple index access + v = GLib.Variant.new_tuple(GLib.Variant.new_int32(-1), + GLib.Variant.new_string('hello')) + self.assertEqual(len(v), 2) + self.assertEqual(v[0], -1) + self.assertEqual(v[1], 'hello') + self.assertEqual(v[-1], 'hello') + self.assertEqual(v[-2], -1) + self.assertRaises(IndexError, v.__getitem__, 2) + self.assertRaises(IndexError, v.__getitem__, -3) + self.assertRaises(ValueError, v.__getitem__, 'a') + + # tuple iteration + self.assertEqual([x for x in v], [-1, 'hello']) + self.assertEqual(tuple(v), (-1, 'hello')) + + # dictionary index access + vsi = GLib.Variant('a{si}', {'key1': 1, 'key2': 2}) + vis = GLib.Variant('a{is}', {1: 'val1', 5: 'val2'}) + + self.assertEqual(len(vsi), 2) + self.assertEqual(vsi['key1'], 1) + self.assertEqual(vsi['key2'], 2) + self.assertRaises(KeyError, vsi.__getitem__, 'unknown') + + self.assertEqual(len(vis), 2) + self.assertEqual(vis[1], 'val1') + self.assertEqual(vis[5], 'val2') + self.assertRaises(KeyError, vsi.__getitem__, 3) + + # dictionary iteration + self.assertEqual(set(vsi.keys()), set(['key1', 'key2'])) + self.assertEqual(set(vis.keys()), set([1, 5])) + + # string index access + v = GLib.Variant('s', 'hello') + self.assertEqual(len(v), 5) + self.assertEqual(v[0], 'h') + self.assertEqual(v[4], 'o') + self.assertEqual(v[-1], 'o') + self.assertEqual(v[-5], 'h') + self.assertRaises(IndexError, v.__getitem__, 5) + self.assertRaises(IndexError, v.__getitem__, -6) + + # string iteration + self.assertEqual([x for x in v], ['h', 'e', 'l', 'l', 'o']) + +class TestPango(unittest.TestCase): + + def test_default_font_description(self): + desc = Pango.FontDescription() + self.assertEquals(desc.get_variant(), Pango.Variant.NORMAL) + + def test_font_description(self): + desc = Pango.FontDescription('monospace') + self.assertEquals(desc.get_family(), 'monospace') + self.assertEquals(desc.get_variant(), Pango.Variant.NORMAL) + + def test_layout(self): + self.assertRaises(TypeError, Pango.Layout) + context = Pango.Context() + layout = Pango.Layout(context) + self.assertEquals(layout.get_context(), context) + +class TestGdk(unittest.TestCase): + + def test_constructor(self): + attribute = Gdk.WindowAttr() + attribute.window_type = Gdk.WindowType.CHILD + attributes_mask = Gdk.WindowAttributesType.X | \ + Gdk.WindowAttributesType.Y + window = Gdk.Window(None, attribute, attributes_mask) + self.assertEquals(window.get_window_type(), Gdk.WindowType.CHILD) + + def test_color(self): + color = Gdk.Color(100, 200, 300) + self.assertEquals(color.red, 100) + self.assertEquals(color.green, 200) + self.assertEquals(color.blue, 300) + self.assertEquals(color, Gdk.Color(100, 200, 300)) + self.assertNotEquals(color, Gdk.Color(1, 2, 3)) + + def test_rgba(self): + self.assertEquals(Gdk.RGBA, overrides.Gdk.RGBA) + rgba = Gdk.RGBA(0.1, 0.2, 0.3, 0.4) + self.assertEquals(rgba, Gdk.RGBA(0.1, 0.2, 0.3, 0.4)) + self.assertNotEquals(rgba, Gdk.RGBA(0.0, 0.2, 0.3, 0.4)) + self.assertEquals(rgba.red, 0.1) + self.assertEquals(rgba.green, 0.2) + self.assertEquals(rgba.blue, 0.3) + self.assertEquals(rgba.alpha, 0.4) + rgba.green = 0.9 + self.assertEquals(rgba.green, 0.9) + + def test_event(self): + event = Gdk.Event.new(Gdk.EventType.CONFIGURE) + self.assertEquals(event.type, Gdk.EventType.CONFIGURE) + self.assertEquals(event.send_event, 0) + + event = Gdk.Event.new(Gdk.EventType.DRAG_MOTION) + event.x_root, event.y_root = 0, 5 + self.assertEquals(event.x_root, 0) + self.assertEquals(event.y_root, 5) + + event = Gdk.Event() + event.type = Gdk.EventType.SCROLL + self.assertRaises(AttributeError, lambda: getattr(event, 'foo_bar')) + + def test_event_structures(self): + def button_press_cb(button, event): + self.assertTrue(isinstance(event, Gdk.EventButton)) + self.assertTrue(event.type == Gdk.EventType.BUTTON_PRESS) + self.assertEquals(event.send_event, 0) + self.assertEquals(event.get_state(), Gdk.ModifierType.CONTROL_MASK) + self.assertEquals(event.get_root_coords(), (2, 5)) + + event.time = 12345 + self.assertEquals(event.get_time(), 12345) + + w = Gtk.Window() + b = Gtk.Button() + b.connect('button-press-event', button_press_cb) + w.add(b) + w.show_all() + Gdk.test_simulate_button(b.get_window(), + 2, 5, + 0, + Gdk.ModifierType.CONTROL_MASK, + Gdk.EventType.BUTTON_PRESS) + + def test_cursor(self): + self.assertEquals(Gdk.Cursor, overrides.Gdk.Cursor) + c = Gdk.Cursor(Gdk.CursorType.WATCH) + self.assertNotEqual(c, None) + c = Gdk.Cursor(cursor_type = Gdk.CursorType.WATCH) + self.assertNotEqual(c, None) + + display_manager = Gdk.DisplayManager.get() + display = display_manager.get_default_display() + + test_pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, + False, + 8, + 5, + 10) + + c = Gdk.Cursor(display, + test_pixbuf, + y=0, x=0) + + self.assertNotEqual(c, None) + self.assertRaises(ValueError, Gdk.Cursor, 1, 2, 3) + +class TestGtk(unittest.TestCase): + + def test_container(self): + box = Gtk.Box() + self.assertTrue(box) + label = Gtk.Label() + label2 = Gtk.Label() + box.add(label) + box.add(label2) + self.assertTrue(label in box) + self.assertTrue(label2 in box) + self.assertEqual(len(box), 2) + self.assertTrue(box) + l = [x for x in box] + self.assertEqual(l, [label, label2]) + + def test_actions(self): + self.assertEquals(Gtk.Action, overrides.Gtk.Action) + self.assertRaises(TypeError, Gtk.Action) + action = Gtk.Action("test", "Test", "Test Action", Gtk.STOCK_COPY) + self.assertEquals(action.get_name(), "test") + self.assertEquals(action.get_label(), "Test") + self.assertEquals(action.get_tooltip(), "Test Action") + self.assertEquals(action.get_stock_id(), Gtk.STOCK_COPY) + + self.assertEquals(Gtk.RadioAction, overrides.Gtk.RadioAction) + self.assertRaises(TypeError, Gtk.RadioAction) + action = Gtk.RadioAction("test", "Test", "Test Action", Gtk.STOCK_COPY, 1) + self.assertEquals(action.get_name(), "test") + self.assertEquals(action.get_label(), "Test") + self.assertEquals(action.get_tooltip(), "Test Action") + self.assertEquals(action.get_stock_id(), Gtk.STOCK_COPY) + self.assertEquals(action.get_current_value(), 1) + + def test_actiongroup(self): + self.assertEquals(Gtk.ActionGroup, overrides.Gtk.ActionGroup) + self.assertRaises(TypeError, Gtk.ActionGroup) + + action_group = Gtk.ActionGroup (name = 'TestActionGroup') + callback_data = "callback data" + + def test_action_callback_data(action, user_data): + self.assertEquals(user_data, callback_data); + + def test_radio_action_callback_data(action, current, user_data): + self.assertEquals(user_data, callback_data); + + action_group.add_actions ([ + ('test-action1', None, 'Test Action 1', + None, None, test_action_callback_data), + ('test-action2', Gtk.STOCK_COPY, 'Test Action 2', + None, None, test_action_callback_data)], callback_data) + action_group.add_toggle_actions([ + ('test-toggle-action1', None, 'Test Toggle Action 1', + None, None, test_action_callback_data, False), + ('test-toggle-action2', Gtk.STOCK_COPY, 'Test Toggle Action 2', + None, None, test_action_callback_data, True)], callback_data) + action_group.add_radio_actions([ + ('test-radio-action1', None, 'Test Radio Action 1'), + ('test-radio-action2', Gtk.STOCK_COPY, 'Test Radio Action 2')], 1, + test_radio_action_callback_data, + callback_data) + + expected_results = [('test-action1', Gtk.Action), + ('test-action2', Gtk.Action), + ('test-toggle-action1', Gtk.ToggleAction), + ('test-toggle-action2', Gtk.ToggleAction), + ('test-radio-action1', Gtk.RadioAction), + ('test-radio-action2', Gtk.RadioAction)] + + for action in action_group.list_actions(): + a = (action.get_name(), type(action)) + self.assertTrue(a in expected_results) + expected_results.remove(a) + action.activate() + + def test_uimanager(self): + self.assertEquals(Gtk.UIManager, overrides.Gtk.UIManager) + ui = Gtk.UIManager() + ui.add_ui_from_string( +""" + + + +""" +) + menubar = ui.get_widget("/menubar1") + self.assertEquals(type(menubar), Gtk.MenuBar) + + ag = Gtk.ActionGroup (name="ag1") + ui.insert_action_group(ag) + ag2 = Gtk.ActionGroup (name="ag2") + ui.insert_action_group(ag2) + groups = ui.get_action_groups() + self.assertEquals(ag, groups[-2]) + self.assertEquals(ag2, groups[-1]) + + def test_builder(self): + self.assertEquals(Gtk.Builder, overrides.Gtk.Builder) + + class SignalTest(GObject.GObject): + __gtype_name__ = "GIOverrideSignalTest" + __gsignals__ = { + "test-signal": (GObject.SIGNAL_RUN_FIRST, + GObject.TYPE_NONE, + []), + } + + + class SignalCheck: + def __init__(self): + self.sentinel = 0 + + def on_signal_1(self, *args): + self.sentinel += 1 + + def on_signal_3(self, *args): + self.sentinel += 3 + + signal_checker = SignalCheck() + builder = Gtk.Builder() + + # add object1 to the builder + builder.add_from_string( +""" + + + + + +""") + + # only add object3 to the builder + builder.add_objects_from_string( +""" + + + + + + + + + + + + +""", + ['object3']) + + # hook up signals + builder.connect_signals(signal_checker) + + # call their notify signals and check sentinel + objects = builder.get_objects() + self.assertEquals(len(objects), 2) + for obj in objects: + obj.emit('test-signal') + + self.assertEquals(signal_checker.sentinel, 4) + + def test_dialogs(self): + self.assertEquals(Gtk.Dialog, overrides.Gtk.Dialog) + self.assertEquals(Gtk.AboutDialog, overrides.Gtk.AboutDialog) + self.assertEquals(Gtk.MessageDialog, overrides.Gtk.MessageDialog) + self.assertEquals(Gtk.ColorSelectionDialog, overrides.Gtk.ColorSelectionDialog) + self.assertEquals(Gtk.FileChooserDialog, overrides.Gtk.FileChooserDialog) + self.assertEquals(Gtk.FontSelectionDialog, overrides.Gtk.FontSelectionDialog) + self.assertEquals(Gtk.RecentChooserDialog, overrides.Gtk.RecentChooserDialog) + + # Gtk.Dialog + dialog = Gtk.Dialog (title='Foo', + flags=Gtk.DialogFlags.MODAL, + buttons=('test-button1', 1)) + + dialog.add_buttons ('test-button2', 2, Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE) + + self.assertEquals('Foo', dialog.get_title()) + self.assertTrue(dialog.get_modal()) + button = dialog.get_widget_for_response (1) + self.assertEquals('test-button1', button.get_label()) + button = dialog.get_widget_for_response (2) + self.assertEquals('test-button2', button.get_label()) + button = dialog.get_widget_for_response (Gtk.ResponseType.CLOSE) + self.assertEquals(Gtk.STOCK_CLOSE, button.get_label()) + + # Gtk.AboutDialog + dialog = Gtk.AboutDialog() + + # Gtk.MessageDialog + dialog = Gtk.MessageDialog (title='message dialog test', + flags=Gtk.DialogFlags.MODAL, + buttons=Gtk.ButtonsType.OK, + message_format='dude!') + + self.assertEquals('message dialog test', dialog.get_title()) + self.assertTrue(dialog.get_modal()) + text = dialog.get_property('text') + self.assertEquals('dude!', text) + + dialog.format_secondary_text('2nd text') + self.assertEqual(dialog.get_property('secondary-text'), '2nd text') + self.assertFalse(dialog.get_property('secondary-use-markup')) + + dialog.format_secondary_markup('2nd markup') + self.assertEqual(dialog.get_property('secondary-text'), '2nd markup') + self.assertTrue(dialog.get_property('secondary-use-markup')) + + # Gtk.ColorSelectionDialog + dialog = Gtk.ColorSelectionDialog("color selection dialog test") + self.assertEquals('color selection dialog test', dialog.get_title()) + + # Gtk.FileChooserDialog + dialog = Gtk.FileChooserDialog (title='file chooser dialog test', + buttons=('test-button1', 1), + action=Gtk.FileChooserAction.SAVE) + + dialog.add_buttons ('test-button2', 2, Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE) + self.assertEquals('file chooser dialog test', dialog.get_title()) + button = dialog.get_widget_for_response (1) + self.assertEquals('test-button1', button.get_label()) + button = dialog.get_widget_for_response (2) + self.assertEquals('test-button2', button.get_label()) + button = dialog.get_widget_for_response (Gtk.ResponseType.CLOSE) + self.assertEquals(Gtk.STOCK_CLOSE, button.get_label()) + action = dialog.get_property('action') + self.assertEquals(Gtk.FileChooserAction.SAVE, action) + + + # Gtk.FontSelectionDialog + dialog = Gtk.ColorSelectionDialog("font selection dialog test") + self.assertEquals('font selection dialog test', dialog.get_title()) + + # Gtk.RecentChooserDialog + test_manager = Gtk.RecentManager() + dialog = Gtk.RecentChooserDialog (title='recent chooser dialog test', + buttons=('test-button1', 1), + manager=test_manager) + + dialog.add_buttons ('test-button2', 2, Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE) + self.assertEquals('recent chooser dialog test', dialog.get_title()) + button = dialog.get_widget_for_response (1) + self.assertEquals('test-button1', button.get_label()) + button = dialog.get_widget_for_response (2) + self.assertEquals('test-button2', button.get_label()) + button = dialog.get_widget_for_response (Gtk.ResponseType.CLOSE) + self.assertEquals(Gtk.STOCK_CLOSE, button.get_label()) + + class TestClass(GObject.GObject): + __gtype_name__ = "GIOverrideTreeAPITest" + + def __init__(self, tester, int_value, string_value): + super(TestGtk.TestClass, self).__init__() + self.tester = tester + self.int_value = int_value + self.string_value = string_value + + def check(self, int_value, string_value): + self.tester.assertEquals(int_value, self.int_value) + self.tester.assertEquals(string_value, self.string_value) + + def test_tree_store(self): + self.assertEquals(Gtk.TreeStore, overrides.Gtk.TreeStore) + self.assertEquals(Gtk.ListStore, overrides.Gtk.ListStore) + self.assertEquals(Gtk.TreeModel, overrides.Gtk.TreeModel) + self.assertEquals(Gtk.TreeViewColumn, overrides.Gtk.TreeViewColumn) + + class TestPyObject(object): + pass + + test_pyobj = TestPyObject() + test_pydict = {1:1, "2":2, "3":"3"} + test_pylist = [1,"2", "3"] + tree_store = Gtk.TreeStore(int, + 'gchararray', + TestGtk.TestClass, + object, + object, + object, + bool, + bool, + GObject.TYPE_UINT, + GObject.TYPE_ULONG, + GObject.TYPE_INT64, + GObject.TYPE_UINT64, + GObject.TYPE_UCHAR, + GObject.TYPE_CHAR) + + parent = None + for i in range(100): + label = 'this is child #%d' % i + testobj = TestGtk.TestClass(self, i, label) + parent = tree_store.append(parent, (i, + label, + testobj, + test_pyobj, + test_pydict, + test_pylist, + i % 2, + bool(i % 2), + i, + 9223372036854775808, + -9223372036854775808, + 0xffffffffffffffff, + 254, + _bytes('a') + )) + + # len gets the number of children in the root node + # since we kept appending to the previous node + # there should only be one child of the root + self.assertEquals(len(tree_store), 1) + + # walk the tree to see if the values were stored correctly + parent = None + i = 0 + + treeiter = tree_store.iter_children(parent) + while treeiter: + i = tree_store.get_value(treeiter, 0) + s = tree_store.get_value(treeiter, 1) + obj = tree_store.get_value(treeiter, 2) + obj.check(i, s) + + pyobj = tree_store.get_value(treeiter, 3) + self.assertEquals(pyobj, test_pyobj) + pydict = tree_store.get_value(treeiter, 4) + self.assertEquals(pydict, test_pydict) + pylist = tree_store.get_value(treeiter, 5) + self.assertEquals(pylist, test_pylist) + + bool_1 = tree_store.get_value(treeiter, 6) + bool_2 = tree_store.get_value(treeiter, 7) + self.assertEquals(bool_1, bool_2) + self.assertTrue(isinstance(bool_1, bool)) + self.assertTrue(isinstance(bool_2, bool)) + + uint_ = tree_store.get_value(treeiter, 8) + self.assertEquals(uint_, i) + ulong_ = tree_store.get_value(treeiter, 9) + self.assertEquals(ulong_, 9223372036854775808) + int64_ = tree_store.get_value(treeiter, 10) + self.assertEquals(int64_, -9223372036854775808) + uint64_ = tree_store.get_value(treeiter, 11) + self.assertEquals(uint64_, 0xffffffffffffffff) + uchar_ = tree_store.get_value(treeiter, 12) + self.assertEquals(ord(uchar_), 254) + char_ = tree_store.get_value(treeiter, 13) + self.assertEquals(char_, 'a') + + parent = treeiter + treeiter = tree_store.iter_children(parent) + + self.assertEquals(i, 99) + + def test_list_store(self): + class TestPyObject(object): + pass + + class TestPyGObject(GObject.Object): + __gtype_name__ = 'TestPyGObject' + def __init__(self, i): + GObject.Object.__init__(self) + self.sentinal = i + 5 + + test_pyobj = TestPyObject() + test_pydict = {1:1, "2":2, "3":"3"} + test_pylist = [1,"2", "3"] + + list_store = Gtk.ListStore(int, str, 'GIOverrideTreeAPITest', object, object, object, bool, bool, object) + for i in range(93): + label = 'this is row #%d' % i + testobj = TestGtk.TestClass(self, i, label) + testpygobj = TestPyGObject(i) + parent = list_store.append((i, + label, + testobj, + test_pyobj, + test_pydict, + test_pylist, + i % 2, + bool(i % 2), + testpygobj)) + + i = 93 + label = _unicode('this is row #93') + treeiter = list_store.append() + list_store.set_value(treeiter, 0, i) + list_store.set_value(treeiter, 1, label) + list_store.set_value(treeiter, 2, TestGtk.TestClass(self, i, label)) + list_store.set_value(treeiter, 3, test_pyobj) + list_store.set_value(treeiter, 4, test_pydict) + list_store.set_value(treeiter, 5, test_pylist) + list_store.set_value(treeiter, 6, 1) + list_store.set_value(treeiter, 7, True) + list_store.set_value(treeiter, 8, TestPyGObject(i)) + + # test automatic unicode->str conversion + i = 94 + label = _unicode('this is row #94') + treeiter = list_store.append((i, + label, + TestGtk.TestClass(self, i, label), + test_pyobj, + test_pydict, + test_pylist, + 0, + False, + TestPyGObject(i))) + + # add sorted items out of order to test insert* apis + # also test sending in None to not set a column + i = 97 + label = 'this is row #97' + treeiter = list_store.append((None, + None, + None, + test_pyobj, + None, + test_pylist, + 1, + None, + TestPyGObject(i))) + + list_store.set_value(treeiter, 0, i) + list_store.set_value(treeiter, 1, label) + list_store.set_value(treeiter, 2, TestGtk.TestClass(self, i, label)) + list_store.set_value(treeiter, 4, test_pydict) + list_store.set_value(treeiter, 7, True) + + # this should append + i = 99 + label = 'this is row #99' + list_store.insert(9999, (i, + label, + TestGtk.TestClass(self, i, label), + test_pyobj, + test_pydict, + test_pylist, + 1, + True, + TestPyGObject(i))) + + i = 96 + label = 'this is row #96' + list_store.insert_before(treeiter, (i, + label, + TestGtk.TestClass(self, i, label), + test_pyobj, + test_pydict, + test_pylist, + 0, + False, + TestPyGObject(i))) + + i = 98 + label = 'this is row #98' + list_store.insert_after(treeiter, (i, + label, + TestGtk.TestClass(self, i, label), + test_pyobj, + test_pydict, + test_pylist, + 0, + False, + TestPyGObject(i))) + + + i = 95 + label = 'this is row #95' + list_store.insert(95, (i, + label, + TestGtk.TestClass(self, i, label), + test_pyobj, + test_pydict, + test_pylist, + 1, + True, + TestPyGObject(i))) + + self.assertEquals(len(list_store), 100) + + # walk the list to see if the values were stored correctly + i = 0 + treeiter = list_store.get_iter_first() + + counter = 0 + while treeiter: + i = list_store.get_value(treeiter, 0) + self.assertEquals(i, counter) + s = list_store.get_value(treeiter, 1) + obj = list_store.get_value(treeiter, 2) + obj.check(i, s) + + pyobj = list_store.get_value(treeiter, 3) + self.assertEquals(pyobj, test_pyobj) + pydict = list_store.get_value(treeiter, 4) + self.assertEquals(pydict, test_pydict) + pylist = list_store.get_value(treeiter, 5) + self.assertEquals(pylist, test_pylist) + + bool_1 = list_store.get_value(treeiter, 6) + bool_2 = list_store.get_value(treeiter, 7) + self.assertEquals(bool_1, bool_2) + self.assertTrue(isinstance(bool_1, bool)) + self.assertTrue(isinstance(bool_2, bool)) + + pygobj = list_store.get_value(treeiter, 8) + self.assertEquals(pygobj.sentinal, i + 5) + + treeiter = list_store.iter_next(treeiter) + + counter += 1 + + self.assertEquals(i, 99) + + def test_tree_path(self): + p1 = Gtk.TreePath() + p2 = Gtk.TreePath.new_first() + self.assertEqual(p1, p2) + self.assertEqual(str(p1), '0') + p1 = Gtk.TreePath(2) + p2 = Gtk.TreePath.new_from_string('2') + self.assertEqual(p1, p2) + self.assertEqual(str(p1), '2') + p1 = Gtk.TreePath('1:2:3') + p2 = Gtk.TreePath.new_from_string('1:2:3') + self.assertEqual(p1, p2) + self.assertEqual(str(p1), '1:2:3') + p1 = Gtk.TreePath((1,2,3)) + p2 = Gtk.TreePath.new_from_string('1:2:3') + self.assertEqual(p1, p2) + self.assertEqual(str(p1), '1:2:3') + self.assertTrue(p1 != None) + self.assertFalse(p1 == None) + self.assertTrue(p1 > None) + self.assertTrue(p1 >= None) + self.assertFalse(p1 < None) + self.assertFalse(p1 <= None) + + def test_tree_model(self): + tree_store = Gtk.TreeStore(int, str) + + self.assertTrue(tree_store) + self.assertEqual(len(tree_store), 0) + self.assertEqual(tree_store.get_iter_first(), None) + + def get_by_index(row, col=None): + if col: + return tree_store[row][col] + else: + return tree_store[row] + + self.assertRaises(TypeError, get_by_index, None) + self.assertRaises(TypeError, get_by_index, "") + self.assertRaises(TypeError, get_by_index, ()) + + self.assertRaises(IndexError, get_by_index, "0") + self.assertRaises(IndexError, get_by_index, 0) + self.assertRaises(IndexError, get_by_index, (0,)) + + self.assertRaises(ValueError, tree_store.get_iter, "0") + self.assertRaises(ValueError, tree_store.get_iter, 0) + self.assertRaises(ValueError, tree_store.get_iter, (0,)) + + self.assertRaises(ValueError, tree_store.get_iter_from_string, "0") + + for row in tree_store: + self.fail("Should not be reached") + + class DerivedIntType(int): + pass + + class DerivedStrType(str): + pass + + for i in range(100): + label = 'this is row #%d' % i + parent = tree_store.append(None, (DerivedIntType(i), DerivedStrType(label),)) + self.assertNotEquals(parent, None) + for j in range(20): + label = 'this is child #%d of node #%d' % (j, i) + child = tree_store.append(parent, (j, label,)) + self.assertNotEqual(child, None) + + self.assertTrue(tree_store) + self.assertEqual(len(tree_store), 100) + + for i,row in enumerate(tree_store): + self.assertEqual(row.model, tree_store) + self.assertEqual(row.parent, None) + + self.assertEqual(tree_store[i].path, row.path) + self.assertEqual(tree_store[str(i)].path, row.path) + self.assertEqual(tree_store[(i,)].path, row.path) + + self.assertEqual(tree_store[i][0], i) + self.assertEqual(tree_store[i][1], "this is row #%d" % i) + + aiter = tree_store.get_iter(i) + self.assertEqual(tree_store.get_path(aiter), row.path) + + aiter = tree_store.get_iter(str(i)) + self.assertEqual(tree_store.get_path(aiter), row.path) + + aiter = tree_store.get_iter((i,)) + self.assertEqual(tree_store.get_path(aiter), row.path) + + self.assertEqual(tree_store.iter_parent(aiter), row.parent) + + next = tree_store.iter_next(aiter) + if i < len(tree_store) - 1: + self.assertEqual(tree_store.get_path(next), row.next.path) + else: + self.assertEqual(next, None) + + self.assertEqual(tree_store.iter_n_children(row.iter), 20) + + child = tree_store.iter_children(row.iter) + for j,childrow in enumerate(row.iterchildren()): + child_path = tree_store.get_path(child) + self.assertEqual(childrow.path, child_path) + self.assertEqual(childrow.parent.path, row.path) + self.assertEqual(childrow.path, tree_store[child].path) + self.assertEqual(childrow.path, tree_store[child_path].path) + + self.assertEqual(childrow[0], tree_store[child][0]) + self.assertEqual(childrow[0], j) + self.assertEqual(childrow[1], tree_store[child][1]) + self.assertEqual(childrow[1], 'this is child #%d of node #%d' % (j, i)) + + self.assertRaises(IndexError, get_by_index, child, 2) + + tree_store[child][1] = 'this was child #%d of node #%d' % (j, i) + self.assertEqual(childrow[1], 'this was child #%d of node #%d' % (j, i)) + + nth_child = tree_store.iter_nth_child(row.iter, j) + self.assertEqual(childrow.path, tree_store.get_path(nth_child)) + + childrow2 = tree_store["%d:%d" % (i, j)] + self.assertEqual(childrow.path, childrow2.path) + + childrow2 = tree_store[(i, j,)] + self.assertEqual(childrow.path, childrow2.path) + + child = tree_store.iter_next(child) + if j < 19: + self.assertEqual(childrow.next.path, tree_store.get_path(child)) + else: + self.assertEqual(child, childrow.next) + self.assertEqual(child, None) + + self.assertEqual(j, 19) + + self.assertEqual(i, 99) + + # negative indices + for i in range(-1,-100,-1): + i_real = i + 100 + self.assertEqual(tree_store[i][0], i_real) + + row = tree_store[i] + for j in range(-1, -20, -1): + j_real = j + 20 + path = (i_real, j_real,) + + self.assertEqual(tree_store[path][-2], j_real) + + label = 'this was child #%d of node #%d' % (j_real, i_real) + self.assertEqual(tree_store[path][-1], label) + + new_label = 'this still is child #%d of node #%d' % (j_real, i_real) + tree_store[path][-1] = new_label + self.assertEqual(tree_store[path][-1], new_label) + + self.assertRaises(IndexError, get_by_index, path, -3) + + self.assertRaises(IndexError, get_by_index, -101) + + last_row = tree_store[99] + self.assertNotEqual(last_row, None) + + for i,childrow in enumerate(last_row.iterchildren()): + if i < 19: + self.assertTrue(tree_store.remove(childrow.iter)) + else: + self.assertFalse(tree_store.remove(childrow.iter)) + + self.assertEqual(i, 19) + + self.assertEqual(tree_store.iter_n_children(last_row.iter), 0) + for childrow in last_row.iterchildren(): + self.fail("Should not be reached") + + aiter = tree_store.get_iter(10) + self.assertRaises(TypeError, tree_store.get, aiter, 1, 'a') + self.assertRaises(ValueError, tree_store.get, aiter, 1, -1) + self.assertRaises(ValueError, tree_store.get, aiter, 1, 100) + self.assertEqual(tree_store.get(aiter, 0, 1), (10, 'this is row #10')) + + def test_tree_view_column(self): + cell = Gtk.CellRendererText() + column = Gtk.TreeViewColumn(title='This is just a test', + cell_renderer=cell, + text=0, + style=2) + + def test_tree_selection(self): + store = Gtk.ListStore(int, str) + for i in range(10): + store.append((i, "foo")) + view = Gtk.TreeView() + view.set_model(store) + firstpath = store.get_path(store.get_iter_first()) + sel = view.get_selection() + + sel.select_path(firstpath) + (m, s) = sel.get_selected() + self.assertEqual(m, store) + self.assertEqual(store.get_path(s), firstpath) + + sel.select_path(0) + (m, s) = sel.get_selected() + self.assertEqual(m, store) + self.assertEqual(store.get_path(s), firstpath) + + sel.select_path("0:0") + (m, s) = sel.get_selected() + self.assertEqual(m, store) + self.assertEqual(store.get_path(s), firstpath) + + sel.select_path((0,0)) + (m, s) = sel.get_selected() + self.assertEqual(m, store) + self.assertEqual(store.get_path(s), firstpath) + + def test_text_buffer(self): + self.assertEquals(Gtk.TextBuffer, overrides.Gtk.TextBuffer) + buffer = Gtk.TextBuffer() + tag = buffer.create_tag ('title', font = 'Sans 18') + + self.assertEquals(tag.props.name, 'title') + self.assertEquals(tag.props.font, 'Sans 18') + + (start, end) = buffer.get_bounds() + + mark = buffer.create_mark(None, start) + self.assertFalse(mark.get_left_gravity()) + + buffer.set_text('Hello Jane Hello Bob') + (start, end) = buffer.get_bounds() + text = buffer.get_text(start, end, False) + self.assertEquals(text, 'Hello Jane Hello Bob') + + buffer.set_text('') + (start, end) = buffer.get_bounds() + text = buffer.get_text(start, end, False) + self.assertEquals(text, '') + + buffer.insert(end, 'HelloHello') + buffer.insert(end, ' Bob') + + cursor_iter = end.copy() + cursor_iter.backward_chars(9) + buffer.place_cursor(cursor_iter) + buffer.insert_at_cursor(' Jane ') + + (start, end) = buffer.get_bounds() + text = buffer.get_text(start, end, False) + self.assertEquals(text, 'Hello Jane Hello Bob') + + sel = buffer.get_selection_bounds() + self.assertEquals(sel, ()) + buffer.select_range(start, end) + sel = buffer.get_selection_bounds() + self.assertTrue(sel[0].equal(start)) + self.assertTrue(sel[1].equal(end)) + + buffer.set_text('') + buffer.insert_with_tags(buffer.get_start_iter(), 'HelloHello', tag) + (start, end) = buffer.get_bounds() + self.assertTrue(start.begins_tag(tag)) + self.assertTrue(start.has_tag(tag)) + + buffer.set_text('') + buffer.insert_with_tags_by_name(buffer.get_start_iter(), 'HelloHello', 'title') + (start, end) = buffer.get_bounds() + self.assertTrue(start.begins_tag(tag)) + self.assertTrue(start.has_tag(tag)) + + self.assertRaises(ValueError, buffer.insert_with_tags_by_name, + buffer.get_start_iter(), 'HelloHello', 'unknowntag') + + def test_text_iter(self): + self.assertEquals(Gtk.TextIter, overrides.Gtk.TextIter) + buffer = Gtk.TextBuffer() + buffer.set_text('Hello Jane Hello Bob') + tag = buffer.create_tag ('title', font = 'Sans 18') + (start, end) = buffer.get_bounds() + start.forward_chars(10) + buffer.apply_tag(tag, start, end) + self.assertTrue(start.begins_tag()) + self.assertTrue(end.ends_tag()) + self.assertTrue(start.toggles_tag()) + self.assertTrue(end.toggles_tag()) + start.backward_chars(1) + self.assertFalse(start.begins_tag()) + self.assertFalse(start.ends_tag()) + self.assertFalse(start.toggles_tag()) + + def test_buttons(self): + self.assertEquals(Gtk.Button, overrides.Gtk.Button) + + # test Gtk.Button + button = Gtk.Button() + button = Gtk.Button(stock=Gtk.STOCK_CLOSE) + self.assertEquals(Gtk.STOCK_CLOSE, button.get_label()) + self.assertTrue(button.get_use_stock()) + self.assertTrue(button.get_use_underline()) + + # test Gtk.LinkButton + self.assertRaises(TypeError, Gtk.LinkButton) + button = Gtk.LinkButton('http://www.gtk.org', 'Gtk') + self.assertEquals('http://www.gtk.org', button.get_uri()) + self.assertEquals('Gtk', button.get_label()) + + def test_inheritance(self): + for name in overrides.Gtk.__all__: + over = getattr(overrides.Gtk, name) + for element in dir(Gtk): + try: + klass = getattr(Gtk, element) + info = klass.__info__ + except (NotImplementedError, AttributeError): + continue + + # Get all parent classes and interfaces klass inherits from + if isinstance(info, gi.types.ObjectInfo): + classes = list(info.get_interfaces()) + parent = info.get_parent() + while parent.get_name() != "Object": + classes.append(parent) + parent = parent.get_parent() + classes = [kl for kl in classes if kl.get_namespace() == "Gtk"] + else: + continue + + for kl in classes: + if kl.get_name() == name: + self.assertTrue(issubclass(klass, over,), + "%r does not inherit from override %r" % (klass, over,)) + + def test_editable(self): + self.assertEquals(Gtk.Editable, overrides.Gtk.Editable) + + # need to use Gtk.Entry because Editable is an interface + entry=Gtk.Entry() + pos = entry.insert_text('HeWorld', 0) + self.assertEquals(pos, 7) + pos = entry.insert_text('llo ', 2) + self.assertEquals(pos, 6) + text = entry.get_chars(0, 11) + self.assertEquals('Hello World', text) + + def test_label(self): + label = Gtk.Label('Hello') + self.assertEquals(label.get_text(), 'Hello') + + def adjustment_check(self, adjustment, value=0.0, lower=0.0, upper=0.0, + step_increment=0.0, page_increment=0.0, page_size=0.0): + self.assertEquals(adjustment.get_value(), value) + self.assertEquals(adjustment.get_lower(), lower) + self.assertEquals(adjustment.get_upper(), upper) + self.assertEquals(adjustment.get_step_increment(), step_increment) + self.assertEquals(adjustment.get_page_increment(), page_increment) + self.assertEquals(adjustment.get_page_size(), page_size) + + def test_adjustment(self): + adjustment = Gtk.Adjustment(1, 0, 6, 4, 5, 3) + self.adjustment_check(adjustment, 1, 0, 6, 4, 5, 3) + + adjustment = Gtk.Adjustment(1, 0, 6, 4, 5) + self.adjustment_check(adjustment, 1, 0, 6, 4, 5) + + adjustment = Gtk.Adjustment(1, 0, 6, 4) + self.adjustment_check(adjustment, 1, 0, 6, 4) + + adjustment = Gtk.Adjustment(1, 0, 6) + self.adjustment_check(adjustment, 1, 0, 6) + + adjustment = Gtk.Adjustment() + self.adjustment_check(adjustment) + + adjustment = Gtk.Adjustment(value=1, lower=0, upper=6, + step_increment=4, page_increment=5, page_size=3) + self.adjustment_check(adjustment, 1, 0, 6, 4, 5, 3) + + def test_table(self): + table = Gtk.Table() + self.assertEquals(table.get_size(), (1,1)) + self.assertEquals(table.get_homogeneous(), False) + table = Gtk.Table(2, 3) + self.assertEquals(table.get_size(), (2,3)) + self.assertEquals(table.get_homogeneous(), False) + table = Gtk.Table(2, 3, True) + self.assertEquals(table.get_size(), (2,3)) + self.assertEquals(table.get_homogeneous(), True) + + # Test PyGTK interface + table = Gtk.Table(rows=3, columns=2) + self.assertEquals(table.get_size(), (3,2)) + # Test using the actual property names + table = Gtk.Table(n_rows=2, n_columns=3, homogeneous=True) + self.assertEquals(table.get_size(), (2,3)) + self.assertEquals(table.get_homogeneous(), True) + + label = Gtk.Label('Hello') + table.attach(label, 0, 1, 0, 1) + self.assertEquals(label, table.get_children()[0]) + + def test_scrolledwindow(self): + sw = Gtk.ScrolledWindow() + sb = sw.get_hscrollbar() + self.assertEquals(sw.get_hadjustment(), sb.get_adjustment()) + sb = sw.get_vscrollbar() + self.assertEquals(sw.get_vadjustment(), sb.get_adjustment()) + + def test_widget_drag_methods(self): + widget = Gtk.Button() + + # here we are not checking functionality, only that the methods exist + # and except the right number of arguments + + widget.drag_check_threshold(0, 0, 0, 0) + + # drag_dest_ methods + widget.drag_dest_set(Gtk.DestDefaults.DROP, None, Gdk.DragAction.COPY) + widget.drag_dest_add_image_targets() + widget.drag_dest_add_text_targets() + widget.drag_dest_add_uri_targets() + widget.drag_dest_get_track_motion() + widget.drag_dest_set_track_motion(True) + widget.drag_dest_get_target_list() + widget.drag_dest_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry()])) + widget.drag_dest_unset() + + widget.drag_highlight() + widget.drag_unhighlight() + + # drag_source_ methods + widget.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, None, Gdk.DragAction.MOVE) + widget.drag_source_add_image_targets() + widget.drag_source_add_text_targets() + widget.drag_source_add_uri_targets() + widget.drag_source_set_icon_name("") + widget.drag_source_set_icon_pixbuf(GdkPixbuf.Pixbuf()) + widget.drag_source_set_icon_stock("") + widget.drag_source_get_target_list() + widget.drag_source_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry()])) + widget.drag_source_unset() + + # these methods cannot be called because they require a valid drag on + # a real GdkWindow. So we only check that they exist and are callable. + self.assertTrue(hasattr(widget.drag_dest_set_proxy, '__call__')) + self.assertTrue(hasattr(widget.drag_get_data, '__call__')) + +class TestGio(unittest.TestCase): + def setUp(self): + os.environ['GSETTINGS_BACKEND'] = 'memory' + # support a separate build tree, so look in build dir first + os.environ['GSETTINGS_SCHEMA_DIR'] = os.environ.get('TESTS_BUILDDIR', + os.path.dirname(__file__)) + self.settings = Gio.Settings('org.gnome.test') + # we change the values in the tests, so set them to predictable start + # value + self.settings.reset('test-string') + self.settings.reset('test-array') + + def test_file_enumerator(self): + self.assertEquals(Gio.FileEnumerator, overrides.Gio.FileEnumerator) + f = Gio.file_new_for_path("./") + + iter_info = [] + for info in f.enumerate_children("standard::*", 0, None): + iter_info.append(info.get_name()) + + next_info = [] + enumerator = f.enumerate_children("standard::*", 0, None) + while True: + info = enumerator.next_file(None) + if info is None: + break + next_info.append(info.get_name()) + + self.assertEquals(iter_info, next_info) + + def test_gsettings_native(self): + self.assertTrue('test-array' in self.settings.list_keys()) + + # get various types + v = self.settings.get_value('test-boolean') + self.assertEqual(v.get_boolean(), True) + self.assertEqual(self.settings.get_boolean('test-boolean'), True) + + v = self.settings.get_value('test-string') + self.assertEqual(v.get_string(), 'Hello') + self.assertEqual(self.settings.get_string('test-string'), 'Hello') + + v = self.settings.get_value('test-array') + self.assertEqual(v.unpack(), [1, 2]) + + v = self.settings.get_value('test-tuple') + self.assertEqual(v.unpack(), (1, 2)) + + # set a value + self.settings.set_string('test-string', 'World') + self.assertEqual(self.settings.get_string('test-string'), 'World') + + self.settings.set_value('test-string', GLib.Variant('s', 'Goodbye')) + self.assertEqual(self.settings.get_string('test-string'), 'Goodbye') + + def test_gsettings_constructor(self): + # default constructor uses path from schema + self.assertEqual(self.settings.get_property('path'), '/tests/') + + # optional constructor arguments + with_path = Gio.Settings('org.gnome.nopathtest', path='/mypath/') + self.assertEqual(with_path.get_property('path'), '/mypath/') + self.assertEqual(with_path['np-int'], 42) + + def test_gsettings_override(self): + # dictionary interface + self.assertEqual(len(self.settings), 4) + self.assertTrue('test-array' in self.settings) + self.assertTrue('test-array' in self.settings.keys()) + self.failIf('nonexisting' in self.settings) + self.failIf(4 in self.settings) + self.assertEqual(bool(self.settings), True) + + # get various types + self.assertEqual(self.settings['test-boolean'], True) + self.assertEqual(self.settings['test-string'], 'Hello') + self.assertEqual(self.settings['test-array'], [1, 2]) + self.assertEqual(self.settings['test-tuple'], (1, 2)) + + self.assertRaises(KeyError, self.settings.__getitem__, 'unknown') + self.assertRaises(KeyError, self.settings.__getitem__, 2) + + # set a value + self.settings['test-string'] = 'Goodbye' + self.assertEqual(self.settings['test-string'], 'Goodbye') + self.settings['test-array'] = [3, 4, 5] + self.assertEqual(self.settings['test-array'], [3, 4, 5]) + + self.assertRaises(TypeError, self.settings.__setitem__, 'test-string', 1) + self.assertRaises(KeyError, self.settings.__setitem__, 'unknown', 'moo') + + def test_gsettings_empty(self): + empty = Gio.Settings('org.gnome.empty', path='/tests/') + self.assertEqual(len(empty), 0) + self.assertEqual(bool(empty), True) + self.assertEqual(empty.keys(), []) + + def test_closures(self): + # make sure this doesn't crash + def fake_cb(*args): + pass + + ag = Gtk.AccelGroup() + ag.connect(Gdk.KEY_l, Gdk.ModifierType.CONTROL_MASK, 0, fake_cb) diff --git a/tests/test_properties.py b/tests/test_properties.py index ccfcb34..54afd11 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -1,4 +1,6 @@ +# coding=utf-8 +import sys import struct import unittest @@ -12,6 +14,15 @@ from gobject.constants import \ G_MININT, G_MAXINT, G_MAXUINT, G_MINLONG, G_MAXLONG, \ G_MAXULONG +if sys.version_info < (3, 0): + TEST_UTF8 = "\xe2\x99\xa5" + UNICODE_UTF8 = unicode(TEST_UTF8, 'UTF-8') +else: + TEST_UTF8 = "♥" + UNICODE_UTF8 = TEST_UTF8 + +from compathelper import _long + class PropertyObject(GObject): normal = gobject.property(type=str) construct = gobject.property( @@ -68,6 +79,22 @@ class TestProperties(unittest.TestCase): self.assertEqual(obj.props.construct, "456") obj.props.construct = '789' self.assertEqual(obj.props.construct, "789") + + def testUTF8(self): + obj = new(PropertyObject, construct_only=UNICODE_UTF8) + self.assertEqual(obj.props.construct_only, TEST_UTF8) + obj.set_property('construct', UNICODE_UTF8) + self.assertEqual(obj.props.construct, TEST_UTF8) + obj.props.normal = UNICODE_UTF8 + self.assertEqual(obj.props.normal, TEST_UTF8) + + def testIntToStr(self): + obj = new(PropertyObject, construct_only=1) + self.assertEqual(obj.props.construct_only, '1') + obj.set_property('construct', '2') + self.assertEqual(obj.props.construct, '2') + obj.props.normal = 3 + self.assertEqual(obj.props.normal, '3') def testConstructOnly(self): obj = new(PropertyObject, construct_only="123") @@ -80,12 +107,12 @@ class TestProperties(unittest.TestCase): def testUint64(self): obj = new(PropertyObject) self.assertEqual(obj.props.uint64, 0) - obj.props.uint64 = 1L - self.assertEqual(obj.props.uint64, 1L) + obj.props.uint64 = _long(1) + self.assertEqual(obj.props.uint64, _long(1)) obj.props.uint64 = 1 - self.assertEqual(obj.props.uint64, 1L) + self.assertEqual(obj.props.uint64, _long(1)) - self.assertRaises((TypeError, OverflowError), obj.set_property, "uint64", -1L) + self.assertRaises((TypeError, OverflowError), obj.set_property, "uint64", _long(-1)) self.assertRaises((TypeError, OverflowError), obj.set_property, "uint64", -1) def testUInt64DefaultValue(self): @@ -93,10 +120,11 @@ class TestProperties(unittest.TestCase): class TimeControl(GObject): __gproperties__ = { 'time': (TYPE_UINT64, 'Time', 'Time', - 0L, (1<<64) - 1, 0L, + _long(0), (1<<64) - 1, _long(0), PARAM_READABLE) } - except OverflowError, ex: + except OverflowError: + (etype, ex) = sys.exc_info()[2:] self.fail(str(ex)) def testRange(self): @@ -182,7 +210,7 @@ class TestProperty(unittest.TestCase): str = gobject.property(type=str) int = gobject.property(type=int) float = gobject.property(type=float) - long = gobject.property(type=long) + long = gobject.property(type=_long) self.failUnless(hasattr(C.props, 'str')) self.failUnless(hasattr(C.props, 'int')) @@ -202,9 +230,9 @@ class TestProperty(unittest.TestCase): o.float = 3.14 self.assertEqual(o.float, 3.14) - self.assertEqual(o.long, 0L) - o.long = 100L - self.assertEqual(o.long, 100L) + self.assertEqual(o.long, _long(0)) + o.long = _long(100) + self.assertEqual(o.long, _long(100)) def testCustomGetter(self): class C(gobject.GObject): @@ -316,6 +344,15 @@ class TestProperty(unittest.TestCase): pobj1 = pobj2.obj self.assertEqual(hash(pobj1), obj1_hash) + def testObjectSubclassProperty(self): + class ObjectSubclass(GObject): + __gtype_name__ = 'ObjectSubclass' + + class PropertyObjectSubclass(GObject): + obj = gobject.property(type=ObjectSubclass) + + obj1 = PropertyObjectSubclass(obj=ObjectSubclass()) + def testPropertySubclass(self): # test for #470718 class A(GObject): @@ -372,5 +409,28 @@ class TestProperty(unittest.TestCase): gobject.property(type=gobject.TYPE_FLOAT, minimum=-1) gobject.property(type=gobject.TYPE_DOUBLE, minimum=-1) + # Bug 644039 + def testReferenceCount(self): + # We can check directly if an object gets finalized, so we will + # observe it indirectly through the refcount of a member object. + + # We create our dummy object and store its current refcount + o = object() + rc = sys.getrefcount(o) + + # We add our object as a member to our newly created object we + # want to observe. Its refcount is increased by one. + t = PropertyObject(normal="test") + t.o = o + self.assertEquals(sys.getrefcount(o), rc + 1) + + # Now we want to ensure we do not leak any references to our + # object with properties. If no ref is leaked, then when deleting + # the local reference to this object, its reference count shoud + # drop to zero, and our dummy object should loose one reference. + del t + self.assertEquals(sys.getrefcount(o), rc) + + if __name__ == '__main__': unittest.main() diff --git a/tests/test_signal.py b/tests/test_signal.py index 96e0731..d68cb5b 100644 --- a/tests/test_signal.py +++ b/tests/test_signal.py @@ -4,7 +4,9 @@ import gc import unittest import sys -from common import gobject, testhelper +import gobject +import testhelper +from compathelper import _long class C(gobject.GObject): __gsignals__ = { 'my_signal': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, @@ -302,7 +304,7 @@ class SigPropClass(gobject.GObject): if pspec.name == 'foo': self._foo = value else: - raise AttributeError, 'unknown property %s' % pspec.name + raise AttributeError('unknown property %s' % pspec.name) try: self.emit("my-signal", 1) except TypeError: @@ -326,7 +328,7 @@ class CM(gobject.GObject): test1=(f, None, ()), test2=(l, None, (str,)), test3=(l, int, (double,)), - test4=(f, None, (bool, long, float, double, int, uint, ulong)), + test4=(f, None, (bool, _long, float, double, int, uint, ulong)), test_float=(l, float, (float,)), test_double=(l, double, (double, )), test_string=(l, str, (str, )), @@ -349,7 +351,7 @@ class _TestCMarshaller: self.assertEqual(rv, 20) def testTest4(self): - self.obj.emit("test4", True, 10L, 3.14, 1.78, 20, 30L, 31L) + self.obj.emit("test4", True, _long(10), 3.14, 1.78, 20, _long(30), _long(31)) def testTestReturnFloat(self): rv = self.obj.emit("test-float", 1.234) @@ -371,9 +373,9 @@ if 'generic-c-marshaller' in gobject.features: class TestCMarshaller(_TestCMarshaller, unittest.TestCase): pass else: - print - print '** WARNING: LIBFFI disabled, not testing' - print + print() + print('** WARNING: LIBFFI disabled, not testing') + print() # Test for 374653 class TestPyGValue(unittest.TestCase): diff --git a/tests/test_source.py b/tests/test_source.py index abe2f69..339fb32 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -1,8 +1,8 @@ -#!/usr/bin/env python +# -*- Mode: Python -*- import unittest -from common import glib +import glib class Idle(glib.Idle): @@ -92,8 +92,8 @@ class TestSource(unittest.TestCase): class TestTimeout(unittest.TestCase): def test504337(self): - timeout_source = glib.Timeout(20) - idle_source = glib.Idle() + timeout_source = glib.Timeout(20) + idle_source = glib.Idle() if __name__ == '__main__': diff --git a/tests/test_subprocess.py b/tests/test_subprocess.py index 1522edb..c90d1d6 100644 --- a/tests/test_subprocess.py +++ b/tests/test_subprocess.py @@ -3,7 +3,7 @@ import sys import unittest -from common import glib +import glib class TestProcess(unittest.TestCase): @@ -22,6 +22,3 @@ class TestProcess(unittest.TestCase): glib.child_watch_add(pid, self._child_watch_cb, 12345) self.loop.run() self.assertEqual(self.data, 12345) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_thread.py b/tests/test_thread.py new file mode 100644 index 0000000..be746a4 --- /dev/null +++ b/tests/test_thread.py @@ -0,0 +1,29 @@ +# -*- Mode: Python -*- + +import unittest + +import glib +import testhelper + + +class TestThread(unittest.TestCase): + def setUp(self): + self.main = glib.MainLoop() + + def from_thread_cb(self, test, enum): + assert test == self.obj + assert int(enum) == 0 + assert type(enum) != int + + def idle_cb(self): + self.obj = testhelper.get_test_thread() + self.obj.connect('from-thread', self.from_thread_cb) + self.obj.emit('emit-signal') + + def testExtensionModule(self): + glib.idle_add(self.idle_cb) + glib.timeout_add(50, self.timeout_cb) + self.main.run() + + def timeout_cb(self): + self.main.quit() diff --git a/tests/test_unknown.py b/tests/test_unknown.py deleted file mode 100644 index d65bb89..0000000 --- a/tests/test_unknown.py +++ /dev/null @@ -1,15 +0,0 @@ - -import unittest - -from common import gobject, testhelper - -TestInterface = gobject.GType.from_name('TestInterface') - - -class TestUnknown(unittest.TestCase): - def testFoo(self): - obj = testhelper.get_unknown() - TestUnknownGType = gobject.GType.from_name('TestUnknown') - TestUnknown = gobject.new(TestUnknownGType).__class__ - assert isinstance(obj, testhelper.Interface) - assert isinstance(obj, TestUnknown) diff --git a/tests/test_uris.py b/tests/test_uris.py new file mode 100644 index 0000000..ee24215 --- /dev/null +++ b/tests/test_uris.py @@ -0,0 +1,15 @@ +import unittest + +import glib + +class TestUris(unittest.TestCase): + def testExtractUris(self): + uri_list_text = "# urn:isbn:0-201-08372-8\n" + \ + "http://www.huh.org/books/foo.html\n" + \ + "http://www.huh.org/books/foo.pdf\n" + \ + "ftp://ftp.foo.org/books/foo.txt\n" + uri_list = glib.uri_list_extract_uris(uri_list_text) + assert uri_list[0] == "http://www.huh.org/books/foo.html" + assert uri_list[1] == "http://www.huh.org/books/foo.pdf" + assert uri_list[2] == "ftp://ftp.foo.org/books/foo.txt" + diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c index 21679bc..4d1b44d 100644 --- a/tests/testhelpermodule.c +++ b/tests/testhelpermodule.c @@ -5,6 +5,8 @@ #include "test-unknown.h" #include "test-floating.h" +#include + static PyTypeObject *_PyGObject_Type; #define PyGObject_Type (*_PyGObject_Type) @@ -83,7 +85,7 @@ _wrap_test_g_object_new (PyObject * self) PyObject *rv; obj = g_object_new(g_type_from_name("PyGObject"), NULL); - rv = PyInt_FromLong(obj->ref_count); /* should be == 2 at this point */ + rv = PYGLIB_PyLong_FromLong(obj->ref_count); /* should be == 2 at this point */ g_object_unref(obj); return rv; } @@ -112,53 +114,7 @@ static const PyMethodDef _PyTestInterface_methods[] = { }; /* TestInterface */ -PyTypeObject PyTestInterface_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "test.Interface", /* tp_name */ - sizeof(PyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)0, /* tp_dealloc */ - (printfunc)0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ - (reprfunc)0, /* tp_repr */ - (PyNumberMethods*)0, /* tp_as_number */ - (PySequenceMethods*)0, /* tp_as_sequence */ - (PyMappingMethods*)0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)0, /* tp_str */ - (getattrofunc)0, /* tp_getattro */ - (setattrofunc)0, /* tp_setattro */ - (PyBufferProcs*)0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, - NULL, /* Documentation string */ - (traverseproc)0, /* tp_traverse */ - (inquiry)0, /* tp_clear */ - (richcmpfunc)0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)0, /* tp_iter */ - (iternextfunc)0, /* tp_iternext */ - (struct PyMethodDef*)_PyTestInterface_methods, /* tp_methods */ - (struct PyMemberDef*)0, /* tp_members */ - (struct PyGetSetDef*)0, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - (descrgetfunc)0, /* tp_descr_get */ - (descrsetfunc)0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)0, /* tp_init */ - (allocfunc)0, /* tp_alloc */ - (newfunc)0, /* tp_new */ - (freefunc)0, /* tp_free */ - (inquiry)0 /* tp_is_gc */ - - - -}; +PYGLIB_DEFINE_TYPE("test.Interface", PyTestInterface_Type, PyObject); static PyObject * _wrap_TestInterface__do_iface_method(PyObject *cls, PyObject *args, PyObject *kwargs) @@ -183,51 +139,7 @@ _wrap_TestInterface__do_iface_method(PyObject *cls, PyObject *args, PyObject *kw return Py_None; } -PyTypeObject PyTestUnknown_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "testhelper.Unknown", /* tp_name */ - sizeof(PyGObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)0, /* tp_dealloc */ - (printfunc)0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ - (reprfunc)0, /* tp_repr */ - (PyNumberMethods*)0, /* tp_as_number */ - (PySequenceMethods*)0, /* tp_as_sequence */ - (PyMappingMethods*)0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)0, /* tp_str */ - (getattrofunc)0, /* tp_getattro */ - (setattrofunc)0, /* tp_setattro */ - (PyBufferProcs*)0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - NULL, /* Documentation string */ - (traverseproc)0, /* tp_traverse */ - (inquiry)0, /* tp_clear */ - (richcmpfunc)0, /* tp_richcompare */ - offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */ - (getiterfunc)0, /* tp_iter */ - (iternextfunc)0, /* tp_iternext */ - (struct PyMethodDef*)0, /* tp_methods */ - (struct PyMemberDef*)0, /* tp_members */ - (struct PyGetSetDef*)0, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - (descrgetfunc)0, /* tp_descr_get */ - (descrsetfunc)0, /* tp_descr_set */ - offsetof(PyGObject, inst_dict), /* tp_dictoffset */ - (initproc)0, /* tp_init */ - (allocfunc)0, /* tp_alloc */ - (newfunc)0, /* tp_new */ - (freefunc)0, /* tp_free */ - (inquiry)0 /* tp_is_gc */ -}; - +PYGLIB_DEFINE_TYPE("testhelper.Unknown", PyTestUnknown_Type, PyGObject); static void _wrap_TestInterface__proxy_do_iface_method(TestInterface *self) @@ -313,99 +225,42 @@ static const GInterfaceInfo __TestInterface__iinfo = { }; /* TestFloatingWithSinkFunc */ +PYGLIB_DEFINE_TYPE("testhelper.FloatingWithSinkFunc", PyTestFloatingWithSinkFunc_Type, PyGObject); + +/* TestFloatingWithoutSinkFunc */ +PYGLIB_DEFINE_TYPE("testhelper.FloatingWithoutSinkFunc", PyTestFloatingWithoutSinkFunc_Type, PyGObject); -PyTypeObject PyTestFloatingWithSinkFunc_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "testhelper.FloatingWithSinkFunc", /* tp_name */ - sizeof(PyGObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)0, /* tp_dealloc */ - (printfunc)0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ - (reprfunc)0, /* tp_repr */ - (PyNumberMethods*)0, /* tp_as_number */ - (PySequenceMethods*)0, /* tp_as_sequence */ - (PyMappingMethods*)0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)0, /* tp_str */ - (getattrofunc)0, /* tp_getattro */ - (setattrofunc)0, /* tp_setattro */ - (PyBufferProcs*)0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - NULL, /* Documentation string */ - (traverseproc)0, /* tp_traverse */ - (inquiry)0, /* tp_clear */ - (richcmpfunc)0, /* tp_richcompare */ - offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */ - (getiterfunc)0, /* tp_iter */ - (iternextfunc)0, /* tp_iternext */ - (struct PyMethodDef*)0, /* tp_methods */ - (struct PyMemberDef*)0, /* tp_members */ - (struct PyGetSetDef*)0, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - (descrgetfunc)0, /* tp_descr_get */ - (descrsetfunc)0, /* tp_descr_set */ - offsetof(PyGObject, inst_dict), /* tp_dictoffset */ - (initproc)0, /* tp_init */ - (allocfunc)0, /* tp_alloc */ - (newfunc)0, /* tp_new */ - (freefunc)0, /* tp_free */ - (inquiry)0 /* tp_is_gc */ +/* TestOwnedByLibrary */ +PYGLIB_DEFINE_TYPE("testhelper.OwnedByLibrary", PyTestOwnedByLibrary_Type, PyGObject); + +static PyObject * +_wrap_test_owned_by_library_release (PyGObject *self) +{ + test_owned_by_library_release (TEST_OWNED_BY_LIBRARY (self->obj)); + return Py_None; +} + +static const PyMethodDef _PyTestOwnedByLibrary_methods[] = { + { "release", (PyCFunction)_wrap_test_owned_by_library_release, METH_NOARGS, NULL }, + { NULL, NULL, 0, NULL } }; -/* TestFloatingWithoutSinkFunc */ +/* TestFloatingAndSunk */ +PYGLIB_DEFINE_TYPE("testhelper.FloatingAndSunk", PyTestFloatingAndSunk_Type, PyGObject); + +static PyObject * +_wrap_test_floating_and_sunk_release (PyGObject *self) +{ + test_floating_and_sunk_release (TEST_FLOATING_AND_SUNK (self->obj)); + return Py_None; +} -PyTypeObject PyTestFloatingWithoutSinkFunc_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "testhelper.FloatingWithoutSinkFunc", /* tp_name */ - sizeof(PyGObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)0, /* tp_dealloc */ - (printfunc)0, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ - (reprfunc)0, /* tp_repr */ - (PyNumberMethods*)0, /* tp_as_number */ - (PySequenceMethods*)0, /* tp_as_sequence */ - (PyMappingMethods*)0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)0, /* tp_str */ - (getattrofunc)0, /* tp_getattro */ - (setattrofunc)0, /* tp_setattro */ - (PyBufferProcs*)0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - NULL, /* Documentation string */ - (traverseproc)0, /* tp_traverse */ - (inquiry)0, /* tp_clear */ - (richcmpfunc)0, /* tp_richcompare */ - offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */ - (getiterfunc)0, /* tp_iter */ - (iternextfunc)0, /* tp_iternext */ - (struct PyMethodDef*)0, /* tp_methods */ - (struct PyMemberDef*)0, /* tp_members */ - (struct PyGetSetDef*)0, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - (descrgetfunc)0, /* tp_descr_get */ - (descrsetfunc)0, /* tp_descr_set */ - offsetof(PyGObject, inst_dict), /* tp_dictoffset */ - (initproc)0, /* tp_init */ - (allocfunc)0, /* tp_alloc */ - (newfunc)0, /* tp_new */ - (freefunc)0, /* tp_free */ - (inquiry)0 /* tp_is_gc */ +static const PyMethodDef _PyTestFloatingAndSunk_methods[] = { + { "release", (PyCFunction)_wrap_test_floating_and_sunk_release, METH_NOARGS, NULL }, + { NULL, NULL, 0, NULL } }; + #include #include @@ -447,7 +302,7 @@ test4_callback (GObject *object, g_return_if_fail (b == TRUE); g_return_if_fail (l == 10L); g_return_if_fail (f <= 3.14001 && f >= 3.13999); - g_return_if_fail (d == 1.78); + g_return_if_fail (d <= 1.78001 && d >= 1.77999); g_return_if_fail (uint == 20); g_return_if_fail (ulong == 30L); } @@ -607,6 +462,52 @@ _wrap_test_gerror_exception(PyObject *self, PyObject *args) return Py_None; } +static PyObject * +_wrap_test_owned_by_library_get_instance_list (PyObject *self) +{ + PyObject *py_list, *py_obj; + GSList *list, *tmp; + + list = test_owned_by_library_get_instance_list (); + + if ((py_list = PyList_New (0)) == NULL) { + return NULL; + } + for (tmp = list; tmp != NULL; tmp = tmp->next) { + py_obj = pygobject_new (G_OBJECT (tmp->data)); + if (py_obj == NULL) { + Py_DECREF (py_list); + return NULL; + } + PyList_Append (py_list, py_obj); + Py_DECREF (py_obj); + } + return py_list; +} + +static PyObject * +_wrap_test_floating_and_sunk_get_instance_list (PyObject *self) +{ + PyObject *py_list, *py_obj; + GSList *list, *tmp; + + list = test_floating_and_sunk_get_instance_list (); + + if ((py_list = PyList_New (0)) == NULL) { + return NULL; + } + for (tmp = list; tmp != NULL; tmp = tmp->next) { + py_obj = pygobject_new (G_OBJECT (tmp->data)); + if (py_obj == NULL) { + Py_DECREF (py_list); + return NULL; + } + PyList_Append (py_list, py_obj); + Py_DECREF (py_obj); + } + return py_list; +} + static PyMethodDef testhelper_functions[] = { { "get_test_thread", (PyCFunction)_wrap_get_test_thread, METH_NOARGS }, { "get_unknown", (PyCFunction)_wrap_get_unknown, METH_NOARGS }, @@ -616,64 +517,97 @@ static PyMethodDef testhelper_functions[] = { { "test_value", (PyCFunction)_wrap_test_value, METH_VARARGS }, { "test_value_array", (PyCFunction)_wrap_test_value_array, METH_VARARGS }, { "test_gerror_exception", (PyCFunction)_wrap_test_gerror_exception, METH_VARARGS }, + { "owned_by_library_get_instance_list", (PyCFunction)_wrap_test_owned_by_library_get_instance_list, METH_NOARGS }, + { "floating_and_sunk_get_instance_list", (PyCFunction)_wrap_test_floating_and_sunk_get_instance_list, METH_NOARGS }, { NULL, NULL } }; -void -inittesthelper () +PYGLIB_MODULE_START(testhelper, "testhelper") { PyObject *m, *d; - PyObject *module; g_thread_init(NULL); - init_pygobject(); - m = Py_InitModule ("testhelper", testhelper_functions); + pygobject_init(-1, -1, -1); - d = PyModule_GetDict(m); + d = PyModule_GetDict(module); - if ((module = PyImport_ImportModule("gobject")) != NULL) { - PyObject *moddict = PyModule_GetDict(module); + if ((m = PyImport_ImportModule("gobject")) != NULL) { + PyObject *moddict = PyModule_GetDict(m); _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject"); if (_PyGObject_Type == NULL) { PyErr_SetString(PyExc_ImportError, "cannot import name GObject from gobject"); - return ; + return PYGLIB_MODULE_ERROR_RETURN; } } else { PyErr_SetString(PyExc_ImportError, "could not import gobject"); - return ; + return PYGLIB_MODULE_ERROR_RETURN; } /* TestInterface */ + PyTestInterface_Type.tp_methods = (struct PyMethodDef*)_PyTestInterface_methods; + PyTestInterface_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); pyg_register_interface(d, "Interface", TEST_TYPE_INTERFACE, &PyTestInterface_Type); pyg_register_interface_info(TEST_TYPE_INTERFACE, &__TestInterface__iinfo); /* TestUnknown */ + PyTestUnknown_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + PyTestUnknown_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); + PyTestUnknown_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); pygobject_register_class(d, "Unknown", TEST_TYPE_UNKNOWN, &PyTestUnknown_Type, Py_BuildValue("(O)", - &PyGObject_Type, - &PyTestInterface_Type)); + &PyGObject_Type, + &PyTestInterface_Type)); pyg_set_object_has_new_constructor(TEST_TYPE_UNKNOWN); //pyg_register_class_init(TEST_TYPE_UNKNOWN, __GtkUIManager_class_init); /* TestFloatingWithSinkFunc */ + PyTestFloatingWithSinkFunc_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + PyTestFloatingWithSinkFunc_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); + PyTestFloatingWithSinkFunc_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); pygobject_register_class(d, "FloatingWithSinkFunc", TEST_TYPE_FLOATING_WITH_SINK_FUNC, &PyTestFloatingWithSinkFunc_Type, Py_BuildValue("(O)", - &PyGObject_Type)); + &PyGObject_Type)); pyg_set_object_has_new_constructor(TEST_TYPE_FLOATING_WITH_SINK_FUNC); pygobject_register_sinkfunc(TEST_TYPE_FLOATING_WITH_SINK_FUNC, sink_test_floating_with_sink_func); /* TestFloatingWithoutSinkFunc */ + PyTestFloatingWithoutSinkFunc_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + PyTestFloatingWithoutSinkFunc_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); + PyTestFloatingWithoutSinkFunc_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); pygobject_register_class(d, "FloatingWithoutSinkFunc", TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC, &PyTestFloatingWithoutSinkFunc_Type, Py_BuildValue("(O)", - &PyGObject_Type)); + &PyGObject_Type)); pyg_set_object_has_new_constructor(TEST_TYPE_FLOATING_WITHOUT_SINK_FUNC); + + /* TestOwnedByLibrary */ + PyTestOwnedByLibrary_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + PyTestOwnedByLibrary_Type.tp_methods = (struct PyMethodDef*)_PyTestOwnedByLibrary_methods; + PyTestOwnedByLibrary_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); + PyTestOwnedByLibrary_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); + pygobject_register_class(d, "OwnedByLibrary", TEST_TYPE_OWNED_BY_LIBRARY, + &PyTestOwnedByLibrary_Type, + Py_BuildValue("(O)", + &PyGObject_Type)); + pyg_set_object_has_new_constructor(TEST_TYPE_OWNED_BY_LIBRARY); + + /* TestFloatingAndSunk */ + PyTestFloatingAndSunk_Type.tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE); + PyTestFloatingAndSunk_Type.tp_methods = (struct PyMethodDef*)_PyTestFloatingAndSunk_methods; + PyTestFloatingAndSunk_Type.tp_weaklistoffset = offsetof(PyGObject, weakreflist); + PyTestFloatingAndSunk_Type.tp_dictoffset = offsetof(PyGObject, inst_dict); + pygobject_register_class(d, "FloatingAndSunk", TEST_TYPE_FLOATING_AND_SUNK, + &PyTestFloatingAndSunk_Type, + Py_BuildValue("(O)", + &PyGObject_Type)); + pyg_set_object_has_new_constructor(TEST_TYPE_FLOATING_AND_SUNK); } +PYGLIB_MODULE_END -- 2.7.4