From cff0d034c2e3efa66bd0947152dd4137bbc7fecf Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 18 Sep 2020 14:40:56 +0900 Subject: [PATCH 1/1] Imported Upstream version 1.61.2 --- NEWS | 9 + girepository/girparser.c | 4 + girepository/gistructinfo.c | 5 +- giscanner/ccompiler.py | 9 + giscanner/dumper.py | 6 +- giscanner/transformer.py | 3 +- meson.build | 3 +- tests/scanner/Regress-1.0-expected.gir | 306 ++++++++++++++++----------------- tests/scanner/Utility-1.0-expected.gir | 2 +- tests/scanner/WarnLib-1.0-expected.gir | 18 +- tests/scanner/annotation.c | 4 + tests/scanner/drawable.c | 4 + tests/scanner/foo.c | 3 + tests/scanner/test_ccompiler.py | 5 + tests/scanner/utility.c | 4 + tests/scanner/warnlib.c | 3 + tools/g-ir-tool-template.in | 3 +- tools/meson.build | 3 + 18 files changed, 218 insertions(+), 176 deletions(-) diff --git a/NEWS b/NEWS index 51d13fc..8e98230 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +1.61.2 - 2019-08-17 +------------------- + +* dumper: Use the distutils linker :mr:`170` (:user:`David Demelier `) +* structinfo: Fix offset in find_method() :mr:`171` (:user:`Florian Müllner `) +* tests: Don't include "config.h" in installed files :mr:`172` (:user:`Philip Chimento `) +* meson: Make meson.override_find_program working on more complex use cases :mr:`173` (:user:`Thibault Saunier `) + + 1.61.1 - 2019-08-07 ------------------- diff --git a/girepository/girparser.c b/girepository/girparser.c index 53450ba..fb47e75 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -309,6 +309,10 @@ locate_gir (GIrParser *parser, if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) return path; g_free (path); + path = g_build_filename (UNINSTALLED_GIR_DIR, girname, NULL); + if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) + return path; + g_free (path); return NULL; } diff --git a/girepository/gistructinfo.c b/girepository/gistructinfo.c index 7db417f..a1edfa9 100644 --- a/girepository/gistructinfo.c +++ b/girepository/gistructinfo.c @@ -215,12 +215,9 @@ g_struct_info_find_method (GIStructInfo *info, { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; - Header *header = (Header *)rinfo->typelib->data; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; - offset = rinfo->offset + header->struct_blob_size - + blob->n_fields * header->field_blob_size; - + offset = g_struct_get_field_offset (info, blob->n_fields); return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py index 32c9296..35549da 100644 --- a/giscanner/ccompiler.py +++ b/giscanner/ccompiler.py @@ -413,6 +413,15 @@ class CCompiler(object): ", ".join(not_resolved)) return shlibs + @property + def linker_cmd(self): + if self.check_is_msvc(): + if not self.compiler.initialized: + self.compiler.initialize() + return [self.compiler.linker] + else: + return self.compiler.linker_exe + def check_is_msvc(self): return isinstance(self.compiler, MSVCCompiler) diff --git a/giscanner/dumper.py b/giscanner/dumper.py index 2b851a5..efa1878 100644 --- a/giscanner/dumper.py +++ b/giscanner/dumper.py @@ -91,10 +91,6 @@ class DumpCompiler(object): self._uninst_srcdir = os.environ.get('UNINSTALLED_INTROSPECTION_SRCDIR') self._packages = ['gio-2.0', 'gmodule-2.0'] self._packages.extend(options.packages) - if self._compiler.check_is_msvc(): - self._linker_cmd = ['link.exe'] - else: - self._linker_cmd = shlex.split(os.environ.get('CC', 'cc')) # Public API @@ -202,7 +198,7 @@ class DumpCompiler(object): if self._options.quiet: args.append('--silent') - args.extend(self._linker_cmd) + args.extend(self._compiler.linker_cmd) # We can use -o for the Microsoft compiler/linker, # but it is considered deprecated usage diff --git a/giscanner/transformer.py b/giscanner/transformer.py index f63894c..bcabded 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -183,7 +183,6 @@ None.""" def _get_gi_data_dirs(self): data_dirs = utils.get_system_data_dirs() data_dirs.append(DATADIR) - data_dirs.append(GIRDIR) if os.name != 'nt': # For backwards compatibility, was always unconditionally added to the list. data_dirs.append('/usr/share') @@ -191,9 +190,9 @@ None.""" def _find_include(self, include): searchdirs = self._includepaths[:] + searchdirs.extend(GIRDIR) for path in self._get_gi_data_dirs(): searchdirs.append(os.path.join(path, 'gir-1.0')) - searchdirs.append(os.path.join(DATADIR, 'gir-1.0')) girname = '%s-%s.gir' % (include.name, include.version) for d in searchdirs: diff --git a/meson.build b/meson.build index 6820057..bd6eaa4 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gobject-introspection', 'c', - version: '1.61.1', + version: '1.61.2', meson_version: '>= 0.49.2', default_options: [ 'warning_level=1', @@ -90,6 +90,7 @@ endif girdir = join_paths(gir_dir_prefix, 'gir-1.0') config.set_quoted('GIR_DIR', girdir) config.set_quoted('GOBJECT_INTROSPECTION_LIBDIR', join_paths(get_option('prefix'), get_option('libdir'))) +config.set_quoted('UNINSTALLED_GIR_DIR', join_paths(meson.current_build_dir(), 'gir')) foreach type : ['char', 'short', 'int', 'long'] size = cc.sizeof(type) diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index 949df37..a589b82 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -251,14 +251,14 @@ and/or use gtk-doc annotations. --> %NULL always + line="572">%NULL always a #GObject + line="569">a #GObject c:identifier="regress_annotation_object_calleeowns"> This is a test for out arguments; GObject defaults to transfer + line="296">This is a test for out arguments; GObject defaults to transfer an int + line="303">an int a #GObject + line="298">a #GObject transfer-ownership="full"> a #GObject + line="299">a #GObject @@ -303,19 +303,19 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_calleesowns"> This is a test for out arguments, one transferred, other not + line="312">This is a test for out arguments, one transferred, other not an int + line="320">an int a #GObject + line="314">a #GObject transfer-ownership="full"> a #GObject + line="315">a #GObject transfer-ownership="none"> a #GObject + line="316">a #GObject @@ -342,7 +342,7 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_compute_sum"> Test taking a zero-terminated array + line="422">Test taking a zero-terminated array @@ -351,13 +351,13 @@ and/or use gtk-doc annotations. --> a #GObject + line="424">a #GObject Sequence of numbers + line="425">Sequence of numbers @@ -368,7 +368,7 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_compute_sum_n"> Test taking an array with length parameter + line="436">Test taking an array with length parameter @@ -377,13 +377,13 @@ and/or use gtk-doc annotations. --> a #GObject + line="438">a #GObject Sequence of + line="439">Sequence of numbers that are zero-terminated @@ -392,7 +392,7 @@ and/or use gtk-doc annotations. --> Length of number array + line="441">Length of number array @@ -401,7 +401,7 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_compute_sum_nz"> Test taking a zero-terminated array with length parameter + line="453">Test taking a zero-terminated array with length parameter @@ -410,13 +410,13 @@ and/or use gtk-doc annotations. --> a #RegressAnnotationObject + line="455">a #RegressAnnotationObject Sequence of numbers that + line="456">Sequence of numbers that are zero-terminated @@ -425,7 +425,7 @@ are zero-terminated Length of number array + line="458">Length of number array @@ -434,19 +434,19 @@ are zero-terminated c:identifier="regress_annotation_object_create_object"> Test returning a caller-owned object + line="396">Test returning a caller-owned object The object + line="402">The object a #GObject + line="398">a #GObject @@ -460,14 +460,14 @@ are zero-terminated %NULL always + line="597">%NULL always a #GObject + line="595">a #GObject @@ -488,7 +488,7 @@ are zero-terminated Test taking a call-scoped callback + line="502">Test taking a call-scoped callback @@ -497,7 +497,7 @@ are zero-terminated a #RegressAnnotationObject + line="504">a #RegressAnnotationObject closure="1"> Callback to invoke + line="505">Callback to invoke @@ -516,7 +516,7 @@ are zero-terminated allow-none="1"> Callback user data + line="506">Callback user data @@ -525,13 +525,13 @@ are zero-terminated c:identifier="regress_annotation_object_get_hash"> This is a test for returning a hash table mapping strings to + line="349">This is a test for returning a hash table mapping strings to objects. hash table + line="356">hash table @@ -541,7 +541,7 @@ objects. a #GObject + line="351">a #GObject @@ -550,14 +550,14 @@ objects. c:identifier="regress_annotation_object_get_objects"> This is a test for returning a list of objects. + line="378">This is a test for returning a list of objects. The list itself should be freed, but not the internal objects, intentionally similar example to gtk_container_get_children list of objects + line="386">list of objects @@ -566,7 +566,7 @@ intentionally similar example to gtk_container_get_children a #GObject + line="380">a #GObject @@ -575,13 +575,13 @@ intentionally similar example to gtk_container_get_children c:identifier="regress_annotation_object_get_strings"> This is a test for returning a list of strings, where + line="331">This is a test for returning a list of strings, where each string needs to be freed. list of strings + line="338">list of strings @@ -590,7 +590,7 @@ each string needs to be freed. a #GObject + line="333">a #GObject @@ -605,7 +605,7 @@ each string needs to be freed. A #RegressAnnotationObject + line="641">A #RegressAnnotationObject @@ -613,25 +613,25 @@ each string needs to be freed. This is a test for in arguments + line="232">This is a test for in arguments an int + line="239">an int a #GObject + line="234">a #GObject This is an argument test + line="235">This is an argument test @@ -639,19 +639,19 @@ each string needs to be freed. This is a test for out arguments + line="248">This is a test for out arguments an int + line="255">an int a #GObject + line="250">a #GObject transfer-ownership="full"> This is an argument test + line="251">This is an argument test @@ -668,19 +668,19 @@ each string needs to be freed. This is a second test for out arguments + line="263">This is a second test for out arguments an int + line="270">an int a #GObject + line="265">a #GObject transfer-ownership="full"> This is an argument test + line="266">This is an argument test @@ -697,19 +697,19 @@ each string needs to be freed. This is a 3th test for out arguments + line="279">This is a 3th test for out arguments an int + line="286">an int a #GObject + line="281">a #GObject allow-none="1"> This is an argument test + line="282">This is an argument test @@ -730,14 +730,14 @@ each string needs to be freed. an int + line="208">an int a #GObject + line="206">a #GObject @@ -747,14 +747,14 @@ each string needs to be freed. An object, not referenced + line="584">An object, not referenced a #GObject + line="582">a #GObject @@ -762,19 +762,19 @@ each string needs to be freed. This is a test for out arguments + line="216">This is a test for out arguments an int + line="223">an int a #GObject + line="218">a #GObject transfer-ownership="full"> This is an argument test + line="219">This is an argument test @@ -792,7 +792,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_parse_args"> Test taking a zero-terminated array with length parameter + line="470">Test taking a zero-terminated array with length parameter @@ -801,7 +801,7 @@ each string needs to be freed. a #RegressAnnotationObject + line="472">a #RegressAnnotationObject transfer-ownership="full"> Length of the argument vector + line="473">Length of the argument vector transfer-ownership="full"> Argument vector + line="474">Argument vector @@ -830,7 +830,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_set_data"> Test taking a guchar * with a length. + line="518">Test taking a guchar * with a length. @@ -839,13 +839,13 @@ each string needs to be freed. a #RegressAnnotationObject + line="520">a #RegressAnnotationObject The data + line="521">The data @@ -853,7 +853,7 @@ each string needs to be freed. Length of the data + line="522">Length of the data @@ -862,7 +862,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_set_data2"> Test taking a gchar * with a length. + line="534">Test taking a gchar * with a length. @@ -871,13 +871,13 @@ each string needs to be freed. a #RegressAnnotationObject + line="536">a #RegressAnnotationObject The data + line="537">The data @@ -885,7 +885,7 @@ each string needs to be freed. Length of the data + line="538">Length of the data @@ -894,7 +894,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_set_data3"> Test taking a gchar * with a length, overriding the array element + line="550">Test taking a gchar * with a length, overriding the array element type. @@ -904,13 +904,13 @@ type. a #RegressAnnotationObject + line="552">a #RegressAnnotationObject The data + line="553">The data @@ -918,7 +918,7 @@ type. Length of the data + line="554">Length of the data @@ -927,19 +927,19 @@ type. c:identifier="regress_annotation_object_string_out"> Test returning a string as an out parameter + line="486">Test returning a string as an out parameter some boolean + line="493">some boolean a #RegressAnnotationObject + line="488">a #RegressAnnotationObject transfer-ownership="full"> string return value + line="489">string return value @@ -963,7 +963,7 @@ type. a #GObject + line="412">a #GObject @@ -977,7 +977,7 @@ type. introspectable="0"> This is here just for the sake of being overriden by its + line="606">This is here just for the sake of being overriden by its regress_annotation_object_watch_full(). @@ -987,13 +987,13 @@ regress_annotation_object_watch_full(). A #RegressAnnotationObject + line="608">A #RegressAnnotationObject The callback + line="609">The callback @@ -1003,7 +1003,7 @@ regress_annotation_object_watch_full(). allow-none="1"> The callback data + line="610">The callback data @@ -1013,7 +1013,7 @@ regress_annotation_object_watch_full(). shadows="watch"> Test overriding via the "Rename To" annotation. + line="622">Test overriding via the "Rename To" annotation. @@ -1022,7 +1022,7 @@ regress_annotation_object_watch_full(). A #RegressAnnotationObject + line="624">A #RegressAnnotationObject destroy="2"> The callback + line="625">The callback @@ -1042,13 +1042,13 @@ regress_annotation_object_watch_full(). allow-none="1"> The callback data + line="626">The callback data Destroy notification + line="627">Destroy notification @@ -1069,7 +1069,7 @@ regress_annotation_object_watch_full(). allow-none="1"> Opaque pointer handle + line="370">Opaque pointer handle @@ -1089,7 +1089,7 @@ regress_annotation_object_watch_full(). transfer-ownership="none"> This is a property which is a string + line="156">This is a property which is a string Use better-string-property instead @@ -1100,7 +1100,7 @@ regress_annotation_object_watch_full(). transfer-ownership="none"> This is a property annotation intentionally indented with a mix + line="181">This is a property annotation intentionally indented with a mix of tabs and strings to test the tab handling capabilities of the scanner. @@ -1110,12 +1110,12 @@ of tabs and strings to test the tab handling capabilities of the scanner. This signal tests a signal with attributes. + line="134">This signal tests a signal with attributes. the return value + line="142">the return value @@ -1123,14 +1123,14 @@ of tabs and strings to test the tab handling capabilities of the scanner. a value + line="137">a value another value + line="138">another value @@ -1138,7 +1138,7 @@ of tabs and strings to test the tab handling capabilities of the scanner. This signal tests an empty document argument (@arg1) + line="118">This signal tests an empty document argument (@arg1) @@ -1154,7 +1154,7 @@ of tabs and strings to test the tab handling capabilities of the scanner. This is a signal which takes a list of strings, but it's not + line="101">This is a signal which takes a list of strings, but it's not known by GObject as it's only marked as G_TYPE_POINTER @@ -1163,7 +1163,7 @@ known by GObject as it's only marked as G_TYPE_POINTER a list of strings + line="104">a list of strings @@ -1177,7 +1177,7 @@ known by GObject as it's only marked as G_TYPE_POINTER deprecated-version="1.2"> This is a signal which has a broken signal handler, + line="81">This is a signal which has a broken signal handler, it says it's pointer but it's actually a string. Use other-signal instead @@ -1187,7 +1187,7 @@ it says it's pointer but it's actually a string. a string + line="84">a string @@ -1865,13 +1865,13 @@ it says it's pointer but it's actually a string. c:identifier="regress_foo_object_get_default"> This function is intended to match clutter_stage_get_default which + line="330">This function is intended to match clutter_stage_get_default which uses a C sugar return type. The global #RegressFooSubobject + line="336">The global #RegressFooSubobject @@ -1885,22 +1885,22 @@ uses a C sugar return type. Read some stuff. + line="291">Read some stuff. - obj + obj - offset + offset - length + length @@ -1923,7 +1923,7 @@ uses a C sugar return type. c:identifier="regress_foo_object_append_new_stack_layer"> This shouldn't be scanned as a constructor. + line="779">This shouldn't be scanned as a constructor. @@ -1954,14 +1954,14 @@ uses a C sugar return type. %NULL always + line="240">%NULL always a #RegressFooObject + line="238">a #RegressFooObject @@ -2012,7 +2012,7 @@ uses a C sugar return type. introspectable="0"> Not sure why this test is here... + line="266">Not sure why this test is here... @@ -2029,22 +2029,22 @@ uses a C sugar return type. Read some stuff. + line="291">Read some stuff. - obj + obj - offset + offset - length + length @@ -2054,14 +2054,14 @@ uses a C sugar return type. introspectable="0"> This is only useful from C. + line="305">This is only useful from C. - obj + obj @@ -2187,19 +2187,19 @@ uses a C sugar return type. - obj + obj offset + line="294">offset length + line="295">length @@ -2252,13 +2252,13 @@ uses a C sugar return type. transfer-ownership="full"> add to this rect + line="559">add to this rect source rectangle + line="560">source rectangle @@ -2268,7 +2268,7 @@ uses a C sugar return type. introspectable="0"> This is a C convenience constructor; we have to (skip) + line="540">This is a C convenience constructor; we have to (skip) it because it's not a boxed type. @@ -5654,14 +5654,14 @@ the introspection client langage. The return value. + line="768">The return value. A #RegressAnnotationObject. + line="765">A #RegressAnnotationObject. @@ -5669,7 +5669,7 @@ the introspection client langage. Some data. + line="766">Some data. @@ -5678,7 +5678,7 @@ the introspection client langage. c:identifier="regress_annotation_custom_destroy"> Test messing up the heuristic of closure/destroy-notification + line="719">Test messing up the heuristic of closure/destroy-notification detection, and fixing it via annotations. @@ -5692,7 +5692,7 @@ detection, and fixing it via annotations. destroy="1"> Destroy notification + line="721">Destroy notification Source file + line="736">Source file @@ -5732,7 +5732,7 @@ detection, and fixing it via annotations. transfer-ownership="full"> The number of args. + line="650">The number of args. transfer-ownership="full"> The arguments. + line="651">The arguments. @@ -5758,7 +5758,7 @@ detection, and fixing it via annotations. some text (e.g. example) or else + line="779">some text (e.g. example) or else @@ -5773,7 +5773,7 @@ detection, and fixing it via annotations. the array + line="756">the array @@ -5786,7 +5786,7 @@ detection, and fixing it via annotations. The return value + line="663">The return value @@ -5798,7 +5798,7 @@ detection, and fixing it via annotations. transfer-ownership="full"> Number of return values + line="661">Number of return values @@ -5809,7 +5809,7 @@ detection, and fixing it via annotations. An annotated filename + line="818">An annotated filename @@ -5823,7 +5823,7 @@ detection, and fixing it via annotations. Source file + line="746">Source file @@ -5832,7 +5832,7 @@ detection, and fixing it via annotations. c:identifier="regress_annotation_space_after_comment_bug631690"> Explicitly test having a space after the ** here. + line="805">Explicitly test having a space after the ** here. @@ -5861,7 +5861,7 @@ detection, and fixing it via annotations. The return value + line="674">The return value @@ -5888,12 +5888,12 @@ detection, and fixing it via annotations. c:identifier="regress_annotation_test_parsing_bug630862"> See https://bugzilla.gnome.org/show_bug.cgi?id=630862 + line="791">See https://bugzilla.gnome.org/show_bug.cgi?id=630862 An object, note the colon:in here + line="796">An object, note the colon:in here @@ -5903,14 +5903,14 @@ detection, and fixing it via annotations. A floating object + line="830">A floating object an object + line="828">an object @@ -6060,7 +6060,7 @@ detection, and fixing it via annotations. c:identifier="regress_foo_not_a_constructor_new"> This should be scanned as a top-level function, and shouldn't cause + line="792">This should be scanned as a top-level function, and shouldn't cause a "Can't find matching type for constructor" warning. @@ -6073,7 +6073,7 @@ a "Can't find matching type for constructor" warning. introspectable="0"> This is a C convenience constructor; we have to (skip) + line="540">This is a C convenience constructor; we have to (skip) it because it's not a boxed type. @@ -6099,7 +6099,7 @@ it because it's not a boxed type. introspectable="0"> Does something that's only interesting from C and should not be + line="719">Does something that's only interesting from C and should not be exposed to language bindings. @@ -6109,7 +6109,7 @@ exposed to language bindings. a #RegressFooSkippable + line="721">a #RegressFooSkippable diff --git a/tests/scanner/Utility-1.0-expected.gir b/tests/scanner/Utility-1.0-expected.gir index 5972d32..81ac436 100644 --- a/tests/scanner/Utility-1.0-expected.gir +++ b/tests/scanner/Utility-1.0-expected.gir @@ -21,7 +21,7 @@ and/or use gtk-doc annotations. --> - the data + the data diff --git a/tests/scanner/WarnLib-1.0-expected.gir b/tests/scanner/WarnLib-1.0-expected.gir index b7f4799..62290cc 100644 --- a/tests/scanner/WarnLib-1.0-expected.gir +++ b/tests/scanner/WarnLib-1.0-expected.gir @@ -50,7 +50,7 @@ and/or use gtk-doc annotations. --> Does boo. + line="38">Does boo. @@ -59,13 +59,13 @@ and/or use gtk-doc annotations. --> a WarnLibWhatever + line="40">a WarnLibWhatever x parameter + line="41">x parameter allow-none="1"> y parameter + line="42">y parameter @@ -102,7 +102,7 @@ and/or use gtk-doc annotations. --> Does boo. + line="38">Does boo. @@ -111,7 +111,7 @@ and/or use gtk-doc annotations. --> a WarnLibWhatever + line="40">a WarnLibWhatever @@ -185,13 +185,13 @@ and/or use gtk-doc annotations. --> a WarnLibWhatever + line="40">a WarnLibWhatever x parameter + line="41">x parameter allow-none="1"> y parameter + line="42">y parameter diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c index fb8b48f..253dbd6 100644 --- a/tests/scanner/annotation.c +++ b/tests/scanner/annotation.c @@ -1,5 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "annotation.h" diff --git a/tests/scanner/drawable.c b/tests/scanner/drawable.c index 9c58bfe..b4a3ddc 100644 --- a/tests/scanner/drawable.c +++ b/tests/scanner/drawable.c @@ -1,5 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "drawable.h" diff --git a/tests/scanner/foo.c b/tests/scanner/foo.c index 2fc8ed9..19bf848 100644 --- a/tests/scanner/foo.c +++ b/tests/scanner/foo.c @@ -1,4 +1,7 @@ +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "foo.h" diff --git a/tests/scanner/test_ccompiler.py b/tests/scanner/test_ccompiler.py index 5890aa9..6c0674a 100644 --- a/tests/scanner/test_ccompiler.py +++ b/tests/scanner/test_ccompiler.py @@ -62,6 +62,11 @@ class UnixCCompilerTest(unittest.TestCase): except ValueError: self.fail('%r is not a subsequence of %r' % (list1, list2)) + def test_link_cmd(self): + with Environ(dict(CC="foobar")): + compiler = CCompiler() + self.assertEqual(compiler.linker_cmd[0], "foobar") + def test_link_args_override(self): with Environ(dict(CC="foobar")): compiler = CCompiler() diff --git a/tests/scanner/utility.c b/tests/scanner/utility.c index c5e48a4..3af374c 100644 --- a/tests/scanner/utility.c +++ b/tests/scanner/utility.c @@ -1,5 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "utility.h" diff --git a/tests/scanner/warnlib.c b/tests/scanner/warnlib.c index 4b92bf6..430e88d 100644 --- a/tests/scanner/warnlib.c +++ b/tests/scanner/warnlib.c @@ -1,6 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "warnlib.h" diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in index 3b33f75..8462f88 100755 --- a/tools/g-ir-tool-template.in +++ b/tools/g-ir-tool-template.in @@ -61,7 +61,7 @@ if '@gir_dir_prefix@' and not '@gir_dir_prefix@'.startswith('@'): # for autotools elif '@GIR_DIR@' and not '@GIR_DIR@'.startswith('@'): girdir = os.path.dirname(os.path.abspath('@GIR_DIR@')) -builtins.__dict__['GIRDIR'] = girdir +builtins.__dict__['GIRDIR'] = [girdir] # Again, relative paths first so that the installation prefix is relocatable pylibdir = os.path.abspath(os.path.join(filedir, '..', 'lib', 'gobject-introspection')) @@ -85,6 +85,7 @@ if not os.path.isfile(os.path.join(pylibdir, 'giscanner', '_giscanner' + py_mod_ # We're running uninstalled inside meson builddir = os.path.abspath(os.path.join(filedir, '..')) pylibdir = builddir + builtins.__dict__['GIRDIR'].append(os.path.join(filedir, os.pardir, 'gir')) gdump_path = os.path.join(builddir, 'girepository', 'gdump.c') if os.path.isfile(gdump_path): builtins.__dict__['GDUMP_PATH'] = gdump_path diff --git a/tools/meson.build b/tools/meson.build index 6cc3186..1fedaa5 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -56,6 +56,7 @@ gircompiler = executable('g-ir-compiler', 'compiler.c', install: true, c_args: custom_c_args, ) +meson.override_find_program('g-ir-compiler', gircompiler) girgenerate = executable('g-ir-generate', 'generate.c', dependencies: [ @@ -65,9 +66,11 @@ girgenerate = executable('g-ir-generate', 'generate.c', install: true, c_args: custom_c_args, ) +meson.override_find_program('g-ir-generate', girgenerate) girinspect = executable('g-ir-inspect', 'g-ir-inspect.c', dependencies: girepo_dep, install: true, c_args: custom_c_args, ) +meson.override_find_program('g-ir-inspect', girinspect) \ No newline at end of file -- 2.7.4