#! /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('compiler_c')
ctx.load('waf_unit_test')
ctx.load('gnu_dirs')
- ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra', '-fPIC']
target_platform = Options.platform
if ctx.options.target_platform:
target_platform = ctx.options.target_platform
ctx.env['DEST_OS'] = target_platform
- if target_platform == 'win32':
- ctx.env['shlib_PATTERN'] = 'lib%s.dll'
+ 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:
+ ctx.define('HAVE_WIN_HACKS', 1)
+ ctx.env['cshlib_PATTERN'] = 'lib%s.dll'
if target_platform == 'darwin':
ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
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
# check for jack
if (ctx.options.enable_jack != False):
- ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',
+ ctx.check_cfg(package = 'jack',
args = '--cflags --libs', mandatory = False)
# check for libav
args = '--cflags --libs', uselib_store = 'AVUTIL', mandatory = False)
ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
args = '--cflags --libs', uselib_store = 'AVRESAMPLE', mandatory = False)
+ if all ( 'HAVE_' + i in ctx.env.define_key
+ for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ):
+ ctx.define('HAVE_LIBAV', 1)
+ ctx.msg('Checking for all libav libraries', 'yes')
+ 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):
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'