summaryrefslogtreecommitdiff
path: root/giscanner/sourcescanner.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-08-22 19:46:03 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-08-22 19:46:03 +0000
commitd63fa8f926d209d3580e61e733d292cf6b1e316d (patch)
tree5b61bb6da6ecc22455590bf8ae16fda31bd42715 /giscanner/sourcescanner.py
parent450d9b88d4a285bb6063b905d570ab08f1380317 (diff)
downloadgobject-introspection-d63fa8f926d209d3580e61e733d292cf6b1e316d.tar.gz
Use the generated glibconfig.h for all scanner invokations. Rename it to
2008-08-22 Johan Dahlin <johan@gnome.org> * configure.ac: * gir/Makefile.am: * giscanner/Makefile.am: * giscanner/config.py.in: * giscanner/sourcescanner.py: Use the generated glibconfig.h for all scanner invokations. Rename it to glibconfig-scanner.h and install it. Add a config.py which so far contains the include dir. svn path=/trunk/; revision=456
Diffstat (limited to 'giscanner/sourcescanner.py')
-rw-r--r--giscanner/sourcescanner.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index ae7b6d07..ab512347 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -23,6 +23,7 @@ import subprocess
import tempfile
from . import _giscanner
+from .config import INCLUDEDIR
(CSYMBOL_TYPE_INVALID,
CSYMBOL_TYPE_CONST,
@@ -229,6 +230,16 @@ class SourceScanner(object):
'-D__GI_SCANNER__',
'-I.',
]
+
+ # Do not parse the normal glibconfig.h, use the
+ # one we provide instead
+ cpp_args.append('-D__G_LIBCONFIG_H__')
+ dirname = os.path.dirname(os.path.abspath(__file__))
+ includedir = os.path.join(dirname, '..', 'giscanner')
+ if not os.path.exists(includedir):
+ includedir = INCLUDEDIR
+ filenames.insert(0, os.path.join(includedir, 'glibconfig-scanner.h'))
+
cpp_args += self._cpp_options
proc = subprocess.Popen(cpp_args,
stdin=subprocess.PIPE,