cleanup up cleanup at session destruction; clarify the meaning of 3 signals (DropRefe...
[ardour.git] / libs / pbd / wscript
1 #!/usr/bin/env python
2 import autowaf
3 import os
4 import sys
5
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)
11
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'
17
18 # Variables for 'waf dist'
19 APPNAME = 'libpbd'
20 VERSION = LIBPBD_VERSION
21
22 # Mandatory variables
23 srcdir = '.'
24 blddir = 'build'
25
26 path_prefix = 'libs/pbd/'
27
28 def set_options(opt):
29         autowaf.set_options(opt)
30
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')
40
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
44         conf.write_config_header('libpbd-config.h')
45
46         # Boost headers
47         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
48         autowaf.check_header(conf, 'boost/weak_ptr.hpp')
49
50 def build(bld):
51         # Library
52         obj = bld.new_task_gen('cxx', 'shlib')
53         obj.source = '''
54                 basename.cc
55                 base_ui.cc
56                 boost_debug.cc
57                 command.cc
58                 convert.cc
59                 controllable.cc
60                 crossthread.cc
61                 enumwriter.cc
62                 event_loop.cc
63                 dmalloc.cc
64                 error.cc
65                 filesystem.cc
66                 filesystem_paths.cc
67                 file_utils.cc
68                 fpu.cc
69                 id.cc
70                 locale_guard.cc
71                 malign.cc
72                 mountpoint.cc
73                 pathscanner.cc
74                 pool.cc
75                 pthread_utils.cc
76                 receiver.cc
77                 search_path.cc
78                 shortpath.cc
79                 signals.cc
80                 stacktrace.cc
81                 stateful.cc
82                 strreplace.cc
83                 strsplit.cc
84                 textreceiver.cc
85                 transmitter.cc
86                 undo.cc
87                 uuid.cc
88                 version.cc
89                 whitespace.cc
90                 xml++.cc
91         '''
92         obj.export_incdirs = ['.']
93         obj.includes     = ['.']
94         obj.name         = 'libpbd'
95         obj.target       = 'pbd'
96         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
97         obj.vnum         = LIBPBD_LIB_VERSION
98         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
99         obj.cxxflags     = ['-DPACKAGE="libpbd"']
100
101         if bld.env['build_target'] == 'x86_64':
102                 obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
103
104 def shutdown():
105         autowaf.shutdown()
106