wscript: improve notes in header
[aubio.git] / wscript
diff --git a/wscript b/wscript
index 58d942a..83ad7b8 100644 (file)
--- a/wscript
+++ b/wscript
@@ -1,13 +1,14 @@
 #! /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'
 
@@ -85,13 +86,16 @@ def configure(ctx):
     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:
@@ -151,7 +155,8 @@ def configure(ctx):
 
     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
@@ -224,6 +229,9 @@ def configure(ctx):
         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)
@@ -243,6 +251,12 @@ def configure(ctx):
     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
@@ -257,7 +271,7 @@ def build(bld):
 
     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:
@@ -276,10 +290,15 @@ def build(bld):
                 )
         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
@@ -297,3 +316,4 @@ def dist(ctx):
     ctx.excl += ' **/doc/full/* **/doc/web/*'
     ctx.excl += ' **/python/*.db'
     ctx.excl += ' **/python.old/*'
+    ctx.excl += ' **/python/tests/sounds'