massive changes to waf build scripts so that nearly everything "should" be working...
[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         conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO')
41
42         conf.write_config_header('libpbd-config.h')
43
44         # Boost headers
45         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
46         autowaf.check_header(conf, 'boost/weak_ptr.hpp')
47
48 def build(bld):
49         # Library
50         obj = bld.new_task_gen('cxx', 'shlib')
51         obj.source = '''
52                 basename.cc
53                 base_ui.cc
54                 command.cc
55                 convert.cc
56                 controllable.cc
57                 enumwriter.cc
58                 dmalloc.cc
59                 error.cc
60                 filesystem.cc
61                 filesystem_paths.cc
62                 file_utils.cc
63                 fpu.cc
64                 id.cc
65                 malign.cc
66                 mountpoint.cc
67                 pathscanner.cc
68                 pool.cc
69                 pthread_utils.cc
70                 receiver.cc
71                 search_path.cc
72                 shortpath.cc
73                 stacktrace.cc
74                 stateful.cc
75                 strreplace.cc
76                 strsplit.cc
77                 textreceiver.cc
78                 transmitter.cc
79                 undo.cc
80                 uuid.cc
81                 version.cc
82                 whitespace.cc
83                 xml++.cc
84         '''
85         obj.export_incdirs = ['.']
86         obj.includes     = ['.']
87         obj.name         = 'libpbd'
88         obj.target       = 'pbd'
89         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
90         obj.vnum         = LIBPBD_LIB_VERSION
91         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
92         obj.cxxflags     = ['-DPACKAGE="libpbd"']
93
94         if bld.env['build_target'] == 'x86_64':
95                 obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
96
97 def shutdown():
98         autowaf.shutdown()
99