Changeset 565

Show
Ignore:
Timestamp:
08/25/07 06:55:39 (14 years ago)
Author:
ppalmers
Message:

add support for out-of-tree building using 'scons BUILDDIR=target_build_dir'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/external/dbus/SConscript

    r564 r565  
    1515 
    1616# add the local version of libdbus++ 
    17 dbus_env.AppendUnique( CCFLAGS=["-I./external/dbus/include"] ) 
    18 dbus_env.AppendUnique( LIBPATH="#/external/dbus" ) 
    19 dbus_env.AppendUnique( LIBS="dbus-c++" ) 
     17dbus_env.AppendUnique( CPPPATH=["#/external/dbus/include"] ) 
     18dbus_env.AppendUnique( LIBPATH=[env['build_base']+"external/dbus"]) 
     19dbus_env.AppendUnique( LIBS=["dbus-c++"] ) 
     20dbus_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE"] ) 
    2021 
    2122sources = [ 
     
    3536] 
    3637 
    37 dbus_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE", "-I./external/dbus/include"] ) 
    3838if env['DEBUG']: 
    3939        dbus_env.AppendUnique( CCFLAGS=["-DDEBUG","-g"] ) 
     
    4141dbus_env.PrependUnique( LIBS=["expat"] ) 
    4242libdbuspp=dbus_env.StaticLibrary('dbus-c++', sources) 
    43  
    4443 
    4544# 
     
    5756] 
    5857 
    59 tools_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE", "-I./external/dbus/include"] ) 
    60 tools_env.PrependUnique( LIBPATH="#/external/dbus" ) 
     58tools_env.AppendUnique( CCFLAGS=["-DDBUS_API_SUBJECT_TO_CHANGE"] ) 
     59tools_env.AppendUnique( CPPPATH=["#/external/dbus/include"] ) 
     60tools_env.PrependUnique( LIBPATH=env['build_base']+"external/dbus" ) 
    6161tools_env.PrependUnique( LIBS="dbus-c++" ) 
    6262 
  • trunk/libffado/SConstruct

    r564 r565  
    66from pkgconfig import * 
    77 
     8build_dir = ARGUMENTS.get('BUILDDIR', "") 
     9if build_dir: 
     10        build_base=build_dir+'/' 
     11        if not os.path.isdir( build_base ): 
     12                os.makedirs( build_base ) 
     13        print "Building into: " + build_base 
     14else: 
     15        build_base='' 
     16 
    817if not os.path.isdir( "cache" ): 
    9         os.mkdir( "cache" ) 
    10         os.mkdir( "cache/objects" ) 
     18        os.makedirs( "cache" ) 
    1119 
    12 opts = Options( "cache/options.cache" ) 
     20opts = Options( "cache/"+build_base+"options.cache" ) 
     21 
     22opts.Add( "BUILDDIR", "Path to place the built files in", "") 
    1323 
    1424opts.AddOptions( 
     
    5161Help( opts.GenerateHelpText( env ) ) 
    5262 
    53 opts.Save( "cache/options.cache", env ) 
     63# make sure the necessary dirs exist 
     64if not os.path.isdir( "cache/" + build_base ): 
     65        os.makedirs( "cache/" + build_base ) 
     66if not os.path.isdir( "cache/" + build_base + 'objects' ): 
     67        os.makedirs( "cache/" + build_base + 'objects' ) 
    5468 
    55 CacheDir( 'cache/objects' ) 
     69CacheDir( 'cache/' + build_base + 'objects' ) 
     70 
     71opts.Save( 'cache/' + build_base + "options.cache", env ) 
    5672 
    5773if not env.GetOption('clean'): 
    58         conf = Configure( env, custom_tests={ 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG }, conf_dir='cache', log_file='cache/config.log' ) 
     74        conf = Configure( env, custom_tests={ 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG }, conf_dir="cache/" + build_base, log_file="cache/" + build_base + 'config.log' ) 
    5975 
    6076        if not conf.CheckHeader( "stdio.h" ): 
     
    151167 
    152168 
    153 env.SConscript( dirs=['src','libffado','tests','support','external'], exports="env" ) 
     169subdirs=['src','libffado','tests','support','external'] 
     170if build_base: 
     171        env['build_base']="#/"+build_base 
     172        for subdir in subdirs: 
     173                env.SConscript( dirs=subdir, exports="env", build_dir=build_base+subdir ) 
     174else: 
     175        env['build_base']="#/" 
     176        env.SConscript( dirs=subdirs, exports="env" ) 
     177 
    154178 
    155179# By default only src is built but all is cleaned 
  • trunk/libffado/src/SConscript

    r561 r565  
    188188# 
    189189env2 = env.Copy() 
    190 env2.PrependUnique( LIBPATH="#/src" ) 
     190env2.PrependUnique( LIBPATH=env['build_base']+"src" ) 
    191191env2.PrependUnique( LIBS="ffado" ) 
    192192 
  • trunk/libffado/tests/SConscript

    r561 r565  
    66 
    77env.PrependUnique( CPPPATH=["#/src"] ) 
    8 env.PrependUnique( LIBPATH=["#/src"] ) 
     8env.PrependUnique( LIBPATH=[env['build_base']+"src"] ) 
    99env.PrependUnique( LIBS=["ffado"] ) 
    1010 
     
    1818env.Program( target="test-sytmonitor", source = env.Split( "test-sytmonitor.cpp SytMonitor.cpp" ) ) 
    1919 
     20env.Program( target="test-dbus", source = env.Split( "test-dbus.cpp" ) ) 
     21 
    2022env.SConscript( dirs="streaming", exports="env" ) 
    2123