]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtoolize: Fix conflicting warnings about AC_PROG_RANLIB
authorIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Thu, 5 Sep 2024 18:19:18 +0000 (21:19 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Fri, 13 Sep 2024 17:19:34 +0000 (20:19 +0300)
The macro _LT_CMD_OLD_ARCHIVE inlines the definition of AC_PROG_RANLIB,
which seems to be outdated functionality. Running autoscan in a
directory with ltmain.sh produces conflicting warnings with libtoolize
about AC_PROG_RANLIB. Autoconf warns that AC_PROG_RANLIB is missing,
but libtoolize warns that it is obsolete. The outdated warning should
no longer appear after replacing AC_CHECK_TOOL(RANLIB, ranlib, :) with
AC_REQUIRE([AC_PROG_RANLIB]).

* m4/libtool.m4: Use AC_REQUIRE([AC_PROG_RANLIB]).
* Makefile.am: Added in tests/bug_42313.at.
* tests/bug_42313.at: Contains test cases for bug 42313.

Makefile.am
m4/libtool.m4
tests/bug_42313.at [new file with mode: 0644]

index b7664cd3c1dd903efcec453395e06ec7e0e21372..3c8f9c600ebc57490301fbb8a21071e5d0986dd7 100644 (file)
@@ -726,6 +726,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/cmdline_wrap.at \
                  tests/bug_62343.at    \
                  tests/bug_71489.at \
+                 tests/bug_42313.at \
                  $(NOTHING_ELSE)
 
 EXTRA_DIST     += $(testsuite) $(TESTSUITE_AT) $(package_m4)
index 1550b76dc14d430fa844015bfb51c30e699f51cb..6a6d13c512e3c2a4968a41148e9903d6a3239d6d 100644 (file)
@@ -1566,7 +1566,7 @@ AC_CHECK_TOOL(STRIP, strip, :)
 test -z "$STRIP" && STRIP=:
 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
 
-AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_REQUIRE([AC_PROG_RANLIB])
 test -z "$RANLIB" && RANLIB=:
 _LT_DECL([], [RANLIB], [1],
     [Commands used to install an old-style archive])
diff --git a/tests/bug_42313.at b/tests/bug_42313.at
new file mode 100644 (file)
index 0000000..1ee0f7b
--- /dev/null
@@ -0,0 +1,61 @@
+# bug_42313.at -- bug 42313   -*- Autotest -*-
+
+#   Copyright (C) 2024 Free Software Foundation, Inc.
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool.  If not, see <https://www.gnu.org/licenses/>.
+####
+
+AT_BANNER([Testing bug 42313:])
+
+AT_SETUP([verify no autoscan AC_PROG_RANLIB warning])
+
+AT_DATA([configure.ac],
+[[
+AC_PREREQ([2.69])
+AC_INIT([testcase], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+LT_INIT
+AC_CONFIG_MACRO_DIR([m4])
+AC_OUTPUT
+]])
+
+LT_AT_LIBTOOLIZE([--install])
+AT_CHECK([$AUTORECONF --install], [0], [stdout], [stderr])
+AT_CHECK([autoscan || exit 77], [0], [stdout], [stderr])
+AT_CHECK([$GREP -- 'AC_PROG_RANLIB' stderr], [1], [ignore])
+
+AT_CLEANUP
+
+AT_SETUP([check AC_PROG_RANLIB declaration has warning])
+
+AT_DATA([configure.ac],
+[[
+AC_PREREQ([2.69])
+AC_INIT([testcase], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+LT_INIT
+AC_CONFIG_MACRO_DIR([m4])
+AC_PROG_CPP
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+AC_OUTPUT
+]])
+
+LT_AT_LIBTOOLIZE([--install])
+AT_CHECK([$AUTORECONF --install], [0], [stdout], [stderr])
+AT_CHECK([$GREP -- 'obsolete' stdout], [0], [ignore])
+
+AT_CLEANUP