Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jul 2013 10:42:51 +0300
From:      Raivo Hool <raivo@lehma.com>
To:        multimedia@FreeBSD.org
Subject:   FreeBSD Port: multimedia/mkvtoolnix
Message-ID:  <C2D99601-4E26-411C-A274-15F455C5A4B9@lehma.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
I have a patch to enable building mkvtoolnix with clang and libc++, thus avoiding pulling in gcc 4.6+. Works with at least 9.1-STABLE and 9.2-PRE, but probably on anything with a new enough libc++.

This implies CXXFLAGS+=-std=c++11 -stdlib=libc++ -Wno-error

I have also sent this upstream, so if they accept it, there'll be no more any need for it in FreeBSD, but some conditional logic in the Makefile (which I am unqualified to cook up) would probably still apply.

Raivo


[-- Attachment #2 --]
--- src/common/logger.cpp.orig	2013-06-27 23:02:44.000000000 +0300
+++ src/common/logger.cpp	2013-07-14 10:13:25.026646733 +0300
@@ -12,6 +12,7 @@
 
 #include <chrono>
 #include <ctime>
+#include <ciso646>
 
 #include "common/logger.h"
 #include "common/fs_sys_helpers.h"
@@ -20,7 +21,11 @@
 
 logger_cptr logger_c::s_default_logger;
 
+#if defined( _LIBCPP_VERSION )
+static auto s_program_start_time = std::chrono::system_clock::now();
+#else
 static auto s_program_start_time = std::chrono::high_resolution_clock::now();
+#endif
 
 logger_c::logger_c(bfs::path const &file_name)
   : m_file_name(file_name)
@@ -41,9 +46,17 @@
     mm_text_io_c out(new mm_file_io_c(m_file_name.string(), bfs::exists(m_file_name) ? MODE_WRITE : MODE_CREATE));
     out.setFilePointer(0, seek_end);
 
-    auto now  = std::chrono::high_resolution_clock::now();
+    #if defined( _LIBCPP_VERSION )
+    auto now  = std::chrono::system_clock::now();
+    #else
+    auto now  = std::chrono::high_resolulution_clock::now();
+    #endif
     auto diff = now - s_program_start_time;
+    #if defined( _LIBCPP_VERSION )
+    auto tnow = std::chrono::system_clock::to_time_t(now);
+    #else
     auto tnow = std::chrono::high_resolution_clock::to_time_t(now);
+    #endif
 
     // 2013-03-02 15:42:32
     char timestamp[30];
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C2D99601-4E26-411C-A274-15F455C5A4B9>