1 deps
= {'libogg':{'libs':('ogg',),
2 'headers':('ogg/ogg.h', 'ogg/os_types.h')},
3 'libvorbis':{'libs':('vorbis',),
4 'headers':('vorbis/codec.h', 'vorbis/vorbisenc.h',
5 'vorbis/vorbisfile.h')},
6 'libtheora':{'libs':('theora',),
7 'headers':('theora/theora.h',)},
8 'libshout':{'libs':('shout',),
9 'headers':('shout/shout.h',)},
10 'v4l':{'headers':('linux/videodev.h',)},
11 'jpeg':{'libs':('jpeg',),
12 'headers':('jpeglib.h',)}}
17 modules
= ['null_cam', 'v4l_jpeg']
18 modulesrcs
= {'null_cam':['modules/null_cam.c'] ,
19 'v4l_jpeg':['modules/v4l_jpeg.c']}
20 moduledeps
= {'null_cam':(),
21 'v4l_jpeg':('v4l', 'jpeg')}
22 modulelibs
= {'null_cam':[],
25 #########################################################################
26 # Shouldn't have to edit anything below this line #
27 #########################################################################
29 def checkdeps(ds
, l
, checks
):
32 if deps
[dep
].has_key(check
) :
33 for test
in deps
[dep
][check
] :
34 if not checks
[check
](test
) :
36 if check
== 'libs' : l
.append(test
)
42 checks
= {'funcs':conf
.CheckFunc
,
44 'headers':conf
.CheckCHeader
}
45 test
= checkdeps(('libogg','libvorbis','libtheora','libshout'),
48 print 'Could not find %s, exiting.' % test
50 for module
in modules
:
51 test
= checkdeps(moduledeps
[module
], modulelibs
[module
], checks
)
53 print 'Could not find %s, not building %s module' % (test
, module
)
54 modules
.remove(module
)
58 f
= open('config.cache','w')
59 f
.write('libs=%s\n' % str(libs
))
60 f
.write('cpppath=%s\n' % str(cpppath
))
61 f
.write('modules=%s\n' % str(modules
))
65 # There has *GOT* to be a simpler way to do this!
66 # ... but at least it's more secure.
68 local_cpppath
= ['include']
70 from os
.path
import exists
71 if exists('config.cache'):
72 f
= open('config.cache','r')
73 b
= f
.read().splitlines()
77 global libs
, cpppath
, modules
79 cpppath
= local_cpppath
80 modules
= local_modules
85 Program('dryice', 'src/core.c', CPPPATH
=cpppath
, LIBS
=libs
)
86 for module
in modules
:
87 SharedLibrary('modules/'+module
, modulesrcs
[module
],
88 CPPPATH
=cpppath
, LIBS
=modulelibs
[module
])
91 do
= ARGUMENTS
.get('do', None)