Merged revisions 6292,6294-6295,6311,6314 via svnmerge from
[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                 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                 locale_guard.cc
69                 malign.cc
70                 mountpoint.cc
71                 pathscanner.cc
72                 pool.cc
73                 pthread_utils.cc
74                 receiver.cc
75                 search_path.cc
76                 shortpath.cc
77                 stacktrace.cc
78                 stateful.cc
79                 strreplace.cc
80                 strsplit.cc
81                 textreceiver.cc
82                 transmitter.cc
83                 undo.cc
84                 uuid.cc
85                 version.cc
86                 whitespace.cc
87                 xml++.cc
88         '''
89         obj.export_incdirs = ['.']
90         obj.includes     = ['.']
91         obj.name         = 'libpbd'
92         obj.target       = 'pbd'
93         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
94         obj.vnum         = LIBPBD_LIB_VERSION
95         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
96         obj.cxxflags     = ['-DPACKAGE="libpbd"']
97
98         if bld.env['build_target'] == 'x86_64':
99                 obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
100
101 def shutdown():
102         autowaf.shutdown()
103