7 opt.load('compiler_cxx')
10 conf.load('compiler_cxx')
11 conf.env.append_value('CXXFLAGS', ['-Wall', '-Werror', '-Wextra', '-Wno-unused-result', '-O2', '-D_FILE_OFFSET_BITS=64'])
12 conf.env.append_value('CXXFLAGS', ['-DLIBDCP_VERSION="%s"' % VERSION])
14 conf.check_cfg(package = 'openssl', args = '--cflags --libs', uselib_store = 'OPENSSL', mandatory = True)
15 conf.check_cfg(package = 'sigc++-2.0', args = '--cflags --libs', uselib_store = 'SIGC++', mandatory = True)
17 conf.check_cxx(fragment = """
18 #include <boost/filesystem.hpp>\n
19 int main() { boost::filesystem::copy_file ("a", "b"); }\n
21 msg = 'Checking for boost filesystem library',
22 libpath = '/usr/local/lib',
23 lib = ['boost_filesystem', 'boost_system'],
24 uselib_store = 'BOOST_FILESYSTEM')
27 conf.recurse('asdcplib')
30 create_version_cc(VERSION)
32 bld(source = 'libdcp.pc.in',
34 includedir = '%s/include' % bld.env.PREFIX,
35 libs = "-L${libdir} -ldcp -lkumu-libdcp -lasdcp-libdcp",
36 install_path = '${LIBDIR}/pkgconfig')
40 bld.recurse('asdcplib')
43 ctx.excl = 'TODO core *~ .git build .waf* .lock* doc/*~ src/*~ test/ref/*~'
45 def create_version_cc(version):
46 cmd = "LANG= git log --abbrev HEAD^..HEAD ."
47 output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
48 o = output[0].decode('utf-8')
49 commit = o.replace ("commit ", "")[0:10]
52 text = '#include "version.h"\n'
53 text += 'char const * libdcp::git_commit = \"%s\";\n' % commit
54 text += 'char const * libdcp::version = \"%s\";\n' % version
55 print('Writing version information to src/version.cc')
56 o = open('src/version.cc', 'w')
60 print('Could not open src/version.cc for writing\n')