Ticket #4031: 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>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Joshua Watt 2019-11-09 20:01:48 -06:00 committed by Andrew Borodin
parent 37fcb210f2
commit d009ea7b8b
3 changed files with 15 additions and 1 deletions

View File

@ -546,7 +546,13 @@ dnl Clarify do we really need GModule
AM_CONDITIONAL([HAVE_GMODULE], [test -n "$g_module_supported" && \
test x"$textmode_x11_support" = x"yes" -o x"$enable_aspell" = x"yes"])
AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments])
AC_ARG_ENABLE([configure-args],
AS_HELP_STRING([--enable-configure-args], [Handle all compiler warnings as errors]))
if test "x$enable_configure_args" != xno; then
AC_DEFINE([ENABLE_CONFIGURE_ARGS], 1, [Define to enable showing configure arguments in help])
AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments])
fi
AC_CONFIG_FILES(
[

View File

@ -95,7 +95,9 @@ static gboolean mc_args__nouse_subshell = FALSE;
#endif /* ENABLE_SUBSHELL */
static gboolean mc_args__show_datadirs = FALSE;
static gboolean mc_args__show_datadirs_extended = FALSE;
#ifdef ENABLE_CONFIGURE_ARGS
static gboolean mc_args__show_configure_opts = FALSE;
#endif
static GOptionGroup *main_group;
@ -125,6 +127,7 @@ static const GOptionEntry argument_main_table[] = {
NULL
},
#ifdef ENABLE_CONFIGURE_ARGS
/* show configure options */
{
"configure-options", '\0', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
@ -132,6 +135,7 @@ static const GOptionEntry argument_main_table[] = {
N_("Print configure options"),
NULL
},
#endif
{
"printwd", 'P', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING,
@ -758,11 +762,13 @@ mc_args_show_info (void)
return FALSE;
}
#ifdef ENABLE_CONFIGURE_ARGS
if (mc_args__show_configure_opts)
{
show_configure_options ();
return FALSE;
}
#endif
return TRUE;
}

View File

@ -232,10 +232,12 @@ show_datadirs_extended (void)
/* --------------------------------------------------------------------------------------------- */
#ifdef ENABLE_CONFIGURE_ARGS
void
show_configure_options (void)
{
(void) printf ("%s\n", MC_CONFIGURE_ARGS);
}
#endif
/* --------------------------------------------------------------------------------------------- */