2009-02-25 12:51:42 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import autowaf
|
2009-02-26 23:40:44 -05:00
|
|
|
import os
|
2009-08-08 18:36:32 -04:00
|
|
|
import sys
|
2010-11-13 00:14:48 -05:00
|
|
|
import TaskGen
|
2009-02-25 12:51:42 -05:00
|
|
|
|
|
|
|
# Version of this package (even if built as a child)
|
2009-02-25 21:24:16 -05:00
|
|
|
MAJOR = '4'
|
|
|
|
MINOR = '1'
|
|
|
|
MICRO = '0'
|
|
|
|
LIBPBD_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
|
2009-02-25 12:51:42 -05:00
|
|
|
|
|
|
|
# Library version (UNIX style major, minor, micro)
|
|
|
|
# major increment <=> incompatible changes
|
|
|
|
# minor increment <=> compatible changes (additions)
|
|
|
|
# micro increment <=> no interface changes
|
|
|
|
LIBPBD_LIB_VERSION = '4.1.0'
|
|
|
|
|
|
|
|
# Variables for 'waf dist'
|
|
|
|
APPNAME = 'libpbd'
|
|
|
|
VERSION = LIBPBD_VERSION
|
|
|
|
|
|
|
|
# Mandatory variables
|
|
|
|
srcdir = '.'
|
|
|
|
blddir = 'build'
|
|
|
|
|
2009-02-25 21:24:16 -05:00
|
|
|
path_prefix = 'libs/pbd/'
|
|
|
|
|
2009-02-25 12:51:42 -05:00
|
|
|
def set_options(opt):
|
2011-03-16 12:32:56 -04:00
|
|
|
autowaf.set_options(opt)
|
2009-02-25 12:51:42 -05:00
|
|
|
|
|
|
|
def configure(conf):
|
2011-03-16 12:32:56 -04:00
|
|
|
autowaf.build_version_files(path_prefix+'pbd/version.h', path_prefix+'version.cc',
|
|
|
|
'libpbd', MAJOR, MINOR, MICRO)
|
|
|
|
autowaf.configure(conf)
|
|
|
|
conf.check_tool('compiler_cxx')
|
|
|
|
autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
|
|
|
|
autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
|
2011-02-07 21:28:42 -05:00
|
|
|
if sys.platform != 'darwin':
|
|
|
|
autowaf.check_pkg(conf, 'uuid', uselib_store='UUID')
|
2009-02-25 12:51:42 -05:00
|
|
|
|
2011-03-16 12:32:56 -04:00
|
|
|
conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
|
|
|
|
conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO')
|
|
|
|
conf.check(header_name='unistd.h', define_name='HAVE_UNISTD')
|
|
|
|
if conf.check_cc(function_name='posix_memalign', header_name='stdlib.h', ccflags='-D_XOPEN_SOURCE=600') == False:
|
|
|
|
conf.define ('NO_POSIX_MEMALIGN',1)
|
2009-02-25 12:51:42 -05:00
|
|
|
|
2011-03-16 12:32:56 -04:00
|
|
|
conf.write_config_header('libpbd-config.h')
|
2009-02-25 12:51:42 -05:00
|
|
|
|
2011-03-16 12:32:56 -04:00
|
|
|
# Boost headers
|
|
|
|
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
|
|
|
|
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
|
|
|
|
# autowaf.check_header(conf, 'boost/uuid/uuid.hpp')
|
2009-02-25 12:51:42 -05:00
|
|
|
|
|
|
|
def build(bld):
|
2011-03-16 12:32:56 -04:00
|
|
|
# Library
|
|
|
|
obj = bld.new_task_gen('cxx', 'shlib')
|
|
|
|
obj.source = '''
|
|
|
|
basename.cc
|
|
|
|
base_ui.cc
|
2009-11-23 12:33:39 -05:00
|
|
|
boost_debug.cc
|
2010-11-18 13:01:30 -05:00
|
|
|
cartesian.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
command.cc
|
|
|
|
convert.cc
|
|
|
|
controllable.cc
|
|
|
|
controllable_descriptor.cc
|
2010-07-16 10:55:11 -04:00
|
|
|
clear_dir.cc
|
2009-12-08 22:05:14 -05:00
|
|
|
crossthread.cc
|
2010-06-24 10:13:45 -04:00
|
|
|
cpus.cc
|
2010-03-01 19:00:00 -05:00
|
|
|
debug.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
enumwriter.cc
|
2009-12-21 13:23:07 -05:00
|
|
|
event_loop.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
dmalloc.cc
|
2009-12-30 11:48:58 -05:00
|
|
|
enums.cc
|
2010-12-22 23:17:56 -05:00
|
|
|
epa.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
error.cc
|
|
|
|
filesystem.cc
|
|
|
|
filesystem_paths.cc
|
|
|
|
file_manager.cc
|
|
|
|
file_utils.cc
|
|
|
|
fpu.cc
|
|
|
|
id.cc
|
2009-10-28 17:36:40 -04:00
|
|
|
locale_guard.cc
|
2009-04-23 13:48:37 -04:00
|
|
|
malign.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
mountpoint.cc
|
2010-03-16 11:33:04 -04:00
|
|
|
openuri.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
pathscanner.cc
|
|
|
|
pool.cc
|
2010-03-01 19:00:00 -05:00
|
|
|
property_list.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
pthread_utils.cc
|
|
|
|
receiver.cc
|
|
|
|
search_path.cc
|
|
|
|
semutils.cc
|
|
|
|
shortpath.cc
|
|
|
|
signals.cc
|
2010-05-25 12:45:21 -04:00
|
|
|
sndfile_manager.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
stacktrace.cc
|
|
|
|
stateful_diff_command.cc
|
|
|
|
stateful.cc
|
|
|
|
strreplace.cc
|
|
|
|
strsplit.cc
|
|
|
|
textreceiver.cc
|
|
|
|
transmitter.cc
|
|
|
|
undo.cc
|
|
|
|
uuid.cc
|
|
|
|
version.cc
|
|
|
|
whitespace.cc
|
|
|
|
xml++.cc
|
|
|
|
'''
|
|
|
|
|
|
|
|
if bld.env['DEBUG_RT_ALLOC']:
|
|
|
|
obj.source += 'debug_rt_alloc.c'
|
|
|
|
|
|
|
|
obj.export_incdirs = ['.']
|
|
|
|
obj.includes = ['.']
|
|
|
|
obj.name = 'libpbd'
|
|
|
|
obj.target = 'pbd'
|
|
|
|
obj.uselib = 'GLIBMM SIGCPP XML UUID SNDFILE'
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
|
|
|
|
obj.source += 'cocoa_open_uri.mm'
|
|
|
|
obj.uselib += ' OSX'
|
|
|
|
obj.vnum = LIBPBD_LIB_VERSION
|
|
|
|
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
|
|
|
|
obj.cxxflags = ['-DPACKAGE="libpbd"']
|
|
|
|
|
|
|
|
if bld.env['build_target'] == 'x86_64':
|
|
|
|
obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
|
|
|
|
|
|
|
|
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
|
|
|
|
# Unit tests
|
|
|
|
testobj = bld.new_task_gen('cxx', 'program')
|
|
|
|
testobj.source = '''
|
2010-04-02 11:35:36 -04:00
|
|
|
test/testrunner.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
test/xpath.cc
|
2010-04-02 11:35:36 -04:00
|
|
|
test/scalar_properties.cc
|
2011-03-16 12:32:56 -04:00
|
|
|
test/signals_test.cc
|
|
|
|
'''.split()
|
|
|
|
testobj.target = 'run-tests'
|
|
|
|
testobj.includes = obj.includes + ['test', '../pbd']
|
|
|
|
testobj.uselib = 'CPPUNIT XML SNDFILE'
|
|
|
|
testobj.uselib_local = 'libpbd'
|
2010-04-02 10:52:55 -04:00
|
|
|
|
2010-11-13 00:14:48 -05:00
|
|
|
|
2009-02-25 12:51:42 -05:00
|
|
|
def shutdown():
|
2011-03-16 12:32:56 -04:00
|
|
|
autowaf.shutdown()
|
2009-02-25 12:51:42 -05:00
|
|
|
|