2009-12-27 09:46:23 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
2011-09-29 15:17:54 -04:00
|
|
|
from waflib.extras import autowaf as autowaf
|
2009-12-31 09:03:30 -05:00
|
|
|
import os
|
2009-12-27 09:46:23 -05:00
|
|
|
|
|
|
|
# Version of this package (even if built as a child)
|
|
|
|
AUDIOGRAPHER_VERSION = '0.0.0'
|
|
|
|
|
|
|
|
# Library version (UNIX style major, minor, micro)
|
|
|
|
# major increment <=> incompatible changes
|
|
|
|
# minor increment <=> compatible changes (additions)
|
|
|
|
# micro increment <=> no interface changes
|
|
|
|
# Version history:
|
|
|
|
# 0.0.0 = 0,0,0
|
|
|
|
AUDIOGRAPHER_LIB_VERSION = '0.0.0'
|
|
|
|
|
|
|
|
# Variables for 'waf dist'
|
|
|
|
APPNAME = 'audiographer'
|
|
|
|
VERSION = AUDIOGRAPHER_VERSION
|
|
|
|
|
|
|
|
# Mandatory variables
|
2011-09-29 15:17:54 -04:00
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
2009-12-27 09:46:23 -05:00
|
|
|
|
2011-09-29 15:17:54 -04:00
|
|
|
def options(opt):
|
2011-04-22 18:15:21 -04:00
|
|
|
autowaf.set_options(opt)
|
2009-12-27 09:46:23 -05:00
|
|
|
|
|
|
|
def configure(conf):
|
2011-09-29 15:58:05 -04:00
|
|
|
conf.load('compiler_cxx')
|
2011-04-22 18:15:21 -04:00
|
|
|
autowaf.configure(conf)
|
|
|
|
|
|
|
|
autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
|
|
|
|
autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0', mandatory=False)
|
|
|
|
autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=False)
|
|
|
|
autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=False)
|
|
|
|
autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.14.0', mandatory=False)
|
|
|
|
autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.7', mandatory=False)
|
|
|
|
autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18', mandatory=False)
|
2016-02-10 08:10:17 -05:00
|
|
|
autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F', mandatory=True)
|
2011-04-22 18:15:21 -04:00
|
|
|
|
|
|
|
# Boost headers
|
2011-09-29 15:17:54 -04:00
|
|
|
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
|
|
|
|
autowaf.check_header(conf, 'cxx', 'boost/format.hpp')
|
2009-12-27 09:46:23 -05:00
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
|
2011-04-22 18:15:21 -04:00
|
|
|
# Headers
|
2011-09-29 19:24:55 -04:00
|
|
|
#bld.install_files('${INCLUDEDIR}/audiographer', bld.path.ant_glob('audiographer/*.h'))
|
|
|
|
#bld.install_files('${INCLUDEDIR}/audiographer/general', bld.path.ant_glob('audiographer/general/*.h'))
|
|
|
|
#bld.install_files('${INCLUDEDIR}/audiographer/sndfile', bld.path.ant_glob('audiographer/sndfile/*.h'))
|
|
|
|
#bld.install_files('${INCLUDEDIR}/audiographer/utils', bld.path.ant_glob('audiographer/utils/*.h'))
|
2011-04-22 18:15:21 -04:00
|
|
|
|
|
|
|
#bld.env['BUILD_TESTS'] = True
|
2011-09-29 16:29:06 -04:00
|
|
|
bld.env['HAVE_ALL_GTHREAD'] = (bld.is_defined('HAVE_GLIB')
|
|
|
|
and bld.is_defined('HAVE_GLIBMM')
|
|
|
|
and bld.is_defined('HAVE_GTHREAD'))
|
2011-04-22 18:15:21 -04:00
|
|
|
|
2016-02-10 08:10:17 -05:00
|
|
|
if bld.is_defined('HAVE_FFTW35F') and bld.env['build_target'] != 'mingw':
|
|
|
|
bld.env['LIB_FFTW3F'] += ['fftw3f_threads']
|
|
|
|
|
2013-10-17 15:37:11 -04:00
|
|
|
audiographer_sources = [
|
|
|
|
'private/gdither/gdither.cc',
|
|
|
|
'src/general/sample_format_converter.cc',
|
|
|
|
'src/routines.cc',
|
|
|
|
'src/debug_utils.cc',
|
2016-02-10 09:10:40 -05:00
|
|
|
'src/general/analyser.cc',
|
2014-01-14 09:33:02 -05:00
|
|
|
'src/general/broadcast_info.cc',
|
2016-05-02 07:58:51 -04:00
|
|
|
'src/general/loudness_reader.cc',
|
2014-01-14 09:33:02 -05:00
|
|
|
'src/general/normalizer.cc'
|
2013-10-17 15:37:11 -04:00
|
|
|
]
|
2011-09-29 15:58:05 -04:00
|
|
|
if bld.is_defined('HAVE_SAMPLERATE'):
|
2013-10-17 15:37:11 -04:00
|
|
|
audiographer_sources += [ 'src/general/sr_converter.cc' ]
|
|
|
|
|
|
|
|
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
|
|
|
|
audiographer = bld.shlib(features = 'c cxx cshlib cxxshlib', source=audiographer_sources)
|
|
|
|
# macros for this shared library
|
2013-10-18 11:50:44 -04:00
|
|
|
audiographer.defines = [ 'LIBAUDIOGRAPHER_DLL_EXPORTS=1' ]
|
2013-10-17 15:37:11 -04:00
|
|
|
else:
|
2015-05-05 22:51:17 -04:00
|
|
|
audiographer = bld.stlib(features = 'c cxx cstlib cxxstlib', source=audiographer_sources)
|
2020-01-13 18:52:01 -05:00
|
|
|
audiographer.cxxflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
2018-10-14 22:06:11 -04:00
|
|
|
audiographer.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
2013-10-17 15:37:11 -04:00
|
|
|
audiographer.defines = []
|
2011-04-22 18:15:21 -04:00
|
|
|
|
|
|
|
audiographer.name = 'libaudiographer'
|
|
|
|
audiographer.target = 'audiographer'
|
2011-09-29 15:17:54 -04:00
|
|
|
audiographer.export_includes = ['.', './src']
|
2017-09-24 12:03:54 -04:00
|
|
|
audiographer.includes = ['.', './src','../ardour','../temporal','../evoral']
|
2016-02-28 15:16:44 -05:00
|
|
|
audiographer.uselib = 'GLIB GLIBMM GTHREAD SAMPLERATE SNDFILE FFTW3F VAMPSDK VAMPHOSTSDK XML'
|
2011-09-29 15:17:54 -04:00
|
|
|
audiographer.use = 'libpbd'
|
2011-04-22 18:15:21 -04:00
|
|
|
audiographer.vnum = AUDIOGRAPHER_LIB_VERSION
|
2014-04-28 21:18:02 -04:00
|
|
|
audiographer.install_path = bld.env['LIBDIR']
|
2011-04-22 18:15:21 -04:00
|
|
|
|
|
|
|
|
2011-11-12 22:54:29 -05:00
|
|
|
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
|
2011-04-22 18:15:21 -04:00
|
|
|
# Unit tests
|
2011-09-29 15:17:54 -04:00
|
|
|
obj = bld(features = 'cxx cxxprogram')
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.source = '''
|
|
|
|
tests/test_runner.cc
|
|
|
|
tests/type_utils_test.cc
|
|
|
|
tests/utils/identity_vertex_test.cc
|
|
|
|
tests/general/interleaver_test.cc
|
|
|
|
tests/general/deinterleaver_test.cc
|
|
|
|
tests/general/interleaver_deinterleaver_test.cc
|
|
|
|
tests/general/chunker_test.cc
|
|
|
|
tests/general/sample_format_converter_test.cc
|
|
|
|
tests/general/peak_reader_test.cc
|
|
|
|
tests/general/normalizer_test.cc
|
|
|
|
tests/general/silence_trimmer_test.cc
|
|
|
|
'''
|
|
|
|
|
2011-09-30 12:22:04 -04:00
|
|
|
if bld.is_defined('HAVE_ALL_GTHREAD'):
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.source += '''
|
|
|
|
tests/general/threader_test.cc
|
|
|
|
'''
|
|
|
|
|
2011-09-29 15:58:05 -04:00
|
|
|
if bld.is_defined('HAVE_SNDFILE'):
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.source += '''
|
|
|
|
tests/sndfile/tmp_file_test.cc
|
|
|
|
'''
|
|
|
|
|
2011-09-29 15:58:05 -04:00
|
|
|
if bld.is_defined('HAVE_SAMPLERATE'):
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.source += '''
|
|
|
|
tests/general/sr_converter_test.cc
|
|
|
|
'''
|
2009-12-27 09:46:23 -05:00
|
|
|
|
2011-09-29 15:17:54 -04:00
|
|
|
obj.use = 'libaudiographer'
|
2016-02-10 13:28:43 -05:00
|
|
|
obj.uselib = 'CPPUNIT GLIBMM SAMPLERATE SNDFILE FFTW3F VAMPSDK VAMPHOSTSDK'
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.target = 'run-tests'
|
|
|
|
obj.install_path = ''
|
2009-12-27 09:46:23 -05:00
|
|
|
|
2011-04-22 18:15:21 -04:00
|
|
|
def shutdown():
|
|
|
|
autowaf.shutdown()
|