]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/bin/make-version.py
robustify.
[lilypond.git] / stepmake / bin / make-version.py
index 9f4a3f46a3b115afdc795c8fbffb2420025a97a9..3c7089db81f6fb0ccac8c409c8f5f2225b215616 100644 (file)
@@ -18,12 +18,27 @@ for l in ls:
                defs.append ((m.group(1), m.group(2)))
 
 
-sys.stdout.write ('/* automatically generated */')
+sys.stdout.write (r'''
+#ifndef VERSION_HH
+#define VERSION_HH
+/* automatically generated */
+
+
+''')
 for d in defs:
-       sys.stdout.write ('#define %s \"%s\"\n' % d)
+
+       # GUILE leaks autoconf data into userspace. 
+       sys.stdout.write ('#ifdef %s\n' % d[0])
+       sys.stdout.write ('#undef %s\n' % d[0])
+       sys.stdout.write ('#endif /* %s */\n' % d[0])           
+       
+       sys.stdout.write ('#define %s "%s"\n' % d)
+       
 
 if ('MY_PATCH_LEVEL', '') in defs:
        sys.stdout.write ('#define NO_MY_PATCHLEVEL')
 
-sys.stdout.write('\n');
+sys.stdout.write(r'''
+#endif
+''')