]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: improve ranlib -D autoconf test
authorDavid Lamparter <equinox@diac24.net>
Wed, 12 Jun 2019 18:43:31 +0000 (20:43 +0200)
committerDavid Lamparter <equinox@diac24.net>
Thu, 13 Jun 2019 11:35:33 +0000 (13:35 +0200)
Signed-off-by: David Lamparter <equinox@diac24.net>
configure.ac

index 77d5ee1555580e64517f4466a18fa4aac03315e9..5047e33cc379b1a0101c746f8f6a866dd4ba1d20 100755 (executable)
@@ -371,14 +371,19 @@ AC_SUBST([ARFLAGS])
 AC_SUBST([AR_FLAGS])
 
 AC_MSG_CHECKING([whether $RANLIB supports D option])
-if $RANLIB -D conftest.a >/dev/null 2>/dev/null; then
-  AC_MSG_RESULT([yes])
-  RANLIB="$RANLIB -D"
+if $RANLIB -D conftest.a >conftest.err 2>&1; then
+  if grep -q -- '-D' conftest.err; then
+    AC_MSG_RESULT([no])
+  else
+    AC_MSG_RESULT([yes])
+    RANLIB="$RANLIB -D"
+  fi
 else
   AC_MSG_RESULT([no])
 fi
 AC_SUBST([RANLIB])
 
+test -f conftest.err && rm conftest.err
 test -f conftest.a && rm conftest.a
 
 dnl ----------------------