diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-14 22:31:50 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-12-03 16:45:01 +0100 |
| commit | bd785a75e61e22aec48cb4ff97696a87afb7bce1 (patch) | |
| tree | 7c2bf4f93b713789f720aa8c1d12f7fc212c9a65 | |
| parent | f2ad6d58402e7cf5ae28011a2135a02b19215c58 (diff) | |
waf build system.
| -rw-r--r-- | asdcplib-cth.pc.in | 10 | ||||
| -rw-r--r-- | src/AS_02_TimedText.cpp | 1 | ||||
| -rw-r--r-- | src/AS_DCP_TimedText.cpp | 1 | ||||
| -rw-r--r-- | src/wscript | 118 | ||||
| -rwxr-xr-x | waf | bin | 0 -> 87683 bytes | |||
| -rw-r--r-- | wscript | 80 |
6 files changed, 210 insertions, 0 deletions
diff --git a/asdcplib-cth.pc.in b/asdcplib-cth.pc.in new file mode 100644 index 0000000..9a7a13e --- /dev/null +++ b/asdcplib-cth.pc.in @@ -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} diff --git a/src/AS_02_TimedText.cpp b/src/AS_02_TimedText.cpp index 49394d6..beee0b8 100644 --- a/src/AS_02_TimedText.cpp +++ b/src/AS_02_TimedText.cpp @@ -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/AS_DCP_TimedText.cpp b/src/AS_DCP_TimedText.cpp index 366c3d6..57198f7 100644 --- a/src/AS_DCP_TimedText.cpp +++ b/src/AS_DCP_TimedText.cpp @@ -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 index 0000000..4a49f5c --- /dev/null +++ b/src/wscript @@ -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') Binary files differ@@ -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') |
