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):
|
|
|
|
autowaf.set_options(opt)
|
|
|
|
|
|
|
|
def configure(conf):
|
2009-02-25 21:24:16 -05:00
|
|
|
autowaf.build_version_files(path_prefix+'pbd/version.h', path_prefix+'version.cc',
|
|
|
|
'libpbd', MAJOR, MINOR, MICRO)
|
2009-02-25 12:51:42 -05:00
|
|
|
autowaf.configure(conf)
|
2009-07-22 16:51:13 -04:00
|
|
|
conf.check_tool('compiler_cxx')
|
2009-02-25 18:21:49 -05:00
|
|
|
autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
|
2009-02-25 19:05:51 -05:00
|
|
|
autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
|
2009-08-08 18:36:32 -04:00
|
|
|
if sys.platform != 'darwin':
|
|
|
|
autowaf.check_pkg(conf, 'uuid', uselib_store='UUID')
|
2009-02-25 12:51:42 -05:00
|
|
|
|
|
|
|
conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
|
2009-07-17 18:12:21 -04:00
|
|
|
conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO')
|
2010-06-24 10:13:45 -04:00
|
|
|
conf.check(header_name='unistd.h', define_name='HAVE_UNISTD')
|
2010-11-10 18:08:55 -05:00
|
|
|
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
|
|
|
|
2009-07-12 20:26:28 -04:00
|
|
|
conf.write_config_header('libpbd-config.h')
|
2009-02-25 12:51:42 -05:00
|
|
|
|
|
|
|
# Boost headers
|
2009-02-25 18:21:49 -05:00
|
|
|
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
|
|
|
|
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
|
2009-02-25 12:51:42 -05:00
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
# 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
|
2009-02-25 12:51:42 -05:00
|
|
|
command.cc
|
|
|
|
convert.cc
|
|
|
|
controllable.cc
|
2009-12-31 18:43:47 -05:00
|
|
|
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
|
2009-02-25 12:51:42 -05:00
|
|
|
enumwriter.cc
|
2009-12-21 13:23:07 -05:00
|
|
|
event_loop.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
dmalloc.cc
|
2009-12-30 11:48:58 -05:00
|
|
|
enums.cc
|
2010-12-22 23:17:56 -05:00
|
|
|
epa.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
error.cc
|
|
|
|
filesystem.cc
|
|
|
|
filesystem_paths.cc
|
2010-05-16 16:54:50 -04:00
|
|
|
file_manager.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
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
|
2009-02-25 12:51:42 -05:00
|
|
|
mountpoint.cc
|
2010-03-16 11:33:04 -04:00
|
|
|
openuri.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
pathscanner.cc
|
|
|
|
pool.cc
|
2010-03-01 19:00:00 -05:00
|
|
|
property_list.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
pthread_utils.cc
|
|
|
|
receiver.cc
|
|
|
|
search_path.cc
|
2010-11-16 14:47:38 -05:00
|
|
|
semutils.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
shortpath.cc
|
2009-12-19 15:26:31 -05:00
|
|
|
signals.cc
|
2010-05-25 12:45:21 -04:00
|
|
|
sndfile_manager.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
stacktrace.cc
|
2010-02-09 09:44:01 -05:00
|
|
|
stateful_diff_command.cc
|
2009-02-25 12:51:42 -05:00
|
|
|
stateful.cc
|
|
|
|
strreplace.cc
|
|
|
|
strsplit.cc
|
|
|
|
textreceiver.cc
|
|
|
|
transmitter.cc
|
|
|
|
undo.cc
|
|
|
|
uuid.cc
|
|
|
|
version.cc
|
|
|
|
whitespace.cc
|
|
|
|
xml++.cc
|
|
|
|
'''
|
2011-01-19 16:36:38 -05:00
|
|
|
|
|
|
|
if bld.env['DEBUG_RT_ALLOC']:
|
|
|
|
obj.source += 'debug_rt_alloc.c'
|
|
|
|
|
2009-02-25 12:51:42 -05:00
|
|
|
obj.export_incdirs = ['.']
|
|
|
|
obj.includes = ['.']
|
|
|
|
obj.name = 'libpbd'
|
|
|
|
obj.target = 'pbd'
|
2010-11-13 00:14:48 -05:00
|
|
|
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'
|
2009-02-25 12:51:42 -05:00
|
|
|
obj.vnum = LIBPBD_LIB_VERSION
|
2009-02-26 23:40:44 -05:00
|
|
|
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
|
2009-04-18 12:15:12 -04:00
|
|
|
obj.cxxflags = ['-DPACKAGE="libpbd"']
|
2009-07-17 18:12:21 -04:00
|
|
|
|
|
|
|
if bld.env['build_target'] == 'x86_64':
|
|
|
|
obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
|
2009-05-04 18:10:15 -04:00
|
|
|
|
2010-04-02 10:52:55 -04:00
|
|
|
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
|
2010-04-02 10:52:55 -04:00
|
|
|
test/xpath.cc
|
2010-04-02 11:35:36 -04:00
|
|
|
test/scalar_properties.cc
|
2010-04-02 10:52:55 -04:00
|
|
|
'''.split()
|
|
|
|
testobj.target = 'run-tests'
|
|
|
|
testobj.includes = obj.includes + ['test', '../pbd']
|
2010-07-24 20:39:04 -04:00
|
|
|
testobj.uselib = 'CPPUNIT XML SNDFILE'
|
2010-04-02 10:52:55 -04:00
|
|
|
testobj.uselib_local = 'libpbd'
|
|
|
|
|
2010-11-13 00:14:48 -05:00
|
|
|
|
2009-02-25 12:51:42 -05:00
|
|
|
def shutdown():
|
|
|
|
autowaf.shutdown()
|
|
|
|
|