Added virtual destructors. Thank you gcc4.
[ardour.git] / SConstruct
1 import os
2 import sys
3 import re
4 import shutil
5 import glob
6 import errno
7 import time
8 import SCons.Node.FS
9
10 SConsignFile()
11 EnsureSConsVersion(0, 96)
12
13 version = '1.9beta1'
14
15 subst_dict = { }
16
17 #
18 # Command-line options
19 #
20
21 opts = Options('scache.conf')
22 opts.AddOptions(
23     BoolOption('ALTIVEC', 'Compile using Altivec instructions', 0),
24   ('ARCH', 'Set architecture-specific compilation flags by hand (all flags as 1 argument)',''),
25     BoolOption('DEBIAN', 'Debian build options (no internal versions of 3rd party libraries)', 0),
26     BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0),
27     PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'),
28     BoolOption('DEVBUILD', 'Use shared libardour (developers only)', 0),
29     BoolOption('NLS', 'Set to turn on i18n support', 1),
30     BoolOption('NOARCH', 'Do not use architecture-specific compilation flags', 0),
31     PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
32     BoolOption('VST', 'Compile with support for VST', 0),
33     BoolOption('VERSIONED', 'Add version information to ardour/gtk executable name inside the build directory', 0)
34   )
35
36
37 #----------------------------------------------------------------------
38 # a handy helper that provides a way to merge compile/link information
39 # from multiple different "environments"
40 #----------------------------------------------------------------------
41 #
42 class LibraryInfo(Environment):
43     def __init__(self,*args,**kw):
44         Environment.__init__ (self,*args,**kw)
45         
46     def Merge (self,others):
47         for other in others:
48             self.Append (LIBS = other.get ('LIBS',[]))
49             self.Append (LIBPATH = other.get ('LIBPATH', []))   
50             self.Append (CPPPATH = other.get('CPPPATH', []))
51             self.Append (LINKFLAGS = other.get('LINKFLAGS', []))
52
53
54 env = LibraryInfo (options = opts,
55                    CPPPATH = [ '.' ],
56                    VERSION = version,
57                    TARBALL='ardour-' + version + '.tar.bz2',
58                    DISTFILES = [ ],
59                    DISTTREE  = '#ardour-' + version,
60                    DISTCHECKDIR = '#ardour-' + version + '/check'
61                    )
62
63
64 #----------------------------------------------------------------------
65 # Builders
66 #----------------------------------------------------------------------
67
68 # Handy subst-in-file builder
69
70
71 def do_subst_in_file(targetfile, sourcefile, dict):
72         """Replace all instances of the keys of dict with their values.
73         For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
74         then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
75         """
76         try:
77             f = open(sourcefile, 'rb')
78             contents = f.read()
79             f.close()
80         except:
81             raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile
82         for (k,v) in dict.items():
83             contents = re.sub(k, v, contents)
84         try:
85             f = open(targetfile, 'wb')
86             f.write(contents)
87             f.close()
88         except:
89             raise SCons.Errors.UserError, "Can't write target file %s"%targetfile
90         return 0 # success
91  
92 def subst_in_file(target, source, env):
93         if not env.has_key('SUBST_DICT'):
94             raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set."
95         d = dict(env['SUBST_DICT']) # copy it
96         for (k,v) in d.items():
97             if callable(v):
98                 d[k] = env.subst(v())
99             elif SCons.Util.is_String(v):
100                 d[k]=env.subst(v)
101             else:
102                 raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v))
103         for (t,s) in zip(target, source):
104             return do_subst_in_file(str(t), str(s), d)
105  
106 def subst_in_file_string(target, source, env):
107         """This is what gets printed on the console."""
108         return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t))
109                           for (t,s) in zip(target, source)])
110  
111 def subst_emitter(target, source, env):
112         """Add dependency from substituted SUBST_DICT to target.
113         Returns original target, source tuple unchanged.
114         """
115         d = env['SUBST_DICT'].copy() # copy it
116         for (k,v) in d.items():
117             if callable(v):
118                 d[k] = env.subst(v())
119             elif SCons.Util.is_String(v):
120                 d[k]=env.subst(v)
121         Depends(target, SCons.Node.Python.Value(d))
122         # Depends(target, source) # this doesn't help the install-sapphire-linux.sh problem
123         return target, source
124  
125 subst_action = Action (subst_in_file, subst_in_file_string)
126 env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
127
128 #
129 # internationalization
130 #
131
132 # po_helper
133 #
134 # this is not a builder. we can't list the .po files as a target,
135 # because then scons -c will remove them (even Precious doesn't alter
136 # this). this function is called whenever a .mo file is being
137 # built, and will conditionally update the .po file if necessary.
138 #
139
140 def po_helper(po,pot):
141     args = [ 'msgmerge',
142              '--update',
143              po,
144              pot,
145              ]
146     print 'Updating ' + po
147     return os.spawnvp (os.P_WAIT, 'msgmerge', args)
148
149 # mo_builder: builder function for (binary) message catalogs (.mo)
150 #
151 # first source:  .po file
152 # second source: .pot file
153 #
154
155 def mo_builder(target,source,env):
156     po_helper (source[0].get_path(), source[1].get_path())
157     args = [ 'msgfmt',
158              '-c',
159              '-o',
160              target[0].get_path(),
161              source[0].get_path()
162              ]
163     return os.spawnvp (os.P_WAIT, 'msgfmt', args)
164
165 mo_bld = Builder (action = mo_builder)
166 env.Append(BUILDERS = {'MoBuild' : mo_bld})
167
168 # pot_builder: builder function for message templates (.pot)
169 #
170 # source: list of C/C++ etc. files to extract messages from
171 #
172
173 def pot_builder(target,source,env):
174     args = [ 'xgettext', 
175              '--keyword=_',
176              '--keyword=N_',
177              '--from-code=UTF-8',
178              '-o', target[0].get_path(), 
179              "--default-domain=" + env['PACKAGE'],
180              '--copyright-holder="Paul Davis"' ]
181     args += [ src.get_path() for src in source ]
182
183     return os.spawnvp (os.P_WAIT, 'xgettext', args)
184
185 pot_bld = Builder (action = pot_builder)
186 env.Append(BUILDERS = {'PotBuild' : pot_bld})
187
188 #
189 # utility function, not a builder
190 #
191
192 def i18n (buildenv, sources, installenv):
193     domain = buildenv['PACKAGE']
194     potfile = buildenv['POTFILE']
195
196     installenv.Alias ('potupdate', buildenv.PotBuild (potfile, sources))
197
198     p_oze = [ os.path.basename (po) for po in glob.glob ('po/*.po') ]
199     languages = [ po.replace ('.po', '') for po in p_oze ]
200     m_oze = [ po.replace (".po", ".mo") for po in p_oze ]
201     
202     for mo in m_oze[:]:
203         po = 'po/' + mo.replace (".mo", ".po")
204         installenv.Alias ('install', buildenv.MoBuild (mo, [ po, potfile ]))
205         
206     for lang in languages[:]:
207         modir = (os.path.join (install_prefix, 'share/locale/' + lang + '/LC_MESSAGES/'))
208         moname = domain + '.mo'
209         installenv.Alias('install', installenv.InstallAs (os.path.join (modir, moname), lang + '.mo'))
210
211 #
212 # A generic builder for version.cc files
213
214 # note: requires that DOMAIN, MAJOR, MINOR, MICRO are set in the construction environment
215 # note: assumes one source files, the header that declares the version variables
216
217 def version_builder (target, source, env):
218    text  = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
219    text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
220    text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
221
222    try:
223       o = file (target[0].get_path(), 'w')
224       o.write (text)
225       o.close ();
226    except IOError:
227       print "Could not open", target[0].get_path(), " for writing\n"
228       sys.exit (-1)
229
230    text  = "#ifndef __" + env['DOMAIN'] + "_version_h__\n";
231    text += "#define __" + env['DOMAIN'] + "_version_h__\n";
232    text += "extern int " + env['DOMAIN'] + "_major_version;\n"
233    text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
234    text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
235    text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n";
236
237    try:
238       o = file (target[1].get_path(), 'w')
239       o.write (text)
240       o.close ();
241    except IOError:
242       print "Could not open", target[1].get_path(), " for writing\n"
243       sys.exit (-1)
244   
245    return None
246
247 version_bld = Builder (action = version_builder)
248 env.Append (BUILDERS = {'VersionBuild' : version_bld})
249
250 #
251 # a builder that makes a hard link from the 'source' executable to a name with
252 # a "build ID" based on the most recent CVS activity that might be reasonably
253 # related to version activity. this relies on the idea that the SConscript
254 # file that builds the executable is updated with new version info and committed
255 # to the source code repository whenever things change.
256 #
257
258 def versioned_builder(target,source,env):
259     # build ID is composed of a representation of the date of the last CVS transaction
260     # for this (SConscript) file
261     
262     try:
263         o = file (source[0].get_dir().get_path() +  '/CVS/Entries', "r")
264     except IOError:
265         print "Could not CVS/Entries for reading"
266         return -1
267
268     last_date = ""        
269     lines = o.readlines()
270     for line in lines:
271         if line[0:12] == '/SConscript/':
272             parts = line.split ("/")
273             last_date = parts[3]
274             break
275     o.close ()
276
277     if last_date == "":
278         print "No SConscript CVS update info found - versioned executable cannot be built"
279         return -1
280
281     tag = time.strftime ('%Y%M%d%H%m', time.strptime (last_date));
282     print "The current build ID is " + tag
283
284     tagged_executable = source[0].get_path() + '-' + tag
285
286     if os.path.exists (tagged_executable):
287         print "Replacing existing executable with the same build tag."
288         os.unlink (tagged_executable)
289
290     return os.link (source[0].get_path(), tagged_executable)
291
292 verbuild = Builder (action = versioned_builder)
293 env.Append (BUILDERS = {'VersionedExecutable' : verbuild})
294
295 #
296 # source tar file builder
297 #
298
299 def distcopy (target, source, env):
300     treedir = str (target[0])
301
302     try:
303         os.mkdir (treedir)
304     except OSError, (errnum, strerror):
305         if errnum != errno.EEXIST:
306             print 'mkdir ', treedir, ':', strerror
307
308     cmd = 'tar cf - '
309     #
310     # we don't know what characters might be in the file names
311     # so quote them all before passing them to the shell
312     #
313     all_files = ([ str(s) for s in source ])
314     cmd += " ".join ([ "'%s'" % quoted for quoted in all_files])
315     cmd += ' | (cd ' + treedir + ' && tar xf -)'
316     p = os.popen (cmd)
317     return p.close ();
318
319 def tarballer (target, source, env):            
320     cmd = 'tar -jcf ' + str (target[0]) +  ' ' + str(source[0]) + "  --exclude '*~'"
321     print 'running ', cmd, ' ... '
322     p = os.popen (cmd)
323     return p.close ()
324
325 dist_bld = Builder (action = distcopy,
326                     target_factory = SCons.Node.FS.default_fs.Entry,
327                     source_factory = SCons.Node.FS.default_fs.Entry,
328                     multi = 1)
329
330 tarball_bld = Builder (action = tarballer,
331                        target_factory = SCons.Node.FS.default_fs.Entry,
332                        source_factory = SCons.Node.FS.default_fs.Entry)
333
334 env.Append (BUILDERS = {'Distribute' : dist_bld})
335 env.Append (BUILDERS = {'Tarball' : tarball_bld})
336
337 # ----------------------------------------------------------------------
338 # Construction environment setup
339 # ----------------------------------------------------------------------
340
341 libraries = { }
342
343 libraries['core'] = LibraryInfo (CPPPATH = [ '#libs'])
344
345 libraries['sndfile'] = LibraryInfo()
346 libraries['sndfile'].ParseConfig('pkg-config --cflags --libs sndfile')
347
348 libraries['lrdf'] = LibraryInfo()
349 libraries['lrdf'].ParseConfig('pkg-config --cflags --libs lrdf')
350
351 libraries['raptor'] = LibraryInfo()
352 libraries['raptor'].ParseConfig('pkg-config --cflags --libs raptor')
353
354 libraries['samplerate'] = LibraryInfo()
355 libraries['samplerate'].ParseConfig('pkg-config --cflags --libs samplerate')
356
357 libraries['jack'] = LibraryInfo()
358 libraries['jack'].ParseConfig('pkg-config --cflags --libs jack')
359
360 libraries['xml'] = LibraryInfo()
361 libraries['xml'].ParseConfig('pkg-config --cflags --libs libxml-2.0')
362
363 libraries['glib2'] = LibraryInfo()
364 libraries['glib2'].ParseConfig ('pkg-config --cflags --libs glib-2.0')
365 libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gobject-2.0')
366 libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gmodule-2.0')
367
368 libraries['gtk2'] = LibraryInfo()
369 libraries['gtk2'].ParseConfig ('pkg-config --cflags --libs gtk+-2.0')
370
371 libraries['pango'] = LibraryInfo()
372 libraries['pango'].ParseConfig ('pkg-config --cflags --libs pango')
373
374 libraries['libgnomecanvas2'] = LibraryInfo()
375 libraries['libgnomecanvas2'].ParseConfig ('pkg-config --cflags --libs libgnomecanvas-2.0')
376
377 libraries['ardour2'] = LibraryInfo (LIBS='ardour2', LIBPATH='#libs/ardour2', CPPPATH='#libs/ardour2')
378 libraries['midi++2'] = LibraryInfo (LIBS='midi++', LIBPATH='#libs/midi++2', CPPPATH='#libs/midi++2')
379 libraries['pbd3']    = LibraryInfo (LIBS='pbd', LIBPATH='#libs/pbd3', CPPPATH='#libs/pbd3')
380 libraries['gtkmm2ext'] = LibraryInfo (LIBS='gtkmm2ext', LIBPATH='#libs/gtkmm2ext', CPPPATH='#libs/gtkmm2ext')
381 libraries['cassowary'] = LibraryInfo (LIBS='cassowary', LIBPATH='#libs/cassowary', CPPPATH='#libs/cassowary')
382
383 libraries['fst'] = LibraryInfo()
384 if env['VST']:
385     libraries['fst'].ParseConfig('pkg-config --cflags --libs libfst')
386
387 #
388 # Audio/MIDI library (needed for MIDI, since audio is all handled via JACK)
389
390
391 conf = Configure(env)
392
393 if conf.CheckCHeader('alsa/asoundlib.h'):
394     libraries['sysmidi'] = LibraryInfo (LIBS='asound')
395     env['SYSMIDI'] = 'ALSA Sequencer'
396     subst_dict['%MIDITAG%'] = "seq"
397     subst_dict['%MIDITYPE%'] = "alsa/sequencer"
398 elif conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
399     # this line is needed because scons can't handle -framework in ParseConfig() yet.
400     libraries['sysmidi'] = LibraryInfo (LINKFLAGS= '-framework CoreMIDI -framework CoreFoundation -framework CoreAudio -framework CoreServices -framework AudioUnit')
401     env['SYSMIDI'] = 'CoreMIDI'
402     subst_dict['%MIDITAG%'] = "coremidi"
403     subst_dict['%MIDITYPE%'] = "coremidi"
404
405 env = conf.Finish()
406
407 if env['DEBIAN']:
408
409     libraries['soundtouch'] = LibraryInfo(LIBS='SoundTouch')
410
411     coredirs = [
412         'templates'
413     ]
414
415     subdirs2 = [
416         'libs/cassowary',
417         'libs/pbd3',
418         'libs/midi++2'
419         ]
420
421     gtk2_subdirs = [
422         'libs/gtkmm2ext'
423          ]
424  
425 else:
426
427     libraries['sigc2'] = LibraryInfo(LIBS='sigc++2',
428                                     LIBPATH='#libs/sigc++2',
429                                     CPPPATH='#libs/sigc++2')
430     libraries['glibmm2'] = LibraryInfo(LIBS='glibmm2',
431                                     LIBPATH='#libs/glibmm2',
432                                     CPPPATH='#libs/glibmm2')
433     libraries['pangomm'] = LibraryInfo(LIBS='pangomm',
434                                     LIBPATH='#libs/gtkmm2/pango',
435                                     CPPPATH='#libs/gtkmm2/pango')
436     libraries['atkmm'] = LibraryInfo(LIBS='atkmm',
437                                      LIBPATH='#libs/gtkmm2/atk',
438                                      CPPPATH='#libs/gtkmm2/atk')
439     libraries['gdkmm2'] = LibraryInfo(LIBS='gdkmm2',
440                                       LIBPATH='#libs/gtkmm2/gdk',
441                                       CPPPATH='#libs/gtkmm2/gdk')
442     libraries['gtkmm2'] = LibraryInfo(LIBS='gtkmm2',
443                                       LIBPATH='#libs/gtkmm2/gtk',
444                                       CPPPATH='#libs/gtkmm2/gtk')
445     libraries['libgnomecanvasmm'] = LibraryInfo(LIBS='libgnomecanvasmm',
446                                                 LIBPATH='#libs/libgnomecanvasmm',
447                                                 CPPPATH='#libs/libgnomecanvasmm')
448     libraries['soundtouch'] = LibraryInfo(LIBS='soundtouch',
449                                           LIBPATH='#libs/soundtouch',
450                                           CPPPATH='#libs')
451
452     coredirs = [
453         'libs/soundtouch',
454         'templates'
455     ]
456
457     subdirs2 = [
458         'libs/cassowary',
459         'libs/sigc++2',
460         'libs/pbd3',
461         'libs/midi++2'
462         ]
463
464     gtk2_subdirs = [
465         'libs/glibmm2', 
466         'libs/gtkmm2/pango', 
467         'libs/gtkmm2/atk', 
468         'libs/gtkmm2/gdk', 
469         'libs/gtkmm2/gtk',
470         'libs/libgnomecanvasmm',
471         'libs/gtkmm2ext'
472         ]
473     
474 opts.Save('scache.conf', env)
475 Help(opts.GenerateHelpText(env))
476
477 if os.environ.has_key('PATH'):
478     env.Append(PATH = os.environ['PATH'])
479 if os.environ.has_key('PKG_CONFIG_PATH'):
480     env.Append(PKG_CONFIG_PATH = os.environ['PKG_CONFIG_PATH'])
481
482 final_prefix = '$PREFIX'
483 install_prefix = '$DESTDIR/$PREFIX'
484
485 if env['PREFIX'] == '/usr':
486     final_config_prefix = '/etc'
487 else:
488     final_config_prefix = env['PREFIX'] + '/etc'
489
490 config_prefix = '$DESTDIR' + final_config_prefix
491
492 #
493 # Compiler flags and other system-dependent stuff
494 #
495
496 opt_flags = []
497
498 # guess at the platform, used to define compiler flags
499
500 config_guess = os.popen("tools/config.guess").read()[:-1]
501
502 config_cpu = 0;
503 config_arch = 1;
504 config_kernel = 2;
505 config_os = 3;
506 config = config_guess.split ("-")
507
508 #
509 # on OS X darwinports puts things in /opt/local by default
510 #
511 if config[config_arch] == 'apple':
512     libraries['core'].Append (LIBPATH = [ '/opt/local/lib' ],
513                               CPPPATH = [ '/opt/local/include' ])
514
515 if config[config_cpu] == 'powerpc':
516     #
517     # Apple/PowerPC optimization options
518     #
519     # -mcpu=7450 does not reliably work with gcc 3.*
520     #
521     if env['NOARCH'] == 0:
522         if env['ALTIVEC'] == 1:
523             opt_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec" ])
524         else:
525             opt_flags.extend([ "-mcpu=750", "-mmultiple" ])
526         opt_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
527
528 elif re.search ("i[0-9]86", config[config_cpu]) != None :
529
530     if env['NOARCH'] == 0:
531
532         if config[config_kernel] == 'linux' :
533
534             flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
535             x86_flags = flag_line.split (": ")[1:][0].split (' ')
536
537             if "mmx" in x86_flags:
538                 opt_flags.append ("-mmmx")
539             if "sse" in x86_flags:
540                 opt_flags.extend (["-msse", "-mfpmath=sse"])
541             if "3dnow" in x86_flags:
542                 opt_flags.append ("-m3dnow")
543
544             if config[config_cpu] == "i586":
545                 opt_flags.append ("-march=i586")
546             elif config[config_cpu] == "i686":
547                 opt_flags.append ("-march=i686")
548         
549 #
550 # ARCH="..." overrides all 
551 #
552
553 if env['ARCH'] != '':
554     opt_flags = env['ARCH'].split()
555
556 #
557 # prepend boiler plate optimization flags
558 #
559
560 opt_flags[:0] = [
561     "-O3",
562     "-fomit-frame-pointer",
563     "-ffast-math",
564     "-fstrength-reduce"
565     ]
566
567 if env['DEBUG'] == 1:
568     env.Append(CCFLAGS="-g")
569 else:
570     env.Append(CCFLAGS=" ".join (opt_flags))
571
572 env.Append(CCFLAGS="-Wall")
573
574 if env['VST']:
575     env.Append(CCFLAGS="-DVST_SUPPORT")
576
577 #
578 # everybody needs this
579 #
580
581 env.Merge ([ libraries['core'] ])
582
583 #
584 # i18n support 
585 #
586
587 conf = Configure (env)
588
589 if env['NLS']:
590     if conf.CheckCHeader('libintl.h') == None:
591         print 'This system is not configured for internationalized applications. An english-only version will be built\n'
592         env['NLS'] = 0
593
594 env = conf.Finish()
595
596 if env['NLS'] == 1:
597     env.Append(CCFLAGS="-DENABLE_NLS")
598
599 Export('env install_prefix final_prefix config_prefix final_config_prefix libraries i18n version')
600
601 #
602 # the configuration file may be system dependent
603 #
604
605 conf = env.Configure ()
606
607 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers/CoreAudio.h'):
608     subst_dict['%JACK_BACKEND%'] = "coreaudio:Built-in Audio:in"
609 else:
610     subst_dict['%JACK_BACKEND%'] = "alsa_pcm:playback_"
611
612 env = conf.Finish()
613
614 rcbuild = env.SubstInFile ('ardour.rc','ardour.rc.in', SUBST_DICT = subst_dict)
615
616 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour_system.rc'))
617 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour.rc'))
618
619 Default (rcbuild)
620
621 # source tarball
622
623 Precious (env['DISTTREE'])
624
625 #
626 # note the special "cleanfirst" source name. this triggers removal
627 # of the existing disttree
628 #
629
630 env.Distribute (env['DISTTREE'],
631                 [ 'SConstruct',
632                   'COPYING', 'PACKAGER_README', 'README',
633                   'ardour.rc.in',
634                   'ardour_system.rc',
635                   'tools/config.guess'
636                   ] +
637                 glob.glob ('DOCUMENTATION/AUTHORS*') +
638                 glob.glob ('DOCUMENTATION/CONTRIBUTORS*') +
639                 glob.glob ('DOCUMENTATION/TRANSLATORS*') +
640                 glob.glob ('DOCUMENTATION/BUILD*') +
641                 glob.glob ('DOCUMENTATION/FAQ*') +
642                 glob.glob ('DOCUMENTATION/README*')
643                 )
644                 
645 srcdist = env.Tarball(env['TARBALL'], env['DISTTREE'])
646 env.Alias ('srctar', srcdist)
647 #
648 # don't leave the distree around 
649 #
650 env.AddPreAction (env['DISTTREE'], Action ('rm -rf ' + str (File (env['DISTTREE']))))
651 env.AddPostAction (srcdist, Action ('rm -rf ' + str (File (env['DISTTREE']))))
652
653 #
654 # the subdirs
655
656
657 for subdir in coredirs:
658     SConscript (subdir + '/SConscript')
659
660 for sublistdir in [subdirs2, gtk2_subdirs]:
661     for subdir in sublistdir:
662         SConscript (subdir + '/SConscript')
663
664 # cleanup
665 env.Clean ('scrub', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log'])
666