12a3791b648e84ef4b089912a2c2c59528d3a0bb
[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
35         # This must be defined for libpbd only, it breaks ardour
36         conf.check(header_name='execinfo.h', define_name='PBD_HAVE_EXECINFO')
37
38         conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
39         conf.write_config_header('wafconfig.h')
40
41         # Boost headers
42         autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True)
43         autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True)
44
45 def build(bld):
46         # Library
47         obj = bld.new_task_gen('cxx', 'shlib')
48         obj.source = '''
49                 basename.cc
50                 base_ui.cc
51                 command.cc
52                 convert.cc
53                 controllable.cc
54                 enumwriter.cc
55                 dmalloc.cc
56                 error.cc
57                 filesystem.cc
58                 filesystem_paths.cc
59                 file_utils.cc
60                 fpu.cc
61                 id.cc
62                 mountpoint.cc
63                 pathscanner.cc
64                 pool.cc
65                 pthread_utils.cc
66                 receiver.cc
67                 search_path.cc
68                 shortpath.cc
69                 stacktrace.cc
70                 stateful.cc
71                 strreplace.cc
72                 strsplit.cc
73                 textreceiver.cc
74                 transmitter.cc
75                 undo.cc
76                 uuid.cc
77                 version.cc
78                 whitespace.cc
79                 xml++.cc
80         '''
81         obj.export_incdirs = ['.']
82         obj.cxxflags     = '-DPACKAGE=\\\"libpbd\\\"'
83         if bld.env['PBD_HAVE_EXECINFO']:
84                 obj.cxxflags += ' -DHAVE_EXECINFO '
85         obj.includes     = ['.']
86         obj.name         = 'libpbd'
87         obj.target       = 'pbd'
88         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
89         obj.vnum         = LIBPBD_LIB_VERSION
90         obj.install_path = ''
91         
92 def shutdown():
93         autowaf.shutdown()
94