* libardour uses ARDOUR::nframes_t and ARDOUR::nframes64_t explicitly in headers
[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                 command.cc
57                 convert.cc
58                 controllable.cc
59                 enumwriter.cc
60                 dmalloc.cc
61                 error.cc
62                 filesystem.cc
63                 filesystem_paths.cc
64                 file_utils.cc
65                 fpu.cc
66                 id.cc
67                 locale_guard.cc
68                 malign.cc
69                 mountpoint.cc
70                 pathscanner.cc
71                 pool.cc
72                 pthread_utils.cc
73                 receiver.cc
74                 search_path.cc
75                 shortpath.cc
76                 stacktrace.cc
77                 stateful.cc
78                 strreplace.cc
79                 strsplit.cc
80                 textreceiver.cc
81                 transmitter.cc
82                 undo.cc
83                 uuid.cc
84                 version.cc
85                 whitespace.cc
86                 xml++.cc
87         '''
88         obj.export_incdirs = ['.']
89         obj.includes     = ['.']
90         obj.name         = 'libpbd'
91         obj.target       = 'pbd'
92         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
93         obj.vnum         = LIBPBD_LIB_VERSION
94         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
95         obj.cxxflags     = ['-DPACKAGE="libpbd"']
96
97         if bld.env['build_target'] == 'x86_64':
98                 obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
99
100 def shutdown():
101         autowaf.shutdown()
102