*** NEW CODING POLICY ***
[ardour.git] / libs / pbd / wscript
1 #!/usr/bin/env python
2 import autowaf
3
4 # Version of this package (even if built as a child)
5 LIBPBD_VERSION = '0.0.0'
6
7 # Library version (UNIX style major, minor, micro)
8 # major increment <=> incompatible changes
9 # minor increment <=> compatible changes (additions)
10 # micro increment <=> no interface changes
11 LIBPBD_LIB_VERSION = '4.1.0'
12
13 # Variables for 'waf dist'
14 APPNAME = 'libpbd'
15 VERSION = LIBPBD_VERSION
16
17 # Mandatory variables
18 srcdir = '.'
19 blddir = 'build'
20
21 def set_options(opt):
22         autowaf.set_options(opt)
23
24 def configure(conf):
25         autowaf.configure(conf)
26         autowaf.check_tool(conf, 'compiler_cxx')
27         autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True)
28         autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True)
29         autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0', mandatory=True)
30         autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML', mandatory=True)
31         autowaf.check_pkg(conf, 'uuid', uselib_store='UUID', mandatory=True)
32
33         conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
34         conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO')
35
36         conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
37         conf.write_config_header('wafconfig.h')
38
39         # Boost headers
40         autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True)
41         autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True)
42
43 def build(bld):
44         # Library
45         obj = bld.new_task_gen('cxx', 'shlib')
46         obj.source = '''
47                 basename.cc
48                 base_ui.cc
49                 command.cc
50                 convert.cc
51                 controllable.cc
52                 enumwriter.cc
53                 dmalloc.cc
54                 error.cc
55                 filesystem.cc
56                 filesystem_paths.cc
57                 file_utils.cc
58                 fpu.cc
59                 id.cc
60                 mountpoint.cc
61                 pathscanner.cc
62                 pool.cc
63                 pthread_utils.cc
64                 receiver.cc
65                 search_path.cc
66                 shortpath.cc
67                 stacktrace.cc
68                 stateful.cc
69                 strreplace.cc
70                 strsplit.cc
71                 textreceiver.cc
72                 transmitter.cc
73                 undo.cc
74                 uuid.cc
75                 version.cc
76                 whitespace.cc
77                 xml++.cc
78         '''
79         obj.export_incdirs = ['.']
80         obj.includes     = ['.']
81         obj.name         = 'libpbd'
82         obj.target       = 'pbd'
83         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
84         obj.vnum         = LIBPBD_LIB_VERSION
85         obj.install_path = ''
86         
87 def shutdown():
88         autowaf.shutdown()
89