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 ('prefix', 'Install prefix', '/usr/')
22 opts.Add ('outdir', 'Output directory', 'out')
24 BoolOption ('warnings', 'compile with -Wall and similiar',
26 BoolOption ('debugging', 'compile with debugging symbols',
28 BoolOption ('optimising', 'compile with optimising',
30 BoolOption ('shared', 'build shared libraries',
32 BoolOption ('static', 'build static libraries',
36 Help (opts.GenerateHelpText (env))
38 env = Environment (options = opts)
41 env.Append (CFLAGS = '-g')
42 env.Append (CXXFLAGS = '-g')
44 env.Append (CFLAGS = '-O2')
45 env.Append (CXXFLAGS = '-O2 -DSTRING_UTILS_INLINED')
47 env.Append (CFLAGS = '-W -Wall')
48 env.Append (CXXFLAGS = '-W -Wall -Wconversion')
50 conf = Configure (env)
52 #ugh -- hardcode territory
57 'PACKAGE': '"lilypond"',
58 'TOPLEVEL_VERSION' : '"2.3.6"',
59 'DATADIR' : '"' + os.getcwd () + '/share"',
60 'PACKAGE_DATADIR': 'DATADIR "/" PACKAGE',
61 'LILYPOND_DATADIR' : 'PACKAGE_DATADIR',
62 'LOCAL_PACKAGE_DATADIR' : 'PACKAGE_DATADIR "/" TOPLEVEL_VERSION',
63 'LOCAL_LILYPOND_DATADIR' : 'LOCAL_PACKAGE_DATADIR',
64 'LOCALEDIR' : '"' + os.getcwd () + '/share/locale"',
67 headers = ('sys/stat.h', 'assert.h', 'kpathsea/kpathsea.h')
69 if conf.CheckCHeader (i):
70 key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
73 ccheaders = ('sstream',)
75 if conf.CheckCXXHeader (i):
76 key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
79 functions = ('gettext', 'isinf', 'memmem', 'snprintf', 'vsnprintf')
81 if 0 or conf.CheckFunc (i):
82 key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
85 if conf.CheckLib ('dl'):
88 if conf.CheckLib ('kpathsea'):
89 defines['KPATHSEA'] = '1'
92 config = open ('config.h', 'w')
93 for i in defines.keys ():
94 config.write ('#define %s %s\n' % (i, defines[i]))
98 os.system (sys.executable \
99 + ' ./stepmake/bin/make-version.py VERSION > version.hh')
103 #this could happen after flower...
104 env.ParseConfig ('guile-config compile')
107 outdir = env['outdir']
109 if os.path.exists ('parser'):
110 env.Append (LIBPATH = ['#/flower', '#/lily', '#/parser', '#/gui',],
113 env.Append (LIBPATH = ['#/flower/' + outdir,],
117 #ugh: remove make config output
118 if os.path.exists ('lily/out/config.h'):
119 os.unlink ('lily/out/config.h')
121 subdirs = ('flower', 'lily',)
122 #subdirs = ('flower', 'lily', 'parser', 'gui', 'main',)
124 alias = os.path.join (builddir, d, outdir)
125 env.BuildDir (alias, d)
126 SConscript (os.path.join (alias, 'SConscript'))