From 748aba4c273806720d58b55ea577812c290f52d7 Mon Sep 17 00:00:00 2001 From: wenyuzifangtest001 Date: Fri, 12 Sep 2025 18:19:42 +0800 Subject: [PATCH] Update code from upstream --- ...t-noinst_PYTHON-preceding-foo_PYTHON.patch | 58 ++++ ...efaults-error-in-link_cond-due-to-ma.patch | 31 ++ ...sure-make_ok-fails-when-run_make-fai.patch | 34 +++ automake.spec | 23 +- ...implicit-function-declaration-errors.patch | 265 ++++++++++++++++++ ...licit-function-declaration-in-ax-dep.patch | 58 ++++ 6 files changed, 467 insertions(+), 2 deletions(-) create mode 100644 0001-python-support-noinst_PYTHON-preceding-foo_PYTHON.patch create mode 100644 0001-tests-Fix-type-defaults-error-in-link_cond-due-to-ma.patch create mode 100644 0001-tests-depcomp-ensure-make_ok-fails-when-run_make-fai.patch create mode 100644 v2-0002-tests-Fix-implicit-function-declaration-errors.patch create mode 100644 v3-0003-tests-Fix-implicit-function-declaration-in-ax-dep.patch diff --git a/0001-python-support-noinst_PYTHON-preceding-foo_PYTHON.patch b/0001-python-support-noinst_PYTHON-preceding-foo_PYTHON.patch new file mode 100644 index 0000000..5d60b9a --- /dev/null +++ b/0001-python-support-noinst_PYTHON-preceding-foo_PYTHON.patch @@ -0,0 +1,58 @@ +From ab347652df9ff8f65ba1be6aaa357cf3c2b16dca Mon Sep 17 00:00:00 2001 +From: Bogdan +Date: Wed, 5 Jul 2023 08:59:29 -0700 +Subject: [PATCH] python: support noinst_PYTHON preceding foo_PYTHON. + +This change fixes https://bugs.gnu.org/24507. + +* lib/am/python.am (am__pep3147_tweak): remove conditional +on %?INSTALL%. +* t/python-pr10995.sh: test with make uninstall. +--- + lib/am/python.am | 4 ++-- + t/python-pr10995.sh | 6 ++++++ + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/lib/am/python.am b/lib/am/python.am +index 98f95af1b..19f268efc 100644 +--- a/lib/am/python.am ++++ b/lib/am/python.am +@@ -94,11 +94,11 @@ endif %?INSTALL% + ## Uninstalling. ## + ## -------------- ## + +-if %?INSTALL% +- + ?FIRST?am__pep3147_tweak = \ + ?FIRST? sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|' + ++if %?INSTALL% ++ + .PHONY uninstall-am: uninstall-%DIR%PYTHON + uninstall-%DIR%PYTHON: + @$(NORMAL_UNINSTALL) +diff --git a/t/python-pr10995.sh b/t/python-pr10995.sh +index 324be916e..abeb8a124 100644 +--- a/t/python-pr10995.sh ++++ b/t/python-pr10995.sh +@@ -17,6 +17,9 @@ + # Test automake bug#10995: am__py_compile doesn't get correctly defined + # when there a 'noinst_PYTHON' declaration precedes a 'foo_PYTHON' + # declaration. ++# Test also automake bug#24507: am__pep3147_tweak doesn't get correctly ++# defined when there a 'noinst_PYTHON' declaration precedes a 'foo_PYTHON' ++# declaration and 'make uninstall' fails functionally (just shows errors). + + required=python + . test-init.sh +@@ -53,4 +56,7 @@ py_installed --not inst/py/no.pyc + + $MAKE disttest + ++LC_ALL=C run_make -M uninstall ++grep 'command substitution' output && exit 1 ++ + : +-- +2.47.0 + diff --git a/0001-tests-Fix-type-defaults-error-in-link_cond-due-to-ma.patch b/0001-tests-Fix-type-defaults-error-in-link_cond-due-to-ma.patch new file mode 100644 index 0000000..e08b977 --- /dev/null +++ b/0001-tests-Fix-type-defaults-error-in-link_cond-due-to-ma.patch @@ -0,0 +1,31 @@ +From 2a9908da9dbc075ee6c4e853cf3be0365b15f202 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= +Date: Mon, 12 Dec 2022 08:05:53 +0100 +Subject: [PATCH] tests: Fix 'type defaults' error in link_cond due to main not + being properly declared + +This is related to an effort to prepare Automake for future GCC/Clang +versions which set c99 as default standard to be used. +Not properly declaring main as "int main(...)" is rejected since c99. + +* t/link_cond.sh: Add (void) to main definition. +--- + t/link_cond.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/t/link_cond.sh b/t/link_cond.sh +index 45d0d7f40..889623131 100644 +--- a/t/link_cond.sh ++++ b/t/link_cond.sh +@@ -52,7 +52,7 @@ $AUTOCONF + rm -f *.c++ + cat > less.c <<'END' + /* Valid C but deliberately invalid C++ */ +-main () ++int main (void) + { + int new = 0; + return new; +-- +2.39.1 + diff --git a/0001-tests-depcomp-ensure-make_ok-fails-when-run_make-fai.patch b/0001-tests-depcomp-ensure-make_ok-fails-when-run_make-fai.patch new file mode 100644 index 0000000..5ffb9c6 --- /dev/null +++ b/0001-tests-depcomp-ensure-make_ok-fails-when-run_make-fai.patch @@ -0,0 +1,34 @@ +From 6d6fc91c472fd84bd71a1b012fa9ab77bd94efea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= +Date: Mon, 12 Dec 2022 07:32:13 +0100 +Subject: [PATCH] tests: depcomp: ensure make_ok() fails when run_make fails + +While running automake tests with -std-gnu=c99, the compiler report +errors which lead to make to fail. Yet, these failures are ignored +during the tests, which considers them to be successful as stderror is +check for one specific pattern. + +If make fails, investigation should be made to discover why, whatever +the reason for the failure is. + +* t/ax/depcomp.sh: Make make_ok fail when make fails. +--- + t/ax/depcomp.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh +index 3c4db10e3..7a3ac63a7 100644 +--- a/t/ax/depcomp.sh ++++ b/t/ax/depcomp.sh +@@ -160,7 +160,7 @@ case $depcomp_with_libtool in + echo lib_LTLIBRARIES = libfoo.la >> Makefile.am + make_ok () + { +- run_make -M -- ${1+"$@"} ++ run_make -M -- ${1+"$@"} || return 1 + $FGREP 'unknown directive' output && return 1 + rm -f output + # Checks for stray files possibly left around by less common +-- +2.39.1 + diff --git a/automake.spec b/automake.spec index fdcd88a..3505cef 100644 --- a/automake.spec +++ b/automake.spec @@ -1,4 +1,4 @@ -%define anolis_release 4 +%define anolis_release 5 # perform 'make check' by default %bcond_without check @@ -11,9 +11,14 @@ Summary: A program which creates Makefiles from template files. # docs ~> GFDL, sources ~> GPLv2+, mkinstalldirs ~> PD and install-sh ~> MIT License: GPLv2+ and GFDL and Public Domain and MIT URL: http://www.gnu.org/software/automake/ -Source0: ftp://ftp.gnu.org/gnu/automake/automake-%{version}.tar.xz +Source0: ftp://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.xz Patch0001: 0001-Add-sw_64-arch-support.patch +Patch2: 0001-tests-depcomp-ensure-make_ok-fails-when-run_make-fai.patch +Patch3: v3-0003-tests-Fix-implicit-function-declaration-in-ax-dep.patch +Patch4: 0001-tests-Fix-type-defaults-error-in-link_cond-due-to-ma.patch +Patch5: 0001-python-support-noinst_PYTHON-preceding-foo_PYTHON.patch +Patch6: v2-0002-tests-Fix-implicit-function-declaration-errors.patch BuildRequires: autoconf BuildRequires: coreutils @@ -40,6 +45,14 @@ BuildRequires: libtool BuildRequires: ncompress BuildRequires: sharutils BuildRequires: vala +BuildRequires: autoconf >= 2.65 +BuildRequires: gcc-objc +BuildRequires: gcc-objc++ +BuildRequires: imake +BuildRequires: lzip +BuildRequires: perl-interpreter +BuildRequires: texinfo-tex +BuildRequires: texlive-dvips %endif Requires: autoconf >= 2.65 @@ -109,6 +122,12 @@ make install DESTDIR=%{buildroot} %doc AUTHORS README THANKS NEWS README.aclocal README.multilib %changelog +* Fri Sep 12 2025 Wenyuzifangtest001 - 1.16.5-5 +- Ensure tests fail on make errors to catch hidden build issues early +- Fixes test failure with C99 compilers by restoring necessary header declarations +- Fixes test failure with C99 compilers by restoring necessary header declarations +- Fix uninstall errors and ensure clean removal of Python bytecode files +- Apply patch to ensure compatibility with future GCC/Clang versions defaulting to C99 standard * Fri Mar 7 2025 zhuyunfei - 1.16.5-4 - Add sw_64 arch support diff --git a/v2-0002-tests-Fix-implicit-function-declaration-errors.patch b/v2-0002-tests-Fix-implicit-function-declaration-errors.patch new file mode 100644 index 0000000..b882e03 --- /dev/null +++ b/v2-0002-tests-Fix-implicit-function-declaration-errors.patch @@ -0,0 +1,265 @@ +From 38f4f6dcdb907e0006a8e83246e010d5d5cad98d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= +Date: Thu, 8 Dec 2022 10:09:14 +0100 +Subject: [PATCH v2 2/3] tests: Fix implicit function declaration errors +In-Reply-To: <20221212070554.1635775-3-fberat@redhat.com> + +Changes from v1: + Modifications to "t/ax/depcomp.sh" have been moved to a dedicated patch + +-- 8< -- + +This is related to an effort to prepare Automake for future GCC/Clang +versions which set c99 as default standard to be used. + +Function should be properly declared prior to use in order to be +compatible with c99 standard. +This is valid for both local functions and standard functions (as +printf). + +Modified files: + + * t/c-demo.sh + * t/cond35.sh + * t/dist-vs-built-sources.sh + * t/lex-clean.sh + * t/lex-multiple.sh + * t/lex-nodist.sh + * t/ltcond2.sh + * t/ltconv.sh + * t/subobj-clean-lt-pr10697.sh + * t/subobj-clean-pr10697.sh + * t/tags-pr12372.sh + * t/yacc-basic.sh + * t/yacc-clean.sh + * t/yacc-nodist.sh +--- + t/c-demo.sh | 1 + + t/cond35.sh | 2 ++ + t/dist-vs-built-sources.sh | 1 + + t/lex-clean.sh | 1 + + t/lex-multiple.sh | 4 ++++ + t/lex-nodist.sh | 2 ++ + t/ltcond2.sh | 2 ++ + t/ltconv.sh | 6 ++++++ + t/subobj-clean-lt-pr10697.sh | 10 +++++++++- + t/subobj-clean-pr10697.sh | 10 +++++++++- + t/tags-pr12372.sh | 3 ++- + t/yacc-basic.sh | 1 + + t/yacc-clean.sh | 4 ++++ + t/yacc-nodist.sh | 2 ++ + 14 files changed, 46 insertions(+), 3 deletions(-) + +diff --git a/t/c-demo.sh b/t/c-demo.sh +index 7e0e8d64f..d25bf214b 100644 +--- a/t/c-demo.sh ++++ b/t/c-demo.sh +@@ -113,6 +113,7 @@ test -f build-aux/compile # We have per-target flags on C sources. + ./configure --enable-dependency-tracking + + cat > src/main.c << 'END' ++#include + #include "foo.h" + #include "bar.h" + int main (void) +diff --git a/t/cond35.sh b/t/cond35.sh +index 215a22548..bad133970 100644 +--- a/t/cond35.sh ++++ b/t/cond35.sh +@@ -73,6 +73,8 @@ END + + cat > tparse.y << 'END' + %{ ++extern int yylex(void); ++ + void yyerror (const char *s) {} + %} + %token EOF +diff --git a/t/dist-vs-built-sources.sh b/t/dist-vs-built-sources.sh +index d038e66dd..db2776f9a 100644 +--- a/t/dist-vs-built-sources.sh ++++ b/t/dist-vs-built-sources.sh +@@ -41,6 +41,7 @@ foo_SOURCES = foo.c + END + + cat > foo.c << 'END' ++#include + #include "h.h" + int main (void) { printf ("%s\n", F); return 0; } + END +diff --git a/t/lex-clean.sh b/t/lex-clean.sh +index 5aa199338..e53da8fd2 100644 +--- a/t/lex-clean.sh ++++ b/t/lex-clean.sh +@@ -61,6 +61,7 @@ cat > lexer.l << 'END' + END + + cat > main.c << 'END' ++extern int yylex (void); + int main (void) + { + return yylex (); +diff --git a/t/lex-multiple.sh b/t/lex-multiple.sh +index 2655b633e..bf119ec84 100644 +--- a/t/lex-multiple.sh ++++ b/t/lex-multiple.sh +@@ -56,6 +56,10 @@ cat > main.c << 'END' + #include + #include + ++extern int yylex (void); ++extern int foolex (void); ++extern int bar_lex (void); ++ + int main (int argc, char *argv[]) + { + if (argc != 2) +diff --git a/t/lex-nodist.sh b/t/lex-nodist.sh +index 599539405..187dd5437 100644 +--- a/t/lex-nodist.sh ++++ b/t/lex-nodist.sh +@@ -62,6 +62,8 @@ CLEANFILES = $(nodist_prog_SOURCES) + END + + cat > main.c << 'END' ++extern int yylex (void); ++ + int main () + { + return yylex (); +diff --git a/t/ltcond2.sh b/t/ltcond2.sh +index 29244c9b3..7e7bcadc4 100644 +--- a/t/ltcond2.sh ++++ b/t/ltcond2.sh +@@ -73,6 +73,8 @@ void print (void) + END + + cat > main.c <<'END' ++extern void print(void); ++ + int main (void) + { + print(); +diff --git a/t/ltconv.sh b/t/ltconv.sh +index 2c4cc47a1..ec79ef80e 100644 +--- a/t/ltconv.sh ++++ b/t/ltconv.sh +@@ -91,6 +91,12 @@ echo 'int sub22 () { return 22; }' > sub2/sub22/sub22.c + + cat >test.c <<'EOF' + #include ++ ++extern int sub1 (void); ++extern int sub2 (void); ++extern int sub21 (void); ++extern int sub22 (void); ++ + int main () + { + if (1 != sub1 ()) +diff --git a/t/subobj-clean-lt-pr10697.sh b/t/subobj-clean-lt-pr10697.sh +index bb656c43f..53fc02f09 100644 +--- a/t/subobj-clean-lt-pr10697.sh ++++ b/t/subobj-clean-lt-pr10697.sh +@@ -83,7 +83,15 @@ libfoo_la_SOURCES = \ + END + + mkdir sub1 sub2 +-echo 'int libmain (void)' > main.c ++ ++echo "/* Subobj clean: libtool case*/" > main.c ++for i in 1 2; do ++ for j in a b c d e f; do ++ echo "extern void $j$i (void);" >> main.c ++ done ++done ++ ++echo 'int libmain (void)' >> main.c + echo '{' >> main.c + for i in 1 2; do + for j in a b c d e f; do +diff --git a/t/subobj-clean-pr10697.sh b/t/subobj-clean-pr10697.sh +index f77de8c92..a7f97f6d1 100644 +--- a/t/subobj-clean-pr10697.sh ++++ b/t/subobj-clean-pr10697.sh +@@ -81,7 +81,15 @@ foo_SOURCES = \ + END + + mkdir sub1 sub2 +-echo 'int main (void)' > main.c ++ ++echo "/* Subobj clean: generic case*/" > main.c ++for i in 1 2; do ++ for j in a b c d e f; do ++ echo "extern void $j$i (void);" >> main.c ++ done ++done ++ ++echo 'int main (void)' >> main.c + echo '{' >> main.c + for i in 1 2; do + for j in a b c d e f; do +diff --git a/t/tags-pr12372.sh b/t/tags-pr12372.sh +index b9c022f70..1a9e1e026 100644 +--- a/t/tags-pr12372.sh ++++ b/t/tags-pr12372.sh +@@ -53,7 +53,8 @@ noinst_PROGRAMS = zap + zap_SOURCES = zardoz.pc + END + +-echo 'int main(void) [ return bar(1); ]' > foo-main.pc ++echo 'extern int bar(int);' > foo-main.pc ++echo 'int main(void) [ return bar(1); ]' >> foo-main.pc + echo 'int bar(int x) { return !x; }' > barbar.c + echo 'int m@in(void) { return 0; }' > sub/zardoz.pc + +diff --git a/t/yacc-basic.sh b/t/yacc-basic.sh +index 5b258a30c..8cc0d06a2 100644 +--- a/t/yacc-basic.sh ++++ b/t/yacc-basic.sh +@@ -49,6 +49,7 @@ a : 'a' { exit(0); }; + END + + cat > foo.c << 'END' ++extern int yyparse(void); + int main () { yyparse (); return 1; } + END + +diff --git a/t/yacc-clean.sh b/t/yacc-clean.sh +index 373774b6a..fef079cf3 100644 +--- a/t/yacc-clean.sh ++++ b/t/yacc-clean.sh +@@ -65,6 +65,8 @@ END + + cat > sub1/parse.y << 'END' + %{ ++#include ++ + int yylex () { return (getchar ()); } + void yyerror (const char *s) {} + %} +@@ -74,6 +76,8 @@ END + cp sub1/parse.y sub2/parse.y + + cat > sub1/main.c << 'END' ++extern int yyparse(void); ++ + int main () + { + return yyparse (); +diff --git a/t/yacc-nodist.sh b/t/yacc-nodist.sh +index d350a80f9..4a8ebe9ca 100644 +--- a/t/yacc-nodist.sh ++++ b/t/yacc-nodist.sh +@@ -78,6 +78,8 @@ BUILT_SOURCES = parse.h + END + + cat > sub1/main.c << 'END' ++extern int yyparse(void); ++ + int main () + { + return yyparse (); +-- +2.38.1 + diff --git a/v3-0003-tests-Fix-implicit-function-declaration-in-ax-dep.patch b/v3-0003-tests-Fix-implicit-function-declaration-in-ax-dep.patch new file mode 100644 index 0000000..4ff1f4e --- /dev/null +++ b/v3-0003-tests-Fix-implicit-function-declaration-in-ax-dep.patch @@ -0,0 +1,58 @@ +From 5e74354030fe88e038a6fc1b3f4c2321df150352 Mon Sep 17 00:00:00 2001 +From: Frederic Berat +Date: Fri, 16 Dec 2022 06:42:45 +0100 +Subject: [PATCH v3] tests: Fix implicit function declaration in ax/depcomp.sh +In-Reply-To: <20230113064804.580F5340B54@smtp.gentoo.org> + +Change since v2: + - Replace the mv operation by a cp operation to ensure that subfoo.h is + considered being modified. + +-- 8< -- + +In depcomp.sh, the following occurs: + +1. Files are created so that headers and units are available in + subdirectories +2. Multiple "make" are executed, while modifying the content of the + headers, some should fail, others should succeed. +3. At the end, the "sub/subfoo.h" header gets removed. +4. make is executed again, which is expected to succeed. + +Yet, with c99, this can't work as the subfoo.h header contains +declaration that are used by foo.c. +Thus, we need to get them back, either by inserting the declaration in +foo.c (or any other header/unit), or by restoring subfoo.h to its +original state. + +The later solution seems the easiest path, being less intrusive in +depcomp.sh. +--- + t/ax/depcomp.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh +index 7a3ac63a7..c92f7c8df 100644 +--- a/t/ax/depcomp.sh ++++ b/t/ax/depcomp.sh +@@ -243,6 +243,7 @@ cat > sub/subfoo.h <<'END' + #include + extern int subfoo (void); + END ++cp sub/subfoo.h sub/subfoo.save + + cat > src/baz.c <<'END' + #include "baz.h" +@@ -399,8 +400,7 @@ do_test () + && rewrite "$srcdir"/sub/subfoo.h echo 'choke me' \ + && not $MAKE \ + && delete "$srcdir"/sub/subfoo.h \ +- && edit "$srcdir"/sub/subfoo.c -e 1d \ +- && edit "$srcdir"/foo.h -e 2d \ ++ && cp "$srcdir"/sub/subfoo.save "$srcdir"/sub/subfoo.h \ + && make_ok \ + || r='not ok' + result_ "$r" "$pfx dependency tracking works" +-- +2.39.0 + -- Gitee