2 from waflib.extras import autowaf as autowaf
3 from waflib import TaskGen
7 # Version of this package (even if built as a child)
11 LIBPBD_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
13 # Library version (UNIX style major, minor, micro)
14 # major increment <=> incompatible changes
15 # minor increment <=> compatible changes (additions)
16 # micro increment <=> no interface changes
17 LIBPBD_LIB_VERSION = '4.1.0'
19 # Variables for 'waf dist'
21 VERSION = LIBPBD_VERSION
27 path_prefix = 'libs/pbd/'
30 autowaf.set_options(opt)
33 conf.load('compiler_cxx')
34 autowaf.build_version_files(path_prefix+'pbd/version.h', path_prefix+'version.cc',
35 'libpbd', MAJOR, MINOR, MICRO)
36 autowaf.configure(conf)
37 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
38 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
39 if sys.platform != 'darwin':
40 autowaf.check_pkg(conf, 'uuid', uselib_store='UUID')
42 conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT',mandatory=False)
43 conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO',mandatory=False)
44 conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
45 if conf.check_cc(function_name='posix_memalign', header_name='stdlib.h', cflags='-D_XOPEN_SOURCE=600',mandatory=False) == False:
46 conf.define ('NO_POSIX_MEMALIGN',1)
48 conf.write_config_header('libpbd-config.h', remove=False)
51 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
52 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
53 # autowaf.check_header(conf, 'cxx', 'boost/uuid/uuid.hpp')
57 obj = bld(features = 'cxx cxxshlib')
66 controllable_descriptor.cc
98 stateful_diff_command.cc
111 if bld.is_defined('DEBUG_RT_ALLOC'):
112 obj.source += 'debug_rt_alloc.c'
114 obj.export_includes = ['.']
118 obj.uselib = 'GLIBMM SIGCPP XML UUID SNDFILE GIOMM'
119 if sys.platform == 'darwin':
120 TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
121 obj.source += 'cocoa_open_uri.mm'
123 obj.vnum = LIBPBD_LIB_VERSION
124 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
125 obj.cxxflags = ['-DPACKAGE="libpbd"']
127 if bld.env['build_target'] == 'x86_64':
128 obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
130 if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
132 testobj = bld(features = 'cxx cxxprogram')
136 test/scalar_properties.cc
139 testobj.target = 'run-tests'
140 testobj.includes = obj.includes + ['test', '../pbd']
141 testobj.uselib = 'CPPUNIT XML SNDFILE'
142 testobj.use = 'libpbd'