gobject-introspection r463 - in trunk: . gir giscanner



Author: johan
Date: Fri Aug 22 21:24:47 2008
New Revision: 463
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=463&view=rev

Log:
2008-08-22  Johan Dahlin  <johan gnome org>

    * gir/Makefile.am:
    * giscanner/sourcescanner.py:
    Send in undefs/defines via writing it directly to stdin
    of cpp instead of via arguments.



Modified:
   trunk/ChangeLog
   trunk/gir/Makefile.am
   trunk/giscanner/sourcescanner.py

Modified: trunk/gir/Makefile.am
==============================================================================
--- trunk/gir/Makefile.am	(original)
+++ trunk/gir/Makefile.am	Fri Aug 22 21:24:47 2008
@@ -66,7 +66,7 @@
 dist_gir_DATA = $(BUILT_SOURCES)
 
 %.typelib: %.gir
-	$(top_builddir)/tools/g-ir-compiler $< --raw -o $@
+	$(top_builddir)/tools/g-ir-compiler $< -o $@
 
 typelibsdir = $(datadir)/gitypelibs
 typelibs_DATA = GLib.typelib GObject.typelib Gio.typelib

Modified: trunk/giscanner/sourcescanner.py
==============================================================================
--- trunk/giscanner/sourcescanner.py	(original)
+++ trunk/giscanner/sourcescanner.py	Fri Aug 22 21:24:47 2008
@@ -223,20 +223,18 @@
         if not filenames:
             return
 
-        cpp_args = [
-            'cpp',
-            '-C',
-            '-U__GNUC__',
-            '-D__GI_SCANNER__',
-            # libintl.h has no types we care about and breaks
-            # cpp on some systems
-            '-D_LIBINTL_H',
-            '-I.',
-            ]
+        defines = ['__GI_SCANNER__']
+        undefs = ['__GNUC__']
+        cpp_args = ['cpp', '-C', '-I.']
+
+        # libintl.h has no types we care about and breaks
+        # cpp on some systems
+        defines.append('_LIBINTL_H')
 
         # Do not parse the normal glibconfig.h, use the
         # one we provide instead
-        cpp_args.append('-D__G_LIBCONFIG_H__')
+        defines.append('__G_LIBCONFIG_H__')
+
         dirname = os.path.dirname(os.path.abspath(__file__))
         includedir = os.path.join(dirname, '..', 'giscanner')
         if not os.path.exists(includedir):
@@ -247,7 +245,12 @@
         proc = subprocess.Popen(cpp_args,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE)
-
+        for define in defines:
+            proc.stdin.write('#ifndef %s\n' % (define, ))
+            proc.stdin.write('# define %s\n' % (define, ))
+            proc.stdin.write('#endif\n')
+        for undef in undefs:
+            proc.stdin.write('#undef %s\n' % (undef, ))
         for filename in filenames:
             filename = os.path.abspath(filename)
             proc.stdin.write('#include <%s>\n' % (filename, ))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]