[Matroska-devel] [Patches] Portability, support for CloudABI, etc.

Ed Schouten ed at nuxi.nl
Wed Nov 18 21:42:32 CET 2015

Hi Moritz,

Thanks for the quick response and upstreaming some of the changes already!

2015-11-18 18:28 GMT+01:00 Moritz Bunkus <moritz at bunkus.org>:
> I would be OK with a configure option for that, though. Now that both
> libraries use autoconf this should be easy enough to implement. Problem
> is that a config.h that would define the appropriate preprocessor
> #defines would have to be shipped and included somehow, too, making the
> #requirement for a patch a bit larger.
> If you're willing to invest the work to create a patch for the following
> points then I'll apply it:
> 1. add option to configure, e.g. --without-build-timestamp
> 2. patch both the header and source files to exclude the variable
>    depending on the configure option
> 3. rename config.h to something else (e.g. libebml_config.h), patch a
>    central include file (e.g. EbmlConfig.h) to include libebml_config.h,
>    and patch the Makefile.am to install the file upon "make install"
> It would be enough for libEBML; I could adjust it for libMatroska.
> A less invasive approach might be to keep the variable but to leave it
> empty.

I agree that installing a build configuration header would be very
useful to have, especially for disabling the StdIOCallback class as
you proposed. I do think that using that to enable/disable the build
date string might offer a bit too much flexibility, considering its

I'll look into installing a build configuration file tomorrow morning.
Here are already some patches to unexpose the build date string from
libebml and libmatroska. We need to retain the declaration to suppress
warnings ( -Wmissing-variable-declarations).

Best regards,
Ed Schouten <ed at nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
-------------- next part --------------
diff --git a/matroska/KaxVersion.h b/matroska/KaxVersion.h
index e98f687..d99c1e8 100644
--- a/matroska/KaxVersion.h
+++ b/matroska/KaxVersion.h
 #define LIBMATROSKA_VERSION 0x010404
 extern const std::string KaxCodeVersion;
-extern const std::string KaxCodeDate;
   \todo Improve the CRC/ECC system (backward and forward possible ?) to fit streaming/live writing/simple reading
diff --git a/src/KaxVersion.cpp b/src/KaxVersion.cpp
index edc99dc..b2ba93a 100644
--- a/src/KaxVersion.cpp
+++ b/src/KaxVersion.cpp
@@ -38,6 +38,11 @@
 const std::string KaxCodeVersion = "1.4.4";
-const std::string KaxCodeDate    = __TIMESTAMP__;
+// Up to version 1.4.4 this library exported a build date string. As
+// this made the build non-reproducible, replace it by a placeholder to
+// remain binary compatible.
+extern const std::string KaxCodeDate;
+const std::string KaxCodeDate = "Unknown";
diff --git a/test/ebml/test00.cpp b/test/ebml/test00.cpp
index a0b5a86..8787e1d 100644
--- a/test/ebml/test00.cpp
+++ b/test/ebml/test00.cpp
@@ -65,7 +65,7 @@ const char RW_FILENAME[] = "test.kax";
 int main(void)
-  printf("Test00 :\nEBML %s %s / Matroska %s %s\n", EbmlCodeVersion.c_str(), EbmlCodeDate.c_str(), KaxCodeVersion.c_str(), KaxCodeDate.c_str());
+  printf("Test00 :\nEBML %s %s / Matroska %s\n", EbmlCodeVersion.c_str(), EbmlCodeDate.c_str(), KaxCodeVersion.c_str());
   StdIOCallback Ebml_file(RW_FILENAME, ::MODE_CREATE);
   ///// Writing test
-------------- next part --------------
diff --git a/ebml/EbmlConfig.h b/ebml/EbmlConfig.h
index 9c96f33..5bb679f 100644
--- a/ebml/EbmlConfig.h
+++ b/ebml/EbmlConfig.h
@@ -111,11 +111,6 @@
 # endif
-// For compilers that don't define __TIMESTAMP__ (e.g. gcc 2.95, gcc 3.2)
-#ifndef __TIMESTAMP__
-#define __TIMESTAMP__ __DATE__ " " __TIME__
 #ifdef __GNUC__
 #define EBML_PRETTYLONGINT(c) (c ## ll)
 #else // __GNUC__
diff --git a/ebml/EbmlVersion.h b/ebml/EbmlVersion.h
index dfc35a6..0db8db3 100644
--- a/ebml/EbmlVersion.h
+++ b/ebml/EbmlVersion.h
 #define LIBEBML_VERSION 0x010303
 extern const std::string EbmlCodeVersion;
-extern const std::string EbmlCodeDate;
   \todo Closer relation between an element and the context it comes from (context is an element attribute ?)
diff --git a/src/EbmlVersion.cpp b/src/EbmlVersion.cpp
index 375b702..49dbf98 100644
--- a/src/EbmlVersion.cpp
+++ b/src/EbmlVersion.cpp
@@ -39,6 +39,11 @@
 const std::string EbmlCodeVersion = "1.3.3";
-const std::string EbmlCodeDate    = __TIMESTAMP__;
+// Up to version 1.3.3 this library exported a build date string. As
+// this made the build non-reproducible, replace it by a placeholder to
+// remain binary compatible.
+extern const std::string EbmlCodeDate;
+const std::string EbmlCodeDate = "Unknown";

More information about the Matroska-devel mailing list