root/branches/libffado-scons_porting_work/SConstruct

Revision 526, 4.4 kB (checked in by arnonym, 17 years ago)

installing ffado should work now (it does here). simply do "scons install" to get the lib, header and pkg-config file installed to the PREFIX...

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