#! /usr/bin/python
#
-# waf build system, see http://code.google.com/p/waf/
-#
# usage:
-# $ ./waf distclean configure build
+# $ python waf --help
+#
+# example:
+# $ ./waf distclean configure build
#
-# TODO
-# - doc: add doxygen
-# - tests: move to new unit test system
+# Note: aubio uses the waf build system, which relies on Python. Provided you
+# have Python installed, you do *not* need to install anything to build aubio.
+# For more info about waf, see http://code.google.com/p/waf/ .
APPNAME = 'aubio'
ctx.load('waf_unit_test')
ctx.load('gnu_dirs')
- ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
-
target_platform = Options.platform
if ctx.options.target_platform:
target_platform = ctx.options.target_platform
ctx.env['DEST_OS'] = target_platform
+ if 'CL.exe' not in ctx.env.CC[0]:
+ ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
+ else:
+ ctx.env.CFLAGS += ['-Wall']
+
if target_platform not in ['win32', 'win64']:
ctx.env.CFLAGS += ['-fPIC']
else:
if ctx.check_cc(fragment = check_c99_varargs,
type='cstlib',
- msg = 'Checking for C99 __VA_ARGS__ macro'):
+ msg = 'Checking for C99 __VA_ARGS__ macro',
+ mandatory = False):
ctx.define('HAVE_C99_VARARGS_MACROS', 1)
# double precision mode
else:
ctx.msg('Checking for all libav libraries', 'not found', color = 'YELLOW')
+ ctx.define('HAVE_WAVREAD', 1)
+ ctx.define('HAVE_WAVWRITE', 1)
+
# use memcpy hacks
if (ctx.options.enable_memcpy == True):
ctx.define('HAVE_MEMCPY_HACKS', 1)
except ctx.errors.ConfigurationError:
ctx.to_log('txt2man was not found (ignoring)')
+ # check if doxygen is installed, optional
+ try:
+ ctx.find_program('doxygen', var='DOXYGEN')
+ except ctx.errors.ConfigurationError:
+ ctx.to_log('doxygen was not found (ignoring)')
+
def build(bld):
bld.env['VERSION'] = VERSION
bld.env['LIB_VERSION'] = LIB_VERSION
bld( source = 'aubio.pc.in' )
- # build manpages from sgml files
+ # build manpages from txt files using txt2man
if bld.env['TXT2MAN']:
from waflib import TaskGen
if 'MANDIR' not in bld.env:
)
bld( source = bld.path.ant_glob('doc/*.txt') )
- """
- bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html')
- """
-
+ # build documentation from source files using doxygen
+ if bld.env['DOXYGEN']:
+ bld( name = 'doxygen', rule = 'doxygen ${SRC} > /dev/null',
+ source = 'doc/web.cfg',
+ cwd = 'doc')
+ bld.install_files( '${PREFIX}' + '/share/doc/libaubio-doc',
+ bld.path.ant_glob('doc/web/html/**'),
+ cwd = bld.path.find_dir ('doc/web'),
+ relative_trick = True)
def shutdown(bld):
from waflib import Logs
ctx.excl += ' **/doc/full/* **/doc/web/*'
ctx.excl += ' **/python/*.db'
ctx.excl += ' **/python.old/*'
+ ctx.excl += ' **/python/tests/sounds'