Support MPEG2 compression.
[libdcp.git] / src / wscript
1 #
2 #    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
3 #
4 #    This program is free software; you can redistribute it and/or modify
5 #    it under the terms of the GNU General Public License as published by
6 #    the Free Software Foundation; either version 2 of the License, or
7 #    (at your option) any later version.
8 #
9 #    This program is distributed in the hope that it will be useful,
10 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #    GNU General Public License for more details.
13 #
14 #    You should have received a copy of the GNU General Public License
15 #    along with this program; if not, write to the Free Software
16 #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #
18 #    In addition, as a special exception, the copyright holders give
19 #    permission to link the code of portions of this program with the
20 #    OpenSSL library under certain conditions as described in each
21 #    individual source file, and distribute linked combinations
22 #    including the two.
23 #
24 #    You must obey the GNU General Public License in all respects
25 #    for all of the code used other than OpenSSL.  If you modify
26 #    file(s) with this exception, you may extend this exception to your
27 #    version of the file(s), but you are not obligated to do so.  If you
28 #    do not wish to do so, delete this exception statement from your
29 #    version.  If you delete this exception statement from all source
30 #    files in the program, then also delete it here.
31 #
32
33 from waflib import TaskGen
34
35 def build(bld):
36     source = """
37              array_data.cc
38              asset.cc
39              asset_factory.cc
40              asset_map.cc
41              asset_writer.cc
42              atmos_asset.cc
43              atmos_asset_writer.cc
44              bitstream.cc
45              certificate.cc
46              certificate_chain.cc
47              chromaticity.cc
48              colour_conversion.cc
49              combine.cc
50              content_kind.cc
51              cpl.cc
52              data.cc
53              dcp.cc
54              dcp_time.cc
55              decrypted_kdm.cc
56              decrypted_kdm_key.cc
57              encrypted_kdm.cc
58              exceptions.cc
59              file.cc
60              filesystem.cc
61              ffmpeg_image.cc
62              font_asset.cc
63              fsk.cc
64              gamma_transfer_function.cc
65              h_align.cc
66              identity_transfer_function.cc
67              interop_load_font_node.cc
68              interop_subtitle_asset.cc
69              j2k_picture_asset.cc
70              j2k_picture_asset_writer.cc
71              j2k_transcode.cc
72              key.cc
73              language_tag.cc
74              local_time.cc
75              locale_convert.cc
76              metadata.cc
77              modified_gamma_transfer_function.cc
78              mono_j2k_picture_asset.cc
79              mono_j2k_picture_asset_writer.cc
80              mono_j2k_picture_frame.cc
81              mono_mpeg2_picture_asset.cc
82              mono_mpeg2_picture_asset_writer.cc
83              mono_mpeg2_picture_frame.cc
84              mpeg2_picture_asset.cc
85              mpeg2_picture_asset_writer.cc
86              mpeg2_transcode.cc
87              mxf.cc
88              name_format.cc
89              object.cc
90              openjpeg_image.cc
91              picture_asset.cc
92              pkl.cc
93              rating.cc
94              raw_convert.cc
95              reel.cc
96              reel_asset.cc
97              reel_atmos_asset.cc
98              reel_closed_caption_asset.cc
99              reel_file_asset.cc
100              reel_interop_closed_caption_asset.cc
101              reel_interop_subtitle_asset.cc
102              reel_markers_asset.cc
103              reel_mono_picture_asset.cc
104              reel_picture_asset.cc
105              reel_smpte_closed_caption_asset.cc
106              reel_smpte_subtitle_asset.cc
107              reel_sound_asset.cc
108              reel_stereo_picture_asset.cc
109              reel_subtitle_asset.cc
110              ref.cc
111              rgb_xyz.cc
112              ruby.cc
113              s_gamut3_transfer_function.cc
114              search.cc
115              smpte_load_font_node.cc
116              smpte_subtitle_asset.cc
117              sound_asset.cc
118              sound_asset_writer.cc
119              sound_frame.cc
120              stereo_j2k_picture_asset.cc
121              stereo_j2k_picture_asset_writer.cc
122              stereo_j2k_picture_frame.cc
123              subtitle.cc
124              subtitle_asset.cc
125              subtitle_asset_internal.cc
126              subtitle_image.cc
127              subtitle_standard.cc
128              subtitle_string.cc
129              transfer_function.cc
130              types.cc
131              utc_offset.cc
132              util.cc
133              v_align.cc
134              verify.cc
135              verify_j2k.cc
136              verify_report.cc
137              version.cc
138              """
139
140     headers = """
141               array_data.h
142               asset.h
143               asset_list.h
144               asset_map.h
145               asset_reader.h
146               asset_writer.h
147               atmos_asset.h
148               atmos_asset_reader.h
149               atmos_asset_writer.h
150               atmos_frame.h
151               behaviour.h
152               certificate.h
153               certificate_chain.h
154               chromaticity.h
155               colour_conversion.h
156               combine.h
157               compose.hpp
158               content_kind.h
159               cpl.h
160               crypto_context.h
161               data.h
162               dcp.h
163               dcp_assert.h
164               dcp_time.h
165               decrypted_kdm.h
166               decrypted_kdm_key.h
167               encrypted_kdm.h
168               equality_options.h
169               exceptions.h
170               file.h
171               filesystem.h
172               font_asset.h
173               frame.h
174               frame_info.h
175               fsk.h
176               gamma_transfer_function.h
177               h_align.h
178               identity_transfer_function.h
179               interop_load_font_node.h
180               interop_subtitle_asset.h
181               ffmpeg_image.h
182               j2k_picture_asset.h
183               j2k_picture_asset_writer.h
184               j2k_transcode.h
185               key.h
186               language_tag.h
187               load_font_node.h
188               local_time.h
189               locale_convert.h
190               metadata.h
191               mpeg2_picture_asset_writer.h
192               modified_gamma_transfer_function.h
193               mono_j2k_picture_asset.h
194               mono_j2k_picture_asset_reader.h
195               mono_j2k_picture_asset_writer.h
196               mono_j2k_picture_frame.h
197               mono_mpeg2_picture_asset.h
198               mono_mpeg2_picture_asset_reader.h
199               mono_mpeg2_picture_asset_writer.h
200               mono_mpeg2_picture_frame.h
201               mpeg2_picture_asset.h
202               mpeg2_transcode.h
203               mxf.h
204               name_format.h
205               object.h
206               openjpeg_image.h
207               picture_asset.h
208               piecewise_lut.h
209               pkl.h
210               rating.h
211               raw_convert.h
212               reel.h
213               reel_asset.h
214               reel_atmos_asset.h
215               reel_closed_caption_asset.h
216               reel_file_asset.h
217               reel_interop_closed_caption_asset.h
218               reel_interop_subtitle_asset.h
219               reel_markers_asset.h
220               reel_mono_picture_asset.h
221               reel_picture_asset.h
222               reel_smpte_closed_caption_asset.h
223               reel_smpte_subtitle_asset.h
224               reel_sound_asset.h
225               reel_stereo_picture_asset.h
226               reel_subtitle_asset.h
227               ref.h
228               rgb_xyz.h
229               ruby.h
230               s_gamut3_transfer_function.h
231               scope_guard.h
232               search.h
233               smpte_load_font_node.h
234               smpte_subtitle_asset.h
235               sound_asset.h
236               sound_asset_reader.h
237               sound_asset_writer.h
238               sound_frame.h
239               stereo_j2k_picture_asset.h
240               stereo_j2k_picture_asset_reader.h
241               stereo_j2k_picture_asset_writer.h
242               stereo_j2k_picture_frame.h
243               subtitle.h
244               subtitle_asset.h
245               subtitle_image.h
246               subtitle_standard.h
247               subtitle_string.h
248               transfer_function.h
249               types.h
250               utc_offset.h
251               util.h
252               v_align.h
253               verify.h
254               verify_j2k.h
255               verify_report.h
256               version.h
257               warnings.h
258               """
259
260     # Main library
261     if bld.env.STATIC:
262         obj = bld(features='cxx cxxstlib')
263     else:
264         obj = bld(features='cxx cxxshlib')
265     obj.name = 'libdcp%s' % bld.env.API_VERSION
266     obj.target = 'dcp%s' % bld.env.API_VERSION
267     obj.export_includes = ['.']
268     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_DCPOMATIC XERCES AVCODEC AVUTIL'
269     obj.source = source
270
271     # Library for gcov
272     if bld.is_defined('HAVE_GCOV'):
273         if bld.env.STATIC:
274             obj = bld(features='cxx cxxstlib')
275         else:
276             obj = bld(features='cxx cxxshlib')
277         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
278         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
279         obj.export_includes = ['.']
280         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_DCPOMATIC XERCES AVCODEC AVUTIL'
281         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
282         obj.source = source
283         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
284
285     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
286     if bld.env.STATIC:
287         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)