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