newly created files for use in recording appear in a .stubs folder, and are moved...
[ardour2.git] / libs / pbd / wscript
blob275db6d70d9d321a77e2540ed1d5bc52c408d116
1 #!/usr/bin/env python
2 import autowaf
3 import os
4 import sys
6 # Version of this package (even if built as a child)
7 MAJOR = '4'
8 MINOR = '1'
9 MICRO = '0'
10 LIBPBD_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
12 # Library version (UNIX style major, minor, micro)
13 # major increment <=> incompatible changes
14 # minor increment <=> compatible changes (additions)
15 # micro increment <=> no interface changes
16 LIBPBD_LIB_VERSION = '4.1.0'
18 # Variables for 'waf dist'
19 APPNAME = 'libpbd'
20 VERSION = LIBPBD_VERSION
22 # Mandatory variables
23 srcdir = '.'
24 blddir = 'build'
26 path_prefix = 'libs/pbd/'
28 def set_options(opt):
29 autowaf.set_options(opt)
31 def configure(conf):
32 autowaf.build_version_files(path_prefix+'pbd/version.h', path_prefix+'version.cc',
33 'libpbd', MAJOR, MINOR, MICRO)
34 autowaf.configure(conf)
35 conf.check_tool('compiler_cxx')
36 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
37 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
38 if sys.platform != 'darwin':
39 autowaf.check_pkg(conf, 'uuid', uselib_store='UUID')
41 conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
42 conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO')
43 conf.check(header_name='unistd.h', define_name='HAVE_UNISTD')
45 conf.write_config_header('libpbd-config.h')
47 # Boost headers
48 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
49 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
51 def build(bld):
52 # Library
53 obj = bld.new_task_gen('cxx', 'shlib')
54 obj.source = '''
55 basename.cc
56 base_ui.cc
57 boost_debug.cc
58 command.cc
59 convert.cc
60 controllable.cc
61 controllable_descriptor.cc
62 clear_dir.cc
63 crossthread.cc
64 cpus.cc
65 debug.cc
66 enumwriter.cc
67 event_loop.cc
68 dmalloc.cc
69 enums.cc
70 error.cc
71 filesystem.cc
72 filesystem_paths.cc
73 file_manager.cc
74 file_utils.cc
75 fpu.cc
76 id.cc
77 locale_guard.cc
78 malign.cc
79 mountpoint.cc
80 openuri.cc
81 pathscanner.cc
82 pool.cc
83 property_list.cc
84 pthread_utils.cc
85 receiver.cc
86 search_path.cc
87 shortpath.cc
88 signals.cc
89 sndfile_manager.cc
90 stacktrace.cc
91 stateful_diff_command.cc
92 stateful.cc
93 strreplace.cc
94 strsplit.cc
95 textreceiver.cc
96 transmitter.cc
97 undo.cc
98 uuid.cc
99 version.cc
100 whitespace.cc
101 xml++.cc
103 obj.export_incdirs = ['.']
104 obj.includes = ['.']
105 obj.name = 'libpbd'
106 obj.target = 'pbd'
107 obj.uselib = 'GLIBMM SIGCPP XML UUID'
108 obj.vnum = LIBPBD_LIB_VERSION
109 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
110 obj.cxxflags = ['-DPACKAGE="libpbd"']
112 if bld.env['build_target'] == 'x86_64':
113 obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
115 if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
116 # Unit tests
117 testobj = bld.new_task_gen('cxx', 'program')
118 testobj.source = '''
119 test/testrunner.cc
120 test/xpath.cc
121 test/scalar_properties.cc
122 '''.split()
123 testobj.target = 'run-tests'
124 testobj.includes = obj.includes + ['test', '../pbd']
125 testobj.uselib = 'CPPUNIT XML'
126 testobj.uselib_local = 'libpbd'
128 def shutdown():
129 autowaf.shutdown()