4 # - plugins/puredata: add pd compilation
5 # - java: add swig compilation
6 # - doc: add docbook2html and doxygen
7 # - tests: move to new unit test system
21 opt.add_option('--disable-fftw3f', action='store_true', default=False,
22 help='compile with fftw3 instead of fftw3f')
23 opt.add_option('--disable-complex', action='store_true', default=False,
24 help='compile without C99 complex')
25 opt.add_option('--disable-jack', action='store_true', default=False,
26 help='compile without jack support')
27 opt.add_option('--disable-alsa', action='store_true', default=False,
28 help='compile without alsa support')
29 opt.add_option('--disable-lash', action='store_true', default=False,
30 help='compile without lash support')
31 opt.add_option('--enable-java', action='store_true', default=False,
32 help='compile with java support')
33 opt.add_option('--with-target-platform', type='string',
34 help='set target platform for cross-compilation', dest='target_platform')
35 opt.tool_options('compiler_cc')
36 opt.tool_options('compiler_cxx')
37 opt.tool_options('gnu_dirs')
38 #opt.tool_options('UnitTest')
42 conf.check_tool('compiler_cc')
43 conf.check_tool('compiler_cxx')
44 conf.check_tool('gnu_dirs') # helpful for autotools transition and .pc generation
45 conf.check_tool('misc') # needed for subst
47 if Options.options.target_platform:
48 Options.platform = Options.options.target_platform
50 if Options.platform == 'win32':
51 conf.env['shlib_PATTERN'] = 'lib%s.dll'
53 # check for required headers
54 conf.check(header_name='stdlib.h')
55 conf.check(header_name='stdio.h')
56 conf.check(header_name='math.h')
57 conf.check(header_name='string.h')
59 # optionally use complex.h
60 if (Options.options.disable_complex == False):
61 conf.check(header_name='complex.h')
63 # required dependancies
64 conf.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
65 args = '--cflags --libs')
66 conf.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
67 args = '--cflags --libs')
69 # one of fftwf or fftw3f
70 if (Options.options.disable_fftw3f == True):
71 conf.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
72 args = '--cflags --libs')
74 conf.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
75 args = '--cflags --libs')
77 # optional dependancies
78 if (Options.options.disable_jack == False):
79 conf.check_cfg(package = 'jack', atleast_version = '0.15.0',
80 args = '--cflags --libs')
81 if (Options.options.disable_alsa == False):
82 conf.check_cfg(package = 'alsa', atleast_version = '0.0.9',
83 args = '--cflags --libs')
84 if (Options.options.disable_lash == False):
85 conf.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0',
86 args = '--cflags --libs', uselib_store = 'LASH')
89 if conf.find_program('swig', var='SWIG', mandatory = False):
90 conf.check_tool('swig', tooldir='swig')
91 conf.check_swig_version('1.3.27')
94 if conf.find_program('python', mandatory = False):
95 conf.check_tool('python')
96 conf.check_python_version((2,4,2))
97 conf.check_python_headers()
100 if (Options.options.enable_java == True):
101 conf.fatal('Java build not yet implemented')
102 conf.check_tool('java')
104 # check support for C99 __VA_ARGS__ macros
105 check_c99_varargs = '''
107 #define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__)
109 if conf.check_cc(fragment = check_c99_varargs,
111 msg = 'Checking for C99 __VA_ARGS__ macro'):
112 conf.define('HAVE_C99_VARARGS_MACROS', 1)
114 # write configuration header
115 conf.write_config_header('src/config.h')
117 # check for puredata header
118 conf.check(header_name='m_pd.h')
120 # add some defines used in examples
121 conf.define('AUBIO_PREFIX', conf.env['PREFIX'])
122 conf.define('PACKAGE', APPNAME)
124 # check if docbook-to-man is installed, optional
125 conf.find_program('docbook-to-man', var='DOCBOOKTOMAN', mandatory=False)
128 bld.env['VERSION'] = VERSION
129 bld.env['LIB_VERSION'] = LIB_VERSION
131 # add sub directories
132 bld.add_subdirs('src ext examples cpp tests/src')
134 if bld.env['PYTHON']:
135 bld.add_subdirs('python/aubio python')
139 # create the aubio.pc file for pkg-config
140 aubiopc = bld.new_task_gen('subst')
141 aubiopc.source = 'aubio.pc.in'
142 aubiopc.target = 'aubio.pc'
143 aubiopc.install_path = '${PREFIX}/lib/pkgconfig'
145 # build manpages from sgml files
146 if bld.env['DOCBOOKTOMAN']:
148 TaskGen.declare_chain(
149 name = 'docbooktoman',
150 rule = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',
155 manpages = bld.new_task_gen(name = 'docbooktoman',
156 source=bld.path.ant_glob('doc/*.sgml'))
157 bld.install_files('${MANDIR}/man1', bld.path.ant_glob('doc/*.1'))
159 if bld.env['HAVE_M_PD_H']:
160 bld.add_subdirs('plugins/puredata')
162 # install woodblock sound
163 bld.install_files('${PREFIX}/share/sounds/aubio/',
164 'sounds/woodblock.aiff')
170 ut = UnitTest.unit_test()
171 ut.change_to_testfile_dir = True