root/branches/libffado-scons_porting_work/SConstruct

Revision 527, 4.7 kB (checked in by arnonym, 17 years ago)

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.

Line 
1 #! /usr/bin/env python
2
3 import os
4 import sys
5 sys.path.append( "./admin" )
6 from pkgconfig import *
7
8 if not os.path.isdir( "cache" ):
9         os.mkdir( "cache" )
10
11 opts = Options( "cache/options.cache" )
12
13 opts.Add( BoolOption( "DEBUG", "Toggle debug-build.", True ) )
14 opts.AddOptions(
15         BoolOption( "ENABLE_BEBOB", "Enable/Disable the bebob part.", True ),
16         BoolOption( "ENABLE_MOTU", "Enable/Disable the Motu part.", False ),
17         BoolOption( "ENABLE_DICE", "Enable/Disable the DICE part.", False ),
18         BoolOption( "ENABLE_METRIC_HALO", "Enable/Disable the Metric Halo part.", False ),
19         BoolOption( "ENABLE_RME", "Enable/Disable the RME part.", False ),
20         BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE part.", False ),
21         PathOption( "PREFIX", "The prefix where ffado will be installed to.", "/usr/local" ),
22         )
23
24 ## Load the builders in config
25 env = Environment( tools=['default','scanreplace','pyuic'], toolpath=['admin'], ENV = { 'PATH' : os.environ['PATH'], 'PKG_CONFIG_PATH' : os.environ['PKG_CONFIG_PATH'] }, options=opts )
26
27 Help( """
28 For building ffado you can set different options as listed below. You have to
29 specify them only once, scons will save the last value you used and re-use
30 that.
31 To really undo your settings and return to the factory defaults, remove the
32 "cache"-folder and the file ".sconsign.dblite" from this directory.
33 For example with: "rm -Rf .sconsign.dblite cache"
34
35 Currently it seems as if only the BEBOB and the MOTU drivers are
36 kind-of-working, thats why only BEBOB is enabled by default.
37
38 Note that this is a development version! Don't complain if its not working!
39 See www.ffado.org for stable releases.
40 """ )
41 Help( opts.GenerateHelpText( env ) )
42
43 opts.Save( "cache/options.cache", env )
44
45 env.Append( CCFLAGS = "-Wall -g -fpic" )
46
47 if not env.GetOption('clean'):
48         conf = Configure( env, custom_tests={ 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG }, conf_dir='cache', log_file='cache/config.log' )
49
50         if not conf.CheckHeader( "stdio.h" ):
51                 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."
52                 Exit( 1 )
53
54         allpresent = 1;
55         allpresent &= conf.CheckForPKGConfig();
56         allpresent &= conf.CheckForPKG( 'libraw1394', "1.3.0" )
57         allpresent &= conf.CheckForPKG( 'libavc1394', "0.5.3" )
58         allpresent &= conf.CheckForPKG( 'libiec61883', "1.1.0" )
59         allpresent &= conf.CheckForPKG( 'alsa', "1.0.0" )
60         allpresent &= conf.CheckForPKG( 'libxml++-2.6', "2.13.0" )
61         allpresent &= conf.CheckForPKG( 'liblo', "0.22" )
62
63         if not allpresent:
64                 print """
65 (At least) One of the dependencies is missing. I can't go on without it, please
66 install the needed packages (remember to also install the *-devel packages)
67 """
68                 Exit( 1 )
69
70         env = conf.Finish()
71
72
73 if env['DEBUG']:
74         env.AppendUnique( CCFLAGS=["-DDEBUG"] )
75
76 if env['ENABLE_BEBOB']:
77         env.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] )
78 if env['ENABLE_MOTU']:
79         env.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] )
80 if env['ENABLE_DICE']:
81         env.AppendUnique( CCFLAGS=["-DENABLE_DICE"] )
82 if env['ENABLE_METRIC_HALO']:
83         env.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] )
84 if env['ENABLE_RME']:
85         env.AppendUnique( CCFLAGS=["-DENABLE_RME"] )
86 if env['ENABLE_BOUNCE']:
87         env.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] )
88
89 env.MergeFlags( ["!pkg-config --cflags --libs libraw1394"] )
90 env.MergeFlags( ["!pkg-config --cflags --libs libavc1394"] )
91 env.MergeFlags( ["!pkg-config --cflags --libs libiec61883"] )
92 env.MergeFlags( ["!pkg-config --cflags --libs alsa"] )
93 env.MergeFlags( ["!pkg-config --cflags --libs libxml++-2.6"] )
94 env.MergeFlags( ["!pkg-config --cflags --libs liblo"] )
95
96 #env.AppendUnique( CCFLAGS = "-Wall -Werror -g -fpic" )
97 env.AppendUnique( CCFLAGS = env.Split("-Wall -g -fpic") )
98 #env.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,soname -Wl,libffado.so.1") )
99
100
101 #
102 # Some includes in src/*/ are full path (src/*), that should be fixed?
103 env.AppendUnique( CPPPATH=["#/"] )
104
105 env['bindir'] = os.path.join( env['PREFIX'], "bin" )
106 env['libdir'] = os.path.join( env['PREFIX'], "lib" )
107 env['includedir'] = os.path.join( env['PREFIX'], "include" )
108 env['cachedir'] = os.path.join( env['PREFIX'] + "var/cache/libffado" )
109
110 env.Alias( "install", env['libdir'] )
111 env.Alias( "install", env['includedir'] )
112
113 env['PACKAGE'] = "libffado"
114 env['VERSION'] = "1.999.5"
115 env['LIBVERSION'] = "1.0.0"
116
117 #
118 # Start building
119 #
120
121 env.ScanReplace( "config.h.in" )
122 pkgconfig = env.ScanReplace( "libffado.pc.in" )
123 env.Alias( "install", env.Install( env['libdir'] + '/pkgconfig', pkgconfig ) )
124
125 if not os.path.exists( env['cachedir'] ):
126         env.Alias( "install", os.makedirs( env["cachedir"] ) )
127
128 env.SConscript( dirs=['src','libffado','tests','support'], exports="env" )
129
130 # By default only src is built but all is cleaned
131 if not env.GetOption('clean'):
132         Default( 'src' )
133
Note: See TracBrowser for help on using the browser.