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 '2PACKAGE': '"lilypond"',
58 '3TOPLEVEL_VERSION' : '"2.3.6"',
59 '4DATADIR' : '"' + os.getcwd () + '/share"',
60 '5PACKAGE_DATADIR': 'DATADIR "/" PACKAGE',
61 '6LILYPOND_DATADIR' : 'PACKAGE_DATADIR',
62 '7LOCAL_PACKAGE_DATADIR' : 'PACKAGE_DATADIR "/" TOPLEVEL_VERSION',
63 '8LOCAL_LILYPOND_DATADIR' : 'LOCAL_PACKAGE_DATADIR',
64 '9LOCALEDIR' : '"' + os.getcwd () + '/share/locale"',
67 headers = ('sys/stat.h', 'assert.h', 'kpathsea/kpathsea.h')
69 if conf.CheckCHeader (i):
70 key = re.sub ('[./]', '_', 'zHAVE_' + string.upper (i))
73 ccheaders = ('sstream',)
75 if conf.CheckCXXHeader (i):
76 key = re.sub ('[./]', '_', 'zHAVE_' + string.upper (i))
79 functions = ('gettext', 'isinf', 'memmem', 'snprintf', 'vsnprintf')
81 if 0 or conf.CheckFunc (i):
82 key = re.sub ('[./]', '_', 'zHAVE_' + string.upper (i))
85 if conf.CheckLib ('dl'):
88 if conf.CheckLib ('kpathsea'):
89 defines['KPATHSEA'] = '1'
92 config = open ('config.h', 'w')
93 sort_helper = defines.keys ()
95 #for i in defines.keys ():
97 config.write ('#define %s %s\n' % (i[1:], defines[i]))
101 os.system (sys.executable \
102 + ' ./stepmake/bin/make-version.py VERSION > version.hh')
106 #this could happen after flower...
107 env.ParseConfig ('guile-config compile')
110 outdir = env['outdir']
112 if os.path.exists ('parser'):
113 env.Append (LIBPATH = ['#/flower', '#/lily', '#/parser', '#/gui',],
116 env.Append (LIBPATH = ['#/flower/' + outdir,],
120 #ugh: remove make config output
121 if os.path.exists ('lily/out/config.h'):
122 os.unlink ('lily/out/config.h')
124 subdirs = ('flower', 'lily',)
125 #subdirs = ('flower', 'lily', 'parser', 'gui', 'main',)
127 alias = os.path.join (builddir, d, outdir)
128 env.BuildDir (alias, d)
129 SConscript (os.path.join (alias, 'SConscript'))