waf build system.
authorCarl Hetherington <cth@carlh.net>
Thu, 14 Jan 2016 22:31:50 +0000 (22:31 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 3 Dec 2019 15:45:01 +0000 (16:45 +0100)
asdcplib-cth.pc.in [new file with mode: 0644]
src/AS_02_TimedText.cpp
src/AS_DCP_TimedText.cpp
src/wscript [new file with mode: 0644]
waf [new file with mode: 0755]
wscript [new file with mode: 0644]

diff --git a/asdcplib-cth.pc.in b/asdcplib-cth.pc.in
new file mode 100644 (file)
index 0000000..9a7a13e
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: asdcplib-cth
+Description: asdcplib with patches by cth@carlh.net
+Version: @version@
+Requires: openssl
+Libs: @libs@
+Cflags: -I${includedir}
index 49394d604ad4f63934d80d0b9c48ac2eaec7cc65..beee0b80bc1e579cdbd76c0faa214f8bd1b14dab 100644 (file)
@@ -43,6 +43,7 @@ static std::string TIMED_TEXT_DEF_LABEL = "Timed Text Track";
 
 //------------------------------------------------------------------------------------------
 
+static
 const char*
 MIME2str(TimedText::MIMEType_t m)
 {
index 366c3d6564ddd72e64ed793079e25b031ddb1881..57198f7b7461c765f649100aad7f72b04f493bb7 100644 (file)
@@ -43,6 +43,7 @@ static std::string TIMED_TEXT_DEF_LABEL = "Timed Text Track";
 
 //------------------------------------------------------------------------------------------
 
+static
 const char*
 MIME2str(TimedText::MIMEType_t m)
 {
diff --git a/src/wscript b/src/wscript
new file mode 100644 (file)
index 0000000..4a49f5c
--- /dev/null
@@ -0,0 +1,118 @@
+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')
diff --git a/waf b/waf
new file mode 100755 (executable)
index 0000000..178461f
Binary files /dev/null and b/waf differ
diff --git a/wscript b/wscript
new file mode 100644 (file)
index 0000000..30cb06c
--- /dev/null
+++ b/wscript
@@ -0,0 +1,80 @@
+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')