diff --git a/configure b/configure index ea338ebc17..c175e2c527 100755 --- a/configure +++ b/configure @@ -1140,6 +1140,7 @@ enable_rpath enable_objc_uniquifying enable_visibility enable_tls +enable_repro_build enable_intl enable_xlocale enable_config @@ -2080,6 +2081,7 @@ Optional Features: --enable-objc_uniquifying enable Objective-C class name uniquifying --disable-visibility disable use of ELF symbols visibility even if supported --disable-tls disable use of compiler TLS support + --enable-repro-build enable reproducible build mode --enable-intl use internationalization system --enable-xlocale use x-locale support (requires wxLocale) --enable-config use wxConfig (and derived) classes @@ -6079,6 +6081,36 @@ fi + enablestring= + defaultval= + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + # Check whether --enable-repro_build was given. +if test "${enable_repro_build+set}" = set; then : + enableval=$enable_repro_build; + if test "$enableval" = yes; then + wx_cv_use_repro_build='wxUSE_REPRODUCIBLE_BUILD=yes' + else + wx_cv_use_repro_build='wxUSE_REPRODUCIBLE_BUILD=no' + fi + +else + + wx_cv_use_repro_build='wxUSE_REPRODUCIBLE_BUILD=${'DEFAULT_wxUSE_REPRODUCIBLE_BUILD":-$defaultval}" + +fi + + + eval "$wx_cv_use_repro_build" + + + enablestring= defaultval=$wxUSE_ALL_FEATURES @@ -30677,6 +30709,11 @@ else fi fi +if test "x$wxUSE_REPRODUCIBLE_BUILD" = "xyes"; then + $as_echo "#define wxUSE_REPRODUCIBLE_BUILD 1" >>confdefs.h + +fi + if test "x$WXWIN_COMPATIBILITY_2_8" = "xyes"; then $as_echo "#define WXWIN_COMPATIBILITY_2_8 1" >>confdefs.h diff --git a/configure.in b/configure.in index 41f274e50b..b148aca6d9 100644 --- a/configure.in +++ b/configure.in @@ -669,6 +669,8 @@ WX_ARG_ENABLE(objc_uniquifying,[ --enable-objc_uniquifying enable Objective-C c WX_ARG_DISABLE(visibility, [ --disable-visibility disable use of ELF symbols visibility even if supported], wxUSE_VISIBILITY) WX_ARG_DISABLE(tls, [ --disable-tls disable use of compiler TLS support], wxUSE_COMPILER_TLS) +WX_ARG_ENABLE(repro_build, [ --enable-repro-build enable reproducible build mode], wxUSE_REPRODUCIBLE_BUILD) + dnl --------------------------------------------------------------------------- dnl optional non GUI features dnl --------------------------------------------------------------------------- @@ -5134,6 +5136,10 @@ else fi fi +if test "x$wxUSE_REPRODUCIBLE_BUILD" = "xyes"; then + AC_DEFINE(wxUSE_REPRODUCIBLE_BUILD) +fi + dnl --------------------------------------------------------------------------- dnl compatibility level dnl --------------------------------------------------------------------------- diff --git a/docs/doxygen/mainpages/const_wxusedef.h b/docs/doxygen/mainpages/const_wxusedef.h index 1e474318c9..d414884997 100644 --- a/docs/doxygen/mainpages/const_wxusedef.h +++ b/docs/doxygen/mainpages/const_wxusedef.h @@ -194,6 +194,7 @@ library: @itemdef{wxUSE_PROTOCOL_HTTP, Use wxHTTP class. (requireswxProtocol)} @itemdef{wxUSE_RADIOBOX, Use wxRadioBox class.} @itemdef{wxUSE_RADIOBTN, Use wxRadioButton class.} +@itemdef{wxUSE_REPRODUCIBLE_BUILD, Make library builds reproducible.} @itemdef{wxUSE_REGEX, Use wxRegEx class.} @itemdef{wxUSE_RICHTEXT, Use wxRichTextCtrl class.} @itemdef{wxUSE_RICHTEXT_XML_HANDLER, See src/xrc/xh_richtext.cpp file.} diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 0686412038..d125af0798 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -66,6 +66,16 @@ // Recommended setting: 0 #define wxUSE_UNSAFE_WXSTRING_CONV 1 +// If set to 1, enables "reproducible builds", i.e. build output should be +// exactly the same if the same build is redone again. As using __DATE__ and +// __TIME__ macros clearly makes the build irreproducible, setting this option +// to 1 disables their use in the library code. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + // ---------------------------------------------------------------------------- // debugging settings // ---------------------------------------------------------------------------- @@ -1282,15 +1292,14 @@ // Metafiles support // ---------------------------------------------------------------------------- -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. +// Windows supports the graphics format known as metafile which, though not +// portable, is widely used under Windows and so is supported by wxWidgets +// (under Windows only, of course). Both the so-called "Window MetaFiles" or +// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by +// default, EMFs will be used. This may be changed by setting +// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0. +// You may also set wxUSE_METAFILE to 0 to not compile in any metafile +// related classes at all. // // Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. // diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index d2651176d6..944260554e 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -67,6 +67,16 @@ // Recommended setting: 0 #define wxUSE_UNSAFE_WXSTRING_CONV 1 +// If set to 1, enables "reproducible builds", i.e. build output should be +// exactly the same if the same build is redone again. As using __DATE__ and +// __TIME__ macros clearly makes the build irreproducible, setting this option +// to 1 disables their use in the library code. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + // ---------------------------------------------------------------------------- // debugging settings // ---------------------------------------------------------------------------- @@ -1283,15 +1293,14 @@ // Metafiles support // ---------------------------------------------------------------------------- -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. +// Windows supports the graphics format known as metafile which, though not +// portable, is widely used under Windows and so is supported by wxWidgets +// (under Windows only, of course). Both the so-called "Window MetaFiles" or +// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by +// default, EMFs will be used. This may be changed by setting +// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0. +// You may also set wxUSE_METAFILE to 0 to not compile in any metafile +// related classes at all. // // Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. // diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 99df491fd6..dafcdaab77 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -67,6 +67,16 @@ // Recommended setting: 0 #define wxUSE_UNSAFE_WXSTRING_CONV 1 +// If set to 1, enables "reproducible builds", i.e. build output should be +// exactly the same if the same build is redone again. As using __DATE__ and +// __TIME__ macros clearly makes the build irreproducible, setting this option +// to 1 disables their use in the library code. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + // ---------------------------------------------------------------------------- // debugging settings // ---------------------------------------------------------------------------- @@ -1283,15 +1293,14 @@ // Metafiles support // ---------------------------------------------------------------------------- -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. +// Windows supports the graphics format known as metafile which, though not +// portable, is widely used under Windows and so is supported by wxWidgets +// (under Windows only, of course). Both the so-called "Window MetaFiles" or +// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by +// default, EMFs will be used. This may be changed by setting +// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0. +// You may also set wxUSE_METAFILE to 0 to not compile in any metafile +// related classes at all. // // Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. // diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 79437947c4..9ac46699d6 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -67,6 +67,16 @@ // Recommended setting: 0 #define wxUSE_UNSAFE_WXSTRING_CONV 1 +// If set to 1, enables "reproducible builds", i.e. build output should be +// exactly the same if the same build is redone again. As using __DATE__ and +// __TIME__ macros clearly makes the build irreproducible, setting this option +// to 1 disables their use in the library code. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + // ---------------------------------------------------------------------------- // debugging settings // ---------------------------------------------------------------------------- @@ -1283,15 +1293,14 @@ // Metafiles support // ---------------------------------------------------------------------------- -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. +// Windows supports the graphics format known as metafile which, though not +// portable, is widely used under Windows and so is supported by wxWidgets +// (under Windows only, of course). Both the so-called "Window MetaFiles" or +// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by +// default, EMFs will be used. This may be changed by setting +// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0. +// You may also set wxUSE_METAFILE to 0 to not compile in any metafile +// related classes at all. // // Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. // @@ -1374,7 +1383,7 @@ // Use wxDropTarget and wxDropSource classes for drag and drop (this is // different from "built in" drag and drop in wxTreeCtrl which is always -// available). Requires wxUSE_DATAOBJ and wxUSE_OLE. +// available). Requires wxUSE_DATAOBJ. // // Default is 1. // diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index f9f1e7c952..21d0ce6fd9 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -68,6 +68,16 @@ // Recommended setting: 0 #define wxUSE_UNSAFE_WXSTRING_CONV 1 +// If set to 1, enables "reproducible builds", i.e. build output should be +// exactly the same if the same build is redone again. As using __DATE__ and +// __TIME__ macros clearly makes the build irreproducible, setting this option +// to 1 disables their use in the library code. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + // ---------------------------------------------------------------------------- // debugging settings // ---------------------------------------------------------------------------- @@ -1284,15 +1294,14 @@ // Metafiles support // ---------------------------------------------------------------------------- -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. +// Windows supports the graphics format known as metafile which, though not +// portable, is widely used under Windows and so is supported by wxWidgets +// (under Windows only, of course). Both the so-called "Window MetaFiles" or +// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by +// default, EMFs will be used. This may be changed by setting +// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0. +// You may also set wxUSE_METAFILE to 0 to not compile in any metafile +// related classes at all. // // Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. // @@ -1439,10 +1448,6 @@ // Compile wxUIActionSimulator class? #define wxUSE_UIACTIONSIMULATOR 1 -// This is only used under Unix, but needs to be defined here as it's checked -// by wx/unix/chkconf.h. -#define wxUSE_XTEST 0 - // ---------------------------------------------------------------------------- // wxDC classes for various output formats // ---------------------------------------------------------------------------- diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index e0e678a69a..ba4c3bd184 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -63,6 +63,16 @@ // Recommended setting: 0 #define wxUSE_UNSAFE_WXSTRING_CONV 1 +// If set to 1, enables "reproducible builds", i.e. build output should be +// exactly the same if the same build is redone again. As using __DATE__ and +// __TIME__ macros clearly makes the build irreproducible, setting this option +// to 1 disables their use in the library code. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + // ---------------------------------------------------------------------------- // debugging settings // ---------------------------------------------------------------------------- diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index f38ab45a8d..9d8bed8509 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -66,6 +66,16 @@ // Recommended setting: 0 #define wxUSE_UNSAFE_WXSTRING_CONV 1 +// If set to 1, enables "reproducible builds", i.e. build output should be +// exactly the same if the same build is redone again. As using __DATE__ and +// __TIME__ macros clearly makes the build irreproducible, setting this option +// to 1 disables their use in the library code. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + // ---------------------------------------------------------------------------- // debugging settings // ---------------------------------------------------------------------------- @@ -1282,15 +1292,14 @@ // Metafiles support // ---------------------------------------------------------------------------- -// Windows supports the graphics format known as metafile which is, though not -// portable, is widely used under Windows and so is supported by wxWin (under -// Windows only, of course). Win16 (Win3.1) used the so-called "Window -// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in -// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by -// default, WMFs will be used under Win16 and EMFs under Win32. This may be -// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting -// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile -// in any metafile related classes at all. +// Windows supports the graphics format known as metafile which, though not +// portable, is widely used under Windows and so is supported by wxWidgets +// (under Windows only, of course). Both the so-called "Window MetaFiles" or +// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by +// default, EMFs will be used. This may be changed by setting +// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0. +// You may also set wxUSE_METAFILE to 0 to not compile in any metafile +// related classes at all. // // Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. // diff --git a/setup.h.in b/setup.h.in index 2e4748c796..01cf34efbe 100644 --- a/setup.h.in +++ b/setup.h.in @@ -153,6 +153,8 @@ #define wxUSE_UNSAFE_WXSTRING_CONV 0 +#define wxUSE_REPRODUCIBLE_BUILD 0 + #define wxUSE_ON_FATAL_EXCEPTION 0 diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index d1f2bc18be..8b31568fa5 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1374,7 +1374,9 @@ wxVersionInfo wxGetLibraryVersionInfo() wxString msg; msg.Printf(wxS("wxWidgets Library (%s port)\n") wxS("Version %d.%d.%d (Unicode: %s, debug level: %d),\n") +#if !wxUSE_REPRODUCIBLE_BUILD wxS("compiled at %s %s\n\n") +#endif wxS("Runtime version of toolkit used is %d.%d.\n"), wxPlatformInfo::Get().GetPortIdName(), wxMAJOR_VERSION, @@ -1388,8 +1390,10 @@ wxVersionInfo wxGetLibraryVersionInfo() "none", #endif wxDEBUG_LEVEL, +#if !wxUSE_REPRODUCIBLE_BUILD __TDATE__, __TTIME__, +#endif wxPlatformInfo::Get().GetToolkitMajorVersion(), wxPlatformInfo::Get().GetToolkitMinorVersion() );