Fix binary STL output with subs that are too big for a single TTI block.
[libsub.git] / cscript
1 #
2 #    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
3 #
4 #    This file is part of libsub.
5 #
6 #    libsub is free software; you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation; either version 2 of the License, or
9 #    (at your option) any later version.
10 #
11 #    libsub is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with libsub.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 import os
21
22 def dependencies(target, options):
23     libdcp_options = { 'force-cpp11': options['force-cpp11'] } if 'force-cpp11' in options else {}
24     return (('asdcplib', 'carl'), ('libcxml', '0d18df4'), ('libdcp', None, libdcp_options))
25
26 def build(target, options):
27     cmd = './waf configure --prefix=%s' % target.directory
28     if target.platform == 'linux':
29         cmd += ' --static'
30         if target.distro == 'centos':
31             cmd += ' --disable-tests'
32             if target.version == '7':
33                 # Centos 7 ships with glibmm 2.50.0 which requires C++11
34                 # but its compiler (gcc 4.8.5) defaults to C++97.  Go figure.
35                 # I worry that this will cause ABI problems but I don't have
36                 # a better solution.
37                 cmd += ' --force-cpp11'
38         if target.distro == 'mageia' and target.version == '6':
39             # Mageia 6 pulls the same stunt except it's libxml++ that requires C++11
40             cmd += ' --force-cpp11'
41     if target.debug:
42         cmd += ' --enable-debug'
43     if target.platform == 'windows':
44         cmd += ' --target-windows --disable-tests'
45
46     if options is not None and 'force-cpp11' in options and options['force-cpp11']:
47         cmd += ' --force-cpp11'
48
49     target.command(cmd)
50     target.command('./waf build install')
51
52 def make_doxygen(target):
53     os.makedirs('build/doc')
54     target.command('doxygen')
55     return os.path.abspath('build/doc/html')
56
57 def test(target, test):
58     if target.platform != 'windows':
59         target.set('LC_ALL', 'C')
60         if test is None:
61             target.command('run/tests')
62         else:
63             target.command('run/tests --run_test=%s' % test)