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])
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),
336 BoolOption('SCLANG64',
337 'Build 64bit sclang (only affects compilation on 64bit systems)', 0),
340 if PLATFORM
== 'darwin':
342 BoolOption('UNIVERSAL',
343 'Build universal binaries (see UNIVERSAL_ARCHS)', 1),
344 BoolOption('INTERNAL_LIBSNDFILE',
345 'Use internal version of libsndfile', 1),
346 # ListOption('UNIVERSAL_ARCHS',
347 # 'Architectures to build for',
348 # 'all', ['ppc', 'i386'])
351 # ======================================================================
353 # ======================================================================
355 env
= Environment(options
= opts
,
356 ENV
= make_os_env('PATH', 'PKG_CONFIG_PATH'),
359 URL
= 'http://supercollider.sourceforge.net',
360 TARBALL
= PACKAGE
+ VERSION
+ '.tbz2')
361 env
.Append(PATH
= ['/usr/local/bin', '/usr/bin', '/bin'])
364 env
.Append(CPPPATH
= ["xtralibs/include/nova-simd"])
365 env
.Append(CPPDEFINES
= ["NOVA_SIMD"])
368 env
.Append(CPPDEFINES
= ["NO_GPL3_CODE"])
370 print 'WARNING: option READLINE is on and option GPL3 is off, yet readline is GPL3+ licensed, so it will NOT be activated.'
372 # checks for DISTCC and CCACHE as used in modern linux-distros:
374 if os
.path
.exists('/usr/lib/distcc/bin'):
375 os
.environ
['PATH'] = '/usr/lib/distcc/bin:' + os
.environ
['PATH']
376 #env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
377 env
['ENV']['DISTCC_HOSTS'] = os
.environ
.get('DISTCC_HOSTS')
379 if os
.path
.exists('/usr/lib/ccache/bin'):
380 os
.environ
['PATH'] = '/usr/lib/ccache/bin:' + os
.environ
['PATH']
381 #env['ENV']['CCACHE_DIR'] = os.environ['CCACHE_DIR']
382 env
['ENV']['CCACHE_DIR'] = os
.environ
.get('CCACHE_DIR')
384 env
['ENV']['PATH'] = os
.environ
['PATH']
385 if PLATFORM
== 'windows':
386 env
['ENV']['HOME'] = os
.environ
['HOMEPATH']
388 env
['ENV']['HOME'] = os
.environ
['HOME']
390 if PLATFORM
== 'linux':
391 env
['amd64'] = 'x86_64' in platform
.uname()
393 print "we are on amd64 linux"
396 # ======================================================================
397 # installation directories
398 # ======================================================================
400 FINAL_PREFIX
= '$PREFIX'
401 INSTALL_PREFIX
= os
.path
.join('$DESTDIR', '$PREFIX')
403 if env
['PREFIX'] == '/usr':
404 FINAL_CONFIG_PREFIX
= '/etc'
406 FINAL_CONFIG_PREFIX
= os
.path
.join(env
['PREFIX'], 'etc')
407 CONFIG_PREFIX
= '$DESTDIR' + FINAL_CONFIG_PREFIX
410 CPPDEFINES
= [('SC_DATA_DIR', '\\"' + pkg_data_dir(FINAL_PREFIX
) + '\\"')])
412 # ======================================================================
414 # ======================================================================
417 return Configure(env
, custom_tests
= { 'CheckPKGConfig' : CheckPKGConfig
,
418 'CheckPKG' : CheckPKG
})
420 def isDefaultBuild():
421 return not env
.GetOption('clean') and not 'debian' in COMMAND_LINE_TARGETS
423 conf
= make_conf(env
)
430 if not conf
.CheckPKGConfig('0'):
431 print 'pkg-config not found.'
435 if env
['NO_LIBSNDFILE']:
436 libraries
['sndfile'] = Environment(CPPDEFINES
= ['NO_LIBSNDFILE'])
438 if PLATFORM
== 'darwin' and env
['INTERNAL_LIBSNDFILE']:
439 libraries
['sndfile'] = Environment(LINKFLAGS
= ['xtralibs/mac/scUBlibsndfile.a'],
440 CPPPATH
= ['#xtralibs/include/libsndfile'])
442 success
, libraries
['sndfile'] = conf
.CheckPKG('sndfile >= 1.0.16')
443 if not success
: Exit(1)
444 succes2
, libraries
['sndfile18'] = conf
.CheckPKG('sndfile >= 1.0.18')
446 libraries
['sndfile'].Append(CPPDEFINES
= ['LIBSNDFILE_1018'])
449 success
, libraries
['libcurl'] = conf
.CheckPKG('libcurl >= 7')
450 if env
['CURL'] and not success
:
451 print 'CURL option was set, but libcurl not found.'
455 libraries
['fftwf'] = Environment()
457 success
, libraries
['fftwf'] = conf
.CheckPKG('fftw3f')
459 libraries
['fftwf'].Append(CPPDEFINES
= ['SC_FFT_FFTW'])
461 libraries
['fftwf'].Append(CPPDEFINES
= ['SC_FFT_NONE'])
463 libraries
['fftwf'].Append(CPPDEFINES
= ['SC_FFT_NONE'])
464 if PLATFORM
== 'darwin':
465 # needed for vector multiplication
466 libraries
['fftwf'] = Environment(LINKFLAGS
= '-framework vecLib')
468 libraries
['sndfile'] = get_new_pkg_env()
469 libraries
['fftwf'] = get_new_pkg_env()
470 libraries
['libcurl'] = get_new_pkg_env()
473 if env
['AUDIOAPI'] == 'jack':
474 features
['audioapi'] = 'Jack'
475 success
, libraries
['audioapi'] = conf
.CheckPKG('jack >= 0.100')
477 libraries
['audioapi'].Append(
478 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_JACK')],
479 ADDITIONAL_SOURCES
= ['Source/server/SC_Jack.cpp']
482 success
, libraries
['audioapi'] = conf
.CheckPKG('jack')
484 if not success
: Exit(1)
486 libraries
['audioapi'] = get_new_pkg_env()
487 libraries
['audioapi'].Append(
488 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_JACK'),
489 'SC_USE_JACK_CLIENT_NEW'],
490 ADDITIONAL_SOURCES
= ['Source/server/SC_Jack.cpp']
492 libraries
['audioapi'].Append(
493 CPPDEFINES
= [('SC_JACK_USE_DLL', env
['JACK_DLL']),
494 ('SC_JACK_DEBUG_DLL', env
['JACK_DEBUG_DLL'])]
496 elif env
['AUDIOAPI'] == 'coreaudio':
497 features
['audioapi'] = 'CoreAudio'
498 libraries
['audioapi'] = Environment(
499 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_COREAUDIO')],
500 LINKFLAGS
= '-framework CoreAudio',
501 ADDITIONAL_SOURCES
= []
503 elif env
['AUDIOAPI'] == 'portaudio':
504 features
['audioapi'] = 'Portaudio'
505 libraries
['audioapi'] = Environment(
506 CPPDEFINES
= [('SC_AUDIO_API', 'SC_AUDIO_API_PORTAUDIO')],
507 LIBS
= ['portaudio'],
508 ADDITIONAL_SOURCES
= []
512 if env
['RENDEZVOUS']:
513 features
['rendezvous'], libraries
['rendezvous'] = conf
.CheckPKG('avahi-client')
514 if features
['rendezvous']:
515 libraries
['rendezvous'].Append(CPPDEFINES
= ['HAVE_AVAHI'])
517 features
['rendezvous'], libraries
['rendezvous'] = conf
.CheckPKG('howl')
518 if features
['rendezvous']:
519 libraries
['rendezvous'].Append(CPPDEFINES
= ['HAVE_HOWL'])
521 features
['rendezvous'] = False
522 libraries
['rendezvous'] = False
526 features
['alsa'], libraries
['alsa'] = conf
.CheckPKG('alsa')
528 features
['alsa'] = False
531 libraries
['alsa'].Append(CPPDEFINES
= ['HAVE_ALSA'])
534 if conf
.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
535 features
['midiapi'] = 'CoreMIDI'
536 libraries
['midiapi'] = Environment(
537 LINKFLAGS
= '-framework CoreMIDI',
539 elif features
['alsa']:
540 features
['midiapi'] = 'ALSA'
541 libraries
['midiapi'] = libraries
['alsa'].Clone()
543 features
['midiapi'] = None
546 features
['lid'] = env
['LID'] and conf
.CheckCHeader('linux/input.h')
549 if PLATFORM
== 'linux':
550 features
['wii'] = env
['WII'] and conf
.CheckCHeader('cwiid.h')
552 features
['wii'] = env
['WII']
556 if PLATFORM
== 'darwin' or conf
.CheckCHeader('unicode/uregex.h'):
557 libraries
['libicu'] = Environment(
558 LINKFLAGS
= '-licui18n -licuuc -licudata',
561 print "libicu not found"
565 if env
['LANG'] and env
['READLINE'] and env
['GPL3']:
566 if conf
.CheckCHeader('readline/readline.h'):
567 libraries
['readline'] = Environment(
568 LINKFLAGS
= '-lreadline',
571 print "libreadline not found"
574 # only _one_ Configure context can be alive at a time
579 if PLATFORM
== 'darwin':
580 altivec_flags
= [ '-faltivec' ]
582 altivec_flags
= [ '-maltivec', '-mabi=altivec' ]
583 libraries
['altivec'] = env
.Clone()
584 libraries
['altivec'].Append(
585 CCFLAGS
= altivec_flags
,
586 CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 16)])
587 altiConf
= Configure(libraries
['altivec'])
588 features
['altivec'] = altiConf
.CheckCHeader('altivec.h')
591 features
['altivec'] = False
595 libraries
['sse'] = env
.Clone()
596 libraries
['sse'].Append(
597 CCFLAGS
= ['-msse', '-mfpmath=sse'],
598 CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 16)])
600 libraries
['sse'].Append(
601 CCFLAGS
= ['-msse2'])
603 sseConf
= Configure(libraries
['sse'])
604 hasSSEHeader
= sseConf
.CheckCHeader('xmmintrin.h')
605 if env
['CROSSCOMPILE']:
606 build_host_supports_sse
= True
607 print 'NOTICE: cross compiling for another platform: assuming SSE support'
609 build_host_supports_sse
= False
611 if CPU
not in [ 'ppc' , 'ppc64' ]:
612 if PLATFORM
== 'freebsd':
613 machine_info
= os
.popen ("sysctl -a hw.instruction_sse").read()[:-1]
615 if "1" in [x
for x
in machine_info
]:
616 build_host_supports_sse
= True
618 elif PLATFORM
!= 'darwin':
619 flag_line
= os
.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
620 x86_flags
= flag_line
.split (": ")[1:][0].split ()
622 machine_info
= os
.popen ("sysctl -a machdep.cpu").read()[:-1]
623 x86_flags
= machine_info
.split()
624 if "sse" in [x
.lower() for x
in x86_flags
]:
625 build_host_supports_sse
= True
626 print 'NOTICE: CPU has SSE support'
628 print 'NOTICE: CPU does not have SSE support'
629 features
['sse'] = hasSSEHeader
and build_host_supports_sse
632 features
['sse'] = False
635 # features['x11'], libraries['x11'] = conf.CheckPKG('xt')
636 if type(env
['X11']) != types
.StringType
:
637 if os
.path
.exists('/usr/X11R6'):
638 env
['X11'] = '/usr/X11R6'
639 elif os
.path
.exists('/usr/lib/X11'):
640 env
['X11'] = '/usr/lib/X11'
641 else: env
['X11'] = '/usr'
642 x11Env
= Environment(
643 CPPPATH
= [os
.path
.join(env
['X11'], 'include')],
644 LIBPATH
= [os
.path
.join(env
['X11'], 'lib')])
645 x11Conf
= Configure(x11Env
)
646 features
['x11'] = x11Conf
.CheckCHeader('X11/Intrinsic.h') \
647 and x11Conf
.CheckLib('X11', 'XQueryPointer')
648 libraries
['x11'] = x11Conf
.Finish()
650 features
['x11'] = False
653 opts
.Save('scache.conf', env
)
654 Help(opts
.GenerateHelpText(env
))
656 # defines and compiler flags
659 CPPDEFINES
= [ '_REENTRANT', PLATFORM_SYMBOL
],
660 CCFLAGS
= [ '-Wno-unknown-pragmas' ],
661 CXXFLAGS
= [ '-Wno-deprecated' ]
666 env
.Append(CCFLAGS
= '-g')
669 CCFLAGS
= make_opt_flags(env
),
670 CPPDEFINES
= ['NDEBUG'])
672 env
.Append(LINKFLAGS
= "-Wl,-s")
675 if False: #PLATFORM == 'darwin':
676 # universal binary support
678 archs
= map(lambda x
: ['-arch', x
], ['ppc', 'i386'])
685 if features
['altivec']:
686 merge_lib_info(env
, libraries
['altivec'])
687 elif features
['sse']:
688 merge_lib_info(env
, libraries
['sse'])
690 env
.AppendUnique(CPPDEFINES
= [('SC_MEMORY_ALIGNMENT', 1)])
692 # ======================================================================
694 # ======================================================================
696 commonEnv
= env
.Clone()
698 CPPPATH
= ['#Headers/common',
699 '#Headers/plugin_interface',
706 conf
= Configure(commonEnv
)
707 if conf
.CheckFunc('strtod'):
709 CPPDEFINES
= 'HAVE_STRTOD'
711 commonEnv
= conf
.Finish()
714 # ======================================================================
716 # ======================================================================
718 commonSources
= Split('''
719 Source/common/SC_AllocPool.cpp
720 Source/common/SC_DirUtils.cpp
721 Source/common/SC_Sem.cpp
722 Source/common/SC_StringBuffer.cpp
723 Source/common/SC_StringParser.cpp
724 Source/common/scsynthsend.cpp
725 Source/common/sc_popen.cpp
727 if PLATFORM
== 'darwin':
729 'Source/common/SC_StandAloneInfo_Darwin.cpp'
732 commonEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
733 merge_lib_info(commonEnv
, libraries
['libcurl'])
734 libcommon
= commonEnv
.Library('build/common', commonSources
)
737 #commonSources32 = list(commonSources)
738 #commonEnv32 = commonEnv.Clone()
742 #libcommon32 = commonEnv32.Library('build/common32', commonSources32)
745 # ======================================================================
747 # ======================================================================
749 serverEnv
= env
.Clone()
751 CPPPATH
= ['#Headers/common',
752 '#Headers/plugin_interface',
754 CPPDEFINES
= [('SC_PLUGIN_DIR', '\\"' + pkg_lib_dir(FINAL_PREFIX
, 'plugins') + '\\"'), ('SC_PLUGIN_EXT', '\\"' + PLUGIN_EXT
+ '\\"')],
756 libscsynthEnv
= serverEnv
.Clone(
757 PKGCONFIG_NAME
= 'libscsynth',
758 PKGCONFIG_DESC
= 'SuperCollider synthesis server library',
759 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
760 PKGCONFIG_REQUIRES
= make_pkgconfig_requires(libraries
['sndfile'],
761 libraries
['audioapi'],
762 libraries
['rendezvous']),
763 PKGCONFIG_LIBS
= ['-lscsynth'],
764 # PKGCONFIG_LIBS_PRIVATE = ['-lm', '-lpthread', '-ldl'],
765 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/server']
770 # functionality of libdl is included in libc on freebsd
771 if PLATFORM
== 'freebsd':
772 serverEnv
.Append(LIBS
= ['common', 'pthread'])
774 serverEnv
.Append(LIBS
= ['common', 'pthread', 'dl'])
776 if PLATFORM
== 'darwin':
779 '-framework', 'CoreServices'])
780 #'-dylib_install_name', FINAL_PREFIX + '/lib/libsclang.dylib'])
781 elif PLATFORM
== 'linux':
783 CPPDEFINES
= [('SC_PLUGIN_LOAD_SYM', '\\"load\\"')],
784 LINKFLAGS
= '-Wl,-rpath,' + FINAL_PREFIX
+ '/lib')
786 elif PLATFORM
== 'freebsd':
787 serverEnv
.Append(CPPDEFINES
= [('SC_PLUGIN_LOAD_SYM', '\\"load\\"')])
792 libraries
['sndfile'], libraries
['audioapi'])
795 if features
['rendezvous']:
796 serverEnv
.Append(CPPDEFINES
= ['USE_RENDEZVOUS'])
797 merge_lib_info(serverEnv
, libraries
['rendezvous'])
800 serverEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
801 merge_lib_info(serverEnv
, libraries
['libcurl'])
803 libscsynthSources
= Split('''
804 Source/server/Rendezvous.cpp
805 Source/server/Samp.cpp
806 Source/server/SC_BufGen.cpp
807 Source/server/SC_Carbon.cpp
808 Source/server/SC_Complex.cpp
809 Source/server/SC_ComPort.cpp
810 Source/server/SC_CoreAudio.cpp
811 Source/server/SC_Dimension.cpp
812 Source/server/SC_Errors.cpp
813 Source/server/SC_Graph.cpp
814 Source/server/SC_GraphDef.cpp
815 Source/server/SC_Group.cpp
816 Source/server/SC_Lib_Cintf.cpp
817 Source/server/SC_Lib.cpp
818 Source/server/SC_MiscCmds.cpp
819 Source/server/SC_Node.cpp
820 Source/server/SC_Rate.cpp
821 Source/server/SC_SequencedCommand.cpp
822 Source/server/SC_Str4.cpp
823 Source/server/SC_SyncCondition.cpp
824 Source/server/SC_Unit.cpp
825 Source/server/SC_UnitDef.cpp
826 Source/server/SC_World.cpp
827 ''') + libraries
['audioapi']['ADDITIONAL_SOURCES']
829 scsynthSources
= ['Source/server/scsynth_main.cpp']
831 libscsynth
= serverEnv
.SharedLibrary('build/scsynth', libscsynthSources
)
832 env
.Alias('install-programs', env
.Install(lib_dir(INSTALL_PREFIX
), [libscsynth
]))
834 libscsynthStaticSources
= libscsynthSources
+ make_static_objects(serverEnv
, commonSources
, "_libscsynthStatic");
835 libscsynthStatic
= serverEnv
.StaticLibrary('build/scsynth', libscsynthStaticSources
)
836 env
.Alias('install-programs', env
.Install(lib_dir(INSTALL_PREFIX
), [libscsynthStatic
]))
838 scsynth
= serverEnv
.Program('build/scsynth', scsynthSources
, LIBS
= ['scsynth'])
839 env
.Alias('install-programs', env
.Install(bin_dir(INSTALL_PREFIX
), [scsynth
]))
841 # ======================================================================
843 # ======================================================================
845 pluginEnv
= env
.Clone(
847 SHLIBSUFFIX
= PLUGIN_EXT
850 CPPPATH
= ['#Headers/common',
851 '#Headers/plugin_interface',
853 PKGCONFIG_NAME
= 'libscplugin',
854 PKGCONFIG_DESC
= 'SuperCollider synthesis plugin headers',
855 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
856 #PKGCONFIG_REQUIRES = make_pkgconfig_requires(libraries['scsynth']),
857 #PKGCONFIG_LIBS = [],
858 # PKGCONFIG_LIBS_PRIVATE = ['-lm', '-lpthread', '-ldl'],
859 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/server']
861 if PLATFORM
== 'darwin':
862 pluginEnv
['SHLINKFLAGS'] = '$LINKFLAGS -bundle -flat_namespace -undefined suppress'
864 # we merge this in even if no libsndfile (it'll pass in the NO_LIBSNDFILE flag)
867 libraries
['sndfile'])
872 def make_plugin_target(name
):
873 return os
.path
.join('build', 'plugins', name
)
876 for name
in Split('''
890 PhysicalModelingUGens
898 pluginEnv
.SharedLibrary(
899 make_plugin_target(name
), os
.path
.join('Source', 'plugins', name
+ '.cpp')))
902 complexEnv
= pluginEnv
.Clone()
903 complexSources
= Split('Source/plugins/SCComplex.cpp')
904 complexEnv
.SharedObject('Source/plugins/SCComplex.o', complexSources
)
907 fftEnv
= pluginEnv
.Clone()
908 fftSources
= Split('Source/common/SC_fftlib.cpp Source/plugins/SCComplex.o')
909 merge_lib_info(fftEnv
, libraries
['fftwf'])
911 fftEnv
.SharedLibrary(
912 make_plugin_target('FFT_UGens'),
913 ['Source/plugins/FFTInterfaceTable.cpp',
914 'Source/plugins/FFT_UGens.cpp',
915 'Source/plugins/PV_UGens.cpp',
916 'Source/plugins/PartitionedConvolution.cpp'] + fftSources
))
919 fftEnv
.SharedLibrary(
920 make_plugin_target('PV_ThirdParty'),
921 ['Source/plugins/Convolution.cpp',
922 'Source/plugins/FFT2InterfaceTable.cpp',
923 'Source/plugins/FeatureDetection.cpp',
924 'Source/plugins/PV_ThirdParty.cpp'] + fftSources
))
926 # fft 'unpacking' ugens
928 pluginEnv
.SharedLibrary(
929 make_plugin_target('UnpackFFTUGens'), ['Source/plugins/SCComplex.o', 'Source/plugins/UnpackFFTUGens.cpp']))
931 # machine listening ugens
933 mlEnv
= pluginEnv
.Clone()
934 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')
937 make_plugin_target('ML_UGens'), mlSources
))
940 if not env
['NO_LIBSNDFILE']: # (libsndfile needed for all of these, so skip if unavailable)
941 diskIOEnv
= pluginEnv
.Clone(
942 LIBS
= ['common', 'm'],
945 if PLATFORM
== 'darwin':
947 LINKFLAGS
= '-framework CoreServices'
951 diskIOEnv
.SharedObject('Source/plugins/SC_SyncCondition', 'Source/server/SC_SyncCondition.cpp'),
952 'Source/plugins/DiskIO_UGens.cpp']
953 merge_lib_info(diskIOEnv
, libraries
['sndfile'])
955 diskIOEnv
.SharedLibrary(
956 make_plugin_target('DiskIO_UGens'), diskIOSources
))
959 if PLATFORM
== 'darwin':
960 uiUGensEnv
= pluginEnv
.Clone(
962 LINKFLAGS
= '-framework CoreServices -framework Carbon'
965 uiUGensEnv
.SharedLibrary(make_plugin_target('MouseUGens'), 'Source/plugins/MouseUGens.cpp'))
967 uiUGensEnv
.SharedLibrary(make_plugin_target('KeyboardUGens'), 'Source/plugins/KeyboardUGens.cpp'))
968 elif features
['x11']:
969 uiUGensEnv
= pluginEnv
.Clone()
970 merge_lib_info(uiUGensEnv
, libraries
['x11'])
972 uiUGensEnv
.SharedLibrary(make_plugin_target('MouseUGens'), 'Source/plugins/MouseUGens.cpp'))
974 uiUGensEnv
.SharedLibrary(make_plugin_target('KeyboardUGens'), 'Source/plugins/KeyboardUGens.cpp'))
976 env
.Alias('install-plugins', env
.Install(
977 pkg_lib_dir(INSTALL_PREFIX
, 'plugins'), plugins
))
979 # ======================================================================
981 # ======================================================================
983 if env
['TERMINAL_CLIENT'] == True:
984 env
['TERMINAL_CLIENT'] = 1
986 env
['TERMINAL_CLIENT'] = 0
988 langEnv
= env
.Clone()
990 CPPPATH
= ['#Headers/common',
991 '#Headers/plugin_interface',
994 '#Source/lang/LangSource/Bison'],
995 CPPDEFINES
= [['USE_SC_TERMINAL_CLIENT', env
['TERMINAL_CLIENT']]],
999 if env
.get('amd64') and not env
.get('SCLANG64'):
1000 langEnv
.Append( CFLAGS
= ['-m32'],
1001 CXXFLAGS
= ['-m32'],
1002 LINKFLAGS
= ['-m32'],
1003 CPPDEFINES
= "NO_INTERNAL_SERVER")
1005 langEnv
.Append(LIBS
= ['common', 'scsynth'])
1006 merge_lib_info(langEnv
, libraries
['audioapi'])
1008 if PLATFORM
== 'windows':
1009 langEnv
.Append(CPPDEFINES
= "NO_INTERNAL_SERVER")
1011 # functionality of libdl is included in libc on freebsd
1012 if PLATFORM
== 'freebsd':
1013 langEnv
.Append(LIBS
= ['pthread', 'm'])
1015 langEnv
.Append(LIBS
= ['pthread', 'dl', 'm'])
1017 if PLATFORM
== 'darwin':
1020 LINKFLAGS
= ['-framework', 'CoreServices'], #'-dylib_install_name', FINAL_PREFIX + '/lib/libsclang.dylib'],
1021 CPPPATH
= ['#xtralibs/include/icu/unicode'])
1022 elif PLATFORM
== 'linux':
1024 LINKFLAGS
= '-Wl,-rpath,build -Wl,-rpath,' + FINAL_PREFIX
+ '/lib')
1026 if env
.get('amd64') and not env
.get('SCLANG64'):
1027 langEnv
.Append(LIBPATH
="/emul/ia32-linux/usr/lib/,/usr/lib32/",
1028 LINKFLAGS
= '-Wl,-rpath,/emul/ia32-linux/usr/lib/')
1030 elif PLATFORM
== 'freebsd':
1032 LINKFLAGS
= '-Wl,-rpath,build -Wl,-rpath,' + FINAL_PREFIX
+ '/lib')
1035 langEnv
.Append(CPPDEFINES
= ['HAVE_LIBCURL'])
1036 merge_lib_info(langEnv
, libraries
['libcurl'])
1038 if env
['READLINE'] and env
['LANG'] and env
['GPL3']:
1039 langEnv
.Append(CPPDEFINES
= ['HAVE_READLINE'])
1040 merge_lib_info(langEnv
, libraries
['readline'])
1043 libsclangEnv
= langEnv
.Clone(
1044 PKGCONFIG_NAME
= 'libsclang',
1045 PKGCONFIG_DESC
= 'SuperCollider synthesis language library',
1046 PKGCONFIG_PREFIX
= FINAL_PREFIX
,
1047 PKGCONFIG_REQUIRES
= make_pkgconfig_requires(libraries
['sndfile']) + ['libscsynth'],
1048 PKGCONFIG_LIBS
= ['-lsclang'],
1049 PKGCONFIG_CFLAGS
= ['-D' + PLATFORM_SYMBOL
, '-I${includedir}/common', '-I${includedir}/plugin_interface', '-I${includedir}/lang', '-I${includedir}/server']
1052 # required libraries
1053 merge_lib_info(langEnv
, libraries
['sndfile'])
1055 libsclangSources
= Split('''
1056 Source/lang/LangSource/AdvancingAllocPool.cpp
1057 Source/lang/LangSource/ByteCodeArray.cpp
1058 Source/lang/LangSource/DumpParseNode.cpp
1059 Source/lang/LangSource/GC.cpp
1060 Source/lang/LangSource/InitAlloc.cpp
1061 Source/lang/LangSource/PyrFileUtils.cpp
1062 Source/lang/LangSource/PyrInterpreter3.cpp
1063 Source/lang/LangSource/PyrLexer.cpp
1064 Source/lang/LangSource/PyrMathOps.cpp
1065 Source/lang/LangSource/PyrMathSupport.cpp
1066 Source/lang/LangSource/PyrMessage.cpp
1067 Source/lang/LangSource/PyrObject.cpp
1068 Source/lang/LangSource/PyrParseNode.cpp
1069 Source/lang/LangSource/PyrSignal.cpp
1070 Source/lang/LangSource/PyrSymbolTable.cpp
1071 Source/lang/LangSource/SC_LanguageClient.cpp
1072 Source/lang/LangSource/SC_LibraryConfig.cpp
1073 Source/lang/LangSource/SC_TerminalClient.cpp
1074 Source/lang/LangSource/Samp.cpp
1075 Source/lang/LangSource/SimpleStack.cpp
1076 Source/lang/LangSource/VMGlobals.cpp
1077 Source/lang/LangSource/alloca.cpp
1078 Source/lang/LangSource/dumpByteCodes.cpp
1079 Source/lang/LangSource/Bison/lang11d_tab.cpp
1080 Source/lang/LangPrimSource/SC_Wii.cpp
1081 Source/lang/LangPrimSource/PyrSignalPrim.cpp
1082 Source/lang/LangPrimSource/PyrSched.cpp
1083 Source/lang/LangPrimSource/PyrPrimitive.cpp
1084 Source/lang/LangPrimSource/PyrMathPrim.cpp
1085 Source/lang/LangPrimSource/SC_ComPort.cpp
1086 Source/lang/LangPrimSource/OSCData.cpp
1087 Source/lang/LangPrimSource/PyrArchiver.cpp
1088 Source/lang/LangPrimSource/PyrArrayPrimitives.cpp
1089 Source/lang/LangPrimSource/PyrBitPrim.cpp
1090 Source/lang/LangPrimSource/PyrCharPrim.cpp
1091 Source/lang/LangPrimSource/PyrFilePrim.cpp
1092 Source/lang/LangPrimSource/PyrListPrim.cpp
1093 Source/lang/LangPrimSource/PyrPlatformPrim.cpp
1094 Source/lang/LangPrimSource/PyrSerialPrim.cpp
1095 Source/lang/LangPrimSource/PyrStringPrim.cpp
1096 Source/lang/LangPrimSource/PyrUStringPrim.cpp
1097 Source/lang/LangPrimSource/PyrSymbolPrim.cpp
1098 Source/lang/LangPrimSource/PyrUnixPrim.cpp
1099 Source/common/fftlib.c
1103 merge_lib_info(langEnv
, libraries
['libicu'])
1106 if features
['midiapi']:
1107 merge_lib_info(langEnv
, libraries
['midiapi'])
1108 if features
['midiapi'] == 'CoreMIDI':
1109 libsclangSources
+= ['Source/lang/LangPrimSource/SC_CoreMIDI.cpp']
1111 libsclangSources
+= ['Source/lang/LangPrimSource/SC_AlsaMIDI.cpp']
1113 # fallback implementation
1114 libsclangSources
+= ['Source/lang/LangPrimSource/SC_AlsaMIDI.cpp']
1116 if PLATFORM
== 'darwin':
1118 CPPPATH
= ['#Source/lang/LangPrimSource/HID_Utilities',
1119 '#Source/lang/LangPrimSource/WiiMote_OSX'],
1120 LINKFLAGS
= '-framework Carbon -framework IOKit -framework IOBluetooth'
1122 libsclangSources
+= Split('''
1123 Source/lang/LangPrimSource/SC_HID.cpp
1124 Source/lang/LangPrimSource/SC_CoreAudioPrim.cpp
1125 Source/lang/LangPrimSource/HID_Utilities/HID_Error_Handler.c
1126 Source/lang/LangPrimSource/HID_Utilities/HID_Name_Lookup.c
1127 Source/lang/LangPrimSource/HID_Utilities/HID_Queue_Utilities.c
1128 Source/lang/LangPrimSource/HID_Utilities/HID_Utilities.c
1129 Source/lang/LangPrimSource/WiiMote_OSX/wiiremote.c
1132 if env
.has_key('amd64') and env
['amd64']:
1133 libsclangSources
+= commonSources
1135 if PLATFORM
== 'linux':
1136 # HAVE_LID does the right thing in SC_LID.cpp source
1137 libsclangSources
+= ['Source/lang/LangPrimSource/SC_LID.cpp']
1139 langEnv
.Append(CPPDEFINES
= 'HAVE_WII')
1140 langEnv
.Append(LINKFLAGS
= '-lcwiid')
1141 #langEnv.Append(LINKFLAGS = '-lbluetooth')
1142 #langEnv.Append(CPPPATH = '-I/usr/local/include/libcwiimote-0.4.0/libcwiimote/' ) #FIXME: to proper include directory
1144 langEnv
.Append(CPPDEFINES
= 'HAVE_LID')
1146 if PLATFORM
== 'darwin':
1147 langEnv
.Append(CPPDEFINES
= 'HAVE_SPEECH')
1148 libsclangSources
+= ['Source/lang/LangPrimSource/SC_Speech.cpp']
1150 sclangSources
= ['Source/lang/LangSource/cmdLineFuncs.cpp']
1153 libsclang
= langEnv
.SharedLibrary('build/sclang', libsclangSources
)
1154 env
.Alias('install-bin', env
.Install(lib_dir(INSTALL_PREFIX
), [libsclang
]))
1155 if PLATFORM
== 'darwin':
1156 sclangLibs
= ['scsynth', 'sclang']
1158 sclangLibs
= ['sclang']
1159 sclang
= langEnv
.Program('build/sclang', sclangSources
, LIBS
=sclangLibs
)
1160 env
.Alias('install-programs', env
.Install(bin_dir(INSTALL_PREFIX
), [sclang
]))
1162 # ======================================================================
1164 # ======================================================================
1166 # doxygen = env.Command(None, 'doc/doxygen/html/index.html', 'doxygen doc/doxygen/doxygen.cfg')
1167 # env.Alias('doxygen', doxygen)
1169 # ======================================================================
1171 # ======================================================================
1173 installEnv
= Environment(
1174 ALL
= ['install-bin', 'install-data'],
1175 BIN
= ['install-plugins', 'install-programs'],
1176 DATA
= ['install-doc']
1179 installEnv
.Append(DATA
= ['install-library'])
1183 env
.Alias('install-library', install_dir(
1184 env
, 'build/SCClassLibrary',
1185 pkg_data_dir(INSTALL_PREFIX
),
1188 env
.Alias('install-library', install_dir(
1190 pkg_data_dir(INSTALL_PREFIX
),
1193 env
.Alias('install-library', install_dir(
1194 env
, 'build/examples',
1195 pkg_data_dir(INSTALL_PREFIX
),
1199 env
.Alias('install-library', install_dir(
1200 env
, 'editors/scel/sc',
1201 pkg_extension_dir(INSTALL_PREFIX
, 'scide_scel'),
1205 # env.Alias('install-library', install_dir(
1206 # env, 'editors/scvim/scclasses',
1207 # pkg_extension_dir(INSTALL_PREFIX, 'scvim'),
1211 # env.Alias('install-library', install_dir(
1212 # env, 'editors/scvim/cache/doc',
1213 # pkg_data_dir(INSTALL_PREFIX, 'scvim-help'),
1216 #scvim : unhtml help files
1218 #os.execvpe("editors/scvim/bin/scvim_make_help", [ "-c", "-s", "build/Help"],"SCVIM=editors/scvim/")
1219 #os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
1222 #vimenv = env.Clone()
1223 #SConscript('editors/test/SConstruct', exports=['vimenv'])
1226 #print 'installing scvim'
1227 #vimenv = env.Clone()
1228 ##env.Append(FROMTOP=True)
1229 #SConscript('editors/scvim/SConstruct', exports=['vimenv'])
1231 #### scvim and sced scripts need to be called independently, until someone fixes setting the proper variables from the parent script
1234 print '----------------------------------------------------'
1235 # SConscript('editors/scvim/SConstruct', exports=['env'])
1236 print 'To install SCVIM, please use scons in the directory editors/scvim/'
1239 # SConscript('editors/sced/SConstruct', 'env')
1240 print '----------------------------------------------------'
1241 print 'To install SCED, please use the scons in the directory editors/sced/'
1245 env
.Command('editors/scel/el/sclang-vars.el', 'editors/scel/el/sclang-vars.el.in',
1246 'sed \'s,@PKG_DATA_DIR@,%s,g\' < $SOURCE > $TARGET' %
1247 pkg_data_dir(FINAL_PREFIX
))
1248 el_files
= glob
.glob('editors/scel/el/*.el') + ['editors/scel/el/sclang-vars.el']
1249 elc_files
= map(lambda f
: os
.path
.splitext(f
)[0] + '.elc', el_files
)
1250 elisp_dir
= os
.path
.join(INSTALL_PREFIX
, 'share', 'emacs', 'site-lisp')
1251 env
.Command(elc_files
, el_files
,
1252 'emacs -batch --eval "(add-to-list \'load-path (expand-file-name \\"editors/scel/el/\\"))" -f batch-byte-compile $SOURCES')
1253 env
.Alias('install-elisp', env
.Install(elisp_dir
, el_files
+ elc_files
))
1254 installEnv
.Append(DATA
= 'install-elisp')
1256 # example library configuration file
1257 env
.Command('linux/examples/sclang.cfg', 'linux/examples/sclang.cfg.in',
1258 'sed \'s,@PKG_DATA_DIR@,%s,g\' < $SOURCE > $TARGET' %
1259 pkg_data_dir(FINAL_PREFIX
))
1262 if env
['DEVELOPMENT']:
1263 header_dirs
= Split('common plugin_interface server lang')
1264 if PLATFORM
== 'darwin':
1265 header_dirs
+= 'app'
1266 for d
in header_dirs
:
1267 env
.Alias('install-dev', install_dir(
1268 env
, os
.path
.join('Headers', d
),
1269 pkg_include_dir(INSTALL_PREFIX
),
1270 re
.compile('.*\.h(h|pp)?'), 1)
1272 # other useful headers
1273 env
.Alias('install-dev',
1274 env
.Install(pkg_include_dir(INSTALL_PREFIX
, 'plugin_interface'), 'Source/plugins/FFT_UGens.h'))
1276 libscsynthEnv
.Command('linux/libscsynth.pc', 'SConstruct',
1277 build_pkgconfig_file
),
1278 libsclangEnv
.Command('linux/libsclang.pc', 'SConstruct',
1279 build_pkgconfig_file
),
1280 pluginEnv
.Command('linux/libscplugin.pc', 'SConstruct',
1281 build_pkgconfig_file
)]
1282 pkgconfig_dir
= os
.path
.join(lib_dir(INSTALL_PREFIX
), 'pkgconfig')
1283 env
.Alias('install-dev', env
.Install(pkgconfig_dir
, pkgconfig_files
))
1284 installEnv
.Append(ALL
= 'install-dev')
1288 # TODO: build html documentation?
1289 doc_dir
= pkg_doc_dir(INSTALL_PREFIX
)
1290 env
.Alias('install-doc',
1291 install_dir(env
, 'doc', doc_dir
, ANY_FILE_RE
, 0) +
1292 install_dir(env
, 'build/examples', doc_dir
, ANY_FILE_RE
, 1) +
1293 install_dir(env
, 'build/TestingAndToDo', doc_dir
, ANY_FILE_RE
, 1))
1295 env
.Alias('install-bin', installEnv
['BIN'])
1296 env
.Alias('install-data', installEnv
['DATA'])
1297 env
.Alias('install', installEnv
['ALL'])
1299 # ======================================================================
1301 # ======================================================================
1303 DIST_FILES
= Split('''
1309 linux/examples/onetwoonetwo.sc
1310 linux/examples/sclang.cfg.in
1311 linux/examples/sclang.sc
1313 editors/scvim/README
1319 ('build', HELP_FILE_RE
),
1320 ('Headers', SRC_FILE_RE
),
1321 ('editors/scel/sc', SC_FILE_RE
),
1322 ('editors/scel/el', re
.compile('.*\.el$')),
1323 ('editors/scvim/scclasses', SC_FILE_RE
),
1324 ('Source', SRC_FILE_RE
)
1328 paths
= DIST_FILES
[:]
1329 specs
= DIST_SPECS
[:]
1331 base
, re
= specs
.pop()
1332 if not re
: re
= ANY_FILE_RE
1333 for root
, dirs
, files
in os
.walk(base
):
1334 if 'CVS' in dirs
: dirs
.remove('CVS')
1335 if '.svn' in dirs
: dirs
.remove('.svn')
1336 for path
in dirs
[:]:
1338 specs
.append((os
.path
.join(root
, path
), re
))
1342 paths
.append(os
.path
.join(root
, path
))
1346 def build_tar(env
, target
, source
):
1347 paths
= dist_paths()
1348 tarfile_name
= str(target
[0])
1349 tar_name
= os
.path
.splitext(os
.path
.basename(tarfile_name
))[0]
1350 tar
= tarfile
.open(tarfile_name
, "w:bz2")
1352 tar
.add(path
, os
.path
.join(tar_name
, path
))
1355 if 'dist' in COMMAND_LINE_TARGETS
:
1356 env
.Alias('dist', env
['TARBALL'])
1357 env
.Command(env
['TARBALL'], 'SConstruct', build_tar
)
1359 # ======================================================================
1361 # ======================================================================
1363 if 'scrub' in COMMAND_LINE_TARGETS
:
1364 env
.Clean('scrub', Split('config.log scache.conf .sconf_temp'))
1366 # ======================================================================
1367 # configuration summary
1368 # ======================================================================
1374 print '------------------------------------------------------------------------'
1375 print ' ALTIVEC: %s' % yesorno(features
['altivec'])
1376 print ' AUDIOAPI: %s' % features
['audioapi']
1377 print ' MIDIAPI: %s' % features
['midiapi']
1378 print ' DEBUG: %s' % yesorno(env
['DEBUG'])
1379 # print ' DESTDIR: %s' % env['DESTDIR']
1380 print ' DEVELOPMENT: %s' % yesorno(env
['DEVELOPMENT'])
1381 print ' LANG: %s' % yesorno(env
['LANG'])
1382 print ' LID: %s' % yesorno(features
['lid'])
1383 print ' NO_LIBSNDFILE: %s' % yesorno(env
['NO_LIBSNDFILE'])
1384 print ' WII: %s' % yesorno(features
['wii'])
1385 print ' PREFIX: %s' % env
['PREFIX']
1386 print ' RENDEZVOUS: %s' % yesorno(features
['rendezvous'])
1387 print ' SCEL: %s' % yesorno(env
['SCEL'])
1388 print ' SCVIM: %s' % yesorno(env
['SCVIM'])
1389 print ' SCED: %s' % yesorno(env
['SCED'])
1390 print ' SSE: %s' % yesorno(features
['sse'])
1391 print ' STRIP: %s' % yesorno(env
['STRIP'])
1392 print ' CROSSCOMPILE: %s' % yesorno(env
['CROSSCOMPILE'])
1393 print ' TERMINAL_CLIENT: %s' % yesorno(env
['TERMINAL_CLIENT'])
1394 print ' X11: %s' % yesorno(features
['x11'])
1395 print ' GPL3: %s' % yesorno(env
['GPL3'])
1396 print ' SCLANG64: %s' % yesorno(env
.get('SCLANG64'))
1397 print '------------------------------------------------------------------------'
1399 # ======================================================================