root/branches/libffado-scons_porting_work/SConstruct

Revision 531, 4.7 kB (checked in by arnonym, 15 years ago)

Install the maudio-files into <prefix>/share/libffado.

Adopt the cachedir-path.

Break creation of cachedir on install. Will fix it tomorrow...

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 if not env.GetOption('clean'):
46         conf = Configure( env, custom_tests={ 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG }, conf_dir='cache', log_file='cache/config.log' )
47
48         if not conf.CheckHeader( "stdio.h" ):
49                 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."
50                 Exit( 1 )
51
52         allpresent = 1;
53         allpresent &= conf.CheckForPKGConfig();
54         allpresent &= conf.CheckForPKG( 'libraw1394', "1.3.0" )
55         allpresent &= conf.CheckForPKG( 'libavc1394', "0.5.3" )
56         allpresent &= conf.CheckForPKG( 'libiec61883', "1.1.0" )
57         allpresent &= conf.CheckForPKG( 'alsa', "1.0.0" )
58         allpresent &= conf.CheckForPKG( 'libxml++-2.6', "2.13.0" )
59         allpresent &= conf.CheckForPKG( 'liblo', "0.22" )
60
61         if not allpresent:
62                 print """
63 (At least) One of the dependencies is missing. I can't go on without it, please
64 install the needed packages (remember to also install the *-devel packages)
65 """
66                 Exit( 1 )
67
68         env = conf.Finish()
69
70
71 if env['DEBUG']:
72         print "Doing a debug build"
73         # -Werror could be added to, which would force the devs to really remove all the warnings :-)
74         env.AppendUnique( CCFLAGS=["-DDEBUG","-Wall","-g"] )
75
76
77 if env['ENABLE_BEBOB']:
78         env.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] )
79 if env['ENABLE_MOTU']:
80         env.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] )
81 if env['ENABLE_DICE']:
82         env.AppendUnique( CCFLAGS=["-DENABLE_DICE"] )
83 if env['ENABLE_METRIC_HALO']:
84         env.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] )
85 if env['ENABLE_RME']:
86         env.AppendUnique( CCFLAGS=["-DENABLE_RME"] )
87 if env['ENABLE_BOUNCE']:
88         env.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] )
89
90 env.MergeFlags( ["!pkg-config --cflags --libs libraw1394"] )
91 env.MergeFlags( ["!pkg-config --cflags --libs libavc1394"] )
92 env.MergeFlags( ["!pkg-config --cflags --libs libiec61883"] )
93 env.MergeFlags( ["!pkg-config --cflags --libs alsa"] )
94 env.MergeFlags( ["!pkg-config --cflags --libs libxml++-2.6"] )
95 env.MergeFlags( ["!pkg-config --cflags --libs liblo"] )
96
97
98 #
99 # Some includes in src/*/ are full path (src/*), that should be fixed?
100 env.AppendUnique( CPPPATH=["#/"] )
101
102 env['bindir'] = os.path.join( env['PREFIX'], "bin" )
103 env['libdir'] = os.path.join( env['PREFIX'], "lib" )
104 env['includedir'] = os.path.join( env['PREFIX'], "include" )
105 env['sharedir'] = os.path.join( env['PREFIX'], "share/libffado" )
106 env['cachedir'] = os.path.join( env['PREFIX'], "var/cache/libffado" )
107
108 env.Alias( "install", env['libdir'] )
109 env.Alias( "install", env['includedir'] )
110
111 env['PACKAGE'] = "libffado"
112 env['VERSION'] = "1.999.5"
113 env['LIBVERSION'] = "1.0.0"
114
115 #
116 # Start building
117 #
118
119 env.ScanReplace( "config.h.in" )
120 pkgconfig = env.ScanReplace( "libffado.pc.in" )
121 env.Alias( "install", env.Install( env['libdir'] + '/pkgconfig', pkgconfig ) )
122
123
124 env.SConscript( dirs=['src','libffado','tests','support'], exports="env" )
125
126 # By default only src is built but all is cleaned
127 if not env.GetOption('clean'):
128         Default( 'src' )
129         #env.Alias( "install", env["cachedir"], os.makedirs( env["cachedir"] ) )
130         env.Alias( "install", env.Install( env["cachedir"], "" ) ) #os.makedirs( env["cachedir"] ) )
131
132
Note: See TracBrowser for help on using the browser.