From 7d1df39ec99498908854f01b22c6beefb04c9e5e Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Wed, 4 Dec 2024 14:43:20 +0800 Subject: [PATCH] fix AC_CHECK_LIB no longer works with g++ (debian bug#992981) --- autoconf.spec | 6 +++- backport-Port-AC_LANG_CALL-C-to-C.patch.patch | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 backport-Port-AC_LANG_CALL-C-to-C.patch.patch diff --git a/autoconf.spec b/autoconf.spec index d10f66d..5932327 100644 --- a/autoconf.spec +++ b/autoconf.spec @@ -3,7 +3,7 @@ Name: autoconf Version: 2.71 -Release: 4 +Release: 8 Summary: An extensible package to automatically configure software source code packages License: GPLv2+ and GPLv3+ and GFDL-1.3-only URL: https://www.gnu.org/software/%{name}/ @@ -12,6 +12,7 @@ Source1: config.site Source2: autoconf-el.el Patch1: backport-_AC_PROG_CXX_STDCXX_EDITION_TRY-fix-typo-in-variable.patch +Patch2: backport-Port-AC_LANG_CALL-C-to-C.patch.patch Patch9000: skip-one-test-at-line-1616-of-autotest.patch @@ -72,6 +73,9 @@ fi %changelog +* Wed Dec 04 2024 fuanan - 2.71-8 +- fix AC_CHECK_LIB no longer works with g++ (debian bug#992981) + * Wed Jun 12 2024 fuanan - 2.71-4 - Type:bugfix - ID:NA diff --git a/backport-Port-AC_LANG_CALL-C-to-C.patch.patch b/backport-Port-AC_LANG_CALL-C-to-C.patch.patch new file mode 100644 index 0000000..da50fc0 --- /dev/null +++ b/backport-Port-AC_LANG_CALL-C-to-C.patch.patch @@ -0,0 +1,36 @@ +From b27bc3e230bb12fdd9a813e38e82bc4c3e22b4cc Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 31 Aug 2021 16:30:46 -0700 +Subject: [PATCH] Port AC_LANG_CALL(C) to C++ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* lib/autoconf/c.m4 (AC_LANG_CALL(C)): Add an extern "C" if C++. +Problem reported by Vincent Lefèvre (sr #110532). +--- + lib/autoconf/c.m4 | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 +index 44443a39..48bd49a3 100644 +--- a/lib/autoconf/c.m4 ++++ b/lib/autoconf/c.m4 +@@ -126,7 +126,13 @@ m4_define([AC_LANG_CALL(C)], + m4_if([$2], [main], , + [/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ ++ builtin and then its argument prototype would still apply. ++ The 'extern "C"' is for builds by C++ compilers; ++ although this is not generally supported in C code, supporting it here ++ has little cost and some practical benefit (sr 110532). */ ++#ifdef __cplusplus ++extern "C" ++#endif + char $2 ();])], [return $2 ();])]) + + +-- +2.43.5 + -- Gitee