summaryrefslogtreecommitdiff
path: root/tools/g-ir-tool-template.in
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2018-10-08 14:10:17 +0800
committerKai Kang <kai.kang@windriver.com>2018-10-08 23:21:55 -0700
commit3fe995a0d38158e0ffde9772ed52fa87608ac084 (patch)
tree3d9b6f3cd2fe0aca639f2429012a5b5dbc7bfdef /tools/g-ir-tool-template.in
parent3938b86f5289c2b28a5ec42965b8da4b509445c4 (diff)
downloadgobject-introspection-3fe995a0d38158e0ffde9772ed52fa87608ac084.tar.gz
g-ir-tools: respect gir_dir_prefix
Configure option gir_dir_prefix is used to configure install dir for .gir files, so add its value to include file search paths. Fix for flake8 and meson-test at same time. Signed-off-by: Kai Kang <kai.kang@windriver.com>
Diffstat (limited to 'tools/g-ir-tool-template.in')
-rwxr-xr-xtools/g-ir-tool-template.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in
index ed33d16b..b9cf0911 100755
--- a/tools/g-ir-tool-template.in
+++ b/tools/g-ir-tool-template.in
@@ -60,6 +60,16 @@ if not os.path.isdir(os.path.join(datadir, 'gir-1.0')):
builtins.__dict__['DATADIR'] = datadir
+# Respect gir_dir_prefix for meson and autotools
+girdir = ''
+# for meson
+if '@gir_dir_prefix@' and not '@gir_dir_prefix@'.startswith('@'):
+ girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@'))
+# for autotools
+elif '@GIR_DIR@' and not '@GIR_DIR@'.startswith('@'):
+ girdir = os.path.dirname(os.path.abspath('@GIR_DIR@'))
+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'))