summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-11-04 14:42:18 -0400
committerColin Walters <walters@verbum.org>2010-11-09 11:52:29 -0500
commit8f5d725524acf1cd1631e36de4de52efbee04ffa (patch)
tree088bd5d50a10fac42cfb53328c9e3d2e4569ae42
parent8916db0a3831cb5e6c3b714125f7596f43d6aa6a (diff)
downloadgobject-introspection-8f5d725524acf1cd1631e36de4de52efbee04ffa.tar.gz
tools: Switch to checking UNINSTALLED_INTROSPECTION_SRCDIR
Rather than introspecting the current directory, use the environment variable we know is present if and only if we're running uninstalled. This will be less prone to failure when we switch to nonrecursive make, since the generated script will be in the top builddir, not tools/ anymore.
-rwxr-xr-xtools/g-ir-annotation-tool.in8
-rwxr-xr-xtools/g-ir-scanner.in8
2 files changed, 6 insertions, 10 deletions
diff --git a/tools/g-ir-annotation-tool.in b/tools/g-ir-annotation-tool.in
index 4fbc4499..4ad19761 100755
--- a/tools/g-ir-annotation-tool.in
+++ b/tools/g-ir-annotation-tool.in
@@ -29,11 +29,9 @@ if 'GI_SCANNER_DEBUG' in os.environ:
pdb.pm()
sys.excepthook = on_exception
-# This only works on unix systems
-currentdir = os.path.dirname(os.path.abspath(sys.argv[0]))
-current_name = os.path.basename(currentdir)
-if current_name == 'tools':
- path = os.path.abspath(os.path.join(currentdir, '..'))
+srcdir=os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None)
+if srcdir is not None:
+ path = srcdir
else:
# This is a private directory, we don't want to pollute the global
# namespace.
diff --git a/tools/g-ir-scanner.in b/tools/g-ir-scanner.in
index 943d9baa..86866c93 100755
--- a/tools/g-ir-scanner.in
+++ b/tools/g-ir-scanner.in
@@ -29,11 +29,9 @@ if 'GI_SCANNER_DEBUG' in os.environ:
pdb.pm()
sys.excepthook = on_exception
-# This only works on unix systems
-currentdir = os.path.dirname(os.path.abspath(sys.argv[0]))
-current_name = os.path.basename(currentdir)
-if current_name == 'tools':
- path = os.path.abspath(os.path.join(currentdir, '..'))
+srcdir=os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None)
+if srcdir is not None:
+ path = srcdir
else:
# This is a private directory, we don't want to pollute the global
# namespace.