root/trunk/libffado/src/SConscript

Revision 561, 5.7 kB (checked in by arnonym, 14 years ago)

Merge the scons-branch to trunk.

This basicly adds scons as a buildsystem. This does not mean that auto* is dropped instantly (the added files should not collide) but allows for some testing in the transition-process. The auto*-files are deleted later on...

Due to this, the config.h.in (which gets built by autogen.sh) is copied from config.h.in.scons using scons. When dropping make this file should be moved to config.h.in.

The scons-system is probably missing a lot of things you are used to in make. But at least here it does build a usable libffado. :-)

To use scons, simply do a "scons". If you want to know about configuration, "scons -h" allows you to view and set parameters, which are saved from there on. What do I mean with this? "scons -h PREFIX=$HOME" sets the install-prefix to $HOME and shows the helptext that already incorporates the changed option. Another "scons -h" will show the same help-text and scons remembers the changed prefix. "scons" now builds the libs and apps and "scons install" installs everything into the prefix. "scons -c install" cleans the local dir and uninstalls the package while "scons -c" just cleans the local dir.

BTW: I also set several more ignores, I am just to lazy to split these two commits. ;-)

Line 
1 #! /usr/bin/env python
2
3 import os
4
5 Import( 'env' )
6
7 env.AppendUnique( CPPPATH=["#/", "#/src"] )
8
9 env1 = env.Copy()
10
11 ffado_source = env.Split( '\
12         devicemanager.cpp \
13         ffado.cpp \
14         ffado_streaming.cpp \
15         ffadodevice.cpp \
16         debugmodule/debugmodule.cpp \
17         libavc/streamformat/avc_extended_stream_format.cpp \
18         libavc/util/avc_serialize.cpp \
19         libavc/musicsubunit/avc_descriptor_music.cpp \
20         libavc/musicsubunit/avc_musicsubunit.cpp \
21         libavc/audiosubunit/avc_audiosubunit.cpp \
22         libavc/audiosubunit/avc_function_block.cpp \
23         libavc/descriptors/avc_descriptor_cmd.cpp \
24         libavc/descriptors/avc_descriptor.cpp \
25         libavc/general/avc_extended_subunit_info.cpp \
26         libavc/general/avc_unit_info.cpp \
27         libavc/general/avc_generic.cpp \
28         libavc/general/avc_subunit_info.cpp \
29         libavc/general/avc_connect.cpp \
30         libavc/general/avc_signal_format.cpp \
31         libavc/general/avc_extended_cmd_generic.cpp \
32         libavc/general/avc_extended_plug_info.cpp \
33         libavc/general/avc_plug_info.cpp \
34         libavc/general/avc_unit.cpp \
35         libavc/general/avc_subunit.cpp \
36         libavc/general/avc_plug.cpp \
37         libavc/general/avc_vendor_dependent_cmd.cpp \
38         libavc/avc_definitions.cpp \
39         libavc/ccm/avc_signal_source.cpp \
40         libieee1394/ARMHandler.cpp \
41         libieee1394/configrom.cpp \
42         libieee1394/csr1212.c \
43         libieee1394/ieee1394service.cpp \
44         libieee1394/IEC61883.cpp \
45         libosc/OscArgument.cpp \
46         libosc/OscClient.cpp \
47         libosc/OscMessage.cpp \
48         libosc/OscNode.cpp \
49         libosc/OscResponse.cpp \
50         libosc/OscServer.cpp \
51         libstreaming/cip.c \
52         libstreaming/IsoHandler.cpp \
53         libstreaming/IsoHandlerManager.cpp \
54         libstreaming/IsoStream.cpp \
55         libstreaming/Port.cpp \
56         libstreaming/PortManager.cpp \
57         libstreaming/StreamProcessor.cpp \
58         libstreaming/StreamProcessorManager.cpp \
59         libutil/DelayLockedLoop.cpp \
60         libutil/PacketBuffer.cpp \
61         libutil/OptionContainer.cpp \
62         libutil/PosixThread.cpp \
63         libutil/ringbuffer.c \
64         libutil/serialize.cpp \
65         libutil/StreamStatistics.cpp \
66         libutil/SystemTimeSource.cpp \
67         libutil/Time.c \
68         libutil/TimeSource.cpp \
69         libutil/TimestampedBuffer.cpp \
70 ' )
71
72 bebob_source = env.Split( '\
73         bebob/bebob_avdevice.cpp \
74         bebob/bebob_avdevice_subunit.cpp \
75         bebob/bebob_avplug.cpp \
76         bebob/bebob_dl_bcd.cpp \
77         bebob/bebob_dl_codes.cpp \
78         bebob/bebob_dl_mgr.cpp \
79         bebob/bebob_functionblock.cpp \
80         bebob/GenericMixer.cpp \
81         bebob/vendorspecific/focusrite.cpp \
82         bebob/vendorspecific/terratec.cpp \
83         maudio/maudio_avdevice.cpp \
84 ' )
85 bebob_pkgdata = env.Split( '\
86         maudio/refdesign.xml \
87         maudio/fw410.xml \
88         maudio/fwap.xml \
89 ' )
90
91 genericavc_source =  env.Split( '\
92         genericavc/avc_avdevice.cpp \
93         genericavc/avc_vendormodel.cpp \
94 ' )
95
96 motu_source = env.Split( '\
97         motu/motu_avdevice.cpp \
98         libstreaming/MotuPort.cpp \
99         libstreaming/MotuPortInfo.cpp \
100         libstreaming/MotuStreamProcessor.cpp \
101 ' )
102
103 dice_source = env.Split( '\
104         dice/dice_avdevice.cpp \
105 ' )
106
107 bounce_source = env.Split( '\
108         bounce/bounce_avdevice.cpp \
109         bounce/bounce_slave_avdevice.cpp \
110         libstreaming/AmdtpSlaveStreamProcessor.cpp \
111 ' )
112
113 metric_halo_source = env.Split( '\
114         metrichalo/mh_avdevice.cpp \
115 ' )
116
117 rme_source = env.Split( '\
118         rme/rme_avdevice.cpp \
119 ' )
120
121 amdtp_source = env.Split( '\
122         libstreaming/AmdtpPort.cpp \
123         libstreaming/AmdtpPortInfo.cpp \
124         libstreaming/AmdtpStreamProcessor.cpp \
125 ' )
126
127 source = ffado_source
128 if env['ENABLE_BEBOB']:
129         source += bebob_source
130 if env['ENABLE_GENERIC_AVC']:
131         source += genericavc_source
132 if env['ENABLE_MOTU']:
133         source += motu_source
134 if env['ENABLE_DICE']:
135         source += dice_source
136 if env['ENABLE_METRIC_HALO']:
137         source += metric_halo_source
138 if env['ENABLE_RME']:
139         source += rme_source
140 if env['ENABLE_BOUNCE']:
141         source += bounce_source
142
143 if env['ENABLE_BEBOB'] or env['ENABLE_GENERIC_AVC'] or env['ENABLE_DICE'] or env['ENABLE_BOUNCE']:
144         source += amdtp_source
145
146 env1.MergeFlags( "-lrt" )
147
148 #env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") )
149 ffadolib = env1.SharedLibrary( "ffado", source )
150
151 #
152 # All the following tries to emulate the versioning of installed libs as seen from libtool...
153 #
154 if False:
155         print "Trying to emulate libtools versioned install"
156         env1.Alias( "install", env1.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) )
157         env1.Ignore( ffadolib, os.path.join('$libdir','libffado.so') )
158         #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib )
159         #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" )
160
161         env1.Alias( "install", env1.Command(
162                 target="$libdir/libffado.so",
163                 source=env1['libdir']+"/libffado.so.$LIBVERSION",
164                 action="ln -s $SOURCE $TARGET"
165                 ) )
166         env1.Alias( "install", env1.Command(
167                 target="$libdir/libffado.so.%s" % str(env1['LIBVERSION']).rsplit('.',1)[0],
168                 source=env1['libdir']+"/libffado.so.$LIBVERSION",
169                 action="ln -s $SOURCE $TARGET"
170                 ) )
171         env1.Alias( "install", env1.Command(
172                 target="$libdir/libffado.so.%s" % str(env1['LIBVERSION']).rsplit('.',2)[0],
173                 source=env1['libdir']+"/libffado.so.$LIBVERSION",
174                 action="ln -s $SOURCE $TARGET"
175                 ) )
176 else:
177         print "Doing simple install"
178         env1.Alias( "install", env1.Install( "$libdir", ffadolib ) )
179
180 #
181 # Install the *_pkgdata to $sharedir
182 #
183 for data in bebob_pkgdata:
184         env1.Alias( "install", env1.Install( "$sharedir", data ) )
185
186 #
187 # For the debugging apps
188 #
189 env2 = env.Copy()
190 env2.PrependUnique( LIBPATH="#/src" )
191 env2.PrependUnique( LIBS="ffado" )
192
193 apps = { \
194         "bridgeco-downloader": "bridgeco-downloader.cpp", \
195         "bebob-sync" : "bebob-sync.cpp", \
196         "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \
197         "test-dll" : "libutil/test-dll.cpp", \
198         "test-unittests-util" : "libutil/unittests.cpp", \
199         "test-unittests-osc" : "libosc/unittests.cpp" \
200 }
201
202 for app in apps.keys():
203         env2.Program( target=app, source = env.Split( apps[app] ) )
204
205 env2.Alias( "install", env2.Install( "$bindir", "bebob-sync" ) )
206 env2.Alias( "install", env2.Install( "$bindir", "bridgeco-downloader" ) )
207
Note: See TracBrowser for help on using the browser.