summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--configure.ac1
-rw-r--r--gir/Makefile.am12
-rw-r--r--giscanner/Makefile.am24
-rw-r--r--giscanner/config.py.in23
-rw-r--r--giscanner/sourcescanner.py11
6 files changed, 70 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ba1eabc..812a4c56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
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.
+
+2008-08-22 Johan Dahlin <johan@gnome.org>
+
* gir/Makefile.am:
Replace glibconfig.h with our own, do some replacement
for CPP/C features we do not support
diff --git a/configure.ac b/configure.ac
index 0aa4573b..ccd0c31a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,6 +102,7 @@ Makefile
gir/Makefile
girepository/Makefile
giscanner/Makefile
+giscanner/config.py
m4/Makefile
tools/Makefile
tests/Makefile
diff --git a/gir/Makefile.am b/gir/Makefile.am
index 7789c103..14be0521 100644
--- a/gir/Makefile.am
+++ b/gir/Makefile.am
@@ -1,17 +1,9 @@
-BUILT_SOURCES = glibconfig.h
+BUILT_SOURCES =
G_IR_SCANNER = $(top_srcdir)/tools/g-ir-scanner
G_IR_SCANNER_FILES = $(top_srcdir)/giscanner/*.py \
$(top_builddir)/giscanner/libgiscanner.la
-GLIBCONFIG=`pkg-config --variable=libdir glib-2.0`/glib-2.0/include/glibconfig.h
-glibconfig.h:
- cat $(GLIBCONFIG) \
- | sed s/__G_LIBCONFIG_H__/__G_LIBCONFIG_GI_COPY_H__/g \
- | sed s/define\ G_HAVE_ISO_VARARGS\ 1/define\ G_HAVE_ISO_VARARGS\ 0/g \
- | sed s/define\ G_HAVE_GNUC_VARARGS\ 1/define\ G_HAVE_GNUC_VARARGS\ 0/g \
- > $(top_builddir)/gir/$@
-
# glib
GLIB_INCLUDEDIR=`pkg-config --variable=includedir glib-2.0`/glib-2.0
GLIB_LIBDIR=`pkg-config --variable=libdir glib-2.0`
@@ -27,7 +19,7 @@ GLib.gir: $(G_IR_SCANNER) $(G_IR_SCANNER_FILES)
-DGETTEXT_PACKAGE=Dummy \
-D__G_I18N_LIB_H__ \
-D__G_LIBCONFIG_H__ \
- $(top_builddir)/gir/glibconfig.h \
+ $(top_builddir)/giscanner/glibconfig-scanner.h \
$(GLIB_INCLUDEDIR)/glib/*.h
BUILT_SOURCES += GLib.gir
diff --git a/giscanner/Makefile.am b/giscanner/Makefile.am
index 0da9b597..0bd394f6 100644
--- a/giscanner/Makefile.am
+++ b/giscanner/Makefile.am
@@ -1,9 +1,19 @@
## Process this file with automake to produce Makefile.in
INCLUDES = -I$(top_srcdir)/girepository
-BUILT_SOURCES = scannerparser.c scannerparser.h scannerlexer.c scannerlexer.h
+BUILT_SOURCES = \
+ glibconfig-scanner.h \
+ scannerparser.c \
+ scannerparser.h \
+ scannerlexer.c \
+ scannerlexer.h
-CLEANFILES = scannerparser.c scannerparser.h scannerlexer.c scannerlexer.h
+CLEANFILES = \
+ glibconfig-scanner.h \
+ scannerparser.c \
+ scannerparser.h \
+ scannerlexer.c \
+ scannerlexer.h
AM_YFLAGS = -d -t
# Why do I have to do this automake?
@@ -57,5 +67,15 @@ CLEANFILES += _giscanner.so
_giscanner.so: _giscanner.la
ln -sf .libs/_giscanner.so .
+GLIBCONFIG=`pkg-config --variable=libdir glib-2.0`/glib-2.0/include/glibconfig.h
+glibconfig-scanner.h:
+ cat $(GLIBCONFIG) \
+ | sed s/__G_LIBCONFIG_H__/__G_LIBCONFIG_SCANNER_H__/g \
+ | sed s/define\ G_HAVE_ISO_VARARGS\ 1/define\ G_HAVE_ISO_VARARGS\ 0/g \
+ | sed s/define\ G_HAVE_GNUC_VARARGS\ 1/define\ G_HAVE_GNUC_VARARGS\ 0/g \
+ > $(top_builddir)/giscanner/$@
+
+gidir = $(includedir)/gobject-introspection-1.0/
+gi_HEADERS = glibconfig-scanner.h
include $(top_srcdir)/gcov.mak
diff --git a/giscanner/config.py.in b/giscanner/config.py.in
new file mode 100644
index 00000000..f39c49d0
--- /dev/null
+++ b/giscanner/config.py.in
@@ -0,0 +1,23 @@
+# -*- Mode: Python -*-
+# GObject-Introspection - a framework for introspecting GObject libraries
+# Copyright (C) 2008 Johan Dahlin
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+
+INCLUDEDIR = "@includedir@/gobject-introspection-1.0"
+INCLUDEDIR = INCLUDEDIR.replace(
+ "${prefix}", "@prefix@")
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,