Changeset 1910
- Timestamp:
- 03/06/08 09:55:18 (2 years ago)
- Files:
-
- jack2/trunk/jackmp/ChangeLog (modified) (1 diff)
- jack2/trunk/jackmp/common/SConscript (modified) (3 diffs)
- jack2/trunk/jackmp/example-clients/SConscript (modified) (2 diffs)
- jack2/trunk/jackmp/linux/SConscript (modified) (5 diffs)
- jack2/trunk/jackmp/macosx/SConscript (modified) (4 diffs)
- jack2/trunk/jackmp/SConstruct (modified) (5 diffs)
- jack2/trunk/jackmp/tests/SConscript (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jack2/trunk/jackmp/ChangeLog
r1906 r1910 21 21 2008-03-06 Stephane Letz <letz@grame.fr> 22 22 23 * Marc-Olivier Barre scons patch (3). 24 25 2008-03-06 Stephane Letz <letz@grame.fr> 26 23 27 * Fix JackSocketClientChannel::ClientClose: async call from the client and server does not need to write any reply. 24 28 * Correct port notification: 2 notifications have to be sent (src, dst) and (dst, src)... jack2/trunk/jackmp/common/SConscript
r1903 r1910 2 2 # Copyright (C) 2007 Arnold Krille 3 3 # Copyright (C) 2007 Pieter Palmers 4 # Copyright (C) 2008 Marc-Olivier Barre 4 5 # 5 # This file origina lly was part of FFADO6 # This file originates from FFADO (www.ffado.org) 6 7 # 7 8 # This program is free software: you can redistribute it and/or modify … … 23 24 from string import Template 24 25 25 Import( 'env')26 Import('env') 26 27 27 # paths where include files can be found 28 env.AppendUnique( CPPPATH=["#/", "#/common", "#/common/jack"] ) 28 # Define the library suffix for POSIX like systems 29 if env['PLATFORM'] == 'posix': 30 env.AppendUnique(SHLIBSUFFIX='.0.0') 31 32 # Paths where include files can be found 33 env.AppendUnique(CPPPATH=['#/', '#/common', '#/common/jack']) 34 35 # Needed libraries 36 env.AppendUnique(LIBS=['rt', 'pthread']) 29 37 30 38 # HACK: this should not be here ideally 31 env.AppendUnique( CPPPATH=["#/linux","#/macosx"])39 env.AppendUnique(CPPPATH=['#/linux','#/macosx']) 32 40 33 # a symlinking command 34 symlinkcmd = 'cd $TARGET.dir && rm -f -v $TARGET.name && ln -v -s $SOURCE.name $TARGET.name' 41 # A symlinking command for our libraries' names 42 symlinkcmd = 'cd $TARGET.dir && rm -f $TARGET.name && ln -s $SOURCE.name $TARGET.name' 43 44 # Library names 45 clientlib_name = 'jackmp' 46 serverlib_name = 'jackservermp' 47 wrapperlib_name = 'jackwrapper' 35 48 36 49 # 37 # Define the source files50 # Source files section 38 51 # 39 52 … … 135 148 136 149 # 137 # Start building150 # Build/install section 138 151 # 139 152 140 env.AppendUnique( LIBS=["rt", "pthread"] ) 153 # Libraries 154 clientlib = env.SharedLibrary(clientlib_name, srcfiles_common_clientlib) 155 serverlib = env.SharedLibrary(serverlib_name, srcfiles_common_serverlib) 156 wrapperlib = env.SharedLibrary(wrapperlib_name, srcfiles_common_wrapperlib) 157 env.Install( env['LIBDIR'], [clientlib, serverlib, wrapperlib]) 158 env.Alias('install', env['LIBDIR']) 141 159 142 # build the common stuff 160 # Handle the way we name libraries on a POSIX system 161 # TODO: this is not quite clean yet. changing the library version is a pain we'll need a nicer loop and a config value somewhere 143 162 if env['PLATFORM'] == 'posix': 144 env.AppendUnique( SHLIBSUFFIX=".0.0" ) 145 clientlib_name = "jackmp" 146 serverlib_name = "jackservermp" 147 wrapperlib_name = "jackwrapper" 148 clientlib = env.SharedLibrary( clientlib_name, srcfiles_common_clientlib ) 149 serverlib = env.SharedLibrary( serverlib_name, srcfiles_common_serverlib ) 150 wrapperlib = env.SharedLibrary( wrapperlib_name, srcfiles_common_wrapperlib ) 151 env.Install( env['libdir'], [clientlib, serverlib, wrapperlib]) 152 env.Alias("install", env['libdir']) 153 if env['PLATFORM'] == 'posix': 154 for lib_name, lib in [(clientlib_name, clientlib), (serverlib_name, serverlib), (wrapperlib_name, wrapperlib)]: 155 env.Command('lib' + lib_name + '.so.0', lib, symlinkcmd) 156 env.Command('lib' + lib_name + '.so', 'lib'+lib_name+'.so.0', symlinkcmd) 157 env.Command(env['libdir'] + '/lib' + lib_name + '.so.0', env['libdir'] + '/lib' + lib_name + '.so.0.0', symlinkcmd) 158 env.Command(env['libdir'] + '/lib' + lib_name + '.so', env['libdir'] + '/lib' + lib_name + '.so.0', symlinkcmd) 159 env.Alias("install", env['libdir'] + '/lib' + lib_name + '.so.0') 160 env.Alias("install", env['libdir'] + '/lib' + lib_name + '.so') 163 for lib_name, lib in [(clientlib_name, clientlib), (serverlib_name, serverlib), (wrapperlib_name, wrapperlib)]: 164 env.Command('lib' + lib_name + '.so.0', lib, symlinkcmd) 165 env.Command('lib' + lib_name + '.so', 'lib'+lib_name+'.so.0', symlinkcmd) 166 env.Command(env['LIBDIR'] + '/lib' + lib_name + '.so.0', env['LIBDIR'] + '/lib' + lib_name + '.so.0.0', symlinkcmd) 167 env.Command(env['LIBDIR'] + '/lib' + lib_name + '.so', env['LIBDIR'] + '/lib' + lib_name + '.so.0', symlinkcmd) 168 env.Alias('install', env['LIBDIR'] + '/lib' + lib_name + '.so.0') 169 env.Alias('install', env['LIBDIR'] + '/lib' + lib_name + '.so') 161 170 162 # install the headers171 # Headers 163 172 for header in jack_headers: 164 env.Install(env['includedir'] + '/jack', 'jack/' + header) 165 env.Alias("install", env['includedir']) 166 #if env['JACK_FLAGS']: 167 #jack_include_dir = env['JACK_INCLUDEDIR'] 168 #if 'install' in COMMAND_LINE_TARGETS and os.path.isdir( jack_include_dir ): 169 #if env.GetOption('clean'): 170 #pass 171 #else: 172 #jack_old_includes_dir = env['includedir'] + '/jack_up' 173 #print "moving old jack includes to %s..." % jack_old_includes_dir 174 #env.Command(jack_old_includes_dir, jack_include_dir, Move("$TARGET", "$SOURCE")) 175 176 # install the libs 177 #jack_libdir = env['JACK_LIBDIR'] 178 #libjackdmp_location = env['libdir'] + '/libjackmp.so' 179 #if 'install' in COMMAND_LINE_TARGETS and os.path.isdir( jack_libdir ): 180 #if env.GetOption('clean'): 181 #note: is this executed before the actual uninstall? 182 #lib_files = glob.glob(jack_libdir + '/libjack.so.*.up') 183 #for old_name in lib_files: 184 #new_name = old_name[:-3] 185 #print "restoring old jack lib %s to %s..." % (old_name, new_name) 186 #env.Command(Delete(new_name)) 187 #env.Command(new_name, old_name, Move("$TARGET", "$SOURCE")) 188 #else: 189 #lib_files = glob.glob(jack_libdir + '/libjack.so.*') 190 #env.Alias("install", env.Install(env['libdir'], serverlib)) 191 #env.Alias("install", env.Install(env['libdir'], clientlib)) 192 #for old_name in lib_files: 193 #new_name = old_name + '.up' 194 #print "moving old jack lib %s to %s..." % (old_name, new_name) 195 #env.Command(new_name, old_name, Move("$TARGET", "$SOURCE")) 196 #print " linking to %s..." % (libjackdmp_location) 197 #env.Command(old_name, libjackdmp_location, "ln -s $TARGET $SOURCE") 173 env.Install(env['INCLUDEDIR'] + '/jack', 'jack/' + header) 174 env.Alias('install', env['INCLUDEDIR']) jack2/trunk/jackmp/example-clients/SConscript
r1903 r1910 2 2 # Copyright (C) 2007 Arnold Krille 3 3 # Copyright (C) 2007 Pieter Palmers 4 # Copyright (C) 2008 Marc-Olivier Barre 4 5 # 5 6 # This file originates from FFADO (www.ffado.org) … … 22 23 from string import Template 23 24 24 Import( 'env')25 Import('env') 25 26 26 27 # paths where include files can be found 27 env.AppendUnique( CPPPATH=["#/", "#/common"])28 env.AppendUnique(CPPPATH=['#/', '#/common']) 28 29 29 30 # 30 # Define the source files31 # Source files section 31 32 # 32 33 33 example_ client_programs = {34 "jack_freewheel" : "freewheel.c",35 "jack_connect" : "connect.c",36 "jack_lsp" : "lsp.c",37 "jack_metro" : "metro.c",38 #"jack_midiseq" : "midiseq.c",39 #"jack_midisine" : "midisine.c",40 "jack_showtime" : "showtime.c",41 "jack_simple_client" : "simple_client.c",42 "jack_zombie" : "zombie.c",43 "jack_load" : "ipload.c",44 "jack_unload" : "ipunload.c",45 }34 example_programs = { 35 'jack_freewheel' : 'freewheel.c', 36 'jack_connect' : 'connect.c', 37 'jack_lsp' : 'lsp.c', 38 'jack_metro' : 'metro.c', 39 'jack_midiseq' : 'midiseq.c', 40 'jack_midisine' : 'midisine.c', 41 'jack_showtime' : 'showtime.c', 42 'jack_simple_client' : 'simple_client.c', 43 'jack_zombie' : 'zombie.c', 44 'jack_load' : 'ipload.c', 45 'jack_unload' : 'ipunload.c', 46 } 46 47 47 example_ client_libs = {48 "inprocess" : "inprocess.c",49 }48 example_libs = { 49 'inprocess' : 'inprocess.c', 50 } 50 51 51 # link extra libs?52 # Libraries to link 52 53 extra_libs = {} 53 for example_ client_program in example_client_programs.keys():54 extra_libs[example_ client_program] = ["jackservermp", "dl"]54 for example_program in example_programs: 55 extra_libs[example_program] = ['jackservermp', 'dl'] 55 56 56 # special cases57 extra_libs[ "jack_load"] = ["jackmp"]58 extra_libs[ "jack_unload"] = ["jackmp"]59 57 # Replace library listing for some special cases 58 extra_libs['jack_load'] = ['jackmp'] 59 extra_libs['jack_unload'] = ['jackmp'] 60 # TODO: we need to really test for READLINE... 60 61 env['HAS_READLINE']=True 61 62 if env['HAS_READLINE']: 62 extra_libs[ "jack_transport"] = ["readline", "jackservermp", "dl"]63 example_ client_programs["jack_transport"] = "transport.c"63 extra_libs['jack_transport'] = ['readline', 'jackservermp', 'dl'] 64 example_programs['jack_transport'] = 'transport.c' 64 65 65 66 # 66 # Start building67 # Build/install section 67 68 # 68 69 69 # build the example clients70 70 if env['BUILD_EXAMPLES']: 71 71 clientenv = env.Copy() 72 clientenv.PrependUnique( LIBPATH=env['build_base'] ) 73 74 for example_client_program in example_client_programs.keys(): 75 clientenv.Program(target=example_client_program, 76 source=env.Split( example_client_programs[example_client_program]), 77 LIBS=extra_libs[example_client_program] ) 72 clientenv.PrependUnique(LIBPATH=env['build_base']) 73 for example_program, example_program_source in example_programs.items(): 74 clientenv.Program(example_program, example_program_source, LIBS=extra_libs[example_program]) 78 75 if env['INSTALL_EXAMPLES']: 79 clientenv.Install( "$bindir", example_client_program ) 80 81 for example_client_lib in example_client_libs.keys(): 82 clientenv.SharedLibrary(target=example_client_lib, 83 source=env.Split( example_client_libs[example_client_lib] ) ) 84 if env['INSTALL_EXAMPLES']: 85 #clientenv.Install( "$libdir", example_client_lib ) 86 pass 76 clientenv.Install(env['BINDIR'], example_program) 77 for example_lib, example_lib_source in example_libs.items(): 78 clientenv.SharedLibrary(example_lib, example_lib_source) 79 # TODO: Not working yet. Do we even intend to install a test library ? 80 # if env['INSTALL_EXAMPLES']: 81 # clientenv.Install(env['LIBDIR'], example_client_lib) jack2/trunk/jackmp/linux/SConscript
r1903 r1910 2 2 # Copyright (C) 2007 Arnold Krille 3 3 # Copyright (C) 2007 Pieter Palmers 4 # Copyright (C) 2008 Marc-Olivier Barre 4 5 # 5 6 # This file originates from FFADO (www.ffado.org) … … 59 60 60 61 server = serverenv.Program("jackdmp", srcfiles_linux_server) 61 serverenv.Install( env[' bindir'], server )62 serverenv.Install( env['BINDIR'], server ) 62 63 63 64 drv = serverenv.SharedLibrary( "jack_dummy", srcfiles_linux_dummy ) 64 serverenv.InstallAs( env[' libdir']+ "/jackmp/jack_dummy.so", drv )65 serverenv.InstallAs( env['LIBDIR']+ "/jackmp/jack_dummy.so", drv ) 65 66 66 67 if env['ENABLE_ALSA']: … … 68 69 serverenv.MergeFlags( env['ALSA_FLAGS'] ) 69 70 drv = serverenv.SharedLibrary( "jack_alsa", srcfiles_linux_alsa ) 70 serverenv.InstallAs( env[' libdir']+ "/jackmp/jack_alsa.so", drv )71 serverenv.InstallAs( env['LIBDIR']+ "/jackmp/jack_alsa.so", drv ) 71 72 72 73 if env['ENABLE_FREEBOB']: … … 74 75 serverenv.MergeFlags( env['FREEBOB_FLAGS'] ) 75 76 drv = serverenv.SharedLibrary( "jack_freebob", srcfiles_linux_freebob ) 76 serverenv.InstallAs( env[' libdir']+ "/jackmp/jack_freebob.so", drv )77 serverenv.InstallAs( env['LIBDIR']+ "/jackmp/jack_freebob.so", drv ) 77 78 78 79 if env['ENABLE_FIREWIRE']: … … 80 81 serverenv.MergeFlags( env['FFADO_FLAGS'] ) 81 82 drv = serverenv.SharedLibrary( "jack_firewire", srcfiles_linux_ffado ) 82 serverenv.InstallAs( env[' libdir']+ "/jackmp/jack_firewire.so", drv )83 serverenv.InstallAs( env['LIBDIR']+ "/jackmp/jack_firewire.so", drv ) jack2/trunk/jackmp/macosx/SConscript
r1732 r1910 2 2 # Copyright (C) 2007 Arnold Krille 3 3 # Copyright (C) 2007 Pieter Palmers 4 # Copyright (C) 2008 Marc-Olivier Barre 4 5 # 5 6 # This file originates from FFADO (www.ffado.org) … … 22 23 from string import Template 23 24 24 Import( 'env')25 Import('env') 25 26 26 # paths where include files can be found27 env.AppendUnique( CPPPATH=["#/", "#/common", "#/common/jack", "#/macosx"])27 # Paths to include files 28 env.AppendUnique(CPPPATH = ['#/', '#/common', '#/common/jack', '#/macosx']) 28 29 29 30 # 30 # Define the source files31 # Source files section 31 32 # 32 33 … … 38 39 39 40 # 40 # Start building41 # Build/install section 41 42 # 42 43 … … 44 45 serverenv = env.Copy() 45 46 serverenv.PrependUnique( LIBPATH=env['build_base'] ) 46 serverenv.PrependUnique( LIBS=[ "jackdmp", "dl"] )47 serverenv.PrependUnique( LIBS=['jackdmp', 'dl'] ) 47 48 48 server = serverenv.Program( "jackdmp", srcfiles_macosx_server)49 serverenv.Install( env[' bindir'], server )49 server = serverenv.Program('jackdmp', srcfiles_macosx_server) 50 serverenv.Install( env['BINDIR'], server ) 50 51 51 drv = serverenv.SharedLibrary( "jack_dummy", srcfiles_macosx_dummy )52 serverenv.InstallAs( env[' libdir']+ "/jackmp/jack_dummy.so", drv )52 drv = serverenv.SharedLibrary( 'jack_dummy', srcfiles_macosx_dummy ) 53 serverenv.InstallAs( env['LIBDIR']+ '/jackmp/jack_dummy.so', drv ) 53 54 54 drv = serverenv.SharedLibrary( "jack_coreaudio", srcfiles_macosx_coreaudio )55 serverenv.InstallAs( env[' libdir']+ "/jackmp/jack_coreaudio.so", drv )55 drv = serverenv.SharedLibrary( 'jack_coreaudio', srcfiles_macosx_coreaudio ) 56 serverenv.InstallAs( env['LIBDIR']+ '/jackmp/jack_coreaudio.so', drv ) jack2/trunk/jackmp/SConstruct
r1903 r1910 2 2 # Copyright (C) 2007 Arnold Krille 3 3 # Copyright (C) 2007 Pieter Palmers 4 # Copyright (C) 2008 Marc-Olivier Barre 4 5 # 5 6 # This file originates from FFADO (www.ffado.org) … … 24 25 platform = ARGUMENTS.get('OS', str(Platform())) 25 26 26 build_dir = ARGUMENTS.get('BUILDDIR', "")27 build_dir = ARGUMENTS.get('BUILDDIR', '') 27 28 if build_dir: 28 build_base =build_dir+'/'29 if not os.path.isdir( build_base):30 os.makedirs( build_base)31 print "Building into: "+ build_base29 build_base = build_dir + '/' 30 if not os.path.isdir(build_base): 31 os.makedirs(build_base) 32 print 'Building into: ' + build_base 32 33 else: 33 34 build_base='' 34 35 35 if not os.path.isdir( "cache"):36 os.makedirs( "cache")37 38 opts = Options( "cache/"+build_base+"options.cache")39 40 # make this into a command line option and/or a detected value41 build_for_linux = True 42 43 # 36 if not os.path.isdir('cache'): 37 os.makedirs('cache') 38 39 opts = Options('cache/'+build_base+'options.cache') 40 41 # 42 # Command-line options section 43 # 44 44 45 # If this is just to display a help-text for the variable used via ARGUMENTS, then its wrong... 45 opts.Add( "BUILDDIR", "Path to place the built files in", "") 46 46 opts.Add( 'BUILDDIR', 'Path to place the built files in', '') 47 47 opts.AddOptions( 48 # BoolOption( "DEBUG", """\ 49 #Toggle debug-build. DEBUG means \"-g -Wall\" and more, otherwise we will use 50 # \"-O2\" to optimise.""", True ), 51 PathOption( "PREFIX", "The prefix where jackdmp will be installed to.", "/usr/local", PathOption.PathAccept ), 52 PathOption( "BINDIR", "Overwrite the directory where apps are installed to.", "$PREFIX/bin", PathOption.PathAccept ), 53 PathOption( "LIBDIR", "Overwrite the directory where libs are installed to.", "$PREFIX/lib", PathOption.PathAccept ), 54 PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ), 55 BoolOption( "ENABLE_ALSA", "Enable/Disable the ALSA backend.", True ), 56 BoolOption( "ENABLE_FREEBOB", "Enable/Disable the FreeBoB backend.", True ), 57 BoolOption( "ENABLE_FIREWIRE", "Enable/Disable the FireWire backend.", True ), 58 BoolOption( "DEBUG", """Do a debug build.""", True ), 59 BoolOption( "BUILD_TESTS", """Build tests where applicable.""", True ), 60 BoolOption( "BUILD_EXAMPLES", """Build the example clients in their directory.""", True ), 61 BoolOption( "INSTALL_EXAMPLES", """Install the example clients in the BINDIR directory.""", True ), 62 BoolOption( "BUILD_DOXYGEN_DOCS", """Build doxygen documentation.""", True ), 48 PathOption('PREFIX', 'The prefix where jackdmp will be installed to', '/usr/local', PathOption.PathAccept), 49 PathOption('BINDIR', 'Overwrite the directory where apps are installed to', '$PREFIX/bin', PathOption.PathAccept), 50 PathOption('LIBDIR', 'Overwrite the directory where libs are installed to', '$PREFIX/lib', PathOption.PathAccept), 51 PathOption('INCLUDEDIR', 'Overwrite the directory where headers are installed to', '$PREFIX/include', PathOption.PathAccept), 52 # TODO: The next one is stupid, should be autodetected 53 BoolOption('BUILD_FOR_LINUX', 'Enable/Disable depending on your system', True), 54 BoolOption('ENABLE_ALSA', 'Enable/Disable the ALSA backend', True), 55 BoolOption('ENABLE_FREEBOB', 'Enable/Disable the FreeBoB backend', True), 56 BoolOption('ENABLE_FIREWIRE', 'Enable/Disable the FireWire backend', True), 57 BoolOption('DEBUG', 'Do a debug build', False), 58 BoolOption('BUILD_TESTS', 'Build tests where applicable', True), 59 BoolOption('BUILD_EXAMPLES', 'Build the example clients in their directory', True), 60 BoolOption('INSTALL_EXAMPLES', 'Install the example clients in the BINDIR directory', True), 61 BoolOption('BUILD_DOXYGEN_DOCS', 'Build doxygen documentation', False), 63 62 ) 64 63 65 ## Load the builders in config 64 # 65 # Configuration section 66 # 67 68 # Load the builders in config 66 69 buildenv = os.environ 67 70 if os.environ.has_key('PATH'): … … 80 83 buildenv['LD_LIBRARY_PATH'] = '' 81 84 82 env = Environment( tools=['default','scanreplace','pkgconfig', 'doxygen'], toolpath=['admin'], 83 ENV=buildenv, PLATFORM = platform, options=opts ) 84 85 Help( """ 86 For building jackdmp you can set different options as listed below. You have to 87 specify them only once, scons will save the last value you used and re-use 88 that. 89 To really undo your settings and return to the factory defaults, remove the 90 "cache"-folder and the file ".sconsign.dblite" from this directory. 91 For example with: "rm -Rf .sconsign.dblite cache" 92 93 """ ) 94 Help( opts.GenerateHelpText( env ) ) 85 env = Environment(tools=['default', 'scanreplace', 'pkgconfig', 'doxygen'], toolpath = ['admin'], ENV=buildenv, PLATFORM = platform, options = opts) 86 87 Help('To build jackdmp you can set different options as listed below. You have to specify them only once, scons will save the latest values you set and re-use then. To really undo your settings and return to the factory defaults, remove the .sconsign.dblite and options.cache files from your BUILDDIR directory.') 88 Help(opts.GenerateHelpText(env)) 95 89 96 90 # make sure the necessary dirs exist 97 if not os.path.isdir( "cache/" + build_base ): 98 os.makedirs( "cache/" + build_base ) 99 if not os.path.isdir( 'cache/objects' ): 100 os.makedirs( 'cache/objects' ) 91 if not os.path.isdir('cache/' + build_base): 92 os.makedirs('cache/' + build_base) 101 93 102 94 if build_base: 103 env['build_base']="#/"+build_base 104 else: 105 env['build_base']="#/" 106 107 108 CacheDir( 'cache/objects' ) 109 opts.Save( 'cache/' + build_base + "options.cache", env ) 95 env['build_base']='#/'+build_base 96 else: 97 env['build_base']='#/' 98 99 opts.Save('cache/' + build_base + 'options.cache', env) 110 100 111 101 tests = {} 112 tests.update( env['PKGCONFIG_TESTS'])102 tests.update(env['PKGCONFIG_TESTS']) 113 103 114 104 if not env.GetOption('clean'): 115 conf = Configure( env,105 conf = Configure(env, 116 106 custom_tests = tests, 117 conf_dir = "cache/" + build_base, 118 log_file = "cache/" + build_base + 'config.log' ) 119 120 # 107 conf_dir = 'cache/' + build_base, 108 log_file = 'cache/' + build_base + 'config.log') 109 121 110 # Check if the environment can actually compile c-files by checking for a 122 # header shipped with gcc. 123 # 124 if not conf.CheckHeader( "stdio.h" ): 125 print "It seems as if stdio.h is missing. This probably means that your build environment is broken, please make sure you have a working c-compiler and libstdc installed and usable." 126 Exit( 1 ) 127 128 # 129 # The following checks are for headers and libs and packages we need. 130 # 111 # header shipped with gcc 112 if not conf.CheckHeader( 'stdio.h' ): 113 print 'Error: It seems as if stdio.h is missing. This probably means that your build environment is broken, please make sure you have a working c-compiler and libstdc installed and usable.' 114 Exit(1) 115 116 # The following checks are for headers, libs and packages we depend on 131 117 allpresent = 1; 132 118 133 if build_for_linux: 134 allpresent &= conf.CheckForPKGConfig(); 135 136 # example on how to check for additional libs 137 # pkgs = { 138 # 'alsa' : '1.0.0', 139 # } 140 # for pkg in pkgs: 141 # name2 = pkg.replace("+","").replace(".","").replace("-","").upper() 142 # env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] ) 143 # if env['%s_FLAGS'%name2] == 0: 144 # allpresent &= 0 119 if env['BUILD_FOR_LINUX']: 120 allpresent &= conf.CheckForPKGConfig('0.20'); 145 121 146 122 if not allpresent: 147 print """ 148 (At least) One of the dependencies is missing. I can't go on without it, please 149 install the needed packages (remember to also install the *-devel packages) 150 """ 151 Exit( 1 ) 152 153 # jack doesn't have to be present, but it would be nice to know if it is 154 env['JACK_FLAGS'] = conf.GetPKGFlags( 'jack', '0.100.0' ) 123 print "--> At least one of the dependencies is missing. I can't go on without it, please install the needed packages (remember to also install the *-devel packages)" 124 Exit(1) 125 126 # If jack has the same PREFIX as the one we plan to use, exit with an error message 127 env['JACK_FLAGS'] = conf.GetPKGFlags('jack', '0.90') 155 128 if env['JACK_FLAGS']: 156 env['JACK_PREFIX'] = conf.GetPKGPrefix( 'jack' ) 157 env['JACK_EXEC_PREFIX'] = conf.GetPKGExecPrefix( 'jack' ) 158 env['JACK_LIBDIR'] = conf.GetPKGLibdir( 'jack' ) 159 env['JACK_INCLUDEDIR'] = conf.GetPKGIncludedir( 'jack' ) 160 161 # 129 print "--> Found an existing JACK installation, let's be careful not to erase it" 130 if conf.GetPKGPrefix( 'jack' ) == env['PREFIX']: 131 print '--> JACK is installed in the same directory as our current PREFIX. Either remove JACK or change your installation PREFIX.' 132 Exit(1) 133 162 134 # Optional checks follow: 163 # 164 if build_for_linux and env['ENABLE_ALSA']: 165 env['ALSA_FLAGS'] = conf.GetPKGFlags( 'alsa', '1.0.0' ) 135 if env['BUILD_FOR_LINUX'] and env['ENABLE_ALSA']: 136 env['ALSA_FLAGS'] = conf.GetPKGFlags('alsa', '1.0.0') 166 137 if env['ALSA_FLAGS'] == 0: 167 print " Disabling 'alsa' backend since no useful ALSA installation found."138 print "--> Disabling 'alsa' backend since no useful ALSA installation found" 168 139 env['ENABLE_ALSA'] = False 169 140 170 if build_for_linuxand env['ENABLE_FREEBOB']:171 env['FREEBOB_FLAGS'] = conf.GetPKGFlags( 'libfreebob', '1.0.0')141 if env['BUILD_FOR_LINUX'] and env['ENABLE_FREEBOB']: 142 env['FREEBOB_FLAGS'] = conf.GetPKGFlags('libfreebob', '1.0.0') 172 143 if env['FREEBOB_FLAGS'] == 0: 173 print " Disabling 'freebob' backend since no useful FreeBoB installation found."144 print "--> Disabling 'freebob' backend since no useful FreeBoB installation found" 174 145 env['ENABLE_FREEBOB'] = False 175 146 176 if build_for_linuxand env['ENABLE_FIREWIRE']:177 env['FFADO_FLAGS'] = conf.GetPKGFlags( 'libffado', '1.999.14')147 if env['BUILD_FOR_LINUX'] and env['ENABLE_FIREWIRE']: 148 env['FFADO_FLAGS'] = conf.GetPKGFlags('libffado', '1.999.14') 178 149 if env['FFADO_FLAGS'] == 0: 179 print " Disabling 'firewire' backend since no useful FFADO installation found."150 print "--> Disabling 'firewire' backend since no useful FFADO installation found" 180 151 env['ENABLE_FIREWIRE'] = False 181 152 … … 183 154 184 155 if env['DEBUG']: 185 print "Doing a DEBUG build" 186 # -Werror could be added to, which would force the devs to really remove all the warnings :-) 187 env.AppendUnique( CCFLAGS=["-DDEBUG","-Wall","-g"] ) 188 else: 189 env.AppendUnique( CCFLAGS=["-O3","-DNDEBUG"] ) 190 191 env.AppendUnique( CCFLAGS=["-fPIC", "-DSOCKET_RPC_FIFO_SEMA", "-D__SMP__"] ) 192 env.AppendUnique( CFLAGS=["-fPIC", "-DUSE_POSIX_SHM"] ) 193 194 # 195 # XXX: Maybe we can even drop these lower-case variables and only use the uppercase ones? 196 # 197 env['prefix'] = Template( os.path.join( env['PREFIX'] ) ).safe_substitute( env ) 198 env['bindir'] = Template( os.path.join( env['BINDIR'] ) ).safe_substitute( env ) 199 env['libdir'] = Template( os.path.join( env['LIBDIR'] ) ).safe_substitute( env ) 200 env['includedir'] = Template( os.path.join( env['INCLUDEDIR'] ) ).safe_substitute( env ) 201 202 env.Alias( "install", env['libdir'] ) 203 env.Alias( "install", env['includedir'] ) 204 env.Alias( "install", env['bindir'] ) 156 print '--> Doing a DEBUG build' 157 # TODO: -Werror could be added to, which would force the devs to really remove all the warnings :-) 158 env.AppendUnique(CCFLAGS = ['-DDEBUG', '-Wall', '-g']) 159 else: 160 env.AppendUnique(CCFLAGS = ['-O3','-DNDEBUG']) 161 162 env.AppendUnique(CCFLAGS = ['-fPIC', '-DSOCKET_RPC_FIFO_SEMA', '-D__SMP__']) 163 env.AppendUnique(CFLAGS = ['-fPIC', '-DUSE_POSIX_SHM']) 164 165 env.Alias('install', env['LIBDIR']) 166 env.Alias('install', env['INCLUDEDIR']) 167 env.Alias('install', env['BINDIR']) 205 168 206 169 # for config.h.in 207 env['ADDON_DIR']='%s' % env['prefix'] 170 # TODO: Is that necessary ? 171 env['ADDON_DIR']='%s' % env['PREFIX'] 208 172 env['LIB_DIR']='lib' 209 env['JACK_LOCATION']='%s' % env['bindir'] 210 211 # 173 env['JACK_LOCATION']='%s' % env['BINDIR'] 174 212 175 # To have the top_srcdir as the doxygen-script is used from auto* 213 # 214 env['top_srcdir'] = env.Dir( "." ).abspath 215 216 #subprojects = env.Split('common common/jack tests example-clients linux/alsa linux/freebob linux/firewire') 217 218 #for subproject in subprojects: 219 #env.AppendUnique( CCFLAGS=["-I%s" % subproject] ) 220 #env.AppendUnique( CFLAGS=["-I%s" % subproject] ) 221 222 env.ScanReplace( "config.h.in" ) 223 # ensure that the config.h is always updated, since it 224 # sometimes fails to pick up the changes 225 # note: this still doesn't seem to cause dependent files to be rebuilt. 226 NoCache("config.h") 227 AlwaysBuild("config.h") 228 229 # ensure we have a path to where the libraries are 230 env.AppendUnique( LIBPATH=["#/common"] ) 231 232 # 233 # Start building 234 # 176 # TODO: Understand the previous comment 177 env['top_srcdir'] = env.Dir('.').abspath 178 179 env.ScanReplace( 'config.h.in' ) 180 # TODO: find out what's that about. Is it useful ? 181 AlwaysBuild('config.h') 182 183 # Ensure we have a path to where the libraries are 184 env.AppendUnique(LIBPATH=['#/common']) 185 186 # 187 # Build section 188 # 189 235 190 if env['BUILD_DOXYGEN_DOCS']: 236 env.Doxygen( "doxyfile")191 env.Doxygen('doxyfile') 237 192 238 193 subdirs=['common'] 194 195 # TODO: Really handle each platform automatically 239 196 if env['PLATFORM'] == 'posix': 240 197 subdirs.append('linux') 241 198 242 if env['PLATFORM'] == 'macosx': # FIXME FOR SLETZ: check macosx/SConscript 199 # TODO FOR SLETZ: test macosx/SConscript 200 if env['PLATFORM'] == 'macosx': 243 201 subdirs.append('macosx') 244 202 245 if env['PLATFORM'] == 'windows': # FIXME FOR SLETZ: create/check macosx/SConscript 246 subdirs.append('windows') 203 # TODO FOR SLETZ & MARC: create/check windows/SConscript 204 #if env['PLATFORM'] == 'windows': 205 # subdirs.append('windows') 247 206 248 207 if env['BUILD_EXAMPLES']: … … 253 212 254 213 if build_base: 255 env.SConscript( dirs=subdirs, exports="env", build_dir=build_base+subdir ) 256 else: 257 env.SConscript( dirs=subdirs, exports="env" ) 258 214 env.SConscript(dirs=subdirs, exports='env', build_dir=build_base+subdir) 215 else: 216 env.SConscript(dirs=subdirs, exports='env') jack2/trunk/jackmp/tests/SConscript
r1742 r1910 2 2 # Copyright (C) 2007 Arnold Krille 3 3 # Copyright (C) 2007 Pieter Palmers 4 # Copyright (C) 2008 Marc-Olivier Barre 4 5 # 5 6 # This file originates from FFADO (www.ffado.org) … … 22 23 from string import Template 23 24 24 Import( 'env')25 Import('env') 25 26 26 # paths where include files can be found27 env.AppendUnique( CPPPATH=["#/", "#/common"])27 # Paths where include files can be found 28 env.AppendUnique(CPPPATH=['#/', '#/common']) 28 29 29 30 # 30 # Define the source files31 # Source files section 31 32 # 32 33 33 34 test_programs = { 34 "synchroClient" : "testSynchroClient.cpp #/common/JackPosixSemaphore.cpp #/common/JackPosixThread.cpp #/common/JackError.c #/common/JackFifo.cpp", 35 "synchroServer" : "testSynchroServer.cpp #/common/JackPosixSemaphore.cpp #/common/JackPosixThread.cpp #/common/JackError.c #/common/JackFifo.cpp", 36 "synchroServerClient" : "testSynchroServerClient.cpp #/common/JackPosixSemaphore.cpp #/common/JackPosixThread.cpp #/common/JackError.c #/common/JackFifo.cpp", 37 "testSem" : "testSem.cpp #/common/JackPosixSemaphore.cpp #/common/JackPosixThread.cpp #/common/JackError.c #/common/JackFifo.cpp", 38 "jack_test" : "jack_test.cpp", 35 'synchroClient': [ 36 'testSynchroClient.cpp', 37 '#/common/JackPosixSemaphore.cpp', 38 '#/common/JackPosixThread.cpp', 39 '#/common/JackError.c', 40 '#/common/JackFifo.cpp' 41 ], 42 'synchroServer': [ 43 'testSynchroServer.cpp', 44 '#/common/JackPosixSemaphore.cpp', 45 '#/common/JackPosixThread.cpp', 46 '#/common/JackError.c', 47 '#/common/JackFifo.cpp' 48 ], 49 'synchroServerClient': [ 50 'testSynchroServerClient.cpp', 51 '#/common/JackPosixSemaphore.cpp', 52 '#/common/JackPosixThread.cpp', 53 '#/common/JackError.c', 54 '#/common/JackFifo.cpp' 55 ], 56 'testSem': [ 57 'testSem.cpp', 58 '#/common/JackPosixSemaphore.cpp', 59 '#/common/JackPosixThread.cpp', 60 '#/common/JackError.c', 61 '#/common/JackFifo.cpp' 62 ], 63 'jack_test': [ 64 'jack_test.cpp' 65 ], 39 66 } 40 67 41 68 # 42 # Start building69 # Build section 43 70 # 44 71 45 72 # build the tests 46 73 testenv = env.Copy() 47 testenv.PrependUnique( LIBPATH=env['build_base'])48 testenv.PrependUnique( LIBS="jackmp")74 testenv.PrependUnique(LIBPATH=env['build_base']) 75 testenv.PrependUnique(LIBS='jackmp') 49 76 50 for test_program in test_programs.keys(): 51 testenv.Program(target=test_program, 52 source=env.Split( test_programs[test_program] ) ) 77 for test_program, test_program_source in test_programs.items(): 78 testenv.Program(test_program, test_program_source)
