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'
41 f
= open('../VERSION')
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])
53 ANY_FILE_RE
= re
.compile('.*')
54 HELP_FILE_RE
= re
.compile('.*\.(rtf(d)?|scd|html)$')
55 SC_FILE_RE
= re
.compile('.*\.sc$')
56 SRC_FILE_RE
= re
.compile('.*\.(c(pp)|h)$')
58 if PLATFORM
== 'darwin':
59 PLATFORM_SYMBOL
= 'SC_DARWIN'
61 DEFAULT_AUDIO_API
= 'coreaudio'
62 DEFAULT_PREFIX
= '/usr/local'
63 elif PLATFORM
== 'freebsd':
64 PLATFORM_SYMBOL
= 'SC_FREEBSD'
66 DEFAULT_AUDIO_API
= 'jack'
67 DEFAULT_PREFIX
= '/usr/local'
68 elif PLATFORM
== 'linux':
69 PLATFORM_SYMBOL
= 'SC_LINUX'
71 DEFAULT_AUDIO_API
= 'jack'
72 DEFAULT_PREFIX
= '/usr/local'
73 elif PLATFORM
== 'windows':
74 PLATFORM_SYMBOL
= 'SC_WIN32'
76 DEFAULT_AUDIO_API
= 'portaudio'
79 print 'Unknown platform: %s' % PLATFORM
82 if CPU
in [ 'ppc' , 'ppc64' ]:
83 DEFAULT_OPT_ARCH
= '7450'
84 elif CPU
in [ 'i586', 'i686' ]:
85 # FIXME: better detection
86 DEFAULT_OPT_ARCH
= CPU
88 DEFAULT_OPT_ARCH
= None
90 if PLATFORM
!= 'windows':
91 subprocess
.call(['sh', 'setMainVersion.sh'])
94 # ======================================================================
96 # ======================================================================
99 def make_os_env(*keys
):
107 def CheckPKGConfig(context
, version
):
108 context
.Message( 'Checking for pkg-config... ' )
109 ret
= context
.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version
)[0]
110 context
.Result( ret
)
113 def CheckPKG(context
, name
):
114 context
.Message('Checking for %s... ' % name
)
115 ret
= context
.TryAction('pkg-config --exists \'%s\'' % name
)[0]
118 res
= Environment(ENV
= make_os_env('PATH', 'PKG_CONFIG_PATH'))
119 res
.ParseConfig('pkg-config --cflags --libs \'%s\'' % name
)
120 res
['PKGCONFIG'] = name
124 def get_new_pkg_env():
125 return Environment(ENV
= make_os_env('PATH', 'PKG_CONFIG_PATH'))
127 def merge_lib_info(env
, *others
):
129 env
.AppendUnique(CCFLAGS
= other
.get('CCFLAGS', []))
130 env
.AppendUnique(CPPDEFINES
= other
.get('CPPDEFINES', []))
131 env
.AppendUnique(CPPPATH
= other
.get('CPPPATH', []))
132 env
.AppendUnique(CXXFLAGS
= other
.get('CXXFLAGS', []))
133 env
.AppendUnique(LIBS
= other
.get('LIBS', []))
134 env
.AppendUnique(LIBPATH
= other
.get('LIBPATH', []))
135 env
['LINKFLAGS'] = env
['LINKFLAGS'] + other
.get('LINKFLAGS', "")
137 def make_pkgconfig_requires(*envs
):
140 if env
and env
.has_key('PKGCONFIG'):
141 res
.append(env
['PKGCONFIG'])
144 def build_pkgconfig_file(target
, source
, env
):
145 def write_field(file, name
, prefix
, separator
=None):
146 if env
.has_key(name
):
148 content
= separator
.join(env
[name
])
151 file.write('%s%s\n' % (prefix
, content
))
152 out
= file(str(target
[0]), 'w')
154 'prefix=%s\n' % env
['PREFIX'],
155 'exec_prefix=${prefix}\n',
156 'libdir=${exec_prefix}/lib\n',
157 'includedir=${prefix}/include/%s\n' % env
['PACKAGE'],
159 write_field(out
, 'PKGCONFIG_NAME', 'Name: ')
160 write_field(out
, 'PKGCONFIG_DESC', 'Description: ')
161 write_field(out
, 'URL', 'URL: ')
162 write_field(out
, 'VERSION', 'Version: ')
163 write_field(out
, 'PKGCONFIG_REQUIRES', 'Requires: ', ', ')
164 write_field(out
, 'PKGCONFIG_REQUIRES_PRIVATE', 'Requires.private: ', ', ')
165 write_field(out
, 'PKGCONFIG_LIBS', 'Libs: -L${libdir} ', ' ')
166 write_field(out
, 'PKGCONFIG_LIBS_PRIVATE', 'Libs.private: ', ' ')
167 write_field(out
, 'PKGCONFIG_CFLAGS', 'Cflags: ', ' ')
170 def flatten_dir(dir):
172 for root
, dirs
, files
in os
.walk(dir):
173 if 'CVS' in dirs
: dirs
.remove('CVS')
174 if '.svn' in dirs
: dirs
.remove('.svn')
176 res
.append(os
.path
.join(root
, f
))
179 def install_dir(env
, src_dir
, dst_dir
, filter_re
, strip_levels
=0):
181 for root
, dirs
, files
in os
.walk(src_dir
):
184 if 'CVS' in dirs
: dirs
.remove('CVS')
185 if '.svn' in dirs
: dirs
.remove('.svn')
187 if filter_re
.match(d
):
188 src_paths
+= flatten_dir(os
.path
.join(root
, d
))
191 if filter_re
.match(f
):
192 src_paths
.append(os
.path
.join(root
, f
))
197 *f
.split(os
.path
.sep
)[strip_levels
:]),
199 nodes
+= env
.InstallAs(dst_paths
, src_paths
)
203 pat
= re
.compile('^install.*$')
204 for x
in COMMAND_LINE_TARGETS
:
205 if pat
.match(x
): return True
208 def is_home_directory(dir):
209 return os
.path
.normpath(dir) == os
.path
.normpath(os
.environ
.get('HOME', '/'))
212 return os
.path
.join(prefix
, 'bin')
214 return os
.path
.join(prefix
, 'lib')
216 def pkg_data_dir(prefix
, *args
):
217 if PLATFORM
== 'darwin':
218 base
= '/Library/Application Support'
219 if is_home_directory(prefix
):
220 base
= os
.path
.join(prefix
, base
)
222 base
= os
.path
.join(prefix
, 'share')
223 return os
.path
.join(base
, PACKAGE
, *args
)
224 def pkg_doc_dir(prefix
, *args
):
225 if PLATFORM
== 'darwin':
226 base
= '/Library/Documentation'
227 if is_home_directory(prefix
):
228 base
= os
.path
.join(prefix
, base
)
230 base
= os
.path
.join(prefix
, 'share', 'doc')
231 return os
.path
.join(base
, PACKAGE
, *args
)
232 def pkg_include_dir(prefix
, *args
):
233 return os
.path
.join(prefix
, 'include', PACKAGE
, *args
)
234 def pkg_lib_dir(prefix
, *args
):
235 return os
.path
.join(lib_dir(prefix
), PACKAGE
, *args
)
237 def pkg_classlib_dir(prefix
, *args
):
238 return pkg_data_dir(prefix
, 'SCClassLibrary', *args
)
239 def pkg_extension_dir(prefix
, *args
):
240 return pkg_data_dir(prefix
, 'Extensions', *args
)
242 def make_opt_flags(env
):
245 ## "-fomit-frame-pointer", # can behave strangely for sclang
247 "-fno-finite-math-only",
250 arch
= env
.get('OPT_ARCH')
252 if CPU
in [ 'ppc' , 'ppc64' ]:
253 flags
.extend([ "-mcpu=%s" % (arch
,) ])
255 flags
.extend([ "-march=%s" % (arch
,) ])
256 if CPU
in [ 'ppc' , 'ppc64' ]:
257 flags
.extend([ "-fsigned-char", "-mhard-float",
258 ## "-mpowerpc-gpopt", # crashes sqrt
263 def make_static_object(env
, source
, postfix
="_a"):
264 obj
= os
.path
.splitext(source
)[0] + postfix
265 return env
.StaticObject(obj
, source
)
267 def make_static_objects(env
, sources
, postfix
="_a"):
268 return map(lambda x
: make_static_object(env
, x
, postfix
), sources
)
270 # ======================================================================
271 # command line options
272 # ======================================================================
274 opts
= Options('scache.conf', ARGUMENTS
)
277 'Build with ALSA sequencer support', 1),
278 BoolOption('ALTIVEC',
279 'Build with Altivec support', 1),
280 ('OPT_ARCH', 'Architecture to optimize for', DEFAULT_OPT_ARCH
),
281 EnumOption('AUDIOAPI',
282 'Build with specified audio API support',
283 DEFAULT_AUDIO_API
, ('jack', 'coreaudio', 'portaudio')),
284 ('CC', 'C compiler executable'),
285 ('CCFLAGS', 'C compiler flags'),
286 ('CXX', 'C++ compiler executable'),
287 ('CXXFLAGS', 'C++ compiler flags'),
289 'Build with debugging information', 0),
290 PathOption('DESTDIR',
291 'Intermediate installation prefix for packaging', '/'),
292 BoolOption('DEVELOPMENT',
293 'Build and install the development files', 0),
295 'Use the FFTW libraries', PLATFORM
!= 'darwin'),
296 BoolOption('JACK_DLL',
297 'Build with delay locked loop support', 0),
298 BoolOption('JACK_DEBUG_DLL',
299 'Build with delay locked loop debugging support', 0),
301 'Build the language application', 1),
303 'Build with Linux Input Device support [linux]', PLATFORM
== 'linux'),
304 BoolOption('NO_LIBSNDFILE',
305 'Disable libsndfile (audio file reading/writing)', 0),
307 'Build with Linux WII support [linux]', PLATFORM
== 'linux'),
309 'Installation prefix', DEFAULT_PREFIX
),
310 BoolOption('RENDEZVOUS',
311 'Enable Zeroconf/Rendezvous.', 1),
313 'Enable the SCEL user interface; NOTE for the HTML help system you need emacs-w3m', 1),
315 'Enable the SCVIM user interface; NOTE see the README in /editors/scvim for setting variables', 1),
317 'Enable the SCED (based on gedit) user interface; NOTE see the README in /editors/sced for setting variables', 0),
319 'Build with SSE support', 1),
321 'Build with SSE2 support', 1),
323 'Strip symbols from binaries', 0),
324 BoolOption('CROSSCOMPILE',
325 'Crosscompile for another platform (does not do SSE support check)', 0),
326 BoolOption('TERMINAL_CLIENT',
327 'Build with terminal client interface', 1),
329 'Build with libcurl - allows server to load files from remote servers by URL', 0),
330 BoolOption('READLINE',
331 'Build with GNU readline for nice command-line sclang interface', PLATFORM
== 'linux'),
333 'Allow the inclusion of gpl-3 licensed code. Makes the license of the whole package gpl-3', 1),
335 'Build with X11 support', 1),
338 if PLATFORM
== 'darwin':
340 BoolOption('UNIVERSAL',
341 'Build universal binaries (see UNIVERSAL_ARCHS)', 1),
342 BoolOption('INTERNAL_LIBSNDFILE',
343 'Use internal version of libsndfile', 1),
344 # ListOption('UNIVERSAL_ARCHS',
345 # 'Architectures to build for',
346 # 'all', ['ppc', 'i386'])
349 # ======================================================================
351 # ======================================================================
353 env
= Environment(options
= opts
,
354 ENV
= make_os_env('PATH', 'PKG_CONFIG_PATH'),
357 URL
= 'http://supercollider.sourceforge.net',
358 TARBALL
= PACKAGE
+ VERSION
+ '.tbz2')
359 env
.Append(PATH
= ['/usr/local/bin', '/usr/bin', '/bin'])
362 env
.Append(CPPPATH
= ["include/nova-simd"])
363 env
.Append(CPPDEFINES
= ["NOVA_SIMD"])
366 env
.Append(CPPDEFINES
= ["NO_GPL3_CODE"])
368 print 'WARNING: option READLINE is on and option GPL3 is off, yet readline is GPL3+ licensed, so it will NOT be activated.'
370 # checks for DISTCC and CCACHE as used in modern linux-distros:
372 if os
.path
.exists('/usr/lib/distcc/bin'):
373 os
.environ
['PATH'] = '/usr/lib/distcc/bin:' + os
.environ
['PATH']
374 #env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
375 env
['ENV']['DISTCC_HOSTS'] = os
.environ
.get('DISTCC_HOSTS')
377 if os
.path
.exists('/usr/lib/ccache/bin'):
378 os
.environ
['PATH'] = '/usr/lib/ccache/bin:' + os
.environ
['PATH']
379 #env['ENV']['CCACHE_DIR'] = os.environ['CCACHE_DIR']
380 env
['ENV']['CCACHE_DIR'] = os
.environ
.get('CCACHE_DIR')
382 env
['ENV']['PATH'] = os
.environ
['PATH']
383 if PLATFORM
== 'windows':
384 env
['ENV']['HOME'] = os
.environ
['HOMEPATH']
386 env
['ENV']['HOME'] = os
.environ
['HOME']
388 if PLATFORM
== 'linux':
389 env
['amd64'] = 'x86_64' in platform
.uname()
391 print "we are on amd64 linux"
394 # ======================================================================
395 # installation directories
396 # ======================================================================
398 FINAL_PREFIX
= '$PREFIX'
399 INSTALL_PREFIX
= os
.path
.join('$DESTDIR', '$PREFIX')
401 if env
['PREFIX'] == '/usr':
402 FINAL_CONFIG_PREFIX
= '/etc'
404 FINAL_CONFIG_PREFIX
= os
.path
.join(env
['PREFIX'], 'etc')
405 CONFIG_PREFIX
= '$DESTDIR' + FINAL_CONFIG_PREFIX
408 CPPDEFINES
= [('SC_DATA_DIR', '\\"' + pkg_data_dir(FINAL_PREFIX
) + '\\"')])
410 # ======================================================================
412 # ======================================================================
415 return Configure(env
, custom_tests
= { 'CheckPKGConfig' : CheckPKGConfig
,
416 'CheckPKG' : CheckPKG
})
418 def isDefaultBuild():
419 return not env
.GetOption('clean') and not 'debian' in COMMAND_LINE_TARGETS
421 conf
= make_conf(env
)
428 if not conf
.CheckPKGConfig('0'):
429 print 'pkg-config not found.'
433 if env
['NO_LIBSNDFILE']:
434 libraries
['sndfile'] = Environment(CPPDEFINES
= ['NO_LIBSNDFILE'])
436 if PLATFORM
== 'darwin' and env
['INTERNAL_LIBSNDFILE']:
437 libraries
['sndfile'] = Environment(LINKFLAGS
= ['../mac/lib/scUBlibsndfile.a'],
438 CPPPATH
= ['#include/libsndfile'])
440 success
, libraries
['sndfile'] = conf
.CheckPKG('sndfile >= 1.0.16')
441 if not success
: Exit(1)
442 succes2
, libraries
['sndfile18'] = conf
.CheckPKG('sndfile >= 1.0.18')
444 libraries
['sndfile'].Append(CPPDEFINES
= ['LIBSNDFILE_1018'])
447 success
, libraries
['libcurl'] = conf
.CheckPKG('libcurl >= 7')
448 if env
['CURL'] and not success
:
449 print 'CURL option was set, but libcurl not found.'
453 libraries
['fftwf'] = Environment()
455 success
, libraries
['fftwf'] = conf
.CheckPKG('fftw3f')
457 libraries
['fftwf'].Append(CPPDEFINES
= ['SC_FFT_FFTW'])
459 libraries
['fftwf'].Append(CPPDEFINES
= ['SC_FFT_NONE'])
461 libraries
['fftwf'].Append(CPPDEFINES
= ['SC_FFT_NONE'])
462 if PLATFORM
== 'darwin':
463 # needed for vector multiplication
464 libraries
['fftwf'] = Environment(LINKFLAGS
= '-framework vecLib')
466 libraries
['sndfile'] = get_new_pkg_env()
467 libraries
['fftwf'] = get_new_pkg_env()
468 libraries
['libcurl'] = get_new_pkg_env()
471 if env
['AUDIOAPI'] == 'jack':
472 features
['audioapi'] = 'Jack'
473 success
, libraries
['audioapi'] = conf
.CheckPKG('jack >= 0.100')
475 libraries
['audioapi'].Append(
476 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_JACK')],
477 ADDITIONAL_SOURCES
= ['Source/server/SC_Jack.cpp']
480 success
, libraries
['audioapi'] = conf
.CheckPKG('jack')
482 if not success
: Exit(1)
484 libraries
['audioapi'] = get_new_pkg_env()
485 libraries
['audioapi'].Append(
486 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_JACK'),
487 'SC_USE_JACK_CLIENT_NEW'],
488 ADDITIONAL_SOURCES
= ['Source/server/SC_Jack.cpp']
490 libraries
['audioapi'].Append(
491 CPPDEFINES
= [('SC_JACK_USE_DLL', env
['JACK_DLL']),
492 ('SC_JACK_DEBUG_DLL', env
['JACK_DEBUG_DLL'])]
494 elif env
['AUDIOAPI'] == 'coreaudio':
495 features
['audioapi'] = 'CoreAudio'
496 libraries
['audioapi'] = Environment(
497 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_COREAUDIO')],
498 LINKFLAGS
= '-framework CoreAudio',
499 ADDITIONAL_SOURCES
= []
501 elif env
['AUDIOAPI'] == 'portaudio':
502 features
['audioapi'] = 'Portaudio'
503 libraries
['audioapi'] = Environment(
504 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_PORTAUDIO')],
505 LIBS
= ['portaudio'],
506 ADDITIONAL_SOURCES
= []
510 if env
['RENDEZVOUS']:
511 features
['rendezvous'], libraries
['rendezvous'] = conf
.CheckPKG('avahi-client')
512 if features
['rendezvous']:
513 libraries
['rendezvous'].Append(CPPDEFINES
= ['HAVE_AVAHI'])
515 features
['rendezvous'], libraries
['rendezvous'] = conf
.CheckPKG('howl')
516 if features
['rendezvous']:
517 libraries
['rendezvous'].Append(CPPDEFINES
= ['HAVE_HOWL'])
519 features
['rendezvous'] = False
520 libraries
['rendezvous'] = False
524 features
['alsa'], libraries
['alsa'] = conf
.CheckPKG('alsa')
526 features
['alsa'] = False
529 libraries
['alsa'].Append(CPPDEFINES
= ['HAVE_ALSA'])
532 if conf
.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
533 features
['midiapi'] = 'CoreMIDI'
534 libraries
['midiapi'] = Environment(
535 LINKFLAGS
= '-framework CoreMIDI',
537 elif features
['alsa']:
538 features
['midiapi'] = 'ALSA'
539 libraries
['midiapi'] = libraries
['alsa'].Clone()
541 features
['midiapi'] = None
544 features
['lid'] = env
['LID'] and conf
.CheckCHeader('linux/input.h')
547 if PLATFORM
== 'linux':
548 features
['wii'] = env
['WII'] and conf
.CheckCHeader('cwiid.h')
550 features
['wii'] = env
['WII']
554 if PLATFORM
== 'darwin' or conf
.CheckCHeader('unicode/uregex.h'):
555 libraries
['libicu'] = Environment(
556 LINKFLAGS
= '-licui18n -licuuc -licudata',
559 print "libicu not found"
563 if env
['LANG'] and env
['READLINE'] and env
['GPL3']:
564 if conf
.CheckCHeader('readline/readline.h'):
565 libraries
['readline'] = Environment(
566 LINKFLAGS
= '-lreadline',
569 print "libreadline not found"
572 # only _one_ Configure context can be alive at a time
577 if PLATFORM
== 'darwin':
578 altivec_flags
= [ '-faltivec' ]
580 altivec_flags
= [ '-maltivec', '-mabi=altivec' ]
581 libraries
['altivec'] = env
.Clone()
582 libraries
['altivec'].Append(
583 CCFLAGS
= altivec_flags
,
584 CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 16)])
585 altiConf
= Configure(libraries
['altivec'])
586 features
['altivec'] = altiConf
.CheckCHeader('altivec.h')
589 features
['altivec'] = False
593 libraries
['sse'] = env
.Clone()
594 libraries
['sse'].Append(
595 CCFLAGS
= ['-msse', '-mfpmath=sse'],
596 CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 16)])
598 libraries
['sse'].Append(
599 CCFLAGS
= ['-msse2'])
601 sseConf
= Configure(libraries
['sse'])
602 hasSSEHeader
= sseConf
.CheckCHeader('xmmintrin.h')
603 if env
['CROSSCOMPILE']:
604 build_host_supports_sse
= True
605 print 'NOTICE: cross compiling for another platform: assuming SSE support'
607 build_host_supports_sse
= False
609 if CPU
not in [ 'ppc' , 'ppc64' ]:
610 if PLATFORM
== 'freebsd':
611 machine_info
= os
.popen ("sysctl -a hw.instruction_sse").read()[:-1]
613 if "1" in [x
for x
in machine_info
]:
614 build_host_supports_sse
= True
616 elif PLATFORM
!= 'darwin':
617 flag_line
= os
.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
618 x86_flags
= flag_line
.split (": ")[1:][0].split ()
620 machine_info
= os
.popen ("sysctl -a machdep.cpu").read()[:-1]
621 x86_flags
= machine_info
.split()
622 if "sse" in [x
.lower() for x
in x86_flags
]:
623 build_host_supports_sse
= True
624 print 'NOTICE: CPU has SSE support'
626 print 'NOTICE: CPU does not have SSE support'
627 features
['sse'] = hasSSEHeader
and build_host_supports_sse
630 features
['sse'] = False
633 # features['x11'], libraries['x11'] = conf.CheckPKG('xt')
634 if type(env
['X11']) != types
.StringType
:
635 if os
.path
.exists('/usr/X11R6'):
636 env
['X11'] = '/usr/X11R6'
637 elif os
.path
.exists('/usr/lib/X11'):
638 env
['X11'] = '/usr/lib/X11'
639 else: env
['X11'] = '/usr'
640 x11Env
= Environment(
641 CPPPATH
= [os
.path
.join(env
['X11'], 'include')],
642 LIBPATH
= [os
.path
.join(env
['X11'], 'lib')])
643 x11Conf
= Configure(x11Env
)
644 features
['x11'] = x11Conf
.CheckCHeader('X11/Intrinsic.h') \
645 and x11Conf
.CheckLib('X11', 'XQueryPointer')
646 libraries
['x11'] = x11Conf
.Finish()
648 features
['x11'] = False
651 opts
.Save('scache.conf', env
)
652 Help(opts
.GenerateHelpText(env
))
654 # defines and compiler flags
657 CPPDEFINES
= [ '_REENTRANT', PLATFORM_SYMBOL
],
658 CCFLAGS
= [ '-Wno-unknown-pragmas' ],
659 CXXFLAGS
= [ '-Wno-deprecated' ]
664 env
.Append(CCFLAGS
= '-g')
667 CCFLAGS
= make_opt_flags(env
),
668 CPPDEFINES
= ['NDEBUG'])
670 env
.Append(LINKFLAGS
= "-Wl,-s")
673 if False: #PLATFORM == 'darwin':
674 # universal binary support
676 archs
= map(lambda x
: ['-arch', x
], ['ppc', 'i386'])
683 if features
['altivec']:
684 merge_lib_info(env
, libraries
['altivec'])
685 elif features
['sse']:
686 merge_lib_info(env
, libraries
['sse'])
688 env
.AppendUnique(CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 1)])
690 # ======================================================================
692 # ======================================================================
694 commonEnv
= env
.Clone()
696 CPPPATH
= ['#Headers/common',
697 '#Headers/plugin_interface',
704 conf
= Configure(commonEnv
)
705 if conf
.CheckFunc('strtod'):
707 CPPDEFINES
= 'HAVE_STRTOD'
709 commonEnv
= conf
.Finish()
712 # ======================================================================
714 # ======================================================================
716 commonSources
= Split('''
717 Source/common/SC_AllocPool.cpp
718 Source/common/SC_DirUtils.cpp
719 Source/common/SC_Sem.cpp
720 Source/common/SC_StringBuffer.cpp
721 Source/common/SC_StringParser.cpp
722 Source/common/scsynthsend.cpp
723 Source/common/sc_popen.cpp
725 if PLATFORM
== 'darwin':
727 'Source/common/SC_StandAloneInfo_Darwin.cpp'
730 commonEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
731 merge_lib_info(commonEnv
, libraries
['libcurl'])
732 libcommon
= commonEnv
.Library('build/common', commonSources
)
735 #commonSources32 = list(commonSources)
736 #commonEnv32 = commonEnv.Clone()
740 #libcommon32 = commonEnv32.Library('build/common32', commonSources32)
743 # ======================================================================
745 # ======================================================================
747 serverEnv
= env
.Clone()
749 CPPPATH
= ['#Headers/common',
750 '#Headers/plugin_interface',
752 CPPDEFINES
= [('SC_PLUGIN_DIR', '\\"' + pkg_lib_dir(FINAL_PREFIX
, 'plugins') + '\\"'), ('SC_PLUGIN_EXT', '\\"' + PLUGIN_EXT
+ '\\"')],
754 libscsynthEnv
= serverEnv
.Clone(
755 PKGCONFIG_NAME
= 'libscsynth',
756 PKGCONFIG_DESC
= 'SuperCollider synthesis server library',
757 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
758 PKGCONFIG_REQUIRES
= make_pkgconfig_requires(libraries
['sndfile'],
759 libraries
['audioapi'],
760 libraries
['rendezvous']),
761 PKGCONFIG_LIBS
= ['-lscsynth'],
762 # PKGCONFIG_LIBS_PRIVATE = ['-lm', '-lpthread', '-ldl'],
763 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/server']
768 # functionality of libdl is included in libc on freebsd
769 if PLATFORM
== 'freebsd':
770 serverEnv
.Append(LIBS
= ['common', 'pthread'])
772 serverEnv
.Append(LIBS
= ['common', 'pthread', 'dl'])
774 if PLATFORM
== 'darwin':
777 '-framework', 'CoreServices'])
778 elif PLATFORM
== 'linux':
780 CPPDEFINES
= [('SC_PLUGIN_LOAD_SYM', '\\"load\\"')],
781 LINKFLAGS
= ['-Wl,-rpath,' + FINAL_PREFIX
+ '/lib'])
783 elif PLATFORM
== 'freebsd':
784 serverEnv
.Append(CPPDEFINES
= [('SC_PLUGIN_LOAD_SYM', '\\"load\\"')])
789 libraries
['sndfile'], libraries
['audioapi'])
792 if features
['rendezvous']:
793 serverEnv
.Append(CPPDEFINES
= ['USE_RENDEZVOUS'])
794 merge_lib_info(serverEnv
, libraries
['rendezvous'])
797 serverEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
798 merge_lib_info(serverEnv
, libraries
['libcurl'])
800 libscsynthSources
= Split('''
801 Source/server/Rendezvous.cpp
802 Source/server/Samp.cpp
803 Source/server/SC_BufGen.cpp
804 Source/server/SC_Carbon.cpp
805 Source/server/SC_Complex.cpp
806 Source/server/SC_ComPort.cpp
807 Source/server/SC_CoreAudio.cpp
808 Source/server/SC_Errors.cpp
809 Source/server/SC_Graph.cpp
810 Source/server/SC_GraphDef.cpp
811 Source/server/SC_Group.cpp
812 Source/server/SC_Lib_Cintf.cpp
813 Source/server/SC_Lib.cpp
814 Source/server/SC_MiscCmds.cpp
815 Source/server/SC_Node.cpp
816 Source/server/SC_Rate.cpp
817 Source/server/SC_SequencedCommand.cpp
818 Source/server/SC_Str4.cpp
819 Source/server/SC_SyncCondition.cpp
820 Source/server/SC_Unit.cpp
821 Source/server/SC_UnitDef.cpp
822 Source/server/SC_World.cpp
823 ''') + libraries
['audioapi']['ADDITIONAL_SOURCES']
825 scsynthSources
= ['Source/server/scsynth_main.cpp']
827 libscsynth
= serverEnv
.SharedLibrary('build/scsynth', libscsynthSources
)
828 env
.Alias('install-programs', env
.Install(lib_dir(INSTALL_PREFIX
), [libscsynth
]))
830 libscsynthStaticSources
= libscsynthSources
+ make_static_objects(serverEnv
, commonSources
, "_libscsynthStatic");
831 libscsynthStatic
= serverEnv
.StaticLibrary('build/scsynth', libscsynthStaticSources
)
832 env
.Alias('install-programs', env
.Install(lib_dir(INSTALL_PREFIX
), [libscsynthStatic
]))
834 scsynth
= serverEnv
.Program('build/scsynth', scsynthSources
, LIBS
= ['scsynth'])
835 env
.Alias('install-programs', env
.Install(bin_dir(INSTALL_PREFIX
), [scsynth
]))
837 # ======================================================================
839 # ======================================================================
841 pluginEnv
= env
.Clone(
843 SHLIBSUFFIX
= PLUGIN_EXT
846 CPPPATH
= ['#Headers/common',
847 '#Headers/plugin_interface',
849 PKGCONFIG_NAME
= 'libscplugin',
850 PKGCONFIG_DESC
= 'SuperCollider synthesis plugin headers',
851 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
852 #PKGCONFIG_REQUIRES = make_pkgconfig_requires(libraries['scsynth']),
853 #PKGCONFIG_LIBS = [],
854 # PKGCONFIG_LIBS_PRIVATE = ['-lm', '-lpthread', '-ldl'],
855 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/server']
857 if PLATFORM
== 'darwin':
858 pluginEnv
['SHLINKFLAGS'] = '$LINKFLAGS -bundle -flat_namespace -undefined suppress'
860 # we merge this in even if no libsndfile (it'll pass in the NO_LIBSNDFILE flag)
863 libraries
['sndfile'])
868 def make_plugin_target(name
):
869 return os
.path
.join('build', 'plugins', name
)
872 for name
in Split('''
886 PhysicalModelingUGens
894 pluginEnv
.SharedLibrary(
895 make_plugin_target(name
), os
.path
.join('Source', 'plugins', name
+ '.cpp')))
898 complexEnv
= pluginEnv
.Clone()
899 complexSources
= Split('Source/plugins/SCComplex.cpp')
900 complexEnv
.SharedObject('Source/plugins/SCComplex.o', complexSources
)
903 fftEnv
= pluginEnv
.Clone()
904 fftSources
= Split('Source/common/SC_fftlib.cpp Source/plugins/SCComplex.o')
905 merge_lib_info(fftEnv
, libraries
['fftwf'])
907 fftEnv
.SharedLibrary(
908 make_plugin_target('FFT_UGens'),
909 ['Source/plugins/FFTInterfaceTable.cpp',
910 'Source/plugins/FFT_UGens.cpp',
911 'Source/plugins/PV_UGens.cpp',
912 'Source/plugins/PartitionedConvolution.cpp'] + fftSources
))
915 fftEnv
.SharedLibrary(
916 make_plugin_target('PV_ThirdParty'),
917 ['Source/plugins/Convolution.cpp',
918 'Source/plugins/FFT2InterfaceTable.cpp',
919 'Source/plugins/FeatureDetection.cpp',
920 'Source/plugins/PV_ThirdParty.cpp'] + fftSources
))
922 # fft 'unpacking' ugens
924 pluginEnv
.SharedLibrary(
925 make_plugin_target('UnpackFFTUGens'), ['Source/plugins/SCComplex.o', 'Source/plugins/UnpackFFTUGens.cpp']))
927 # machine listening ugens
929 mlEnv
= pluginEnv
.Clone()
930 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')
933 make_plugin_target('ML_UGens'), mlSources
))
936 if not env
['NO_LIBSNDFILE']: # (libsndfile needed for all of these, so skip if unavailable)
937 diskIOEnv
= pluginEnv
.Clone(
938 LIBS
= ['common', 'm'],
941 if PLATFORM
== 'darwin':
943 LINKFLAGS
= '-framework CoreServices'
947 diskIOEnv
.SharedObject('Source/plugins/SC_SyncCondition', 'Source/server/SC_SyncCondition.cpp'),
948 'Source/plugins/DiskIO_UGens.cpp']
949 merge_lib_info(diskIOEnv
, libraries
['sndfile'])
951 diskIOEnv
.SharedLibrary(
952 make_plugin_target('DiskIO_UGens'), diskIOSources
))
955 if PLATFORM
== 'darwin':
956 uiUGensEnv
= pluginEnv
.Clone(
958 LINKFLAGS
= '-framework CoreServices -framework Carbon'
961 uiUGensEnv
.SharedLibrary(make_plugin_target('MouseUGens'), 'Source/plugins/MouseUGens.cpp'))
963 uiUGensEnv
.SharedLibrary(make_plugin_target('KeyboardUGens'), 'Source/plugins/KeyboardUGens.cpp'))
964 elif features
['x11']:
965 uiUGensEnv
= pluginEnv
.Clone()
966 merge_lib_info(uiUGensEnv
, libraries
['x11'])
968 uiUGensEnv
.SharedLibrary(make_plugin_target('MouseUGens'), 'Source/plugins/MouseUGens.cpp'))
970 uiUGensEnv
.SharedLibrary(make_plugin_target('KeyboardUGens'), 'Source/plugins/KeyboardUGens.cpp'))
972 env
.Alias('install-plugins', env
.Install(
973 pkg_lib_dir(INSTALL_PREFIX
, 'plugins'), plugins
))
975 # ======================================================================
977 # ======================================================================
979 if env
['TERMINAL_CLIENT'] == True:
980 env
['TERMINAL_CLIENT'] = 1
982 env
['TERMINAL_CLIENT'] = 0
984 langEnv
= env
.Clone()
986 CPPPATH
= ['#Headers/common',
987 '#Headers/plugin_interface',
990 '#Source/lang/LangSource/Bison'],
991 CPPDEFINES
= [['USE_SC_TERMINAL_CLIENT', env
['TERMINAL_CLIENT']]],
995 langEnv
.Append(LIBS
= ['common', 'scsynth'])
996 merge_lib_info(langEnv
, libraries
['audioapi'])
998 if PLATFORM
== 'windows':
999 langEnv
.Append(CPPDEFINES
= "NO_INTERNAL_SERVER")
1001 # functionality of libdl is included in libc on freebsd
1002 if PLATFORM
== 'freebsd':
1003 langEnv
.Append(LIBS
= ['pthread', 'm'])
1005 langEnv
.Append(LIBS
= ['pthread', 'dl', 'm'])
1007 if PLATFORM
== 'darwin':
1010 LINKFLAGS
= ['-framework', 'CoreServices'],
1011 CPPPATH
= ['#include/icu/unicode'])
1012 elif PLATFORM
== 'linux':
1014 LINKFLAGS
= ['-Wl,-rpath,build', '-Wl,-rpath,' + FINAL_PREFIX
+ '/lib'])
1017 elif PLATFORM
== 'freebsd':
1019 LINKFLAGS
= '-Wl,-rpath,build -Wl,-rpath,' + FINAL_PREFIX
+ '/lib')
1022 langEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
1023 merge_lib_info(langEnv
, libraries
['libcurl'])
1025 if env
['READLINE'] and env
['LANG'] and env
['GPL3']:
1026 langEnv
.Append(CPPDEFINES
= ['HAVE_READLINE'])
1027 merge_lib_info(langEnv
, libraries
['readline'])
1030 libsclangEnv
= langEnv
.Clone(
1031 PKGCONFIG_NAME
= 'libsclang',
1032 PKGCONFIG_DESC
= 'SuperCollider synthesis language library',
1033 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
1034 PKGCONFIG_REQUIRES
= make_pkgconfig_requires(libraries
['sndfile']) + ['libscsynth'],
1035 PKGCONFIG_LIBS
= ['-lsclang'],
1036 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/lang', '-I${includedir}/server']
1038 if PLATFORM
== 'linux':
1039 libsclangEnv
.Append(
1040 LINKFLAGS
= ['-Wl,-soname,libsclang.so'])
1042 # required libraries
1043 merge_lib_info(langEnv
, libraries
['sndfile'])
1045 libsclangSources
= Split('''
1046 Source/lang/LangSource/AdvancingAllocPool.cpp
1047 Source/lang/LangSource/ByteCodeArray.cpp
1048 Source/lang/LangSource/DumpParseNode.cpp
1049 Source/lang/LangSource/GC.cpp
1050 Source/lang/LangSource/InitAlloc.cpp
1051 Source/lang/LangSource/PyrFileUtils.cpp
1052 Source/lang/LangSource/PyrInterpreter3.cpp
1053 Source/lang/LangSource/PyrLexer.cpp
1054 Source/lang/LangSource/PyrMathOps.cpp
1055 Source/lang/LangSource/PyrMathSupport.cpp
1056 Source/lang/LangSource/PyrMessage.cpp
1057 Source/lang/LangSource/PyrObject.cpp
1058 Source/lang/LangSource/PyrParseNode.cpp
1059 Source/lang/LangSource/PyrSignal.cpp
1060 Source/lang/LangSource/PyrSymbolTable.cpp
1061 Source/lang/LangSource/SC_LanguageClient.cpp
1062 Source/lang/LangSource/SC_LibraryConfig.cpp
1063 Source/lang/LangSource/SC_TerminalClient.cpp
1064 Source/lang/LangSource/Samp.cpp
1065 Source/lang/LangSource/SimpleStack.cpp
1066 Source/lang/LangSource/VMGlobals.cpp
1067 Source/lang/LangSource/alloca.cpp
1068 Source/lang/LangSource/dumpByteCodes.cpp
1069 Source/lang/LangSource/Bison/lang11d_tab.cpp
1070 Source/lang/LangPrimSource/SC_Wii.cpp
1071 Source/lang/LangPrimSource/PyrSignalPrim.cpp
1072 Source/lang/LangPrimSource/PyrSched.cpp
1073 Source/lang/LangPrimSource/PyrPrimitive.cpp
1074 Source/lang/LangPrimSource/PyrMathPrim.cpp
1075 Source/lang/LangPrimSource/SC_ComPort.cpp
1076 Source/lang/LangPrimSource/OSCData.cpp
1077 Source/lang/LangPrimSource/PyrArchiver.cpp
1078 Source/lang/LangPrimSource/PyrArrayPrimitives.cpp
1079 Source/lang/LangPrimSource/PyrBitPrim.cpp
1080 Source/lang/LangPrimSource/PyrCharPrim.cpp
1081 Source/lang/LangPrimSource/PyrFilePrim.cpp
1082 Source/lang/LangPrimSource/PyrListPrim.cpp
1083 Source/lang/LangPrimSource/PyrPlatformPrim.cpp
1084 Source/lang/LangPrimSource/PyrSerialPrim.cpp
1085 Source/lang/LangPrimSource/PyrStringPrim.cpp
1086 Source/lang/LangPrimSource/PyrUStringPrim.cpp
1087 Source/lang/LangPrimSource/PyrSymbolPrim.cpp
1088 Source/lang/LangPrimSource/PyrUnixPrim.cpp
1089 Source/common/fftlib.c
1093 merge_lib_info(langEnv
, libraries
['libicu'])
1096 if features
['midiapi']:
1097 merge_lib_info(langEnv
, libraries
['midiapi'])
1098 if features
['midiapi'] == 'CoreMIDI':
1099 libsclangSources
+= ['Source/lang/LangPrimSource/SC_CoreMIDI.cpp']
1101 libsclangSources
+= ['Source/lang/LangPrimSource/SC_AlsaMIDI.cpp']
1103 # fallback implementation
1104 libsclangSources
+= ['Source/lang/LangPrimSource/SC_AlsaMIDI.cpp']
1106 if PLATFORM
== 'darwin':
1108 CPPPATH
= ['#Source/lang/LangPrimSource/HID_Utilities',
1109 '#Source/lang/LangPrimSource/WiiMote_OSX'],
1110 LINKFLAGS
= '-framework Carbon -framework IOKit -framework IOBluetooth'
1112 libsclangSources
+= Split('''
1113 Source/lang/LangPrimSource/SC_HID.cpp
1114 Source/lang/LangPrimSource/SC_CoreAudioPrim.cpp
1115 Source/lang/LangPrimSource/HID_Utilities/HID_Error_Handler.c
1116 Source/lang/LangPrimSource/HID_Utilities/HID_Name_Lookup.c
1117 Source/lang/LangPrimSource/HID_Utilities/HID_Queue_Utilities.c
1118 Source/lang/LangPrimSource/HID_Utilities/HID_Utilities.c
1119 Source/lang/LangPrimSource/WiiMote_OSX/wiiremote.c
1122 if env
.has_key('amd64') and env
['amd64']:
1123 libsclangSources
+= commonSources
1125 if PLATFORM
== 'linux':
1126 # HAVE_LID does the right thing in SC_LID.cpp source
1127 libsclangSources
+= ['Source/lang/LangPrimSource/SC_LID.cpp']
1129 langEnv
.Append(CPPDEFINES
= 'HAVE_WII')
1130 langEnv
.Append(LINKFLAGS
= '-lcwiid')
1131 #langEnv.Append(LINKFLAGS = '-lbluetooth')
1132 #langEnv.Append(CPPPATH = '-I/usr/local/include/libcwiimote-0.4.0/libcwiimote/' ) #FIXME: to proper include directory
1134 langEnv
.Append(CPPDEFINES
= 'HAVE_LID')
1136 if PLATFORM
== 'darwin':
1137 langEnv
.Append(CPPDEFINES
= 'HAVE_SPEECH')
1138 libsclangSources
+= ['Source/lang/LangPrimSource/SC_Speech.cpp']
1140 sclangSources
= ['Source/lang/LangSource/cmdLineFuncs.cpp']
1143 libsclang
= langEnv
.SharedLibrary('build/sclang', libsclangSources
)
1144 env
.Alias('install-bin', env
.Install(lib_dir(INSTALL_PREFIX
), [libsclang
]))
1145 if PLATFORM
== 'darwin':
1146 sclangLibs
= ['scsynth', 'sclang']
1148 sclangLibs
= ['sclang']
1149 sclang
= langEnv
.Program('build/sclang', sclangSources
, LIBS
=sclangLibs
)
1150 env
.Alias('install-programs', env
.Install(bin_dir(INSTALL_PREFIX
), [sclang
]))
1152 # ======================================================================
1154 # ======================================================================
1156 # doxygen = env.Command(None, 'doc/doxygen/html/index.html', 'doxygen doc/doxygen/doxygen.cfg')
1157 # env.Alias('doxygen', doxygen)
1159 # ======================================================================
1161 # ======================================================================
1163 installEnv
= Environment(
1164 ALL
= ['install-bin', 'install-data'],
1165 BIN
= ['install-plugins', 'install-programs'],
1166 DATA
= ['install-doc']
1169 installEnv
.Append(DATA
= ['install-library'])
1173 env
.Alias('install-library', install_dir(
1174 env
, 'build/SCClassLibrary',
1175 pkg_data_dir(INSTALL_PREFIX
),
1178 env
.Alias('install-library', install_dir(
1180 pkg_data_dir(INSTALL_PREFIX
),
1183 env
.Alias('install-library', install_dir(
1184 env
, 'build/examples',
1185 pkg_data_dir(INSTALL_PREFIX
),
1189 env
.Alias('install-library', install_dir(
1190 env
, '../editors/scel/sc',
1191 pkg_extension_dir(INSTALL_PREFIX
, 'scide_scel'),
1195 # env.Alias('install-library', install_dir(
1196 # env, 'editors/scvim/scclasses',
1197 # pkg_extension_dir(INSTALL_PREFIX, 'scvim'),
1201 # env.Alias('install-library', install_dir(
1202 # env, 'editors/scvim/cache/doc',
1203 # pkg_data_dir(INSTALL_PREFIX, 'scvim-help'),
1206 #scvim : unhtml help files
1208 #os.execvpe("editors/scvim/bin/scvim_make_help", [ "-c", "-s", "build/Help"],"SCVIM=editors/scvim/")
1209 #os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
1212 #vimenv = env.Clone()
1213 #SConscript('editors/test/SConstruct', exports=['vimenv'])
1216 #print 'installing scvim'
1217 #vimenv = env.Clone()
1218 ##env.Append(FROMTOP=True)
1219 #SConscript('editors/scvim/SConstruct', exports=['vimenv'])
1221 #### scvim and sced scripts need to be called independently, until someone fixes setting the proper variables from the parent script
1224 print '----------------------------------------------------'
1225 # SConscript('../editors/scvim/SConstruct', exports=['env'])
1226 print 'To install SCVIM, please use scons in the directory ../editors/scvim/'
1229 # SConscript('../editors/sced/SConstruct', 'env')
1230 print '----------------------------------------------------'
1231 print 'To install SCED, please use the scons in the directory ../editors/sced/'
1235 env
.Command('../editors/scel/el/sclang-vars.el', '../editors/scel/el/sclang-vars.el.in',
1236 'sed \'s,@PKG_DATA_DIR@,%s,g\' < $SOURCE > $TARGET' %
1237 pkg_data_dir(FINAL_PREFIX
))
1238 el_files
= glob
.glob('../editors/scel/el/*.el') + ['../editors/scel/el/sclang-vars.el']
1239 elc_files
= map(lambda f
: os
.path
.splitext(f
)[0] + '.elc', el_files
)
1240 elisp_dir
= os
.path
.join(INSTALL_PREFIX
, 'share', 'emacs', 'site-lisp')
1241 env
.Command(elc_files
, el_files
,
1242 'emacs -batch --eval "(add-to-list \'load-path (expand-file-name \\"../editors/scel/el/\\"))" -f batch-byte-compile $SOURCES')
1243 env
.Alias('install-elisp', env
.Install(elisp_dir
, el_files
+ elc_files
))
1244 installEnv
.Append(DATA
= 'install-elisp')
1246 # example library configuration file
1247 env
.Command('../linux/examples/sclang.cfg', '../linux/examples/sclang.cfg.in',
1248 'sed \'s,@PKG_DATA_DIR@,%s,g\' < $SOURCE > $TARGET' %
1249 pkg_data_dir(FINAL_PREFIX
))
1252 if env
['DEVELOPMENT']:
1253 header_dirs
= Split('common plugin_interface server lang')
1254 if PLATFORM
== 'darwin':
1255 header_dirs
+= 'app'
1256 for d
in header_dirs
:
1257 env
.Alias('install-dev', install_dir(
1258 env
, os
.path
.join('Headers', d
),
1259 pkg_include_dir(INSTALL_PREFIX
),
1260 re
.compile('.*\.h(h|pp)?'), 1)
1262 # other useful headers
1263 env
.Alias('install-dev',
1264 env
.Install(pkg_include_dir(INSTALL_PREFIX
, 'plugin_interface'), 'Source/plugins/FFT_UGens.h'))
1266 libscsynthEnv
.Command('../linux/libscsynth.pc', 'SConstruct',
1267 build_pkgconfig_file
),
1268 libsclangEnv
.Command('../linux/libsclang.pc', 'SConstruct',
1269 build_pkgconfig_file
),
1270 pluginEnv
.Command('../linux/libscplugin.pc', 'SConstruct',
1271 build_pkgconfig_file
)]
1272 pkgconfig_dir
= os
.path
.join(lib_dir(INSTALL_PREFIX
), 'pkgconfig')
1273 env
.Alias('install-dev', env
.Install(pkgconfig_dir
, pkgconfig_files
))
1274 installEnv
.Append(ALL
= 'install-dev')
1278 # TODO: build html documentation?
1279 doc_dir
= pkg_doc_dir(INSTALL_PREFIX
)
1280 env
.Alias('install-doc',
1281 install_dir(env
, 'doc', doc_dir
, ANY_FILE_RE
, 0) +
1282 install_dir(env
, 'build/examples', doc_dir
, ANY_FILE_RE
, 1) +
1283 install_dir(env
, 'build/TestingAndToDo', doc_dir
, ANY_FILE_RE
, 1))
1285 env
.Alias('install-bin', installEnv
['BIN'])
1286 env
.Alias('install-data', installEnv
['DATA'])
1287 env
.Alias('install', installEnv
['ALL'])
1289 # ======================================================================
1291 # ======================================================================
1293 DIST_FILES
= Split('''
1296 ../mac/clean-compile.sh
1299 ../linux/examples/onetwoonetwo.sc
1300 ../linux/examples/sclang.cfg.in
1301 ../linux/examples/sclang.sc
1302 ../editors/scel/README
1303 ../editors/scvim/README
1304 ../editors/sced/README
1309 ('build', HELP_FILE_RE
),
1310 ('Headers', SRC_FILE_RE
),
1311 ('../editors/scel/sc', SC_FILE_RE
),
1312 ('../editors/scel/el', re
.compile('.*\.el$')),
1313 ('../editors/scvim/scclasses', SC_FILE_RE
),
1314 ('Source', SRC_FILE_RE
)
1318 paths
= DIST_FILES
[:]
1319 specs
= DIST_SPECS
[:]
1321 base
, re
= specs
.pop()
1322 if not re
: re
= ANY_FILE_RE
1323 for root
, dirs
, files
in os
.walk(base
):
1324 if 'CVS' in dirs
: dirs
.remove('CVS')
1325 if '.svn' in dirs
: dirs
.remove('.svn')
1326 for path
in dirs
[:]:
1328 specs
.append((os
.path
.join(root
, path
), re
))
1332 paths
.append(os
.path
.join(root
, path
))
1336 def build_tar(env
, target
, source
):
1337 paths
= dist_paths()
1338 tarfile_name
= str(target
[0])
1339 tar_name
= os
.path
.splitext(os
.path
.basename(tarfile_name
))[0]
1340 tar
= tarfile
.open(tarfile_name
, "w:bz2")
1342 tar
.add(path
, os
.path
.join(tar_name
, path
))
1345 if 'dist' in COMMAND_LINE_TARGETS
:
1346 env
.Alias('dist', env
['TARBALL'])
1347 env
.Command(env
['TARBALL'], 'SConstruct', build_tar
)
1349 # ======================================================================
1351 # ======================================================================
1353 if 'scrub' in COMMAND_LINE_TARGETS
:
1354 env
.Clean('scrub', Split('config.log scache.conf .sconf_temp'))
1356 # ======================================================================
1357 # configuration summary
1358 # ======================================================================
1364 print '------------------------------------------------------------------------'
1365 print ' ALTIVEC: %s' % yesorno(features
['altivec'])
1366 print ' AUDIOAPI: %s' % features
['audioapi']
1367 print ' MIDIAPI: %s' % features
['midiapi']
1368 print ' DEBUG: %s' % yesorno(env
['DEBUG'])
1369 # print ' DESTDIR: %s' % env['DESTDIR']
1370 print ' DEVELOPMENT: %s' % yesorno(env
['DEVELOPMENT'])
1371 print ' LANG: %s' % yesorno(env
['LANG'])
1372 print ' LID: %s' % yesorno(features
['lid'])
1373 print ' NO_LIBSNDFILE: %s' % yesorno(env
['NO_LIBSNDFILE'])
1374 print ' WII: %s' % yesorno(features
['wii'])
1375 print ' PREFIX: %s' % env
['PREFIX']
1376 print ' RENDEZVOUS: %s' % yesorno(features
['rendezvous'])
1377 print ' SCEL: %s' % yesorno(env
['SCEL'])
1378 print ' SCVIM: %s' % yesorno(env
['SCVIM'])
1379 print ' SCED: %s' % yesorno(env
['SCED'])
1380 print ' SSE: %s' % yesorno(features
['sse'])
1381 print ' STRIP: %s' % yesorno(env
['STRIP'])
1382 print ' CROSSCOMPILE: %s' % yesorno(env
['CROSSCOMPILE'])
1383 print ' TERMINAL_CLIENT: %s' % yesorno(env
['TERMINAL_CLIENT'])
1384 print ' X11: %s' % yesorno(features
['x11'])
1385 print ' GPL3: %s' % yesorno(env
['GPL3'])
1386 print '------------------------------------------------------------------------'
1388 # ======================================================================