3 # Experimental scons building
7 # * mf, Documentation, ly etc.
8 # * --srcdir ? (mkdir =build; cd =build; scons -Y .. ;
9 # ===> os.chdir (Dir ('.').srcdir ()); glob.glob (*.cc); os.chdir (cwd) ?
20 opts = Options (None, ARGUMENTS)
21 ##opts.Add (PackageOption ('prefix', 'Install prefix', '/usr/'))
22 ## `Path' means a directory rather than a path?
23 opts.Add (PathOption ('prefix', 'Install prefix', '/usr/'))
25 BoolOption ('warnings', 'compile with -Wall and similiar',
27 BoolOption ('debugging', 'compile with debugging symbols',
29 BoolOption ('optimising', 'compile with optimising',
31 BoolOption ('shared', 'build shared libraries',
33 BoolOption ('static', 'build static libraries',
37 Help (opts.GenerateHelpText (env))
39 env = Environment (options = opts)
42 env.Append (CFLAGS = '-g')
43 env.Append (CXXFLAGS = '-g')
45 env.Append (CFLAGS = '-O2')
46 env.Append (CXXFLAGS = '-O2 -DSTRING_UTILS_INLINED')
48 env.Append (CFLAGS = '-W -Wall')
49 env.Append (CXXFLAGS = '-W -Wall -Wconversion')
51 conf = Configure (env)
53 #ugh -- hardcode territory
58 'PACKAGE': '"lilypond"',
59 'TOPLEVEL_VERSION' : '"2.3.6"',
60 'DATADIR' : '"' + os.getcwd () + '/share"',
61 'PACKAGE_DATADIR': 'DATADIR "/" PACKAGE',
62 'LILYPOND_DATADIR' : 'PACKAGE_DATADIR',
63 'LOCAL_PACKAGE_DATADIR' : 'PACKAGE_DATADIR "/" TOPLEVEL_VERSION',
64 'LOCAL_LILYPOND_DATADIR' : 'LOCAL_PACKAGE_DATADIR',
65 'LOCALEDIR' : '"' + os.getcwd () + '/share/locale"',
68 headers = ('sys/stat.h', 'assert.h', 'kpathsea/kpathsea.h')
70 if conf.CheckCHeader (i):
71 key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
74 ccheaders = ('sstream',)
76 if conf.CheckCXXHeader (i):
77 key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
80 functions = ('gettext', 'isinf', 'memmem', 'snprintf', 'vsnprintf')
82 if 0 or conf.CheckFunc (i):
83 key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
86 if conf.CheckLib ('dl'):
89 if conf.CheckLib ('kpathsea'):
90 defines['KPATHSEA'] = '1'
93 config = open ('config.h', 'w')
94 for i in defines.keys ():
95 config.write ('#define %s %s\n' % (i, defines[i]))
99 if os.path.exists ('parser'):
100 env.Append (LIBPATH = ['#/flower', '#/lily', '#/parser', '#/gui',],
103 env.Append (LIBPATH = ['#/flower', '#/lily',],
106 os.system (sys.executable \
107 + ' ./stepmake/bin/make-version.py VERSION > version.hh')
113 #simple: build in ./flower
114 SConscript ('flower/SConscript')
116 # moellik: build in [/tmp/build/]flower[/out]
117 # werkt 'bijna', maar glob in flower/Sconscript snapt niet
118 # dat-i in flower SCRDRI moet globben
123 alias = os.path.join (builddir, d, outdir)
124 env.BuildDir (alias, d)
125 SConscript (os.path.join (alias, 'SConscript'))
127 env.ParseConfig ('guile-config compile')
129 SConscript ('lily/SConscript')
130 if os.path.exists ('parser'):
131 SConscript ('parser/SConscript')
132 SConscript ('gui/SConscript')
133 SConscript ('main/SConscript')