diff options
Diffstat (limited to 'externals')
-rw-r--r-- | externals/build/SConstruct | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/externals/build/SConstruct b/externals/build/SConstruct index 39dadbb4..73a3a728 100644 --- a/externals/build/SConstruct +++ b/externals/build/SConstruct @@ -1,34 +1,34 @@ import glob import os import re -prefix = "/usr/local/lib/pd" -platform = os.uname()[0] +env = Environment(CPPPATH = Split('/usr/include /usr/local/include . ../../pd/src ../../src src'), CPPDEFINES=['PD'], SHLIBPREFIX = '', CCFLAGS = '-pipe -O2') -if re.match("Linux", platform) != None: - OSdefine = 'UNIX' - extSuffix = '.pd_linux' -elif re.match("MINGW", platform) != None: - OSdefine = 'NT' - extSuffix = '.dll' -elif re.match("Darwin", platform) != None: - OSdefine = 'UNIX' - extSuffix = '.pd_darwin' +opt = Options(['options.cache', 'custom.py']) +opt.AddOptions(('prefix', 'install prefix', '/usr/local/lib/pd')) +opt.Update(env) +opt.Save('options.cache',env) +prefix = env['prefix'] -env = Environment(CPPPATH = Split(prefix + '/src /usr/include /usr/local/include . ../../pd/src ../../src src'), CPPDEFINES=['PD', OSdefine], SHLIBPREFIX = '', SHLIBSUFFIX = extSuffix, CCFLAGS = '-pipe -O2') - -########### delete when namespace conflict issue is finally resolved -##(cyclone has all of these, the other versions are from all over the place) -delete = """ -cd src && test -f prepend.c && rm urn.* match.* prepend.* sinh.c delta~.c reson~.c abs~.c svf~.c matrix~.c atan2~.c avg~.c pmpd.c && echo "poof...no more conflicting externals..!!" -""" -print os.popen(delete).read() -########### +if env['PLATFORM'] == 'win32': + env.Append(CPPDEFINES='NT') + env.Append(LINKFLAGS=prefix+'bin/pd.dll') + env['SHLIBSUFFIX']='.dll' +elif env['PLATFORM'] == 'darwin': + env.Append(CPPDEFINES='UNIX') + env['SHLIBSUFFIX']='.pd_darwin' +elif env['PLATFORM'] == 'posix': + env.Append(CPPDEFINES='UNIX') + env['SHLIBSUFFIX']='.pd_linux' +#remove one-off externals that are also in cyclone +print os.popen("""cd src && test -f prepend.c && rm urn.* match.* prepend.* sinh.c delta~.c reson~.c abs~.c svf~.c matrix~.c atan2~.c avg~.c pmpd.c && echo "poof...no more conflicting externals..!!" """).read() # C sources in src/ for extra in glob.glob('src/*.c'): - external = env.SharedLibrary(re.sub("\.c$","",os.path.basename(extra)), extra) + name = re.sub("\.c$","",os.path.basename(extra)) + print name, + external = env.SharedLibrary(name,'src/'+name+'.c') env.Alias('install', env.Install(os.path.join(prefix, 'extra'), external)) Default(external) env.Alias('install', env.Install(os.path.join(prefix, 'doc/5.reference'), glob.glob('doc/*.pd'))) |