010-autoconf-version.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- a/gnulib-tool.sh
  2. +++ b/gnulib-tool.sh
  3. @@ -344,6 +344,34 @@ Options for --import, --add/remove-impor
  4. Report bugs to <[email protected]>."
  5. }
  6. +get_version_sed='
  7. +# Move version to start of line.
  8. +s/.*[v ]\([0-9]\)/\1/
  9. +
  10. +# Skip lines that do not start with version.
  11. +/^[0-9]/!d
  12. +
  13. +# Remove characters after the version.
  14. +s/[^.a-z0-9-].*//
  15. +
  16. +# The first component must be digits only.
  17. +s/^\([0-9]*\)[a-z-].*/\1/
  18. +
  19. +# The following essentially does s/5.005/5.5/
  20. +s/\.0*\([1-9]\)/.\1/g
  21. +p
  22. +q'
  23. +
  24. +# get_version
  25. +# copied from build-aux/bootstrap
  26. +get_version () {
  27. + app=$1
  28. +
  29. + $app --version >/dev/null 2>&1 || { $app --version; return 1; }
  30. +
  31. + $app --version 2>&1 | sed -n "$get_version_sed"
  32. +}
  33. +
  34. # func_version
  35. # outputs to stdout the --version message.
  36. func_version ()
  37. @@ -1666,6 +1694,9 @@ func_determine_path_separator
  38. fi
  39. case "$autoconf_minversion" in
  40. 1.* | 2.[0-5]* | 2.6[0-3]*)
  41. + # if the version of autoconf in use is high enough, do not error
  42. + case "$(get_version autoconf)" in 1.* | 2.[0-5]* | 2.6[0-3]*) false ;; esac && \
  43. + func_warning "gnulib requires a newer version of autoconf than configure.ac ( $DEFAULT_AUTOCONF_MINVERSION > AC_PREREQ([$autoconf_minversion]) )" || \
  44. func_fatal_error "minimum supported autoconf version is 2.64. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;;
  45. esac