1 # -*- python -*- =======================================================
3 # CONTENTS: scons build script for SuperCollider
4 # AUTHOR: sk AT k-hornz DOT de
5 # modifications: nescivi AT gmail DOT com
6 # ======================================================================
8 # ======================================================================
9 # NOTE: Please use an indentation level of 4 spaces, i.e. no mixing of
11 # ======================================================================
13 # ======================================================================
15 # ======================================================================
17 EnsureSConsVersion(0,96)
18 EnsurePythonVersion(2,3)
21 # ======================================================================
23 # ======================================================================
31 import platform
# Seems to have more portable uname() than os
33 # ======================================================================
35 # ======================================================================
37 PACKAGE
= 'SuperCollider'
42 VERSION
= f
.readline()
45 def short_cpu_name(cpu
):
46 if cpu
== 'Power Macintosh':
50 PLATFORM
= platform
.uname()[0].lower()
51 CPU
= short_cpu_name(platform
.uname()[4])
55 ANY_FILE_RE
= re
.compile('.*')
56 HELP_FILE_RE
= re
.compile('.*\.(rtf(d)?|scd|html)$')
57 SC_FILE_RE
= re
.compile('.*\.sc$')
58 SRC_FILE_RE
= re
.compile('.*\.(c(pp)|h)$')
60 if PLATFORM
== 'darwin':
61 PLATFORM_SYMBOL
= 'SC_DARWIN'
63 DEFAULT_AUDIO_API
= 'coreaudio'
64 DEFAULT_PREFIX
= '/usr/local'
65 elif PLATFORM
== 'freebsd':
66 PLATFORM_SYMBOL
= 'SC_FREEBSD'
68 DEFAULT_AUDIO_API
= 'jack'
69 DEFAULT_PREFIX
= '/usr/local'
70 elif PLATFORM
== 'linux':
71 PLATFORM_SYMBOL
= 'SC_LINUX'
73 DEFAULT_AUDIO_API
= 'jack'
74 DEFAULT_PREFIX
= '/usr/local'
75 elif PLATFORM
== 'windows':
76 PLATFORM_SYMBOL
= 'SC_WIN32'
78 DEFAULT_AUDIO_API
= 'portaudio'
81 print 'Unknown platform: %s' % PLATFORM
84 if CPU
in [ 'ppc' , 'ppc64' ]:
85 DEFAULT_OPT_ARCH
= '7450'
86 elif CPU
in [ 'i586', 'i686' ]:
87 # FIXME: better detection
88 DEFAULT_OPT_ARCH
= CPU
90 DEFAULT_OPT_ARCH
= None
92 if PLATFORM
!= 'windows':
93 subprocess
.call(['sh', 'setMainVersion.sh'])
96 # ======================================================================
98 # ======================================================================
101 def make_os_env(*keys
):
109 def CheckPKGConfig(context
, version
):
110 context
.Message( 'Checking for pkg-config... ' )
111 ret
= context
.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version
)[0]
112 context
.Result( ret
)
115 def CheckPKG(context
, name
):
116 context
.Message('Checking for %s... ' % name
)
117 ret
= context
.TryAction('pkg-config --exists \'%s\'' % name
)[0]
120 res
= Environment(ENV
= make_os_env('PATH', 'PKG_CONFIG_PATH'))
121 res
.ParseConfig('pkg-config --cflags --libs \'%s\'' % name
)
122 res
['PKGCONFIG'] = name
126 def get_new_pkg_env():
127 return Environment(ENV
= make_os_env('PATH', 'PKG_CONFIG_PATH'))
129 def merge_lib_info(env
, *others
):
131 env
.AppendUnique(CCFLAGS
= other
.get('CCFLAGS', []))
132 env
.AppendUnique(CPPDEFINES
= other
.get('CPPDEFINES', []))
133 env
.AppendUnique(CPPPATH
= other
.get('CPPPATH', []))
134 env
.AppendUnique(CXXFLAGS
= other
.get('CXXFLAGS', []))
135 env
.AppendUnique(LIBS
= other
.get('LIBS', []))
136 env
.AppendUnique(LIBPATH
= other
.get('LIBPATH', []))
137 env
['LINKFLAGS'] = env
['LINKFLAGS'] + other
.get('LINKFLAGS', "")
139 def make_pkgconfig_requires(*envs
):
142 if env
and env
.has_key('PKGCONFIG'):
143 res
.append(env
['PKGCONFIG'])
146 def build_pkgconfig_file(target
, source
, env
):
147 def write_field(file, name
, prefix
, separator
=None):
148 if env
.has_key(name
):
150 content
= separator
.join(env
[name
])
153 file.write('%s%s\n' % (prefix
, content
))
154 out
= file(str(target
[0]), 'w')
156 'prefix=%s\n' % env
['PREFIX'],
157 'exec_prefix=${prefix}\n',
158 'libdir=${exec_prefix}/lib\n',
159 'includedir=${prefix}/include/%s\n' % env
['PACKAGE'],
161 write_field(out
, 'PKGCONFIG_NAME', 'Name: ')
162 write_field(out
, 'PKGCONFIG_DESC', 'Description: ')
163 write_field(out
, 'URL', 'URL: ')
164 write_field(out
, 'VERSION', 'Version: ')
165 write_field(out
, 'PKGCONFIG_REQUIRES', 'Requires: ', ', ')
166 write_field(out
, 'PKGCONFIG_REQUIRES_PRIVATE', 'Requires.private: ', ', ')
167 write_field(out
, 'PKGCONFIG_LIBS', 'Libs: -L${libdir} ', ' ')
168 write_field(out
, 'PKGCONFIG_LIBS_PRIVATE', 'Libs.private: ', ' ')
169 write_field(out
, 'PKGCONFIG_CFLAGS', 'Cflags: ', ' ')
172 def flatten_dir(dir):
174 for root
, dirs
, files
in os
.walk(dir):
175 if 'CVS' in dirs
: dirs
.remove('CVS')
176 if '.svn' in dirs
: dirs
.remove('.svn')
178 res
.append(os
.path
.join(root
, f
))
181 def install_dir(env
, src_dir
, dst_dir
, filter_re
, strip_levels
=0):
183 for root
, dirs
, files
in os
.walk(src_dir
):
186 if 'CVS' in dirs
: dirs
.remove('CVS')
187 if '.svn' in dirs
: dirs
.remove('.svn')
189 if filter_re
.match(d
):
190 src_paths
+= flatten_dir(os
.path
.join(root
, d
))
193 if filter_re
.match(f
):
194 src_paths
.append(os
.path
.join(root
, f
))
199 *f
.split(os
.path
.sep
)[strip_levels
:]),
201 nodes
+= env
.InstallAs(dst_paths
, src_paths
)
205 pat
= re
.compile('^install.*$')
206 for x
in COMMAND_LINE_TARGETS
:
207 if pat
.match(x
): return True
210 def is_home_directory(dir):
211 return os
.path
.normpath(dir) == os
.path
.normpath(os
.environ
.get('HOME', '/'))
214 return os
.path
.join(prefix
, 'bin')
216 return os
.path
.join(prefix
, 'lib')
218 def pkg_data_dir(prefix
, *args
):
219 if PLATFORM
== 'darwin':
220 base
= '/Library/Application Support'
221 if is_home_directory(prefix
):
222 base
= os
.path
.join(prefix
, base
)
224 base
= os
.path
.join(prefix
, 'share')
225 return os
.path
.join(base
, PACKAGE
, *args
)
226 def pkg_doc_dir(prefix
, *args
):
227 if PLATFORM
== 'darwin':
228 base
= '/Library/Documentation'
229 if is_home_directory(prefix
):
230 base
= os
.path
.join(prefix
, base
)
232 base
= os
.path
.join(prefix
, 'share', 'doc')
233 return os
.path
.join(base
, PACKAGE
, *args
)
234 def pkg_include_dir(prefix
, *args
):
235 return os
.path
.join(prefix
, 'include', PACKAGE
, *args
)
236 def pkg_lib_dir(prefix
, *args
):
237 return os
.path
.join(lib_dir(prefix
), PACKAGE
, *args
)
239 def pkg_classlib_dir(prefix
, *args
):
240 return pkg_data_dir(prefix
, 'SCClassLibrary', *args
)
241 def pkg_extension_dir(prefix
, *args
):
242 return pkg_data_dir(prefix
, 'Extensions', *args
)
244 def make_opt_flags(env
):
247 ## "-fomit-frame-pointer", # can behave strangely for sclang
251 arch
= env
.get('OPT_ARCH')
253 if CPU
in [ 'ppc' , 'ppc64' ]:
254 flags
.extend([ "-mcpu=%s" % (arch
,) ])
256 flags
.extend([ "-march=%s" % (arch
,) ])
257 if CPU
in [ 'ppc' , 'ppc64' ]:
258 flags
.extend([ "-fsigned-char", "-mhard-float",
259 ## "-mpowerpc-gpopt", # crashes sqrt
264 def make_static_object(env
, source
, postfix
="_a"):
265 obj
= os
.path
.splitext(source
)[0] + postfix
266 return env
.StaticObject(obj
, source
)
268 def make_static_objects(env
, sources
, postfix
="_a"):
269 return map(lambda x
: make_static_object(env
, x
, postfix
), sources
)
271 # ======================================================================
272 # command line options
273 # ======================================================================
275 opts
= Options('scache.conf', ARGUMENTS
)
278 'Build with ALSA sequencer support', 1),
279 BoolOption('ALTIVEC',
280 'Build with Altivec support', 1),
281 ('OPT_ARCH', 'Architecture to optimize for', DEFAULT_OPT_ARCH
),
282 EnumOption('AUDIOAPI',
283 'Build with specified audio API support',
284 DEFAULT_AUDIO_API
, ('jack', 'coreaudio', 'portaudio')),
285 ('CC', 'C compiler executable'),
286 ('CCFLAGS', 'C compiler flags'),
287 ('CXX', 'C++ compiler executable'),
288 ('CXXFLAGS', 'C++ compiler flags'),
290 'Build with debugging information', 0),
291 PathOption('DESTDIR',
292 'Intermediate installation prefix for packaging', '/'),
293 BoolOption('DEVELOPMENT',
294 'Build and install the development files', 0),
296 'Use the FFTW libraries', PLATFORM
!= 'darwin'),
297 BoolOption('JACK_DLL',
298 'Build with delay locked loop support', 0),
299 BoolOption('JACK_DEBUG_DLL',
300 'Build with delay locked loop debugging support', 0),
302 'Build the language application', 1),
304 'Build with Linux Input Device support [linux]', PLATFORM
== 'linux'),
306 'Build with Linux WII support [linux]', PLATFORM
== 'linux'),
308 'Installation prefix', DEFAULT_PREFIX
),
309 BoolOption('RENDEZVOUS',
310 'Enable Zeroconf/Rendezvous.', 1),
312 'Enable the SCEL user interface; NOTE for the HTML help system you need emacs-w3m', 1),
314 'Enable the SCVIM user interface; NOTE see the README in /editors/scvim for setting variables', 1),
316 'Enable the SCED (based on gedit) user interface', 0),
318 'Build with SSE support', 1),
320 'Strip symbols from binaries', 0),
321 BoolOption('CROSSCOMPILE',
322 'Crosscompile for another platform (does not do SSE support check)', 0),
323 BoolOption('TERMINAL_CLIENT',
324 'Build with terminal client interface', 1),
326 'Build with libcurl - allows server to load files from remote servers by URL', 0),
328 'Build with X11 support', 1)
331 if PLATFORM
== 'darwin':
333 BoolOption('UNIVERSAL',
334 'Build universal binaries (see UNIVERSAL_ARCHS)', 1),
335 BoolOption('INTERNAL_LIBSNDFILE',
336 'Use internal version of libsndfile', 1),
337 # ListOption('UNIVERSAL_ARCHS',
338 # 'Architectures to build for',
339 # 'all', ['ppc', 'i386'])
342 # ======================================================================
344 # ======================================================================
346 env
= Environment(options
= opts
,
347 ENV
= make_os_env('PATH', 'PKG_CONFIG_PATH'),
350 URL
= 'http://supercollider.sourceforge.net',
351 TARBALL
= PACKAGE
+ VERSION
+ '.tbz2')
352 env
.Append(PATH
= ['/usr/local/bin', '/usr/bin', '/bin'])
354 # checks for DISTCC and CCACHE as used in modern linux-distros:
356 if os
.path
.exists('/usr/lib/distcc/bin'):
357 os
.environ
['PATH'] = '/usr/lib/distcc/bin:' + os
.environ
['PATH']
358 #env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
359 env
['ENV']['DISTCC_HOSTS'] = os
.environ
.get('DISTCC_HOSTS')
361 if os
.path
.exists('/usr/lib/ccache/bin'):
362 os
.environ
['PATH'] = '/usr/lib/ccache/bin:' + os
.environ
['PATH']
363 #env['ENV']['CCACHE_DIR'] = os.environ['CCACHE_DIR']
364 env
['ENV']['CCACHE_DIR'] = os
.environ
.get('CCACHE_DIR')
366 env
['ENV']['PATH'] = os
.environ
['PATH']
367 if PLATFORM
== 'windows':
368 env
['ENV']['HOME'] = os
.environ
['HOMEPATH']
370 env
['ENV']['HOME'] = os
.environ
['HOME']
372 if PLATFORM
== 'linux':
373 env
['amd64'] = platform
.uname()[2].find( 'amd64' ) > 0
375 print "we are on amd64 linux"
378 # ======================================================================
379 # installation directories
380 # ======================================================================
382 FINAL_PREFIX
= '$PREFIX'
383 INSTALL_PREFIX
= os
.path
.join('$DESTDIR', '$PREFIX')
385 if env
['PREFIX'] == '/usr':
386 FINAL_CONFIG_PREFIX
= '/etc'
388 FINAL_CONFIG_PREFIX
= os
.path
.join(env
['PREFIX'], 'etc')
389 CONFIG_PREFIX
= '$DESTDIR' + FINAL_CONFIG_PREFIX
392 CPPDEFINES
= [('SC_DATA_DIR', '\\"' + pkg_data_dir(FINAL_PREFIX
) + '\\"')])
394 # ======================================================================
396 # ======================================================================
399 return Configure(env
, custom_tests
= { 'CheckPKGConfig' : CheckPKGConfig
,
400 'CheckPKG' : CheckPKG
})
402 def isDefaultBuild():
403 return not env
.GetOption('clean') and not 'debian' in COMMAND_LINE_TARGETS
405 conf
= make_conf(env
)
412 if not conf
.CheckPKGConfig('0'):
413 print 'pkg-config not found.'
417 if PLATFORM
== 'darwin' and env
['INTERNAL_LIBSNDFILE']:
418 libraries
['sndfile'] = Environment(LINKFLAGS
= ['libsndfile/libsndfile.a'],
419 CPPPATH
= ['#libsndfile'])
421 success
, libraries
['sndfile'] = conf
.CheckPKG('sndfile >= 1.0.16')
422 if not success
: Exit(1)
423 succes2
, libraries
['sndfile18'] = conf
.CheckPKG('sndfile >= 1.0.18')
425 libraries
['sndfile'].Append(CPPDEFINES
= ['LIBSNDFILE_1018'])
428 success
, libraries
['libcurl'] = conf
.CheckPKG('libcurl >= 7')
429 if env
['CURL'] and not success
:
430 print 'CURL option was set, but libcurl not found.'
434 success
, libraries
['fftwf'] = conf
.CheckPKG('fftw3f')
437 libraries
['fftwf'].Append(CPPDEFINES
= ['SC_FFT_FFTW'])
438 elif PLATFORM
== 'darwin':
439 libraries
['fftwf'] = Environment()
443 libraries
['fftwf'] = Environment()
444 if PLATFORM
== 'darwin':
445 # needed for vector multiplication
446 libraries
['fftwf'].Append(LINKFLAGS
= '-framework vecLib')
448 libraries
['sndfile'] = get_new_pkg_env()
449 libraries
['fftwf'] = get_new_pkg_env()
450 libraries
['libcurl'] = get_new_pkg_env()
453 if env
['AUDIOAPI'] == 'jack':
454 features
['audioapi'] = 'Jack'
455 success
, libraries
['audioapi'] = conf
.CheckPKG('jack >= 0.100')
457 libraries
['audioapi'].Append(
458 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_JACK')],
459 ADDITIONAL_SOURCES
= ['Source/server/SC_Jack.cpp']
462 success
, libraries
['audioapi'] = conf
.CheckPKG('jack')
464 if not success
: Exit(1)
466 libraries
['audioapi'] = get_new_pkg_env()
467 libraries
['audioapi'].Append(
468 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_JACK'),
469 'SC_USE_JACK_CLIENT_NEW'],
470 ADDITIONAL_SOURCES
= ['Source/server/SC_Jack.cpp']
472 libraries
['audioapi'].Append(
473 CPPDEFINES
= [('SC_JACK_USE_DLL', env
['JACK_DLL']),
474 ('SC_JACK_DEBUG_DLL', env
['JACK_DEBUG_DLL'])]
476 elif env
['AUDIOAPI'] == 'coreaudio':
477 features
['audioapi'] = 'CoreAudio'
478 libraries
['audioapi'] = Environment(
479 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_COREAUDIO')],
480 LINKFLAGS
= '-framework CoreAudio',
481 ADDITIONAL_SOURCES
= []
483 elif env
['AUDIOAPI'] == 'portaudio':
484 features
['audioapi'] = 'Portaudio'
485 libraries
['audioapi'] = Environment(
486 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_PORTAUDIO')],
487 LIBS
= ['portaudio'],
488 ADDITIONAL_SOURCES
= []
492 if env
['RENDEZVOUS']:
493 features
['rendezvous'], libraries
['rendezvous'] = conf
.CheckPKG('avahi-client')
494 if features
['rendezvous']:
495 libraries
['rendezvous'].Append(CPPDEFINES
= ['HAVE_AVAHI'])
497 features
['rendezvous'], libraries
['rendezvous'] = conf
.CheckPKG('howl')
498 if features
['rendezvous']:
499 libraries
['rendezvous'].Append(CPPDEFINES
= ['HAVE_HOWL'])
501 features
['rendezvous'] = False
502 libraries
['rendezvous'] = False
506 features
['alsa'], libraries
['alsa'] = conf
.CheckPKG('alsa')
508 features
['alsa'] = False
511 libraries
['alsa'].Append(CPPDEFINES
= ['HAVE_ALSA'])
514 if conf
.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
515 features
['midiapi'] = 'CoreMIDI'
516 libraries
['midiapi'] = Environment(
517 LINKFLAGS
= '-framework CoreMIDI',
519 elif features
['alsa']:
520 features
['midiapi'] = 'ALSA'
521 libraries
['midiapi'] = libraries
['alsa'].Clone()
523 features
['midiapi'] = None
526 features
['lid'] = env
['LID'] and conf
.CheckCHeader('linux/input.h')
529 if PLATFORM
== 'linux':
530 features
['wii'] = env
['WII'] and conf
.CheckCHeader('cwiid.h')
532 features
['wii'] = env
['WII']
534 # only _one_ Configure context can be alive at a time
539 if PLATFORM
== 'darwin':
540 altivec_flags
= [ '-faltivec' ]
542 altivec_flags
= [ '-maltivec', '-mabi=altivec' ]
543 libraries
['altivec'] = env
.Clone()
544 libraries
['altivec'].Append(
545 CCFLAGS
= altivec_flags
,
546 CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 16)])
547 altiConf
= Configure(libraries
['altivec'])
548 features
['altivec'] = altiConf
.CheckCHeader('altivec.h')
551 features
['altivec'] = False
555 libraries
['sse'] = env
.Clone()
556 libraries
['sse'].Append(
557 CCFLAGS
= ['-msse', '-mfpmath=sse'],
558 CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 16)])
559 sseConf
= Configure(libraries
['sse'])
560 hasSSEHeader
= sseConf
.CheckCHeader('xmmintrin.h')
561 if env
['CROSSCOMPILE']:
562 build_host_supports_sse
= True
563 print 'NOTICE: cross compiling for another platform: assuming SSE support'
565 build_host_supports_sse
= False
567 if CPU
not in [ 'ppc' , 'ppc64' ]:
568 if PLATFORM
== 'freebsd':
569 machine_info
= os
.popen ("sysctl -a hw.instruction_sse").read()[:-1]
571 if "1" in [x
for x
in machine_info
]:
572 build_host_supports_sse
= True
574 elif PLATFORM
!= 'darwin':
575 flag_line
= os
.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
576 x86_flags
= flag_line
.split (": ")[1:][0].split ()
578 machine_info
= os
.popen ("sysctl -a machdep.cpu").read()[:-1]
579 x86_flags
= machine_info
.split()
580 if "sse" in [x
.lower() for x
in x86_flags
]:
581 build_host_supports_sse
= True
582 print 'NOTICE: CPU has SSE support'
584 print 'NOTICE: CPU does not have SSE support'
585 features
['sse'] = hasSSEHeader
and build_host_supports_sse
588 features
['sse'] = False
591 if type(env
['X11']) != types
.StringType
:
592 if os
.path
.exists('/usr/X11R6'):
593 env
['X11'] = '/usr/X11R6'
594 else: env
['X11'] = '/usr'
595 x11Env
= Environment(
596 CPPPATH
= [os
.path
.join(env
['X11'], 'include')],
597 LIBPATH
= [os
.path
.join(env
['X11'], 'lib')])
598 x11Conf
= Configure(x11Env
)
599 features
['x11'] = x11Conf
.CheckCHeader('X11/Intrinsic.h') \
600 and x11Conf
.CheckLib('X11', 'XQueryPointer')
601 libraries
['x11'] = x11Conf
.Finish()
603 features
['x11'] = False
607 opts
.Save('scache.conf', env
)
608 Help(opts
.GenerateHelpText(env
))
610 # defines and compiler flags
613 CPPDEFINES
= [ '_REENTRANT', PLATFORM_SYMBOL
],
614 CCFLAGS
= [ '-Wno-unknown-pragmas' ],
615 CXXFLAGS
= [ '-Wno-deprecated' ]
620 env
.Append(CCFLAGS
= '-g')
623 CCFLAGS
= make_opt_flags(env
),
624 CPPDEFINES
= ['NDEBUG'])
626 env
.Append(LINKFLAGS
= "-Wl,-s")
629 if False: #PLATFORM == 'darwin':
630 # universal binary support
632 archs
= map(lambda x
: ['-arch', x
], ['ppc', 'i386'])
639 if features
['altivec']:
640 merge_lib_info(env
, libraries
['altivec'])
641 elif features
['sse']:
642 merge_lib_info(env
, libraries
['sse'])
644 env
.AppendUnique(CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 1)])
646 # ======================================================================
648 # ======================================================================
650 commonEnv
= env
.Clone()
652 CPPPATH
= ['#Headers/common',
653 '#Headers/plugin_interface',
660 conf
= Configure(commonEnv
)
661 if conf
.CheckFunc('strtod'):
663 CPPDEFINES
= 'HAVE_STRTOD'
665 commonEnv
= conf
.Finish()
667 # ======================================================================
668 # Source/common dtoa.c (needs other flags)
669 # ======================================================================
671 dtoaEnv
= commonEnv
.Clone()
673 dtoaCCFDict
= dtoaEnv
.Dictionary('CCFLAGS')
675 dtoaCCFDict
.remove('-O3')
676 dtoaEnv
.Replace(CCFLAGS
= dtoaCCFDict
)
678 dtoaSources
= Split('''
681 dtoaEnv
.StaticObject('dtoa.o', dtoaSources
)
683 # ======================================================================
685 # ======================================================================
687 commonSources
= Split('''
688 Source/common/SC_AllocPool.cpp
689 Source/common/SC_DirUtils.cpp
690 Source/common/SC_Sem.cpp
691 Source/common/SC_StringBuffer.cpp
692 Source/common/SC_StringParser.cpp
693 Source/common/g_fmt.c
694 Source/common/scsynthsend.cpp
696 Source/common/sc_popen.cpp
698 if PLATFORM
== 'darwin':
700 'Source/common/SC_StandAloneInfo_Darwin.cpp'
703 commonEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
704 merge_lib_info(commonEnv
, libraries
['libcurl'])
705 libcommon
= commonEnv
.Library('build/common', commonSources
)
708 #commonSources32 = list(commonSources)
709 #commonEnv32 = commonEnv.Clone()
713 #libcommon32 = commonEnv32.Library('build/common32', commonSources32)
716 # ======================================================================
718 # ======================================================================
720 serverEnv
= env
.Clone()
722 CPPPATH
= ['#Headers/common',
723 '#Headers/plugin_interface',
725 CPPDEFINES
= [('SC_PLUGIN_DIR', '\\"' + pkg_lib_dir(FINAL_PREFIX
, 'plugins') + '\\"'), ('SC_PLUGIN_EXT', '\\"' + PLUGIN_EXT
+ '\\"')],
727 libscsynthEnv
= serverEnv
.Clone(
728 PKGCONFIG_NAME
= 'libscsynth',
729 PKGCONFIG_DESC
= 'SuperCollider synthesis server library',
730 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
731 PKGCONFIG_REQUIRES
= make_pkgconfig_requires(libraries
['sndfile'],
732 libraries
['audioapi'],
733 libraries
['rendezvous']),
734 PKGCONFIG_LIBS
= ['-lscsynth'],
735 # PKGCONFIG_LIBS_PRIVATE = ['-lm', '-lpthread', '-ldl'],
736 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/server']
741 # functionality of libdl is included in libc on freebsd
742 if PLATFORM
== 'freebsd':
743 serverEnv
.Append(LIBS
= ['common', 'pthread'])
745 serverEnv
.Append(LIBS
= ['common', 'pthread', 'dl'])
747 if PLATFORM
== 'darwin':
750 '-framework', 'CoreServices'])
751 #'-dylib_install_name', FINAL_PREFIX + '/lib/libsclang.dylib'])
752 elif PLATFORM
== 'linux':
754 CPPDEFINES
= [('SC_PLUGIN_LOAD_SYM', '\\"load\\"')],
755 LINKFLAGS
= '-Wl,-rpath,' + FINAL_PREFIX
+ '/lib')
757 elif PLATFORM
== 'freebsd':
758 serverEnv
.Append(CPPDEFINES
= [('SC_PLUGIN_LOAD_SYM', '\\"load\\"')])
763 libraries
['sndfile'], libraries
['audioapi'])
766 if features
['rendezvous']:
767 serverEnv
.Append(CPPDEFINES
= ['USE_RENDEZVOUS'])
768 merge_lib_info(serverEnv
, libraries
['rendezvous'])
771 serverEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
772 merge_lib_info(serverEnv
, libraries
['libcurl'])
774 libscsynthSources
= Split('''
775 Source/server/Rendezvous.cpp
776 Source/server/Samp.cpp
777 Source/server/SC_BufGen.cpp
778 Source/server/SC_Carbon.cpp
779 Source/server/SC_Complex.cpp
780 Source/server/SC_ComPort.cpp
781 Source/server/SC_CoreAudio.cpp
782 Source/server/SC_Dimension.cpp
783 Source/server/SC_Errors.cpp
784 Source/server/SC_Graph.cpp
785 Source/server/SC_GraphDef.cpp
786 Source/server/SC_Group.cpp
787 Source/server/SC_Lib_Cintf.cpp
788 Source/server/SC_Lib.cpp
789 Source/server/SC_MiscCmds.cpp
790 Source/server/SC_Node.cpp
791 Source/server/SC_Rate.cpp
792 Source/server/SC_SequencedCommand.cpp
793 Source/server/SC_Str4.cpp
794 Source/server/SC_SyncCondition.cpp
795 Source/server/SC_Unit.cpp
796 Source/server/SC_UnitDef.cpp
797 Source/server/SC_World.cpp
798 ''') + libraries
['audioapi']['ADDITIONAL_SOURCES']
800 scsynthSources
= ['Source/server/scsynth_main.cpp']
802 libscsynth
= serverEnv
.SharedLibrary('build/scsynth', libscsynthSources
)
803 env
.Alias('install-programs', env
.Install(lib_dir(INSTALL_PREFIX
), [libscsynth
]))
805 libscsynthStaticSources
= libscsynthSources
+ make_static_objects(serverEnv
, commonSources
, "_libscsynthStatic");
806 libscsynthStatic
= serverEnv
.StaticLibrary('build/scsynth', libscsynthStaticSources
)
807 env
.Alias('install-programs', env
.Install(lib_dir(INSTALL_PREFIX
), [libscsynthStatic
]))
809 scsynth
= serverEnv
.Program('build/scsynth', scsynthSources
, LIBS
= ['scsynth'])
810 env
.Alias('install-programs', env
.Install(bin_dir(INSTALL_PREFIX
), [scsynth
]))
812 # ======================================================================
814 # ======================================================================
816 pluginEnv
= env
.Clone(
818 SHLIBSUFFIX
= PLUGIN_EXT
821 CPPPATH
= ['#Headers/common',
822 '#Headers/plugin_interface',
824 PKGCONFIG_NAME
= 'libscplugin',
825 PKGCONFIG_DESC
= 'SuperCollider synthesis plugin headers',
826 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
827 #PKGCONFIG_REQUIRES = make_pkgconfig_requires(libraries['scsynth']),
828 #PKGCONFIG_LIBS = [],
829 # PKGCONFIG_LIBS_PRIVATE = ['-lm', '-lpthread', '-ldl'],
830 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/server']
832 if PLATFORM
== 'darwin':
833 pluginEnv
['SHLINKFLAGS'] = '$LINKFLAGS -bundle -flat_namespace -undefined suppress'
835 if PLATFORM
== 'freebsd':
838 libraries
['sndfile'])
843 def make_plugin_target(name
):
844 return os
.path
.join('build', 'plugins', name
)
847 for name
in Split('''
861 PhysicalModelingUGens
869 pluginEnv
.SharedLibrary(
870 make_plugin_target(name
), os
.path
.join('Source', 'plugins', name
+ '.cpp')))
873 complexEnv
= pluginEnv
.Clone()
874 complexSources
= Split('Source/plugins/SCComplex.cpp')
875 complexEnv
.SharedObject('Source/plugins/SCComplex.o', complexSources
)
878 fftEnv
= pluginEnv
.Clone()
879 fftSources
= Split('Source/common/SC_fftlib.cpp Source/plugins/SCComplex.o')
880 merge_lib_info(fftEnv
, libraries
['fftwf'])
882 fftEnv
.SharedLibrary(
883 make_plugin_target('FFT_UGens'),
884 ['Source/plugins/FFTInterfaceTable.cpp',
885 'Source/plugins/FFT_UGens.cpp',
886 'Source/plugins/PV_UGens.cpp',
887 'Source/plugins/PartitionedConvolution.cpp'] + fftSources
))
890 fftEnv
.SharedLibrary(
891 make_plugin_target('PV_ThirdParty'),
892 ['Source/plugins/Convolution.cpp',
893 'Source/plugins/FFT2InterfaceTable.cpp',
894 'Source/plugins/FeatureDetection.cpp',
895 'Source/plugins/PV_ThirdParty.cpp'] + fftSources
))
897 # fft 'unpacking' ugens
899 pluginEnv
.SharedLibrary(
900 make_plugin_target('UnpackFFTUGens'), ['Source/plugins/SCComplex.o', 'Source/plugins/UnpackFFTUGens.cpp']))
902 # machine listening ugens
904 mlEnv
= pluginEnv
.Clone()
905 mlSources
= Split('Source/plugins/ML.cpp Source/plugins/Loudness.cpp Source/plugins/BeatTrack.cpp Source/plugins/Onsets.cpp Source/plugins/onsetsds.c Source/plugins/KeyTrack.cpp Source/plugins/MFCC.cpp Source/plugins/SCComplex.o Source/plugins/BeatTrack2.cpp Source/plugins/ML_SpecStats.cpp')
908 make_plugin_target('ML_UGens'), mlSources
))
911 diskIOEnv
= pluginEnv
.Clone(
912 LIBS
= ['common', 'm'],
915 if PLATFORM
== 'darwin':
917 LINKFLAGS
= '-framework CoreServices'
921 diskIOEnv
.SharedObject('Source/plugins/SC_SyncCondition', 'Source/server/SC_SyncCondition.cpp'),
922 'Source/plugins/DiskIO_UGens.cpp']
923 merge_lib_info(diskIOEnv
, libraries
['sndfile'])
925 diskIOEnv
.SharedLibrary(
926 make_plugin_target('DiskIO_UGens'), diskIOSources
))
929 if PLATFORM
== 'darwin':
930 uiUGensEnv
= pluginEnv
.Clone(
932 LINKFLAGS
= '-framework CoreServices -framework Carbon'
935 uiUGensEnv
.SharedLibrary(make_plugin_target('MouseUGens'), 'Source/plugins/MouseUGens.cpp'))
937 uiUGensEnv
.SharedLibrary(make_plugin_target('KeyboardUGens'), 'Source/plugins/KeyboardUGens.cpp'))
938 elif features
['x11']:
939 uiUGensEnv
= pluginEnv
.Clone()
940 merge_lib_info(uiUGensEnv
, libraries
['x11'])
942 uiUGensEnv
.SharedLibrary(make_plugin_target('MouseUGens'), 'Source/plugins/MouseUGens.cpp'))
944 uiUGensEnv
.SharedLibrary(make_plugin_target('KeyboardUGens'), 'Source/plugins/KeyboardUGens.cpp'))
946 env
.Alias('install-plugins', env
.Install(
947 pkg_lib_dir(INSTALL_PREFIX
, 'plugins'), plugins
))
949 # ======================================================================
951 # ======================================================================
953 if env
['TERMINAL_CLIENT'] == True:
954 env
['TERMINAL_CLIENT'] = 1
956 env
['TERMINAL_CLIENT'] = 0
958 langEnv
= env
.Clone()
960 CPPPATH
= ['#Headers/common',
961 '#Headers/plugin_interface',
964 '#Source/lang/LangSource/Bison'],
965 CPPDEFINES
= [['USE_SC_TERMINAL_CLIENT', env
['TERMINAL_CLIENT']]],
969 if env
.has_key('amd64') and env
['amd64']:
970 langEnv
.Append( CXXFLAGS
= ['-m32'] )
972 # functionality of libdl is included in libc on freebsd
973 if PLATFORM
== 'freebsd':
974 langEnv
.Append(LIBS
= ['common', 'scsynth', 'pthread', 'm'])
976 langEnv
.Append(LIBS
= ['common', 'scsynth', 'pthread', 'dl', 'm'])
978 if PLATFORM
== 'darwin':
981 LINKFLAGS
= ['-framework', 'CoreServices'], #'-dylib_install_name', FINAL_PREFIX + '/lib/libsclang.dylib'],
982 CPPPATH
= ['#Headers/icu/unicode'])
983 elif PLATFORM
== 'linux':
985 LINKFLAGS
= '-Wl,-rpath,build -Wl,-rpath,' + FINAL_PREFIX
+ '/lib')
986 elif PLATFORM
== 'freebsd':
988 LINKFLAGS
= '-Wl,-rpath,build -Wl,-rpath,' + FINAL_PREFIX
+ '/lib')
991 langEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
992 merge_lib_info(langEnv
, libraries
['libcurl'])
994 merge_lib_info(langEnv
, libraries
['audioapi'])
996 libsclangEnv
= langEnv
.Clone(
997 PKGCONFIG_NAME
= 'libsclang',
998 PKGCONFIG_DESC
= 'SuperCollider synthesis language library',
999 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
1000 PKGCONFIG_REQUIRES
= make_pkgconfig_requires(libraries
['sndfile']) + ['libscsynth'],
1001 PKGCONFIG_LIBS
= ['-lsclang'],
1002 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/lang', '-I${includedir}/server']
1005 # required libraries
1006 merge_lib_info(langEnv
, libraries
['sndfile'])
1008 libsclangSources
= Split('''
1009 Source/lang/LangSource/AdvancingAllocPool.cpp
1010 Source/lang/LangSource/ByteCodeArray.cpp
1011 Source/lang/LangSource/DumpParseNode.cpp
1012 Source/lang/LangSource/GC.cpp
1013 Source/lang/LangSource/InitAlloc.cpp
1014 Source/lang/LangSource/PyrFileUtils.cpp
1015 Source/lang/LangSource/PyrInterpreter3.cpp
1016 Source/lang/LangSource/PyrLexer.cpp
1017 Source/lang/LangSource/PyrMathOps.cpp
1018 Source/lang/LangSource/PyrMathSupport.cpp
1019 Source/lang/LangSource/PyrMessage.cpp
1020 Source/lang/LangSource/PyrObject.cpp
1021 Source/lang/LangSource/PyrParseNode.cpp
1022 Source/lang/LangSource/PyrSignal.cpp
1023 Source/lang/LangSource/PyrSymbolTable.cpp
1024 Source/lang/LangSource/SC_LanguageClient.cpp
1025 Source/lang/LangSource/SC_LibraryConfig.cpp
1026 Source/lang/LangSource/SC_TerminalClient.cpp
1027 Source/lang/LangSource/Samp.cpp
1028 Source/lang/LangSource/SimpleStack.cpp
1029 Source/lang/LangSource/VMGlobals.cpp
1030 Source/lang/LangSource/alloca.cpp
1031 Source/lang/LangSource/dumpByteCodes.cpp
1032 Source/lang/LangSource/Bison/lang11d_tab.cpp
1033 Source/lang/LangPrimSource/SC_Wii.cpp
1034 Source/lang/LangPrimSource/PyrSignalPrim.cpp
1035 Source/lang/LangPrimSource/PyrSched.cpp
1036 Source/lang/LangPrimSource/PyrPrimitive.cpp
1037 Source/lang/LangPrimSource/PyrMathPrim.cpp
1038 Source/lang/LangPrimSource/SC_ComPort.cpp
1039 Source/lang/LangPrimSource/OSCData.cpp
1040 Source/lang/LangPrimSource/PyrArchiver.cpp
1041 Source/lang/LangPrimSource/PyrArrayPrimitives.cpp
1042 Source/lang/LangPrimSource/PyrBitPrim.cpp
1043 Source/lang/LangPrimSource/PyrCharPrim.cpp
1044 Source/lang/LangPrimSource/PyrFilePrim.cpp
1045 Source/lang/LangPrimSource/PyrListPrim.cpp
1046 Source/lang/LangPrimSource/PyrPlatformPrim.cpp
1047 Source/lang/LangPrimSource/PyrSerialPrim.cpp
1048 Source/lang/LangPrimSource/PyrStringPrim.cpp
1049 Source/lang/LangPrimSource/PyrUStringPrim.cpp
1050 Source/lang/LangPrimSource/PyrSymbolPrim.cpp
1051 Source/lang/LangPrimSource/PyrUnixPrim.cpp
1052 ''') + [libsclangEnv
.SharedObject('Source/lang/LangSource/fftlib', 'Source/common/fftlib.c')]
1055 if features
['midiapi']:
1056 merge_lib_info(langEnv
, libraries
['midiapi'])
1057 if features
['midiapi'] == 'CoreMIDI':
1058 libsclangSources
+= ['Source/lang/LangPrimSource/SC_CoreMIDI.cpp']
1060 libsclangSources
+= ['Source/lang/LangPrimSource/SC_AlsaMIDI.cpp']
1062 # fallback implementation
1063 libsclangSources
+= ['Source/lang/LangPrimSource/SC_AlsaMIDI.cpp']
1065 if PLATFORM
== 'darwin':
1067 CPPPATH
= ['#Source/lang/LangPrimSource/HID_Utilities',
1068 '#Source/lang/LangPrimSource/WiiMote_OSX'],
1069 LINKFLAGS
= '-framework Carbon -framework IOKit -framework IOBluetooth'
1071 libsclangSources
+= Split('''
1072 Source/lang/LangPrimSource/SC_HID.cpp
1073 Source/lang/LangPrimSource/SC_CoreAudioPrim.cpp
1074 Source/lang/LangPrimSource/HID_Utilities/HID_Error_Handler.c
1075 Source/lang/LangPrimSource/HID_Utilities/HID_Name_Lookup.c
1076 Source/lang/LangPrimSource/HID_Utilities/HID_Queue_Utilities.c
1077 Source/lang/LangPrimSource/HID_Utilities/HID_Utilities.c
1078 Source/lang/LangPrimSource/WiiMote_OSX/wiiremote.c
1082 langEnv
.Append(CPPDEFINES
= 'HAVE_WII')
1083 langEnv
.Append(LINKFLAGS
= '-lcwiid')
1084 #langEnv.Append(LINKFLAGS = '-lbluetooth')
1085 #langEnv.Append(CPPPATH = '-I/usr/local/include/libcwiimote-0.4.0/libcwiimote/' ) #FIXME: to proper include directory
1087 langEnv
.Append(CPPDEFINES
= 'HAVE_LID')
1088 libsclangSources
+= ['Source/lang/LangPrimSource/SC_LID.cpp']
1090 if PLATFORM
== 'darwin':
1091 langEnv
.Append(CPPDEFINES
= 'HAVE_SPEECH')
1092 libsclangSources
+= ['Source/lang/LangPrimSource/SC_Speech.cpp']
1094 sclangSources
= ['Source/lang/LangSource/cmdLineFuncs.cpp']
1097 libsclang
= langEnv
.SharedLibrary('build/sclang', libsclangSources
)
1098 env
.Alias('install-bin', env
.Install(lib_dir(INSTALL_PREFIX
), [libsclang
]))
1099 if PLATFORM
== 'darwin':
1100 sclangLibs
= ['scsynth', 'sclang']
1102 sclangLibs
= ['sclang']
1103 sclang
= langEnv
.Program('build/sclang', sclangSources
, LIBS
=sclangLibs
)
1104 env
.Alias('install-programs', env
.Install(bin_dir(INSTALL_PREFIX
), [sclang
]))
1106 # ======================================================================
1108 # ======================================================================
1110 # doxygen = env.Command(None, 'doc/doxygen/html/index.html', 'doxygen doc/doxygen/doxygen.cfg')
1111 # env.Alias('doxygen', doxygen)
1113 # ======================================================================
1115 # ======================================================================
1117 installEnv
= Environment(
1118 ALL
= ['install-bin', 'install-data'],
1119 BIN
= ['install-plugins', 'install-programs'],
1120 DATA
= ['install-doc']
1123 installEnv
.Append(DATA
= ['install-library'])
1127 env
.Alias('install-library', install_dir(
1128 env
, 'build/SCClassLibrary',
1129 pkg_data_dir(INSTALL_PREFIX
),
1132 env
.Alias('install-library', install_dir(
1134 pkg_data_dir(INSTALL_PREFIX
),
1137 env
.Alias('install-library', install_dir(
1138 env
, 'build/examples',
1139 pkg_data_dir(INSTALL_PREFIX
),
1143 env
.Alias('install-library', install_dir(
1144 env
, 'editors/scel/sc',
1145 pkg_extension_dir(INSTALL_PREFIX
, 'scel'),
1149 env
.Alias('install-library', install_dir(
1150 env
, 'editors/scvim/scclasses',
1151 pkg_extension_dir(INSTALL_PREFIX
, 'scvim'),
1155 env
.Alias('install-library', install_dir(
1156 env
, 'editors/scvim/cache/doc',
1157 pkg_data_dir(INSTALL_PREFIX
, 'scvim-help'),
1160 #scvim : unhtml help files
1162 #os.execvpe("editors/scvim/bin/scvim_make_help.rb", [ "-c", "-s", "build/Help"],"SCVIM=editors/scvim/")
1163 #os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
1166 #vimenv = env.Clone()
1167 #SConscript('editors/test/SConstruct', exports=['vimenv'])
1170 #print 'installing scvim'
1171 #vimenv = env.Clone()
1172 ##env.Append(FROMTOP=True)
1173 #SConscript('editors/scvim/SConstruct', exports=['vimenv'])
1176 SConscript('editors/scvim/SConstruct', exports
=['env'])
1179 SConscript('editors/sced/SConstruct', 'env')
1183 env
.Command('editors/scel/el/sclang-vars.el', 'editors/scel/el/sclang-vars.el.in',
1184 'sed \'s,@PKG_DATA_DIR@,%s,g\' < $SOURCE > $TARGET' %
1185 pkg_data_dir(FINAL_PREFIX
))
1186 el_files
= glob
.glob('editors/scel/el/*.el') + ['editors/scel/el/sclang-vars.el']
1187 elc_files
= map(lambda f
: os
.path
.splitext(f
)[0] + '.elc', el_files
)
1188 elisp_dir
= os
.path
.join(INSTALL_PREFIX
, 'share', 'emacs', 'site-lisp')
1189 env
.Command(elc_files
, el_files
,
1190 'emacs -batch --eval "(add-to-list \'load-path (expand-file-name \\"editors/scel/el/\\"))" -f batch-byte-compile $SOURCES')
1191 env
.Alias('install-elisp', env
.Install(elisp_dir
, el_files
+ elc_files
))
1192 installEnv
.Append(DATA
= 'install-elisp')
1194 # example library configuration file
1195 env
.Command('linux/examples/sclang.cfg', 'linux/examples/sclang.cfg.in',
1196 'sed \'s,@PKG_DATA_DIR@,%s,g\' < $SOURCE > $TARGET' %
1197 pkg_data_dir(FINAL_PREFIX
))
1200 if env
['DEVELOPMENT']:
1201 header_dirs
= Split('common plugin_interface server lang')
1202 if PLATFORM
== 'darwin':
1203 header_dirs
+= 'app'
1204 for d
in header_dirs
:
1205 env
.Alias('install-dev', install_dir(
1206 env
, os
.path
.join('Headers', d
),
1207 pkg_include_dir(INSTALL_PREFIX
),
1208 re
.compile('.*\.h(h|pp)?'), 1)
1210 # other useful headers
1211 env
.Alias('install-dev',
1212 env
.Install(pkg_include_dir(INSTALL_PREFIX
, 'plugin_interface'), 'Source/plugins/FFT_UGens.h'))
1214 libscsynthEnv
.Command('linux/libscsynth.pc', 'SConstruct',
1215 build_pkgconfig_file
),
1216 libsclangEnv
.Command('linux/libsclang.pc', 'SConstruct',
1217 build_pkgconfig_file
),
1218 pluginEnv
.Command('linux/libscplugin.pc', 'SConstruct',
1219 build_pkgconfig_file
)]
1220 pkgconfig_dir
= os
.path
.join(lib_dir(INSTALL_PREFIX
), 'pkgconfig')
1221 env
.Alias('install-dev', env
.Install(pkgconfig_dir
, pkgconfig_files
))
1222 installEnv
.Append(ALL
= 'install-dev')
1226 # TODO: build html documentation?
1227 doc_dir
= pkg_doc_dir(INSTALL_PREFIX
)
1228 env
.Alias('install-doc',
1229 install_dir(env
, 'doc', doc_dir
, ANY_FILE_RE
, 0) +
1230 install_dir(env
, 'build/examples', doc_dir
, ANY_FILE_RE
, 1) +
1231 install_dir(env
, 'build/TestingAndToDo', doc_dir
, ANY_FILE_RE
, 1))
1233 env
.Alias('install-bin', installEnv
['BIN'])
1234 env
.Alias('install-data', installEnv
['DATA'])
1235 env
.Alias('install', installEnv
['ALL'])
1237 # ======================================================================
1239 # ======================================================================
1241 DIST_FILES
= Split('''
1251 linux/examples/onetwoonetwo.sc
1252 linux/examples/sclang.cfg.in
1253 linux/examples/sclang.sc
1255 editors/scvim/README
1261 ('build', HELP_FILE_RE
),
1262 ('Headers', SRC_FILE_RE
),
1263 ('editors/scel/sc', SC_FILE_RE
),
1264 ('editors/scel/el', re
.compile('.*\.el$')),
1265 ('editors/scvim/scclasses', SC_FILE_RE
),
1266 ('Source', SRC_FILE_RE
)
1270 paths
= DIST_FILES
[:]
1271 specs
= DIST_SPECS
[:]
1273 base
, re
= specs
.pop()
1274 if not re
: re
= ANY_FILE_RE
1275 for root
, dirs
, files
in os
.walk(base
):
1276 if 'CVS' in dirs
: dirs
.remove('CVS')
1277 if '.svn' in dirs
: dirs
.remove('.svn')
1278 for path
in dirs
[:]:
1280 specs
.append((os
.path
.join(root
, path
), re
))
1284 paths
.append(os
.path
.join(root
, path
))
1288 def build_tar(env
, target
, source
):
1289 paths
= dist_paths()
1290 tarfile_name
= str(target
[0])
1291 tar_name
= os
.path
.splitext(os
.path
.basename(tarfile_name
))[0]
1292 tar
= tarfile
.open(tarfile_name
, "w:bz2")
1294 tar
.add(path
, os
.path
.join(tar_name
, path
))
1297 if 'dist' in COMMAND_LINE_TARGETS
:
1298 env
.Alias('dist', env
['TARBALL'])
1299 env
.Command(env
['TARBALL'], 'SConstruct', build_tar
)
1301 # ======================================================================
1303 # ======================================================================
1305 if 'scrub' in COMMAND_LINE_TARGETS
:
1306 env
.Clean('scrub', Split('config.log scache.conf .sconf_temp'))
1308 # ======================================================================
1309 # configuration summary
1310 # ======================================================================
1316 print '------------------------------------------------------------------------'
1317 print ' ALTIVEC: %s' % yesorno(features
['altivec'])
1318 print ' AUDIOAPI: %s' % features
['audioapi']
1319 print ' MIDIAPI: %s' % features
['midiapi']
1320 print ' DEBUG: %s' % yesorno(env
['DEBUG'])
1321 # print ' DESTDIR: %s' % env['DESTDIR']
1322 print ' DEVELOPMENT: %s' % yesorno(env
['DEVELOPMENT'])
1323 print ' LANG: %s' % yesorno(env
['LANG'])
1324 print ' LID: %s' % yesorno(features
['lid'])
1325 print ' WII: %s' % yesorno(features
['wii'])
1326 print ' PREFIX: %s' % env
['PREFIX']
1327 print ' RENDEZVOUS: %s' % yesorno(features
['rendezvous'])
1328 print ' SCEL: %s' % yesorno(env
['SCEL'])
1329 print ' SCVIM: %s' % yesorno(env
['SCVIM'])
1330 print ' SCED: %s' % yesorno(env
['SCED'])
1331 print ' SSE: %s' % yesorno(features
['sse'])
1332 print ' STRIP: %s' % yesorno(env
['STRIP'])
1333 print ' CROSSCOMPILE: %s' % yesorno(env
['CROSSCOMPILE'])
1334 print ' TERMINAL_CLIENT: %s' % yesorno(env
['TERMINAL_CLIENT'])
1335 print ' X11: %s' % yesorno(features
['x11'])
1336 print '------------------------------------------------------------------------'
1338 # ======================================================================