summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Pratt2024-05-19 23:33:13 +0000
committerRobert Marko2024-06-19 09:22:13 +0000
commite6d106284eeaf632c581dc593ce4d5b774229604 (patch)
treefe02b6ede327455810ab0dc879d1684775609fe8
parentefdd65cb871c1fe369a56351064aca363fd792af (diff)
downloadneocturne-e6d106284eeaf632c581dc593ce4d5b774229604.tar.gz
tools/gnulib: ignore AC_PREREQ error if actual version passes
The gnulib-tool script is written to have a fatal error whenever the minimum required version of autoconf for the project that gnulib is being imported into as defined in configure.ac was less than the minimum required version required by gnulib. However, none of this matters if the version of autoconf that we use is newer than both requirements. Instead, use functions from the bootstrap script to check for the version of autoconf being used and print a warning whenever this case occurs. Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/15690 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--tools/gnulib/patches/010-autoconf-version.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/gnulib/patches/010-autoconf-version.patch b/tools/gnulib/patches/010-autoconf-version.patch
new file mode 100644
index 0000000000..a091bb2e1d
--- /dev/null
+++ b/tools/gnulib/patches/010-autoconf-version.patch
@@ -0,0 +1,47 @@
+--- a/gnulib-tool
++++ b/gnulib-tool
+@@ -346,6 +346,34 @@ Options for --import, --add/remove-impor
+ Report bugs to <bug-gnulib@gnu.org>."
+ }
+
++get_version_sed='
++# Move version to start of line.
++s/.*[v ]\([0-9]\)/\1/
++
++# Skip lines that do not start with version.
++/^[0-9]/!d
++
++# Remove characters after the version.
++s/[^.a-z0-9-].*//
++
++# The first component must be digits only.
++s/^\([0-9]*\)[a-z-].*/\1/
++
++# The following essentially does s/5.005/5.5/
++s/\.0*\([1-9]\)/.\1/g
++p
++q'
++
++# get_version
++# copied from build-aux/bootstrap
++get_version () {
++ app=$1
++
++ $app --version >/dev/null 2>&1 || { $app --version; return 1; }
++
++ $app --version 2>&1 | sed -n "$get_version_sed"
++}
++
+ # func_version
+ # outputs to stdout the --version message.
+ func_version ()
+@@ -1620,6 +1648,9 @@ func_determine_path_separator
+ fi
+ case "$autoconf_minversion" in
+ 1.* | 2.[0-5]* | 2.6[0-3]*)
++ # if the version of autoconf in use is high enough, do not error
++ case "$(get_version autoconf)" in 1.* | 2.[0-5]* | 2.6[0-3]*) false ;; esac && \
++ func_warning "gnulib requires a newer version of autoconf than configure.ac ( $DEFAULT_AUTOCONF_MINVERSION > AC_PREREQ([$autoconf_minversion]) )" || \
+ func_fatal_error "minimum supported autoconf version is 2.64. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;;
+ esac
+