Changeset 1910

Show
Ignore:
Timestamp:
03/06/08 09:55:18 (2 years ago)
Author:
sletz
Message:

Marc-Olivier Barre scons patch (3)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jack2/trunk/jackmp/ChangeLog

    r1906 r1910  
    21212008-03-06 Stephane Letz  <letz@grame.fr> 
    2222                 
     23        * Marc-Olivier Barre scons patch (3). 
     24 
     252008-03-06 Stephane Letz  <letz@grame.fr> 
     26                 
    2327        * Fix JackSocketClientChannel::ClientClose: async call from the client and server does not need to write any reply.  
    2428        * Correct port notification: 2 notifications have to be sent (src, dst) and (dst, src)... 
  • jack2/trunk/jackmp/common/SConscript

    r1903 r1910  
    22# Copyright (C) 2007 Arnold Krille 
    33# Copyright (C) 2007 Pieter Palmers 
     4# Copyright (C) 2008 Marc-Olivier Barre 
    45# 
    5 # This file originally was part of FFADO 
     6# This file originates from FFADO (www.ffado.org) 
    67# 
    78# This program is free software: you can redistribute it and/or modify 
     
    2324from string import Template 
    2425 
    25 Import( 'env'
     26Import('env'
    2627 
    27 # paths where include files can be found 
    28 env.AppendUnique( CPPPATH=["#/", "#/common", "#/common/jack"] ) 
     28# Define the library suffix for POSIX like systems 
     29if env['PLATFORM'] == 'posix': 
     30    env.AppendUnique(SHLIBSUFFIX='.0.0') 
     31 
     32# Paths where include files can be found 
     33env.AppendUnique(CPPPATH=['#/', '#/common', '#/common/jack']) 
     34 
     35# Needed libraries 
     36env.AppendUnique(LIBS=['rt', 'pthread']) 
    2937 
    3038# HACK: this should not be here ideally 
    31 env.AppendUnique( CPPPATH=["#/linux","#/macosx"]
     39env.AppendUnique(CPPPATH=['#/linux','#/macosx']
    3240 
    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 
     42symlinkcmd = 'cd $TARGET.dir && rm -f $TARGET.name && ln -s $SOURCE.name $TARGET.name' 
     43 
     44# Library names 
     45clientlib_name = 'jackmp' 
     46serverlib_name = 'jackservermp' 
     47wrapperlib_name = 'jackwrapper' 
    3548 
    3649# 
    37 # Define the source files 
     50# Source files section 
    3851# 
    3952 
     
    135148 
    136149# 
    137 # Start building 
     150# Build/install section 
    138151# 
    139152 
    140 env.AppendUnique( LIBS=["rt", "pthread"] ) 
     153# Libraries 
     154clientlib = env.SharedLibrary(clientlib_name, srcfiles_common_clientlib) 
     155serverlib = env.SharedLibrary(serverlib_name, srcfiles_common_serverlib) 
     156wrapperlib = env.SharedLibrary(wrapperlib_name, srcfiles_common_wrapperlib) 
     157env.Install( env['LIBDIR'], [clientlib, serverlib, wrapperlib]) 
     158env.Alias('install', env['LIBDIR']) 
    141159 
    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 
    143162if 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') 
    161170 
    162 # install the headers 
     171# Headers 
    163172for 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  
    22# Copyright (C) 2007 Arnold Krille 
    33# Copyright (C) 2007 Pieter Palmers 
     4# Copyright (C) 2008 Marc-Olivier Barre 
    45# 
    56# This file originates from FFADO (www.ffado.org) 
     
    2223from string import Template 
    2324 
    24 Import( 'env'
     25Import('env'
    2526 
    2627# paths where include files can be found 
    27 env.AppendUnique( CPPPATH=["#/", "#/common"]
     28env.AppendUnique(CPPPATH=['#/', '#/common']
    2829 
    2930# 
    30 # Define the source files 
     31# Source files section 
    3132# 
    3233 
    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 
     34example_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   
    4647 
    47 example_client_libs = { 
    48     "inprocess" : "inprocess.c"
    49 
     48example_libs = { 
     49    'inprocess' : 'inprocess.c'
     50   
    5051 
    51 # link extra libs? 
     52# Libraries to link 
    5253extra_libs = {} 
    53 for example_client_program in example_client_programs.keys()
    54     extra_libs[example_client_program] = ["jackservermp", "dl"
     54for example_program in example_programs
     55    extra_libs[example_program] = ['jackservermp', 'dl'
    5556 
    56 # special cases 
    57 extra_libs["jack_load"] = ["jackmp"
    58 extra_libs["jack_unload"] = ["jackmp"
    59  
     57# Replace library listing for some special cases 
     58extra_libs['jack_load'] = ['jackmp'
     59extra_libs['jack_unload'] = ['jackmp'
     60# TODO: we need to really test for READLINE... 
    6061env['HAS_READLINE']=True 
    6162if 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' 
    6465 
    6566# 
    66 # Start building 
     67# Build/install section 
    6768# 
    6869 
    69 # build the  example clients 
    7070if env['BUILD_EXAMPLES']: 
    7171    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]) 
    7875        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  
    22# Copyright (C) 2007 Arnold Krille 
    33# Copyright (C) 2007 Pieter Palmers 
     4# Copyright (C) 2008 Marc-Olivier Barre 
    45# 
    56# This file originates from FFADO (www.ffado.org) 
     
    5960 
    6061server = serverenv.Program("jackdmp", srcfiles_linux_server) 
    61 serverenv.Install( env['bindir'], server ) 
     62serverenv.Install( env['BINDIR'], server ) 
    6263 
    6364drv = serverenv.SharedLibrary( "jack_dummy", srcfiles_linux_dummy ) 
    64 serverenv.InstallAs( env['libdir']+ "/jackmp/jack_dummy.so", drv ) 
     65serverenv.InstallAs( env['LIBDIR']+ "/jackmp/jack_dummy.so", drv ) 
    6566 
    6667if env['ENABLE_ALSA']: 
     
    6869        serverenv.MergeFlags( env['ALSA_FLAGS'] ) 
    6970    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 ) 
    7172 
    7273if env['ENABLE_FREEBOB']: 
     
    7475        serverenv.MergeFlags( env['FREEBOB_FLAGS'] ) 
    7576    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 ) 
    7778 
    7879if env['ENABLE_FIREWIRE']: 
     
    8081        serverenv.MergeFlags( env['FFADO_FLAGS'] ) 
    8182    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  
    22# Copyright (C) 2007 Arnold Krille 
    33# Copyright (C) 2007 Pieter Palmers 
     4# Copyright (C) 2008 Marc-Olivier Barre 
    45# 
    56# This file originates from FFADO (www.ffado.org) 
     
    2223from string import Template 
    2324 
    24 Import( 'env'
     25Import('env'
    2526 
    26 # paths where include files can be found 
    27 env.AppendUnique( CPPPATH=["#/", "#/common", "#/common/jack", "#/macosx"]
     27# Paths to include files 
     28env.AppendUnique(CPPPATH = ['#/', '#/common', '#/common/jack', '#/macosx']
    2829 
    2930# 
    30 # Define the source files 
     31# Source files section 
    3132# 
    3233 
     
    3839 
    3940# 
    40 # Start building 
     41# Build/install section 
    4142# 
    4243 
     
    4445serverenv = env.Copy() 
    4546serverenv.PrependUnique( LIBPATH=env['build_base'] ) 
    46 serverenv.PrependUnique( LIBS=["jackdmp", "dl"] ) 
     47serverenv.PrependUnique( LIBS=['jackdmp', 'dl'] ) 
    4748 
    48 server = serverenv.Program("jackdmp", srcfiles_macosx_server) 
    49 serverenv.Install( env['bindir'], server ) 
     49server = serverenv.Program('jackdmp', srcfiles_macosx_server) 
     50serverenv.Install( env['BINDIR'], server ) 
    5051 
    51 drv = serverenv.SharedLibrary( "jack_dummy", srcfiles_macosx_dummy ) 
    52 serverenv.InstallAs( env['libdir']+ "/jackmp/jack_dummy.so", drv ) 
     52drv = serverenv.SharedLibrary( 'jack_dummy', srcfiles_macosx_dummy ) 
     53serverenv.InstallAs( env['LIBDIR']+ '/jackmp/jack_dummy.so', drv ) 
    5354 
    54 drv = serverenv.SharedLibrary( "jack_coreaudio", srcfiles_macosx_coreaudio ) 
    55 serverenv.InstallAs( env['libdir']+ "/jackmp/jack_coreaudio.so", drv ) 
     55drv = serverenv.SharedLibrary( 'jack_coreaudio', srcfiles_macosx_coreaudio ) 
     56serverenv.InstallAs( env['LIBDIR']+ '/jackmp/jack_coreaudio.so', drv ) 
  • jack2/trunk/jackmp/SConstruct

    r1903 r1910  
    22# Copyright (C) 2007 Arnold Krille 
    33# Copyright (C) 2007 Pieter Palmers 
     4# Copyright (C) 2008 Marc-Olivier Barre 
    45# 
    56# This file originates from FFADO (www.ffado.org) 
     
    2425platform = ARGUMENTS.get('OS', str(Platform())) 
    2526 
    26 build_dir = ARGUMENTS.get('BUILDDIR', ""
     27build_dir = ARGUMENTS.get('BUILDDIR', ''
    2728if 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_base 
     29    build_base = build_dir + '/' 
     30    if not os.path.isdir(build_base): 
     31        os.makedirs(build_base
     32    print 'Building into: ' + build_base 
    3233else: 
    3334    build_base='' 
    3435 
    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 value 
    41 build_for_linux = True 
    42  
    43 
     36if not os.path.isdir('cache'): 
     37    os.makedirs('cache'
     38 
     39opts = Options('cache/'+build_base+'options.cache'
     40 
     41# 
     42# Command-line options section 
     43
     44 
    4445# 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  
     46opts.Add( 'BUILDDIR', 'Path to place the built files in', '') 
    4747opts.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), 
    6362    ) 
    6463 
    65 ## Load the builders in config 
     64
     65# Configuration section 
     66
     67 
     68# Load the builders in config 
    6669buildenv = os.environ 
    6770if os.environ.has_key('PATH'): 
     
    8083    buildenv['LD_LIBRARY_PATH'] = '' 
    8184 
    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 ) ) 
     85env = Environment(tools=['default', 'scanreplace', 'pkgconfig', 'doxygen'], toolpath = ['admin'], ENV=buildenv, PLATFORM = platform, options = opts) 
     86 
     87Help('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.') 
     88Help(opts.GenerateHelpText(env)) 
    9589 
    9690# 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' ) 
     91if not os.path.isdir('cache/' + build_base): 
     92    os.makedirs('cache/' + build_base) 
    10193 
    10294if 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 
     96else: 
     97    env['build_base']='#/' 
     98 
     99opts.Save('cache/' + build_base + 'options.cache', env) 
    110100 
    111101tests = {} 
    112 tests.update( env['PKGCONFIG_TESTS']
     102tests.update(env['PKGCONFIG_TESTS']
    113103 
    114104if not env.GetOption('clean'): 
    115     conf = Configure( env, 
     105    conf = Configure(env, 
    116106        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 
    121110    # 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 
    131117    allpresent = 1; 
    132118 
    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'); 
    145121 
    146122    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') 
    155128    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 
    162134    # 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') 
    166137        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
    168139            env['ENABLE_ALSA'] = False 
    169140 
    170     if build_for_linux and 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'
    172143        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
    174145            env['ENABLE_FREEBOB'] = False 
    175146 
    176     if build_for_linux and 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'
    178149        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
    180151            env['ENABLE_FIREWIRE'] = False 
    181152 
     
    183154 
    184155if 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']) 
     159else: 
     160    env.AppendUnique(CCFLAGS = ['-O3','-DNDEBUG']) 
     161 
     162env.AppendUnique(CCFLAGS = ['-fPIC', '-DSOCKET_RPC_FIFO_SEMA', '-D__SMP__']) 
     163env.AppendUnique(CFLAGS = ['-fPIC', '-DUSE_POSIX_SHM']) 
     164 
     165env.Alias('install', env['LIBDIR']) 
     166env.Alias('install', env['INCLUDEDIR']) 
     167env.Alias('install', env['BINDIR']) 
    205168 
    206169# for config.h.in 
    207 env['ADDON_DIR']='%s' % env['prefix'] 
     170# TODO: Is that necessary ? 
     171env['ADDON_DIR']='%s' % env['PREFIX'] 
    208172env['LIB_DIR']='lib' 
    209 env['JACK_LOCATION']='%s' % env['bindir'] 
    210  
    211 
     173env['JACK_LOCATION']='%s' % env['BINDIR'] 
     174 
    212175# 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 
     177env['top_srcdir'] = env.Dir('.').abspath 
     178 
     179env.ScanReplace( 'config.h.in' ) 
     180# TODO: find out what's that about. Is it useful ? 
     181AlwaysBuild('config.h') 
     182 
     183# Ensure we have a path to where the libraries are 
     184env.AppendUnique(LIBPATH=['#/common']) 
     185 
     186
     187# Build section 
     188
     189 
    235190if env['BUILD_DOXYGEN_DOCS']: 
    236     env.Doxygen("doxyfile"
     191    env.Doxygen('doxyfile'
    237192 
    238193subdirs=['common'] 
     194 
     195# TODO: Really handle each platform automatically 
    239196if env['PLATFORM'] == 'posix': 
    240197    subdirs.append('linux') 
    241198 
    242 if env['PLATFORM'] == 'macosx': # FIXME FOR SLETZ: check macosx/SConscript 
     199# TODO FOR SLETZ: test macosx/SConscript 
     200if env['PLATFORM'] == 'macosx': 
    243201    subdirs.append('macosx') 
    244202 
    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') 
    247206 
    248207if env['BUILD_EXAMPLES']: 
     
    253212 
    254213if 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) 
     215else: 
     216    env.SConscript(dirs=subdirs, exports='env') 
  • jack2/trunk/jackmp/tests/SConscript

    r1742 r1910  
    22# Copyright (C) 2007 Arnold Krille 
    33# Copyright (C) 2007 Pieter Palmers 
     4# Copyright (C) 2008 Marc-Olivier Barre 
    45# 
    56# This file originates from FFADO (www.ffado.org) 
     
    2223from string import Template 
    2324 
    24 Import( 'env'
     25Import('env'
    2526 
    26 # paths where include files can be found 
    27 env.AppendUnique( CPPPATH=["#/", "#/common"]
     27# Paths where include files can be found 
     28env.AppendUnique(CPPPATH=['#/', '#/common']
    2829 
    2930# 
    30 # Define the source files 
     31# Source files section 
    3132# 
    3233 
    3334test_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        ], 
    3966} 
    4067 
    4168# 
    42 # Start building 
     69# Build section 
    4370# 
    4471 
    4572# build the tests 
    4673testenv = env.Copy() 
    47 testenv.PrependUnique( LIBPATH=env['build_base']
    48 testenv.PrependUnique( LIBS="jackmp"
     74testenv.PrependUnique(LIBPATH=env['build_base']
     75testenv.PrependUnique(LIBS='jackmp'
    4976 
    50 for test_program in test_programs.keys(): 
    51     testenv.Program(target=test_program,  
    52                     source=env.Split( test_programs[test_program] ) ) 
     77for test_program, test_program_source in test_programs.items(): 
     78    testenv.Program(test_program, test_program_source)