summaryrefslogtreecommitdiff
path: root/giscanner
Commit message (Collapse)AuthorAgeFilesLines
* Use CC rather than LD to fix build issue for gir. Closes #593599.Halton Huo2009-08-311-1/+1
|
* Bug 574351 - Add --pkg-export optionGOBJECT_INTROSPECTION_0_6_4Colin Walters2009-08-241-1/+8
| | | | | | | | | We need to differentiate between --pkg options we use to parse ourself, and --pkg-export which are needed for library consumers. When introspecting a library we won't necessarily have the pkg-config file built, so add a --pkg-export line so library authors can explicitly make the .gir -> pkg-config association.
* Bug 556628 – (skip) annotationDan Winship2009-08-243-1/+10
| | | | | Adds a (skip) option that can be added to the header of any doc comment to cause that symbol to be skipped in the .gir output
* Bug 590883 - Use 'cc' instead of 'gcc' for preprocessingColin Walters2009-08-241-1/+1
| | | | | Don't hardcode gcc, any cc which handles those options is good enough; in particular this is reported to fix Sun Studio.
* LD_LIBRARY_PATH exorcismColin Walters2009-08-241-14/+0
| | | | | | | | | | | | | | | Thanks to commit 6d510b8db, we now no longer need LD_LIBRARY_PATH to be set for invoking the compiler. Next, before we were taking the LD_LIBRARY_PATH variable and turning it into a compile path, presumably to attempt to handle the cases where we weren't getting the right -L flags. Also interacting with this was a while ago we weren't really doing uninstalled libtool libraries correctly, which is probably how hacks involving LD_LIBRARY_PATH crept into the scanner. Just require that we're passed the right -L flags, and we should be doing libtool libraries better now.
* Bug 592055 - Build/test fixesColin Walters2009-08-174-6/+4
| | | | The last few commits regressed 'check'; fix those up.
* Support passing --library=lib<foo>.laOwen W. Taylor2009-08-173-17/+72
| | | | | | | | | | | | | | | | In addition to the current --library=<foo>, support --library=lib<foo>.la. This makes it unambiguous that we are referencing an uninstalled library and allows accurate extraction of the shared library name for the uninstalled library. * tests/scanner/Makefile.am tests/offsets/Makefile.am: Use the new form of --library=. Also some LD_LIBRARY_PATH frobbing as needed. *-expected.gir *-expected.tgir: We now pick out the shared library accurately, so fix shared-library="" in our reference girs. (The comparison may need some pre-sanitization now to work on non-ELF) http://bugzilla.gnome.org/show_bug.cgi?id=591669
* Resolve library names to shared libraries ourselvesOwen W. Taylor2009-08-176-32/+107
| | | | | | | | | | | | | | | | | | | | | Using ctypes.util.find_library() to resolve library names to sonames causes problems with dealing with uninstalled libtool operation properly. We're unlikely to find any way of combining the two that will be robust against future changes in both facilities. Switch to a different approach - run 'ldd' on the compiled introspection binary and extract sonames from there This is less portable but should be quite robust where it works. utils.py dumper.py: Move libtool-command-line finding into utils.py girwriter.py: Remove library name resolution from here, expect libraries to be passed in preresolved. shlibs.py scannermain.py: New file including resolve_shlibs() to resolve library names using the introspection binary. tests/scanner/Makefile.am: Add .libs to LD_LIBRARY_PATH http://bugzilla.gnome.org/show_bug.cgi?id=591669
* Protect against source_filename being None when analyzing constantsColin Walters2009-08-161-1/+1
| | | | | It's allowed for source_filename to be None if we can't match it up with a file, so just skip the constant in that case.
* Use current working directory for temporary executablesColin Walters2009-08-161-1/+3
| | | | This avoids /tmp noexec madness.
* Back out the previous change. Now go back to hardcoding compiler to gcc.Brian Cameron2009-08-051-1/+1
| | | | | | Using CC fails when building gobject-introspection because CC is defined to be $(SHELL) scripts/shave cc '$(SHAVE_SAVED_CC)'. A more sophisticated fix will be needed later.
* Check the CC environment variable instead of assuming to use the gcc compiler.Brian Cameron2009-08-051-1/+1
|
* Use all libraries specified on the command lineColin Walters2009-08-051-6/+5
| | | | | | | | | | | | | | | | | | | Earlier we were only using the first library specified when compiling an introspection binary. This breaks builds on Solaris which doesn't have implicit linking and we need to be able to specify multiple libraries. The tension here is primarily related to OS X' distinction between modules and shared libraries; if we build the custom libraries in gir-repository as shared libraries, then we can't dlopen them. If we build them as modules, then the introspection binary compiler can't link to them. If we want to fix the OS X build, probably the way to go would be a special --use-first-library-only option that gets conditionalized on OS X + gir-repository. But even better is to finish killing gir-repository entirely.
* Merge commit 'origin'Johan Dahlin2009-07-061-6/+17
|\
| * Allow annotations on fieldsAndreas Rottmann2009-07-031-5/+15
| | | | | | | | Plain fields (i.e. non-callbacks) may have a 'type' annotation now.
| * Bug 579008 - Don't override element-type for arraysColin Walters2009-06-231-1/+2
| | | | | | | | | | | | | | Annotation parser patch from: Tim Horton <hortont424@gmail.com> If an explicit element type is specified, don't override it with guint8.
* | Omit warnings, my console is not a todo listJohan Dahlin2009-07-061-3/+3
|/
* Bug 584423 – Add short/ushort supportMark Lee2009-06-222-15/+19
| | | | | | | | | Add type tags for short and ushort, plus all of the requisite code needed to utilize them in libgirepository. Add support in the scanner's AST files. Add test functions to the everything library and the expected gir file. gtypelib.c constant validation fixed by Colin Walters <walters@verbum.org>
* Bug 581685: Parse parameterized types (using <>) in annotations.C. Scott Ananian2009-06-122-15/+50
| | | | | | | | | | You can now specify a nested parameterized type in annotations as (for example): @param: (type GLib.HashTable<utf8,GLib.HashTable<utf,utf>>) or @param: (element-type utf8 GLib.HashTable<utf,utf>) New test functions for the Everything typelib show how it works.
* Make g-ir-compiler find files installed by make installHolger Hans Peter Freyther2009-06-112-2/+5
| | | | | | | | | | | When ./configure --prefix $HOME/some/where is used gobject-introspection will happily install the files into $HOME/some/where/data/gir-1.0 but it will refuse to find them. Apply the same trick as in girepository/girepository.c:init_globals to find the gir files. Unifiy the name gir-1.0 in GIR_SUFFIX and use it throughout the project, introduce GIR_DIR which holds the path to the gir files and update girparser and transformer.py to look into this path.
* Don't fail if no --output option is specifiedColin Walters2009-06-111-1/+2
| | | | Printing to stdout is legitimate.
* Bug 584453 - Handle char ** correctly (and const variation)Colin Walters2009-06-092-6/+5
| | | | | | | | | This patch fixes our default handling of char **. We add Return node types as a case where we test for array handling. Remove the hardcoded assumption of array = "no transfer", just use the separate Parameter/Return cases. This change causes inout char ** to be transfer="full", but that seems more correct.
* Better handle classes with non-standard to_underscore names.C. Scott Ananian2009-05-201-2/+27
| | | | | | | | | | | | | | | | | | | Previously we tried to guess what the "underscore version" of a class name would be, but for classes like NMSetting8021x we'd guess "nm_setting8021x" instead of "nm_setting_802_1x". All such guesses are subject to error: instead let's try to use the prefix of the _get_type() method instead, and only guess if that doesn't work. We do this for both class names and when detecting methods. An additional type with a "non-standard" underscored version (TestWi8021x) added to the everything.[ch] test suite to test proper conversion. GdkWindow and GObject have unusual get_type methods; add special quirks to handle these (at least until the methods are renamed upstream). (Slightly modified for PEP8 compliance by Colin Walters) Signed-off-by: Colin Walters <walters@verbum.org>
* Allow the use of the "Rename To" annotation for literal method renaming.C. Scott Ananian2009-05-121-2/+15
| | | | | | As originally implemented, this annotation was only used for method overloading (argument signature polymorphism). Allow it to be used to clean up historically poorly-named methods as well.
* Avoid writing out empty array if we have no _get_type functionsColin Walters2009-04-031-12/+12
| | | | | Zero length arrays are a GNU C extension, so this way we don't fail on non-GCC.
* Bug 574284 - Add support for a 'closure' and 'destroy' annotationsAndreas Rottmann2009-03-232-1/+36
| | | | | | | | | | This allows to annotate cases where the heuristics don't work. TODO: According to Juerbi, there are cases where two callbacks refer to the same user_data, which is prohibited by the current implementation. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Bug 556475 – support Shadows: annotationAndreas Rottmann2009-03-192-1/+45
| | | | Add support for the 'Rename To:' annotation for functions and methods.
* Bug 564016 - Add c:prefix to .girColin Walters2009-03-173-7/+13
| | | | | | | This has a few use cases; the main one in mind right now is that when we place this in the .typelib as well, we can use it to optimize lookups based on GType names, by skipping entirely typelibs whose c:prefix is not a prefix of the target type lookup.
* Bug 575613 - Enum stripping with common prefix, also use "_" consistentlyColin Walters2009-03-173-15/+42
| | | | | | | | | | | | | Some enums have members which have a common prefix which doesn't match that of the enum name, but it also longer than the global namespace prefix. Instead, try stripping the common prefix first, and only if that fails fall back to the global strip. Also, for glib-registered enums we were using the nick, which typically has "-" as a separator. Replace that with "_" for consistency between unregistered enums and registered. utils.py:strip_common_prefix is now unused, delete.
* Bug 565147 - Add (type) annotation to override the C type definitionColin Walters2009-03-161-1/+6
| | | | | | We previously supported (type) on signals only, extend it to all cases. This is useful for a few cases where libraries use a superclass like GtkWidget* for C convenience, where the actual type is a subclass.
* Bug 574501 - Install giscanner Python module to private directoryColin Walters2009-03-162-1/+344
| | | | | | We don't want to pollute the global namespace with our private libraries. Also, this sidesteps all the craziness that is happening with OS vendors changing how Python installs modules.
* Bug 574139 – There is no way to identify 'user_data' arguments in the ↵Andreas Rottmann2009-03-091-2/+9
| | | | | | | | | | | | callback signature Add a heuristic to the scanner that flags arguments of callbacks that are named 'user_data' (exact match) and have a 'any (void*) type. These arguments are marked by setting the 'closure' field of ArgBlob to the index of themselves. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Bug 557383 - Virtual method supportColin Walters2009-03-054-56/+157
| | | | | | | | | | | | | | | | Broadly speaking, this change adds the concept of <vfunc> to the .gir. The typelib already had most of the infrastructure for virtual functions, though there is one API addition. The scanner assumes that any class callback slot that doesn't match a signal name is a virtual. In the .gir, we write out *both* the <method> wrapper and a <vfunc>. If we can determine an association between them (based on the names matching, or a new Virtual: annotation), then we notate that in the .gir. The typelib gains an association from the vfunc to the function, if it exists. This will be useful for bindings since they already know how to consume FunctionInfo.
* Bug 573332 - Allow annotation of enums as bitfieldsAndreas Rottmann2009-03-041-0/+7
| | | | | | Add support for a `(type bitfield)' annotation for enums. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Introduce documentation-block optionsAndreas Rottmann2009-03-041-7/+18
| | | | | | | | | | Allow a documentation block to have options, e.g.: /* * SomeType: (OPT-NAME VALUE) ... */ Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Bug 571548 - Generic attributesColin Walters2009-03-034-19/+59
| | | | | | | | We now support an extensible mechanism where arbitrary key-value pairs may be associated with almost all items, including objects, methods, and properties. These attributes appear in both the .gir and the .typelib.
* Revert "Bug 557383 - Virtual function support"Colin Walters2009-02-263-23/+10
| | | | | | | This reverts commit 4470a24e8cf3827efaddcfe240c3271cf1a0d6c0. Needs more work as it turns out, we need to figure out the binding story.
* Bug 573306 – Relax callback grouping detection rulesAndreas Rottmann2009-02-261-4/+4
| | | | | | | | Make the callback grouping heuristic more lax: consider all pointer parameters ending in 'data' to be the user_data parameter (instead of requiring an exact 'user_data' name). Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Merge branch 'bug557383-vfuncs'Colin Walters2009-02-263-10/+23
|\
| * Bug 557383 - Virtual function supportColin Walters2009-02-263-10/+23
| | | | | | | | | | | | | | In order to determine whether a method is virtual, by default we look at the class table to find a callback field. This should be fairly reliable, but we may also later need annotations to more finely control this in the case of a name clash with a signal.
* | Don't assume _pkgconfig_packages is set.Johan Dahlin2009-02-261-0/+4
|/ | | | | This fixes a cache issue where the pickle in the cache doesn't have self._pkgconfig_packages set in its instance
* Bug 572434 - Associate interfaces with their C structuresColin Walters2009-02-254-18/+36
| | | | | | | | Similar to GObject class structs, we pair up GInterfaces with their C structures. Also, move some GLib-specific things into glibast.py, and make the naming more generic.
* Bug 555964 - Parse floating-point #definesColin Walters2009-02-255-7/+42
| | | | | | Previously we just supported int and string, add double to this. Technically we should probably differentiate between float and double, but it's not likely to be very useful in practice to do so.
* Handle multiple arguments for $CCColin Walters2009-02-251-1/+2
| | | | This makes the dumper not fail for people who set $CC to e.g. "distcc gcc".
* Bug 572790 - Don't register #defines from .c files as constantsColin Walters2009-02-245-1/+30
| | | | | We keep track of the source filename for every symbol. This enables us to later filter symbols based on that name.
* Bug 561604 - Don't fail on va_list*Colin Walters2009-02-231-1/+1
| | | | | gvariant uses va_list *; we were previously skipping va_list, we should skip indirect variants as well.
* Do not include yyoutput in the generated lexerJohan Dahlin2009-02-211-0/+2
| | | | | Avoids a compilation warning (unused function) in the generated lexer output.
* Fix warnings pointed out by GCCJohan Dahlin2009-02-201-0/+2
|
* Be less verboseJohan Dahlin2009-02-201-7/+6
|
* Mention that we're generating a GIRJohan Dahlin2009-02-201-0/+1
|