From 1c4071a3cbe4cc1b67eabd6a1afafa0a0554b65c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 May 2017 13:05:47 +0200 Subject: [PATCH 1/4] Remove obsolete and useless --enable_no_deps configure option This option didn't do anything for the last 14 years, ever since the switch to bakefile-generated makefiles in fe0895cf82381b91113de34a32b0bcf9bdef98a7, so remove it from configure and stop mentioning it in documentation. Use --disable-dependency-tracking to do what this option used to be doing 15 years ago. --- configure | 31 ------------------------------- configure.in | 1 - docs/gtk/install.txt | 3 --- docs/motif/install.txt | 3 --- docs/x11/install.txt | 3 --- 5 files changed, 41 deletions(-) diff --git a/configure b/configure index 39ab736cda..318f13ac17 100755 --- a/configure +++ b/configure @@ -1130,7 +1130,6 @@ enable_profile enable_no_rtti enable_no_exceptions enable_permissive -enable_no_deps enable_vararg_macros enable_universal_binary enable_macosx_arch @@ -2071,7 +2070,6 @@ Optional Features: --enable-no_rtti create code without RTTI information --enable-no_exceptions create code without C++ exceptions handling --enable-permissive compile code disregarding strict ANSI - --enable-no_deps create code without dependency information --disable-vararg_macros don't use vararg macros, even if they are supported --enable-universal_binary=archs create universal binary for the specified (or all supported) architectures --enable-macosx_arch=ARCH build for just the specified architecture @@ -5755,35 +5753,6 @@ fi eval "$wx_cv_use_permissive" - enablestring= - defaultval= - if test -z "$defaultval"; then - if test x"$enablestring" = xdisable; then - defaultval=yes - else - defaultval=no - fi - fi - - # Check whether --enable-no_deps was given. -if test "${enable_no_deps+set}" = set; then : - enableval=$enable_no_deps; - if test "$enableval" = yes; then - wx_cv_use_no_deps='wxUSE_NO_DEPS=yes' - else - wx_cv_use_no_deps='wxUSE_NO_DEPS=no' - fi - -else - - wx_cv_use_no_deps='wxUSE_NO_DEPS=${'DEFAULT_wxUSE_NO_DEPS":-$defaultval}" - -fi - - - eval "$wx_cv_use_no_deps" - - enablestring=disable defaultval= if test -z "$defaultval"; then diff --git a/configure.in b/configure.in index 3ee19c7d96..c4e5f0f9f5 100644 --- a/configure.in +++ b/configure.in @@ -654,7 +654,6 @@ WX_ARG_ENABLE(profile, [ --enable-profile create code with profili WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI) WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS) WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE) -WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS) WX_ARG_DISABLE(vararg_macros,[ --disable-vararg_macros don't use vararg macros, even if they are supported], wxUSE_VARARG_MACROS) WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary=archs create universal binary for the specified (or all supported) architectures]], wxUSE_UNIVERSAL_BINARY) diff --git a/docs/gtk/install.txt b/docs/gtk/install.txt index e71c71b0ff..965822c89a 100644 --- a/docs/gtk/install.txt +++ b/docs/gtk/install.txt @@ -231,9 +231,6 @@ The following options handle the kind of library you want to build. binary size. Also fewer crashes during the actual compilation... - --enable-no_deps Enable compilation without creation of - dependency information. - --enable-permissive Enable compilation without checking for strict ANSI conformance. Useful to prevent the build dying with errors as soon as you compile with diff --git a/docs/motif/install.txt b/docs/motif/install.txt index fb9eecce77..1b937c304a 100644 --- a/docs/motif/install.txt +++ b/docs/motif/install.txt @@ -264,9 +264,6 @@ The following options handle the kind of library you want to build. binary size. Also fewer crashes during the actual compilation... - --enable-no_deps Enable compilation without creation of - dependency information. - --enable-permissive Enable compilation without checking for strict ANSI conformance. Useful to prevent the build dying with errors as soon as you compile with diff --git a/docs/x11/install.txt b/docs/x11/install.txt index c60ee8c74d..61d252b010 100644 --- a/docs/x11/install.txt +++ b/docs/x11/install.txt @@ -246,9 +246,6 @@ The following options handle the kind of library you want to build. binary size. Also fewer crashes during the actual compilation... - --enable-no_deps Enable compilation without creation of - dependency information. - --enable-permissive Enable compilation without checking for strict ANSI conformance. Useful to prevent the build dying with errors as soon as you compile with From aa7e10bb0919982bfdc510bd9cdc8b84d621d80b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 May 2017 13:50:37 +0200 Subject: [PATCH 2/4] Check --enable-xxx and --with-xxx options in configure by default Give an error if an unknown option is specified because this is very helpful for catching typos which happen quite frequently in practice, considering the number of options that we have. To explicitly allow unknown options, i.e. restore the old behaviour, --disable-option-checking can be used. --- configure | 3 +++ configure.in | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/configure b/configure index 318f13ac17..28173dcc34 100755 --- a/configure +++ b/configure @@ -623,6 +623,7 @@ ac_includes_default="\ #endif" enable_option_checking=no +enable_option_checking=fatal ac_subst_vars='LTLIBOBJS LIBOBJS CPPUNIT_CONFIG @@ -40281,6 +40282,8 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + + echo echo "Configured wxWidgets ${WX_VERSION} for \`${host}'" echo "" diff --git a/configure.in b/configure.in index c4e5f0f9f5..11638b042d 100644 --- a/configure.in +++ b/configure.in @@ -8300,6 +8300,19 @@ fi dnl wxWITH_SUBDIRS AC_OUTPUT +dnl Enable strict option checking by default because typos in --enable-xxx is +dnl a much more common case than wanting to explicitly pass an option unknown +dnl to the main configure script (this one) to a configure scripts in a +dnl subdirectory (e.g. src/tiff or src/expat). If someone really needs to do +dnl the latter, --disable-option-checking would need to be explicitly used. +dnl +dnl Notice that we need to do this at the very end of configure script as +dnl otherwise this would be overridden by AC_CONFIG_SUBDIRS() which disables +dnl option checking. And we need to use m4_divert_text() because we want this +dnl to appear in the beginning of the generated file, before the code parsing +dnl the options. +m4_divert_text([DEFAULTS],[enable_option_checking=fatal]) + dnl report how we have been configured echo echo "Configured wxWidgets ${WX_VERSION} for \`${host}'" From a7ae3de70315224d0e8f8b83aba61f591fca1ab0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 May 2017 14:11:07 +0200 Subject: [PATCH 3/4] Don't accept nonsensical --without- options in configure Only --with- options make sense, something like --without-x11 couldn't possibly be useful and was actually actively harmful as it set wxUSE_UNIVERSAL to 1 as a side effect. Closes #2306. --- acinclude.m4 | 10 +++++ configure | 108 +++++++++++++++++++++++++++++++++++++++++++++------ configure.in | 24 ++++++------ 3 files changed, 118 insertions(+), 24 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 08486d3e61..a91268b5b8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -394,6 +394,16 @@ AC_DEFUN([WX_ARG_WITH], dnl same as WX_ARG_WITH but makes it clear that the option is enabled by default AC_DEFUN([WX_ARG_WITHOUT], [WX_ARG_WITH($1, [$2], $3, without)]) +dnl variant of AC_ARG_WITH which doesn't accept --without-xxx varient +AC_DEFUN([WX_ARG_ONLY_WITH], [ + AC_ARG_WITH($1, [$2], [ + if test "$withval" != yes; then + AC_MSG_ERROR([Option --with-$1 doesn't accept any arguments]) + fi + $3 + ]) + ]) + dnl like WX_ARG_WITH but uses AC_ARG_ENABLE instead of AC_ARG_WITH dnl usage: WX_ARG_ENABLE(option, helpmessage, var, [enablestring], [default]) dnl diff --git a/configure b/configure index 28173dcc34..ea338ebc17 100755 --- a/configure +++ b/configure @@ -4247,78 +4247,162 @@ if test "${with_gtk+set}" = set; then : fi + # Check whether --with-motif was given. if test "${with_motif+set}" = set; then : - withval=$with_motif; wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1 + withval=$with_motif; + if test "$withval" != yes; then + as_fn_error $? "Option --with-motif doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-osx_cocoa was given. if test "${with_osx_cocoa+set}" = set; then : - withval=$with_osx_cocoa; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + withval=$with_osx_cocoa; + if test "$withval" != yes; then + as_fn_error $? "Option --with-osx_cocoa doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-osx_iphone was given. if test "${with_osx_iphone+set}" = set; then : - withval=$with_osx_iphone; wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1 + withval=$with_osx_iphone; + if test "$withval" != yes; then + as_fn_error $? "Option --with-osx_iphone doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-osx was given. if test "${with_osx+set}" = set; then : - withval=$with_osx; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + withval=$with_osx; + if test "$withval" != yes; then + as_fn_error $? "Option --with-osx doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-cocoa was given. if test "${with_cocoa+set}" = set; then : - withval=$with_cocoa; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + withval=$with_cocoa; + if test "$withval" != yes; then + as_fn_error $? "Option --with-cocoa doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-iphone was given. if test "${with_iphone+set}" = set; then : - withval=$with_iphone; wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1 + withval=$with_iphone; + if test "$withval" != yes; then + as_fn_error $? "Option --with-iphone doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-mac was given. if test "${with_mac+set}" = set; then : - withval=$with_mac; wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + withval=$with_mac; + if test "$withval" != yes; then + as_fn_error $? "Option --with-mac doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-wine was given. if test "${with_wine+set}" = set; then : - withval=$with_wine; wxUSE_WINE="$withval" CACHE_WINE=1 + withval=$with_wine; + if test "$withval" != yes; then + as_fn_error $? "Option --with-wine doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_WINE="$withval" CACHE_WINE=1 + fi + + # Check whether --with-msw was given. if test "${with_msw+set}" = set; then : - withval=$with_msw; wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1 + withval=$with_msw; + if test "$withval" != yes; then + as_fn_error $? "Option --with-msw doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-directfb was given. if test "${with_directfb+set}" = set; then : - withval=$with_directfb; wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1 + withval=$with_directfb; + if test "$withval" != yes; then + as_fn_error $? "Option --with-directfb doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-x11 was given. if test "${with_x11+set}" = set; then : - withval=$with_x11; wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1 + withval=$with_x11; + if test "$withval" != yes; then + as_fn_error $? "Option --with-x11 doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1 + fi + + # Check whether --with-qt was given. if test "${with_qt+set}" = set; then : - withval=$with_qt; wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1 + withval=$with_qt; + if test "$withval" != yes; then + as_fn_error $? "Option --with-qt doesn't accept any arguments" "$LINENO" 5 + fi + wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1 + fi + enablestring= defaultval= if test -z "$defaultval"; then diff --git a/configure.in b/configure.in index 11638b042d..41f274e50b 100644 --- a/configure.in +++ b/configure.in @@ -415,18 +415,18 @@ fi dnl we use AC_ARG_WITH and not WX_ARG_WITH for the toolkit options as they dnl shouldn't default to wxUSE_ALL_FEATURES AC_ARG_WITH(gtk, [[ --with-gtk[=VERSION] use GTK+, VERSION can be 3, 2 (default), 1 or "any"]], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(osx_cocoa, [ --with-osx_cocoa use Mac OS X (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(osx_iphone, [ --with-osx_iphone use iPhone OS X port], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(osx, [ --with-osx use Mac OS X (default port, Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(cocoa, [ --with-cocoa same as --with-osx_cocoa], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(iphone, [ --with-iphone same as --with-osx_iphone], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(mac, [ --with-mac same as --with-osx], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1]) -AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) -AC_ARG_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(osx_cocoa, [ --with-osx_cocoa use Mac OS X (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(osx_iphone, [ --with-osx_iphone use iPhone OS X port], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(osx, [ --with-osx use Mac OS X (default port, Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(cocoa, [ --with-cocoa same as --with-osx_cocoa], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(iphone, [ --with-iphone same as --with-osx_iphone], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(mac, [ --with-mac same as --with-osx], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1]) +WX_ARG_ONLY_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1]) WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) WX_ARG_ENABLE(gpe, [ --enable-gpe use GNOME PDA Environment features if possible], wxUSE_GPE) From 2f8a343b225e68d62f53c0908560f92b194a49c9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 May 2017 14:27:10 +0200 Subject: [PATCH 4/4] Add an option for reproducible library builds This can be useful to the library packagers, notably under Debian. Closes #17000. --- configure | 37 +++++++++++++++++++++++++ configure.in | 6 ++++ docs/doxygen/mainpages/const_wxusedef.h | 1 + include/wx/android/setup.h | 27 ++++++++++++------ include/wx/gtk/setup0.h | 27 ++++++++++++------ include/wx/motif/setup0.h | 27 ++++++++++++------ include/wx/msw/setup0.h | 29 ++++++++++++------- include/wx/osx/setup0.h | 31 ++++++++++++--------- include/wx/setup_inc.h | 10 +++++++ include/wx/univ/setup0.h | 27 ++++++++++++------ setup.h.in | 2 ++ src/common/utilscmn.cpp | 4 +++ 12 files changed, 169 insertions(+), 59 deletions(-) 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() );