new file
[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                 controllable_descriptor.cc
61                 crossthread.cc
62                 enumwriter.cc
63                 event_loop.cc
64                 dmalloc.cc
65                 enums.cc
66                 error.cc
67                 filesystem.cc
68                 filesystem_paths.cc
69                 file_utils.cc
70                 fpu.cc
71                 id.cc
72                 locale_guard.cc
73                 malign.cc
74                 mountpoint.cc
75                 pathscanner.cc
76                 pool.cc
77                 pthread_utils.cc
78                 receiver.cc
79                 search_path.cc
80                 shortpath.cc
81                 signals.cc
82                 stacktrace.cc
83                 stateful_diff_command.cc
84                 stateful.cc
85                 strreplace.cc
86                 strsplit.cc
87                 textreceiver.cc
88                 transmitter.cc
89                 undo.cc
90                 uuid.cc
91                 version.cc
92                 whitespace.cc
93                 xml++.cc
94         '''
95         obj.export_incdirs = ['.']
96         obj.includes     = ['.']
97         obj.name         = 'libpbd'
98         obj.target       = 'pbd'
99         obj.uselib       = 'GLIBMM SIGCPP XML UUID'
100         obj.vnum         = LIBPBD_LIB_VERSION
101         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
102         obj.cxxflags     = ['-DPACKAGE="libpbd"']
103
104         if bld.env['build_target'] == 'x86_64':
105                 obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
106
107 def shutdown():
108         autowaf.shutdown()
109