import glob import os import re prefix = "/usr/local/lib/pd" platform = os.uname()[0] 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' 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() ########### # C sources in src/ for extra in glob.glob('src/*.c'): external = env.SharedLibrary(re.sub("\.c$","",os.path.basename(extra)), extra) 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'))) # libraries Export('env prefix') for subdir in Split('ann miXed OSCx pmpd signal/expr~ unauthorized zexy'): SConscript ('../' + subdir + '/SConscript')