#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)
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;
+}
+
*/
+#include <string>
+
#ifdef DVDOMATIC_WINDOWS
#define WEXITSTATUS(w) (w)
#endif
void dvdomatic_sleep (int);
+extern std::pair<std::string, int> cpu_info ();
#include "audio_decoder.h"
#include "sndfile_decoder.h"
#include "analyse_audio_job.h"
+#include "cross.h"
#include "i18n.h"
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)
{
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
{
return false;
}
-#ifdef DVDOMATIC_POSIX
+#ifdef DVDOMATIC_LINUX
unsetenv ("UBUNTU_MENUPROXY");
#endif
return false;
}
-#ifdef DVDOMATIC_POSIX
+#ifdef DVDOMATIC_LINUX
unsetenv ("UBUNTU_MENUPROXY");
#endif
if conf.env.TARGET_LINUX:
# 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'])