Add an option for reproducible library builds

This can be useful to the library packagers, notably under Debian.

Closes #17000.
This commit is contained in:
Vadim Zeitlin 2017-05-27 14:27:10 +02:00
parent a7ae3de703
commit 2f8a343b22
12 changed files with 169 additions and 59 deletions

37
configure vendored
View File

@ -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

View File

@ -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 ---------------------------------------------------------------------------

View File

@ -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.}

View File

@ -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.
//

View File

@ -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.
//

View File

@ -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.
//

View File

@ -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.
//

View File

@ -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
// ----------------------------------------------------------------------------

View File

@ -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
// ----------------------------------------------------------------------------

View File

@ -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.
//

View File

@ -153,6 +153,8 @@
#define wxUSE_UNSAFE_WXSTRING_CONV 0
#define wxUSE_REPRODUCIBLE_BUILD 0
#define wxUSE_ON_FATAL_EXCEPTION 0

View File

@ -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()
);