diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-21 22:45:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-21 22:45:18 +0100 |
| commit | 9e99813876a6e8d72f81b1fd2cd04c4dc28fb4c5 (patch) | |
| tree | d9e403df7dff35034724e5ac959ad1014c465bcd | |
| parent | 78cb780e8cf266e27b0adf6714b9d23f8fbcd796 (diff) | |
Various tweaks for Windows builds.
| -rw-r--r-- | asdcplib/src/KM_platform.h | 16 | ||||
| -rwxr-xr-x | asdcplib/src/KM_prng.cpp | 6 | ||||
| -rw-r--r-- | asdcplib/src/wscript | 14 | ||||
| -rw-r--r-- | src/metadata.cc | 6 | ||||
| -rw-r--r-- | test/wscript | 10 | ||||
| -rw-r--r-- | wscript | 15 |
6 files changed, 50 insertions, 17 deletions
diff --git a/asdcplib/src/KM_platform.h b/asdcplib/src/KM_platform.h index 4216bc2f..266c01ae 100644 --- a/asdcplib/src/KM_platform.h +++ b/asdcplib/src/KM_platform.h @@ -51,10 +51,10 @@ WINUSERAPI LRESULT
WINAPI
SendMessage(
- __in HWND hWnd,
- __in UINT Msg,
- __in WPARAM wParam,
- __in LPARAM lParam)
+ HWND hWnd,
+ UINT Msg,
+ WPARAM wParam,
+ LPARAM lParam)
{
return SendMessageW(hWnd, Msg, wParam, lParam);
}
@@ -64,10 +64,10 @@ WINUSERAPI LRESULT
WINAPI
SendMessage(
- __in HWND hWnd,
- __in UINT Msg,
- __in WPARAM wParam,
- __in LPARAM lParam)
+ HWND hWnd,
+ UINT Msg,
+ WPARAM wParam,
+ LPARAM lParam)
{
return SendMessageA(hWnd, Msg, wParam, lParam);
}
diff --git a/asdcplib/src/KM_prng.cpp b/asdcplib/src/KM_prng.cpp index e7526da1..06b22d91 100755 --- a/asdcplib/src/KM_prng.cpp +++ b/asdcplib/src/KM_prng.cpp @@ -141,11 +141,17 @@ public: memcpy(buf + gen_count, tmp, len - gen_count); } +#ifdef LIBDCP_POSIX if (libdcp_test) { for (unsigned int i = 0; i < len; ++i) buf[i] = rand_r(&m_libdcp_test_rng_state); } +#endif + +#ifdef LIBDCP_WINDOWS + /* XXX */ +#endif } }; diff --git a/asdcplib/src/wscript b/asdcplib/src/wscript index 2d118aed..a2756dfa 100644 --- a/asdcplib/src/wscript +++ b/asdcplib/src/wscript @@ -1,16 +1,17 @@ def configure(conf): - conf.check_cc(msg = 'Checking for library expat', header_name = 'tiffio.h', lib = 'expat', uselib_store = 'EXPAT', mandatory = True) - conf.env.append_value('CXXFLAGS', '-DHAVE_EXPAT') conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64') conf.env.append_value('CXXFLAGS', '-DPACKAGE_VERSION="1.9.45-dvdomatic"') - # XXX: ? - conf.env.append_value('CXXFLAGS', '-DASDCP_PLATFORM="linux"') + 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): obj = bld(features = 'cxx cxxshlib') obj.name = 'libkumu-libdcp' obj.target = 'kumu-libdcp' - obj.uselib = 'EXPAT' + obj.uselib = 'OPENSSL' obj.includes = ['.'] obj.export_includes = ['.'] obj.source = """ @@ -25,7 +26,8 @@ def build(bld): obj = bld(features = 'cxx cxxshlib') obj.name = 'libasdcp-libdcp' obj.target = 'asdcp-libdcp' - obj.uselib = 'EXPAT' + obj.uselib = 'OPENSSL' + obj.use = 'libkumu-libdcp' obj.includes = ['.'] obj.export_includes = ['.'] obj.source = """ diff --git a/src/metadata.cc b/src/metadata.cc index 07e289b3..7d663eb2 100644 --- a/src/metadata.cc +++ b/src/metadata.cc @@ -36,12 +36,18 @@ Metadata::Metadata () , issuer ("libdcp" LIBDCP_VERSION) , creator ("libdcp" LIBDCP_VERSION) { +#ifdef LIBDCP_POSIX char buffer[64]; time_t now; time (&now); struct tm* tm = localtime (&now); strftime (buffer, 64, "%Y-%m-%dT%I:%M:%S+00:00", tm); issue_date = string (buffer); +#endif + +#ifdef LIBDCP_WINDOWS + /* XXX */ +#endif } /** @return Singleton Metadata instance */ diff --git a/test/wscript b/test/wscript index cd10983a..136cf36d 100644 --- a/test/wscript +++ b/test/wscript @@ -1,9 +1,17 @@ def configure(conf): + if conf.options.target_windows: + boost_lib_suffix = '-mt' + else: + boost_lib_suffix = '' + conf.check_cxx(fragment = """ #define BOOST_TEST_MODULE Config test\n #include <boost/test/unit_test.hpp>\n int main() {} - """, msg = 'Checking for boost unit testing library', lib = 'boost_unit_test_framework', uselib_store = 'BOOST_TEST') + """, + msg = 'Checking for boost unit testing library', + lib = 'boost_unit_test_framework%s' % boost_lib_suffix, + uselib_store = 'BOOST_TEST') def build(bld): obj = bld(features = 'cxx cxxprogram') @@ -6,14 +6,25 @@ VERSION = '0.05pre' 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') def configure(conf): conf.load('compiler_cxx') - conf.env.append_value('CXXFLAGS', ['-Wall', '-Werror', '-Wextra', '-Wno-unused-result', '-O2', '-D_FILE_OFFSET_BITS=64']) + conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-Wno-unused-result', '-O2', '-D_FILE_OFFSET_BITS=64']) conf.env.append_value('CXXFLAGS', ['-DLIBDCP_VERSION="%s"' % VERSION]) + if conf.options.target_windows: + conf.env.append_value('CXXFLAGS', '-DLIBDCP_WINDOWS') + else: + conf.env.append_value('CXXFLAGS', '-DLIBDCP_POSIX') + conf.check_cfg(package = 'openssl', args = '--cflags --libs', uselib_store = 'OPENSSL', mandatory = True) conf.check_cfg(package = 'sigc++-2.0', args = '--cflags --libs', uselib_store = 'SIGC++', mandatory = True) + + if conf.options.target_windows: + boost_lib_suffix = '-mt' + else: + boost_lib_suffix = '' conf.check_cxx(fragment = """ #include <boost/filesystem.hpp>\n @@ -21,7 +32,7 @@ def configure(conf): """, msg = 'Checking for boost filesystem library', libpath = '/usr/local/lib', - lib = ['boost_filesystem', 'boost_system'], + lib = ['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix], uselib_store = 'BOOST_FILESYSTEM') conf.recurse('test') |
