+2012-01-20 Roland McGrath <roland@hack.frob.com>
+
+ * configure.ac: Handle --enable-deterministic-archives.
+
2011-10-08 Roland McGrath <roland@hack.frob.com>
* configure.ac (eu_version): Use sed instead of ${x/y/z} syntax.
ar: Support D modifier for "deterministic output" with no uid/gid/mtime info.
The U modifier is the inverse.
+ elfutils can be configured with the --enable-deterministic-archives
+ option to make the D behavior the default when U is not specified.
ranlib: Support -D and -U flags with same meaning.
Version 0.152
dnl Process this file with autoconf to produce a configure script.
dnl Configure input file for elfutils. -*-autoconf-*-
dnl
-dnl Copyright (C) 1996-2011 Red Hat, Inc.
+dnl Copyright (C) 1996-2012 Red Hat, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
AC_CANONICAL_HOST
+AC_ARG_ENABLE(deterministic-archives,
+[AS_HELP_STRING([--enable-deterministic-archives],
+ [ar and ranlib default to -D behavior])], [
+if test "${enableval}" = no; then
+ default_ar_deterministic=false
+else
+ default_ar_deterministic=true
+fi], [default_ar_deterministic=false])
+AC_DEFINE_UNQUOTED(DEFAULT_AR_DETERMINISTIC, $default_ar_deterministic,
+ [Should ar and ranlib use -D behavior by default?])
+
AC_ARG_ENABLE([thread-safety],
AS_HELP_STRING([--enable-thread-safety], [enable thread safety of libraries]),
use_locks=$enableval, use_locks=no)
2012-01-20 Roland McGrath <roland@hack.frob.com>
+ * arlib-argp.c (arlib_deterministic_output): Initialize from
+ configured value.
+ (help_filter): New function.
+ (argp): Use it.
+
* ar.c (main): Handle oper_none as usage error.
* arlib-argp.c (options, parse_opt): Grok -U as inverse of -D.
#endif
#include <argp.h>
+#include <libintl.h>
+
#include "arlib.h"
-bool arlib_deterministic_output;
+bool arlib_deterministic_output = DEFAULT_AR_DETERMINISTIC;
static const struct argp_option options[] =
{
return 0;
}
+static char *
+help_filter (int key, const char *text, void *input __attribute__ ((unused)))
+{
+ inline char *text_for_default (void)
+ {
+ char *new_text;
+ if (unlikely (asprintf (&new_text, gettext ("%s (default)"), text) < 0))
+ return (char *) text;
+ return new_text;
+ }
+
+ switch (key)
+ {
+ case 'D':
+ if (DEFAULT_AR_DETERMINISTIC)
+ return text_for_default ();
+ break;
+ case 'U':
+ if (! DEFAULT_AR_DETERMINISTIC)
+ return text_for_default ();
+ break;
+ }
+
+ return (char *) text;
+}
+
static const struct argp argp =
{
- options, parse_opt, NULL, NULL, NULL, NULL, NULL
+ options, parse_opt, NULL, NULL, NULL, help_filter, NULL
};
const struct argp_child arlib_argp_children[] =