Upgrade to waf 1.5.4.
[ardour.git] / libs / pbd / wscript
1 #!/usr/bin/env python
2 import autowaf
3 import os
4
5 # Version of this package (even if built as a child)
6 MAJOR = '4'
7 MINOR = '1'
8 MICRO = '0'
9 LIBPBD_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
10
11 # Library version (UNIX style major, minor, micro)
12 # major increment <=> incompatible changes
13 # minor increment <=> compatible changes (additions)
14 # micro increment <=> no interface changes
15 LIBPBD_LIB_VERSION = '4.1.0'
16
17 # Variables for 'waf dist'
18 APPNAME = 'libpbd'
19 VERSION = LIBPBD_VERSION
20
21 # Mandatory variables
22 srcdir = '.'
23 blddir = 'build'
24
25 path_prefix = 'libs/pbd/'
26
27 def set_options(opt):
28         autowaf.set_options(opt)
29
30 def configure(conf):
31         autowaf.build_version_files(path_prefix+'pbd/version.h', path_prefix+'version.cc',
32                         'libpbd', MAJOR, MINOR, MICRO)
33         autowaf.configure(conf)
34         autowaf.check_tool(conf, 'compiler_cxx')
35         autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
36         autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
37         autowaf.check_pkg(conf, 'uuid', uselib_store='UUID')
38
39         conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
40
41         # This must be defined for libpbd only, it breaks ardour
42         conf.check(header_name='execinfo.h', define_name='PBD_HAVE_EXECINFO')
43
44         conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
45         conf.write_config_header('wafconfig.h')
46
47         # Boost headers
48         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
49         autowaf.check_header(conf, 'boost/weak_ptr.hpp')
50
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                 command.cc
58                 convert.cc
59                 controllable.cc
60                 enumwriter.cc
61                 dmalloc.cc
62                 error.cc
63                 filesystem.cc
64                 filesystem_paths.cc
65                 file_utils.cc
66                 fpu.cc
67                 id.cc
68                 mountpoint.cc
69                 pathscanner.cc
70                 pool.cc
71                 pthread_utils.cc
72                 receiver.cc
73                 search_path.cc
74                 shortpath.cc
75                 stacktrace.cc
76                 stateful.cc
77                 strreplace.cc
78                 strsplit.cc
79                 textreceiver.cc
80                 transmitter.cc
81                 undo.cc
82                 uuid.cc
83                 version.cc
84                 whitespace.cc
85                 xml++.cc
86         '''
87         obj.export_incdirs = ['.']
88         obj.includes     = ['.']
89         obj.name         = 'libpbd'
90         obj.target       = 'pbd'
91         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
92         obj.vnum         = LIBPBD_LIB_VERSION
93         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
94         obj.cxxflags     = ['-DPACKAGE="libpbd"']
95         if bld.env['PBD_HAVE_EXECINFO']:
96                 obj.cxxflags += ['-DHAVE_EXECINFO']
97         
98 def shutdown():
99         autowaf.shutdown()
100