]> git.donarmstrong.com Git - lilypond.git/commitdiff
lekker hakken
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 6 Jul 2004 17:48:20 +0000 (17:48 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 6 Jul 2004 17:48:20 +0000 (17:48 +0000)
ChangeLog
SConstruct [new file with mode: 0644]
flower/SConscript [new file with mode: 0644]
lily/SConscript [new file with mode: 0644]

index 232e250babce4116fe9e903fccbd8cc5e91efd1c..651cf7dd4adcab7cb0d596f104f966d3c20a9083 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-06  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * SConstruct:
+       * flower/SConscript:
+       * lily/SConscript: New file.
+
 2004-07-05  Carl Sorensen  <carldsorensen@comcast.net>
 
        * scm/define-grob-properties.scm (all-user-grob-properties): Add
diff --git a/SConstruct b/SConstruct
new file mode 100644 (file)
index 0000000..babe6eb
--- /dev/null
@@ -0,0 +1,133 @@
+# -*-python-*-
+#
+# Experimental scons building
+# TODO:
+#   * install
+#   * build in out/ ?
+#   * mf, Documentation, ly etc.
+#   * --srcdir ?  (mkdir =build; cd =build; scons -Y .. ;
+#     ===> os.chdir (Dir ('.').srcdir ()); glob.glob (*.cc); os.chdir (cwd) ?
+# 
+
+import re
+import glob
+import os
+import sys
+import string
+
+env = Environment ()
+
+opts = Options (None, ARGUMENTS)
+##opts.Add (PackageOption ('prefix', 'Install prefix', '/usr/'))
+## `Path' means a directory rather than a path?
+opts.Add (PathOption ('prefix', 'Install prefix', '/usr/'))
+opts.AddOptions (
+       BoolOption ('warnings', 'compile with -Wall and similiar',
+                  1),
+       BoolOption ('debugging', 'compile with debugging symbols',
+                   0),
+       BoolOption ('optimising', 'compile with optimising',
+                   1),
+       BoolOption ('shared', 'build shared libraries',
+                   1),
+       BoolOption ('static', 'build static libraries',
+                   0),
+       )
+
+Help (opts.GenerateHelpText (env))
+
+env = Environment (options = opts)
+
+if env['debugging']:
+       env.Append (CFLAGS = '-g')
+       env.Append (CXXFLAGS = '-g')
+if env['optimising']:
+       env.Append (CFLAGS = '-O2')
+       env.Append (CXXFLAGS = '-O2 -DSTRING_UTILS_INLINED')
+if env['warnings']:
+       env.Append (CFLAGS = '-W -Wall')
+       env.Append (CXXFLAGS = '-W -Wall -Wconversion')
+
+conf = Configure (env)
+
+#ugh -- hardcode territory
+defines = {
+   'DIRSEP' : "'/'",
+   'PATHSEP' : "':'",
+
+   'PACKAGE': '"lilypond"',
+   'TOPLEVEL_VERSION' : '"2.3.6"',
+   'DATADIR' : '"' + os.getcwd () + '/share"',
+   'PACKAGE_DATADIR': 'DATADIR "/" PACKAGE',
+   'LILYPOND_DATADIR' : 'PACKAGE_DATADIR',
+   'LOCAL_PACKAGE_DATADIR' : 'PACKAGE_DATADIR "/" TOPLEVEL_VERSION',
+   'LOCAL_LILYPOND_DATADIR' : 'LOCAL_PACKAGE_DATADIR',
+   'LOCALEDIR' : '"' + os.getcwd () + '/share/locale"',
+}
+
+headers = ('sys/stat.h', 'assert.h', 'kpathsea/kpathsea.h')
+for i in headers:
+       if conf.CheckCHeader (i):
+                       key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
+                defines[key] = '1'
+
+ccheaders = ('sstream',)
+for i in ccheaders:
+       if conf.CheckCXXHeader (i):
+                       key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
+                defines[key] = '1'
+
+functions = ('gettext', 'isinf', 'memmem', 'snprintf', 'vsnprintf')
+for i in functions:
+       if 0 or conf.CheckFunc (i):
+                       key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i))
+                defines[key] = '1'
+
+if conf.CheckLib ('dl'):
+       pass
+
+if conf.CheckLib ('kpathsea'):
+       defines['KPATHSEA'] = '1'
+
+# ugh?
+config = open ('config.h', 'w')
+for i in defines.keys ():
+       config.write ('#define %s %s\n' % (i, defines[i]))
+config.close ()
+env = conf.Finish ()
+
+if os.path.exists ('parser'):
+       env.Append (LIBPATH = ['#/flower', '#/lily', '#/parser', '#/gui',],
+                   CPPPATH = ['#',])
+else:  
+       env.Append (LIBPATH = ['#/flower', '#/lily',],
+                   CPPPATH = ['#',])
+
+os.system (sys.executable \
+          + ' ./stepmake/bin/make-version.py VERSION > version.hh')
+
+Export ('env')
+
+
+if 1:
+       #simple: build in ./flower
+       SConscript ('flower/SConscript')
+else:
+       # moellik: build in [/tmp/build/]flower[/out]
+       # werkt 'bijna', maar glob in flower/Sconscript snapt niet
+       # dat-i in flower SCRDRI moet globben
+       builddir = ''
+       outdir = 'out'
+
+       d = 'flower'
+       alias = os.path.join (builddir, d, outdir)
+       env.BuildDir (alias, d)
+       SConscript (os.path.join (alias, 'SConscript'))
+
+env.ParseConfig ('guile-config compile')
+
+SConscript ('lily/SConscript')
+if os.path.exists ('parser'):
+       SConscript ('parser/SConscript')
+       SConscript ('gui/SConscript')
+       SConscript ('main/SConscript')
diff --git a/flower/SConscript b/flower/SConscript
new file mode 100644 (file)
index 0000000..54ad4dc
--- /dev/null
@@ -0,0 +1,16 @@
+# -*-python-*-
+
+import glob
+sources = glob.glob ('*.cc')
+
+name = 'flower'
+
+Import ('env')
+##print `env.__dict__`
+
+e = env.Copy ()
+e.Append (CPPPATH = ['include'])
+if env['static']:
+       e.Library (name, sources) 
+if not env['static'] or ['shared']:
+       e.SharedLibrary (name, sources)
diff --git a/lily/SConscript b/lily/SConscript
new file mode 100644 (file)
index 0000000..03b30a2
--- /dev/null
@@ -0,0 +1,26 @@
+# -*-python-*-
+
+import glob
+
+sources = glob.glob ('*.cc') + ['parser.yy', 'lexer.ll']
+name = 'lyparser'
+
+Import ('env')
+e = env.Copy ()
+
+e.Append (YACCFLAGS = '-d')
+e.Append (CPPPATH = ['include', '#/lily/include', '#/flower/include'])
+e.Depends ('lexer.cc', 'parser.cc')
+
+# some stuff here from lily-as-lib
+if os.path.exists ('main.cc'):
+       if env['static']:
+               e.Library (name, sources) 
+       if not env['static'] or ['shared']:
+               e.SharedLibrary (name, sources)
+else:
+       #e.Append (LIBS = ['lygui', 'lyparser', 'lily', 'flower'])
+       e.Append (LIBS = ['flower'])
+       e.ParseConfig ('guile-config link')
+       name = 'lilypond-bin'
+       e.Program (name, sources)