Ticket #4031: 0001-Add-option-to-control-configure-args.patch

File 0001-Add-option-to-control-configure-args.patch, 2.9 KB (added by jpew, 4 years ago)

Patch to disable configure args at configure time

  • configure.ac

    From 635c64c46041c247976dfd2ab95e2c4bda205ee2 Mon Sep 17 00:00:00 2001
    From: Joshua Watt <JPEWhacker@gmail.com>
    Date: Sat, 9 Nov 2019 20:01:48 -0600
    Subject: [PATCH] Add option to control configure args
    
    Embedding the configure time options into the executable can lead to
    non-reproducible builds, since configure options often have embedded
    paths. Add a configure time option to control if the configure args are
    embedded so this can be disabled.
    
    Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
    ---
     configure.ac   | 6 ++++++
     src/args.c     | 6 ++++++
     src/textconf.c | 2 ++
     3 files changed, 14 insertions(+)
    
    diff --git a/configure.ac b/configure.ac
    index 6abe53100..4414484e5 100644
    a b dnl Clarify do we really need GModule 
    546546AM_CONDITIONAL([HAVE_GMODULE], [test -n "$g_module_supported" && \ 
    547547                                test x"$textmode_x11_support" = x"yes" -o x"$enable_aspell" = x"yes"]) 
    548548 
     549AC_ARG_ENABLE([configure-args], 
     550    AS_HELP_STRING([--enable-configure-args], [Handle all compiler warnings as errors])) 
     551if test "x$enable_configure_args" != xno; then 
     552    AC_DEFINE([ENABLE_CONFIGURE_ARGS], 1, [Define to enable showing configure arguments in help]) 
     553fi 
     554 
    549555AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments]) 
    550556 
    551557AC_CONFIG_FILES( 
  • src/args.c

    diff --git a/src/args.c b/src/args.c
    index baef1a1c8..f8dc24020 100644
    a b static gboolean mc_args__nouse_subshell = FALSE; 
    9595#endif /* ENABLE_SUBSHELL */ 
    9696static gboolean mc_args__show_datadirs = FALSE; 
    9797static gboolean mc_args__show_datadirs_extended = FALSE; 
     98#ifdef ENABLE_CONFIGURE_ARGS 
    9899static gboolean mc_args__show_configure_opts = FALSE; 
     100#endif 
    99101 
    100102static GOptionGroup *main_group; 
    101103 
    static const GOptionEntry argument_main_table[] = { 
    125127     NULL 
    126128    }, 
    127129 
     130#ifdef ENABLE_CONFIGURE_ARGS 
    128131    /* show configure options */ 
    129132    { 
    130133     "configure-options", '\0', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, 
    static const GOptionEntry argument_main_table[] = { 
    132135     N_("Print configure options"), 
    133136     NULL 
    134137    }, 
     138#endif 
    135139 
    136140    { 
    137141     "printwd", 'P', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, 
    mc_args_show_info (void) 
    758762        return FALSE; 
    759763    } 
    760764 
     765#ifdef ENABLE_CONFIGURE_ARGS 
    761766    if (mc_args__show_configure_opts) 
    762767    { 
    763768        show_configure_options (); 
    764769        return FALSE; 
    765770    } 
     771#endif 
    766772 
    767773    return TRUE; 
    768774} 
  • src/textconf.c

    diff --git a/src/textconf.c b/src/textconf.c
    index 1e0613e58..f39b9e028 100644
    a b show_datadirs_extended (void) 
    232232 
    233233/* --------------------------------------------------------------------------------------------- */ 
    234234 
     235#ifdef ENABLE_CONFIGURE_ARGS 
    235236void 
    236237show_configure_options (void) 
    237238{ 
    238239    (void) printf ("%s\n", MC_CONFIGURE_ARGS); 
    239240} 
     241#endif 
    240242 
    241243/* --------------------------------------------------------------------------------------------- */