#! /usr/bin/env python
# encoding: utf-8

test_programs = {
    #'synchroClient': ['testSynchroClient.cpp'],
    #'synchroServer': ['testSynchroServer.cpp'],
    #'synchroServerClient': ['testSynchroServerClient.cpp'],
    'testSem': ['testSem.cpp'],
    'jack_test': ['jack_test.cpp'],
    'jack_cpu': ['jack_cpu.c'],
    'jdelay': ['jdelay.cpp'],
    }

def build(bld):
    for test_program, test_program_sources in test_programs.items():
        prog = bld.create_obj('cpp', 'program')
        prog.features.append('cc')
	if bld.env()['IS_MACOSX']:
	    prog.includes = ['../macosx', '../posix', '../common/jack', '../common']
	if bld.env()['IS_LINUX']:
	    prog.includes = ['../linux', '../posix', '../common/jack', '../common']
        prog.source = test_program_sources
        if bld.env()['IS_LINUX']:
            prog.uselib = 'RT'
        if bld.env()['IS_MACOSX']:
            prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
            #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
	    prog.env.append_value("LINKFLAGS", "")
        prog.uselib_local = 'clientlib'
        prog.target = test_program
        #if test_program != 'jack_test':
        #    prog.inst_var = 0
