]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/bin/make-version.py
* stepmake/GNUmakefile.in: remove nested stepmake packaging stuff.
[lilypond.git] / stepmake / bin / make-version.py
1
2 import re
3 import sys
4 import getopt
5
6
7 vf = 'VERSION'
8 if sys.argv[1:]:
9         vf = sys.argv[1]
10
11 f = open (vf)
12 ls = f.readlines ()
13 mypatch = 0
14 defs = []
15 for a in sys.argv[1:]
16         m  = re.search ('([^ =]*)=([^ \t]*)[ \t]*\n', a)
17         if m:
18                 defs.append ((m.group(1), m.group(2)))
19
20
21 sys.stdout.write (r'''
22 #ifndef VERSION_HH
23 #define VERSION_HH
24 /* automatically generated */
25
26
27 ''')
28 for d in defs:
29
30         # GUILE leaks autoconf data into userspace. 
31         sys.stdout.write ('#ifdef %s\n' % d[0])
32         sys.stdout.write ('#undef %s\n' % d[0])
33         sys.stdout.write ('#endif /* %s */\n' % d[0])           
34         
35         sys.stdout.write ('#define %s "%s"\n' % d)
36         
37
38 if ('MY_PATCH_LEVEL', '') in defs:
39         sys.stdout.write ('#define NO_MY_PATCHLEVEL')
40
41 sys.stdout.write(r'''
42 #endif
43 ''')
44