Changeset 527

Show
Ignore:
Timestamp:
08/20/07 09:57:14 (14 years ago)
Author:
arnonym
Message:

More on the installation. and the directory for the cache is now defined via config.h so adopt the devicemanager to it.

I think I have to look into libtool for the installation of libs...

And there should probably be a configure-check for the architecture, as I don't think that everybody needs the -fpic.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-scons_porting_work/config.h.in

    r526 r527  
    2525#define VERSION "$VERSION" 
    2626 
     27#define CACHEDIR "$cachedir" 
     28 
  • branches/libffado-scons_porting_work/SConstruct

    r526 r527  
    4343opts.Save( "cache/options.cache", env ) 
    4444 
    45 #env.Append( CCFLAGS = "-Wall -Werror -g -fpic" ) 
    4645env.Append( CCFLAGS = "-Wall -g -fpic" ) 
    47  
    4846 
    4947if not env.GetOption('clean'): 
     
    7674        env.AppendUnique( CCFLAGS=["-DDEBUG"] ) 
    7775 
    78 env.AppendUnique( CCFLAGS=['-DCACHEDIR=\'\".\"\''] ) 
    79  
    8076if env['ENABLE_BEBOB']: 
    8177        env.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] ) 
     
    9894env.MergeFlags( ["!pkg-config --cflags --libs liblo"] ) 
    9995 
     96#env.AppendUnique( CCFLAGS = "-Wall -Werror -g -fpic" ) 
     97env.AppendUnique( CCFLAGS = env.Split("-Wall -g -fpic") ) 
     98#env.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,soname -Wl,libffado.so.1") ) 
     99 
    100100 
    101101# 
     
    103103env.AppendUnique( CPPPATH=["#/"] ) 
    104104 
    105 env['bindir'] = env['PREFIX'] + "/bin" 
    106 env['libdir'] = env['PREFIX'] + "/lib" 
    107 env['includedir'] = env['PREFIX'] + "/include" 
     105env['bindir'] = os.path.join( env['PREFIX'], "bin" ) 
     106env['libdir'] = os.path.join( env['PREFIX'], "lib" ) 
     107env['includedir'] = os.path.join( env['PREFIX'], "include" ) 
     108env['cachedir'] = os.path.join( env['PREFIX'] + "var/cache/libffado" ) 
    108109 
    109110env.Alias( "install", env['libdir'] ) 
     
    122123env.Alias( "install", env.Install( env['libdir'] + '/pkgconfig', pkgconfig ) ) 
    123124 
     125if not os.path.exists( env['cachedir'] ): 
     126        env.Alias( "install", os.makedirs( env["cachedir"] ) ) 
     127 
    124128env.SConscript( dirs=['src','libffado','tests','support'], exports="env" ) 
    125129 
  • branches/libffado-scons_porting_work/src/devicemanager.cpp

    r516 r527  
    2323 */ 
    2424 
     25#include "config.h" 
     26 
    2527#include "fbtypes.h" 
    2628 
     
    520522    Glib::ustring cachePath; 
    521523    char* pCachePath; 
    522     if ( asprintf( &pCachePath, "%s/cache/libffado/",  CACHEDIR ) < 0 ) { 
     524    if ( asprintf( &pCachePath, "%s/libffado/",  CACHEDIR ) < 0 ) { 
    523525        debugError( "Could not create path string for cache pool (trying '/var/cache/libffado' instead)\n" ); 
    524526        cachePath == "/var/cache/libffado/"; 
  • branches/libffado-scons_porting_work/src/SConscript

    r526 r527  
    55Import( 'env' ) 
    66 
    7 env = env.Copy(
     7env.AppendUnique( CPPPATH=["#/", "#/src"]
    88 
    9 env.AppendUnique( CPPPATH=["#/src"]
     9env1 = env.Copy(
    1010 
    1111ffado_source = env.Split( '\ 
     
    117117        source += bounce_source 
    118118 
    119 ffadolib = env.SharedLibrary( "ffado", source ) 
     119env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") ) 
     120ffadolib = env1.SharedLibrary( "ffado", source ) 
    120121 
    121 env.Alias( "install", env.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) ) 
    122 env.Ignore( ffadolib, os.path.join('$libdir','libffado.so') ) 
    123 #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib ) 
    124 #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" ) 
     122
     123# All the following tries to emulate the versioning of installed libs as seen from libtool... 
     124
     125if False: 
     126        print "Trying to emulate libtools versioned install" 
     127        env1.Alias( "install", env1.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) ) 
     128        env1.Ignore( ffadolib, os.path.join('$libdir','libffado.so') ) 
     129        #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib ) 
     130        #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" ) 
    125131 
    126 env.Alias( "install", env.Command( target=env['libdir']+"/libffado.so", source=env['libdir']+"/libffado.so.$LIBVERSION", action="ln -s libffado.so.%s $libdir/libffado.so" % env['LIBVERSION'] ) ) 
    127 env.Alias( "install", env.Command( target="$libdir/libffado.so.%s" % str(env['LIBVERSION']).rsplit('.',1)[0], source=env['libdir']+"/libffado.so.$LIBVERSION", action="ln -s $SOURCE $TARGET" ) ) 
    128 env.Alias( "install", env.Command( target="$libdir/libffado.so.%s" % str(env['LIBVERSION']).rsplit('.',2)[0], source=env['libdir']+"/libffado.so.$LIBVERSION", action="ln -s $SOURCE $TARGET" ) ) 
     132        env1.Alias( "install", env1.Command( 
     133                target="$libdir/libffado.so", 
     134                source=env1['libdir']+"/libffado.so.$LIBVERSION", 
     135                action="ln -s $SOURCE $TARGET" 
     136                ) ) 
     137        env1.Alias( "install", env1.Command( 
     138                target="$libdir/libffado.so.%s" % str(env1['LIBVERSION']).rsplit('.',1)[0], 
     139                source=env1['libdir']+"/libffado.so.$LIBVERSION", 
     140                action="ln -s $SOURCE $TARGET" 
     141                ) ) 
     142        env1.Alias( "install", env1.Command( 
     143                target="$libdir/libffado.so.%s" % str(env1['LIBVERSION']).rsplit('.',2)[0], 
     144                source=env1['libdir']+"/libffado.so.$LIBVERSION", 
     145                action="ln -s $SOURCE $TARGET" 
     146                ) ) 
     147else: 
     148        print "Doing simple install" 
     149        env1.Alias( "install", env1.Install( "$libdir", ffadolib ) ) 
     150 
    129151 
    130152# 
    131153# For the debugging apps 
    132154# 
    133 env.AppendUnique( LIBPATH="#/src" ) 
    134 env.AppendUnique( LIBS="ffado" ) 
     155env2 = env.Copy() 
     156env2.AppendUnique( LIBPATH="#/src" ) 
     157env2.AppendUnique( LIBS="ffado" ) 
    135158 
    136159apps = { \ 
     
    144167 
    145168for app in apps.keys(): 
    146         env.Program( target=app, source = env.Split( apps[app] ) ) 
     169        env2.Program( target=app, source = env.Split( apps[app] ) ) 
    147170