--- /dev/null
+def configure(conf):
+ conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
+ conf.env.append_value('CXXFLAGS', '-DPACKAGE_VERSION="%s"' % conf.env.VERSION)
+ if conf.options.target_windows:
+ conf.env.append_value('CXXFLAGS', '-DASDCP_PLATFORM="win32"')
+ conf.env.append_value('CXXFLAGS', '-DKM_WIN32')
+ else:
+ conf.env.append_value('CXXFLAGS', '-DASDCP_PLATFORM="linux"')
+
+def build(bld):
+ if bld.env.STATIC:
+ obj = bld(features='cxx cxxstlib')
+ else:
+ obj = bld(features='cxx cxxshlib')
+
+ obj.name = 'libkumu-cth'
+ obj.target = 'kumu-cth'
+ obj.uselib = 'OPENSSL BOOST_FILESYSTEM'
+ obj.includes = ['.']
+ obj.export_includes = ['.']
+ obj.source = """
+ KM_fileio.cpp
+ KM_log.cpp
+ KM_util.cpp
+ KM_xml.cpp
+ KM_tai.cpp
+ KM_prng.cpp
+ """
+
+ if bld.env.STATIC:
+ obj = bld(features='cxx cxxstlib')
+ else:
+ obj = bld(features='cxx cxxshlib')
+
+ obj.name = 'libasdcp-cth'
+ obj.target = 'asdcp-cth'
+ obj.uselib = 'OPENSSL'
+ obj.use = 'libkumu-cth'
+ obj.includes = ['.']
+ obj.export_includes = ['.']
+ obj.source = """
+ MPEG2_Parser.cpp
+ MPEG.cpp
+ JP2K_Codestream_Parser.cpp
+ JP2K_Sequence_Parser.cpp
+ JP2K.cpp
+ PCM_Parser.cpp
+ Wav.cpp
+ TimedText_Parser.cpp
+ KLV.cpp
+ Dict.cpp
+ MXFTypes.cpp
+ MXF.cpp
+ Index.cpp
+ Metadata.cpp
+ AS_02_JP2K.cpp
+ AS_02_PCM.cpp
+ AS_02_PHDR.cpp
+ AS_02_TimedText.cpp
+ AS_DCP.cpp
+ AS_DCP_MXF.cpp
+ AS_DCP_AES.cpp
+ h__Reader.cpp
+ h__02_Reader.cpp
+ h__Writer.cpp
+ h__02_Writer.cpp
+ AS_DCP_MPEG2.cpp
+ AS_DCP_JP2K.cpp
+ AS_DCP_PCM.cpp
+ AS_DCP_TimedText.cpp
+ AS_DCP_ATMOS.cpp
+ AS_DCP_DCData.cpp
+ PCMParserList.cpp
+ MDD.cpp
+ """
+
+ headers = """
+ KM_xml.h
+ KM_error.h
+ SyncEncoder.h
+ ST2095_PinkNoise.h
+ MXF.h
+ Wav.h
+ Metadata.h
+ KM_mutex.h
+ JP2K.h
+ AtmosSyncChannel_Mixer.h
+ AtmosSyncChannel_Generator.h
+ SyncCommon.h
+ AS_02.h
+ AS_02_internal.h
+ KM_tai.h
+ KLV.h
+ PCMParserList.h
+ AS_DCP_internal.h
+ KM_log.h
+ AS_02_PHDR.h
+ UUIDInformation.h
+ KM_memio.h
+ KM_prng.h
+ KM_fileio.h
+ MXFTypes.h
+ AS_DCP.h
+ KM_util.h
+ AS_DCP_DCData_internal.h
+ MDD.h
+ MPEG.h
+ WavFileWriter.h
+ S12MTimecode.h
+ KM_platform.h
+ PCMDataProviders.h
+ CRC16.h
+ """
+
+ bld.install_files('${PREFIX}/include/asdcplib-cth', headers)
+ if bld.env.STATIC:
+ bld.install_files('${PREFIX}/lib', 'libkumu-cth.a')
+ bld.install_files('${PREFIX}/lib', 'libasdcp-cth.a')
--- /dev/null
+import subprocess
+import os
+import sys
+import distutils.spawn
+from waflib import Logs
+
+APPNAME = 'asdcplib-cth'
+VERSION = '2.5.11-cth1'
+
+def options(opt):
+ opt.load('compiler_cxx')
+ opt.add_option('--target-windows', action='store_true', default=False, help='set up to do a cross-compile to Windows')
+ opt.add_option('--static', action='store_true', default=False, help='build statically')
+
+def configure(conf):
+ conf.load('compiler_cxx')
+ conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS'])
+
+ conf.env.TARGET_WINDOWS = conf.options.target_windows
+ conf.env.TARGET_OSX = sys.platform == 'darwin'
+ conf.env.STATIC = conf.options.static
+ conf.env.VERSION = VERSION
+
+ if conf.env.TARGET_OSX:
+ conf.env.append_value('CXXFLAGS', ['-Wno-unused-result', '-Wno-unused-parameter', '-Wno-unused-local-typedef'])
+
+ conf.check_cfg(package='openssl', args='--cflags --libs', uselib_store='OPENSSL', mandatory=True)
+
+ if conf.options.target_windows:
+ boost_lib_suffix = '-mt'
+ else:
+ boost_lib_suffix = ''
+
+ conf.env.append_value('CXXFLAGS', '-O2')
+
+ conf.check_cxx(fragment="""
+ #include <boost/version.hpp>\n
+ #if BOOST_VERSION < 104500\n
+ #error boost too old\n
+ #endif\n
+ int main(void) { return 0; }\n
+ """,
+ mandatory=True,
+ msg='Checking for boost library >= 1.45',
+ okmsg='yes',
+ errmsg='too old\nPlease install boost version 1.45 or higher.')
+
+ conf.check_cxx(fragment="""
+ #include <boost/filesystem.hpp>\n
+ int main() { boost::filesystem::copy_file ("a", "b"); }\n
+ """,
+ msg='Checking for boost filesystem library',
+ libpath='/usr/local/lib',
+ lib=['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
+ uselib_store='BOOST_FILESYSTEM')
+
+ conf.recurse('src')
+
+def build(bld):
+ if bld.env.TARGET_WINDOWS:
+ boost_lib_suffix = '-mt'
+ else:
+ boost_lib_suffix = ''
+
+ bld(source='asdcplib-cth.pc.in',
+ version=VERSION,
+ includedir='%s/include/asdcplib-cth' % bld.env.PREFIX,
+ libs="-L${libdir} -lasdcplib-cth -lkumu-cth -lboost_system%s" % boost_lib_suffix,
+ install_path='${LIBDIR}/pkgconfig')
+
+ bld.recurse('src')
+
+ bld.add_post_fun(post)
+
+def post(ctx):
+ if ctx.cmd == 'install':
+ ctx.exec_command('/sbin/ldconfig')
+
+def tags(bld):
+ os.system('etags src/*.cc src/*.h')