summaryrefslogtreecommitdiffstats
path: root/spice_codegen.py
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-06-22 10:58:57 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2011-06-22 16:29:52 +0200
commit4caf14087d9968dfc0ec0b1b9c74aa5d6ac87ff0 (patch)
tree566a93335ecdf1ada04ea9207716f0de14bb93ab /spice_codegen.py
parente261cb2d54d417cfe0cc7613eec297e7fcfbc7c0 (diff)
downloadspice-4caf14087d9968dfc0ec0b1b9c74aa5d6ac87ff0.tar.gz
spice-4caf14087d9968dfc0ec0b1b9c74aa5d6ac87ff0.tar.xz
spice-4caf14087d9968dfc0ec0b1b9c74aa5d6ac87ff0.zip
don't #include config.h in generated header files
7e30572ab adds a #include <config.h> to the beginning of generated files. It also does this for generated headers and enums files, which is not wanted, especially if it's an installed file. This commit only adds this include for the non-header non-enum case (hopefully, enums are only generated for use in a .h file).
Diffstat (limited to 'spice_codegen.py')
-rwxr-xr-xspice_codegen.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/spice_codegen.py b/spice_codegen.py
index c6d6aa96..a9fdee98 100755
--- a/spice_codegen.py
+++ b/spice_codegen.py
@@ -144,9 +144,10 @@ writer.public_prefix = options.prefix
writer.writeln("/* this is a file autogenerated by spice_codegen.py */")
writer.header.writeln("/* this is a file autogenerated by spice_codegen.py */")
-writer.writeln("#ifdef HAVE_CONFIG_H")
-writer.writeln("#include <config.h>")
-writer.writeln("#endif")
+if not options.header and not options.generate_enums:
+ writer.writeln("#ifdef HAVE_CONFIG_H")
+ writer.writeln("#include <config.h>")
+ writer.writeln("#endif")
if options.assert_on_error:
writer.set_option("assert_on_error")