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 <equinox@diac24.net>
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`
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 ----------------------