summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-13 21:28:36 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-13 21:28:36 +0100
commite36c24bf1522593976de7de2c4d79c76f0ba36a8 (patch)
treeb342028831b620944ebc5a45946d82c1f69f64d0
parent43b4e55710271c797b5d251c891047ed4da20e10 (diff)
parenta991c734ebfedb5456cec827d5eaf2583fdbb9a1 (diff)
Merge branch 'master' of ssh://houllier/home/carl/git/dvdomatic
-rw-r--r--ChangeLog4
-rw-r--r--cscript2
-rw-r--r--debian/changelog6
-rw-r--r--src/lib/cross.cc43
-rw-r--r--src/lib/cross.h3
-rw-r--r--src/lib/film.cc1
-rw-r--r--src/lib/util.cc26
-rw-r--r--src/lib/util.h1
-rw-r--r--src/tools/dvdomatic.cc2
-rw-r--r--src/tools/dvdomatic_batch.cc2
-rw-r--r--wscript21
11 files changed, 72 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index b5a62111c..e8f9273ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-09 Carl Hetherington <cth@carlh.net>
+
+ * Version 0.98 released.
+
2013-06-07 Carl Hetherington <cth@carlh.net>
* Version 0.97 released.
diff --git a/cscript b/cscript
index 1f43f8936..4ba4eadb9 100644
--- a/cscript
+++ b/cscript
@@ -14,8 +14,6 @@ def build(env, target):
cmd = './waf configure --prefix=%s' % env.work_dir_cscript()
if target.platform == 'windows':
cmd += ' --target-windows'
- elif target.platform == 'osx':
- cmd += ' --osx'
elif target.platform == 'linux':
cmd += ' --static'
env.command(cmd)
diff --git a/debian/changelog b/debian/changelog
index 2d7075050..1db230a66 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+dvdomatic (0.98-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Carl Hetherington <carl@houllier.lan> Sun, 09 Jun 2013 20:54:08 +0100
+
dvdomatic (0.97-1) UNRELEASED; urgency=low
* New upstream release.
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index 2c66ab53a..1f1be907f 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -24,6 +24,12 @@
#ifdef DVDOMATIC_WINDOWS
#include "windows.h"
#endif
+#ifdef DVDOMATIC_OSX
+#include <sys/sysctl.h>
+#endif
+
+using std::pair;
+using std::string;
void
dvdomatic_sleep (int s)
@@ -35,3 +41,40 @@ dvdomatic_sleep (int s)
Sleep (s * 1000);
#endif
}
+
+/** @return A pair containing CPU model name and the number of processors */
+pair<string, int>
+cpu_info ()
+{
+ pair<string, int> info;
+ info.second = 0;
+
+#ifdef DVDOMATIC_LINUX
+ ifstream f (N_("/proc/cpuinfo"));
+ while (f.good ()) {
+ string l;
+ getline (f, l);
+ if (boost::algorithm::starts_with (l, N_("model name"))) {
+ string::size_type const c = l.find (':');
+ if (c != string::npos) {
+ info.first = l.substr (c + 2);
+ }
+ } else if (boost::algorithm::starts_with (l, N_("processor"))) {
+ ++info.second;
+ }
+ }
+#endif
+
+#ifdef DVDOMATIC_OSX
+ size_t N = sizeof (info.second);
+ sysctlbyname ("hw.ncpu", &info.second, &N, 0, 0);
+ char buffer[64];
+ N = sizeof (buffer);
+ if (sysctlbyname ("machdep.cpu.brand_string", buffer, &N, 0, 0) == 0) {
+ info.first = buffer;
+ }
+#endif
+
+ return info;
+}
+
diff --git a/src/lib/cross.h b/src/lib/cross.h
index 110660b16..970bf3e9d 100644
--- a/src/lib/cross.h
+++ b/src/lib/cross.h
@@ -17,8 +17,11 @@
*/
+#include <string>
+
#ifdef DVDOMATIC_WINDOWS
#define WEXITSTATUS(w) (w)
#endif
void dvdomatic_sleep (int);
+extern std::pair<std::string, int> cpu_info ();
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 5573ee9d2..8aedd7639 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -52,6 +52,7 @@
#include "audio_decoder.h"
#include "sndfile_decoder.h"
#include "analyse_audio_job.h"
+#include "cross.h"
#include "i18n.h"
diff --git a/src/lib/util.cc b/src/lib/util.cc
index b8b60c6f6..4cf57368a 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -942,32 +942,6 @@ still_image_file (string f)
return (ext == N_(".tif") || ext == N_(".tiff") || ext == N_(".jpg") || ext == N_(".jpeg") || ext == N_(".png") || ext == N_(".bmp"));
}
-/** @return A pair containing CPU model name and the number of processors */
-pair<string, int>
-cpu_info ()
-{
- pair<string, int> info;
- info.second = 0;
-
-#ifdef DVDOMATIC_POSIX
- ifstream f (N_("/proc/cpuinfo"));
- while (f.good ()) {
- string l;
- getline (f, l);
- if (boost::algorithm::starts_with (l, N_("model name"))) {
- string::size_type const c = l.find (':');
- if (c != string::npos) {
- info.first = l.substr (c + 2);
- }
- } else if (boost::algorithm::starts_with (l, N_("processor"))) {
- ++info.second;
- }
- }
-#endif
-
- return info;
-}
-
string
audio_channel_name (int c)
{
diff --git a/src/lib/util.h b/src/lib/util.h
index 3e1d7f4b4..0d745e50c 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -299,7 +299,6 @@ private:
extern int64_t video_frames_to_audio_frames (SourceFrame v, float audio_sample_rate, float frames_per_second);
extern bool still_image_file (std::string);
-extern std::pair<std::string, int> cpu_info ();
class LocaleGuard
{
diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc
index 71207c4ae..de94d0a2f 100644
--- a/src/tools/dvdomatic.cc
+++ b/src/tools/dvdomatic.cc
@@ -457,7 +457,7 @@ class App : public wxApp
return false;
}
-#ifdef DVDOMATIC_POSIX
+#ifdef DVDOMATIC_LINUX
unsetenv ("UBUNTU_MENUPROXY");
#endif
diff --git a/src/tools/dvdomatic_batch.cc b/src/tools/dvdomatic_batch.cc
index 7a3d38d9c..d9ddb9d46 100644
--- a/src/tools/dvdomatic_batch.cc
+++ b/src/tools/dvdomatic_batch.cc
@@ -197,7 +197,7 @@ class App : public wxApp
return false;
}
-#ifdef DVDOMATIC_POSIX
+#ifdef DVDOMATIC_LINUX
unsetenv ("UBUNTU_MENUPROXY");
#endif
diff --git a/wscript b/wscript
index a2183f3b6..542c9b640 100644
--- a/wscript
+++ b/wscript
@@ -3,7 +3,7 @@ import os
import sys
APPNAME = 'dvdomatic'
-VERSION = '0.98pre'
+VERSION = '0.99pre'
def options(opt):
opt.load('compiler_cxx')
@@ -15,7 +15,6 @@ def options(opt):
opt.add_option('--static', action='store_true', default=False, help='build statically, and link statically to libdcp and FFmpeg')
opt.add_option('--magickpp-config', action='store', default='Magick++-config', help='path to Magick++-config')
opt.add_option('--wx-config', action='store', default='wx-config', help='path to wx-config')
- opt.add_option('--osx', action='store_true', default=False, help='build on OS X')
def configure(conf):
conf.load('compiler_cxx')
@@ -26,13 +25,13 @@ def configure(conf):
conf.env.DISABLE_GUI = conf.options.disable_gui
conf.env.STATIC = conf.options.static
conf.env.VERSION = VERSION
- conf.env.TARGET_OSX = conf.options.osx
- conf.env.TARGET_LINUX = not conf.options.target_windows and not conf.options.osx
+ conf.env.TARGET_OSX = sys.platform == 'darwin'
+ conf.env.TARGET_LINUX = not conf.env.TARGET_WINDOWS and not conf.env.TARGET_OSX
conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing',
'-Wall', '-Wno-attributes', '-Wextra'])
- if conf.options.target_windows:
+ if conf.env.TARGET_WINDOWS:
conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE'])
wxrc = os.popen('wx-config --rescomp').read().split()[1:]
conf.env.append_value('WINRCFLAGS', wxrc)
@@ -54,8 +53,12 @@ def configure(conf):
conf.env.append_value('LINKFLAGS', '-pthread')
if conf.env.TARGET_LINUX:
- # libxml2 seems to be linked against this on Ubuntu, but it doesn't mention it in its .pc file
+ # libxml2 seems to be linked against this on Ubuntu but it doesn't mention it in its .pc file
conf.env.append_value('LIB', 'lzma')
+ conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_LINUX')
+
+ if conf.env.TARGET_OSX:
+ conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_OSX')
if conf.options.enable_debug:
conf.env.append_value('CXXFLAGS', ['-g', '-DDVDOMATIC_DEBUG'])
@@ -102,8 +105,10 @@ def configure(conf):
conf.check_cfg(package = 'sndfile', args = '--cflags --libs', uselib_store = 'SNDFILE', mandatory = True)
conf.check_cfg(package = 'glib-2.0', args = '--cflags --libs', uselib_store = 'GLIB', mandatory = True)
- if conf.options.target_windows is False:
- conf.check_cfg(package = 'liblzma', args = '--cflags --libs', uselib_store = 'LZMA', mandatory = True)
+
+ if conf.env.TARGET_LINUX:
+ conf.check_cfg(package='liblzma', args='--cflags --libs', uselib_store='LZMA', mandatory=True)
+
conf.check_cfg(package = '', path = conf.options.magickpp_config, args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True)
if conf.options.static: