From 773810fb454b73e2ff6d5817ffbcd1ba84b21ef2 Mon Sep 17 00:00:00 2001 From: Kai Wang Date: Sun, 28 Nov 2010 18:53:57 +0000 Subject: [PATCH] Add option -D for ranlib(1). When -D is speicified, ranlib(1) will generate a deterministic archive symbol table (i.e. timestamp for the symbol table member header is set to 0). Submitted by: Erik Cederstrand --- usr.bin/ar/ar.1 | 1 + usr.bin/ar/ar.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/ar/ar.1 b/usr.bin/ar/ar.1 index c64c7f64ac6e..692d8b15bb11 100644 --- a/usr.bin/ar/ar.1 +++ b/usr.bin/ar/ar.1 @@ -92,6 +92,7 @@ .Ar archive .Op Ar files ... .Nm ranlib +.Op Fl D .Ar archive ... .Sh DESCRIPTION The diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c index e5bc1d2682aa..bb53aa43d939 100644 --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -113,12 +113,15 @@ main(int argc, char **argv) len = strlen(bsdar->progname); if (len >= strlen("ranlib") && strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) { - while ((opt = getopt_long(argc, argv, "tV", longopts, + while ((opt = getopt_long(argc, argv, "tDV", longopts, NULL)) != -1) { switch(opt) { case 't': /* Ignored. */ break; + case 'D': + bsdar->options |= AR_D; + break; case 'V': ranlib_version(); break;