From: David Lamparter Date: Sun, 7 Oct 2018 00:49:20 +0000 (+0200) Subject: build: try to use -D option for ar and ranlib X-Git-Tag: frr-7.1-dev~256^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=105a8189730ee29f6740b4f3be4a584bc4e3e4c0;p=matthieu%2Ffrr.git build: try to use -D option for ar and ranlib The -D option zeroes out timestamps in .a files and has become the default on recent distributions to enable reproducible builds. This also shuts up the "u ignored because D is default" warning that is showing up on some distributions. Signed-off-by: David Lamparter --- diff --git a/Makefile.am b/Makefile.am index 4cbf111b04..474f8ab5b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,6 +19,10 @@ AM_LDFLAGS = \ DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE) LIBCAP = @LIBCAP@ +AR_FLAGS = @AR_FLAGS@ +ARFLAGS = @ARFLAGS@ +RANLIB = @RANLIB@ + # these two targets are provided to easily grab autoconf/Makefile variables # you can use either: # eval `make VARFD=3 shvar-CFLAGS 3>&1 1>&2` diff --git a/configure.ac b/configure.ac index f498a65129..fad306a4fb 100755 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,32 @@ fi AC_SUBST(AC_LDFLAGS) AM_CONDITIONAL([STATIC_BIN], [test "x$enable_static_bin" = "xyes"]) +dnl $AR and $RANLIB are set by LT_INIT above +AC_MSG_CHECKING([whether $AR supports D option]) +if $AR crD conftest.a; then + AC_MSG_RESULT([yes]) + dnl ARFLAGS is for automake, AR_FLAGS for libtool m-( + ARFLAGS="crD" + AR_FLAGS="crD" +else + AC_MSG_RESULT([no]) + ARFLAGS="cru" + AR_FLAGS="cru" +fi +AC_SUBST(ARFLAGS) +AC_SUBST(AR_FLAGS) + +AC_MSG_CHECKING([whether $RANLIB supports D option]) +if $RANLIB -D conftest.a; then + AC_MSG_RESULT([yes]) + RANLIB="$RANLIB -D" +else + AC_MSG_RESULT([no]) +fi +AC_SUBST(RANLIB) + +test -f conftest.a && rm conftest.a + dnl ---------------------- dnl Packages configuration dnl ----------------------