ansi2knr-no-more.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #! /bin/sh
  2. # Copyright (C) 2011-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check that any attempt to use the obsolete de-ANSI-fication support
  17. # is diagnosed.
  18. . test-init.sh
  19. warn_rx='automatic de-ANSI-fication.*removed'
  20. echo AC_PROG_CC >> configure.ac
  21. $ACLOCAL
  22. mv aclocal.m4 aclocal.sav
  23. cp configure.ac configure.sav
  24. echo AM_C_PROTOTYPES >> configure.ac
  25. $ACLOCAL -Wnone 2>stderr && { cat stderr >&2; exit 1; }
  26. cat stderr >&2
  27. grep "^configure\\.ac:5:.*$warn_rx" stderr
  28. cat aclocal.sav "$am_automake_acdir"/obsolete.m4 > aclocal.m4
  29. $AUTOCONF -Wnone 2>stderr && { cat stderr >&2; exit 1; }
  30. cat stderr >&2
  31. grep "^configure\\.ac:5:.*$warn_rx" stderr
  32. for opt in ansi2knr lib/ansi2knr; do
  33. # ansi2knr option in Makefile.am
  34. cp configure.sav configure.ac
  35. echo "AUTOMAKE_OPTIONS = $opt" > Makefile.am
  36. rm -rf autom4te*.cache
  37. AUTOMAKE_fails -Wnone
  38. grep "^Makefile\.am:1:.*$warn_rx" stderr
  39. # ansi2knr option in configure.ac
  40. : > Makefile.am
  41. sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" configure.sav >configure.ac
  42. cat configure.ac # For debugging.
  43. rm -rf autom4te*.cache
  44. AUTOMAKE_fails -Wnone
  45. grep "^configure\\.ac:2:.*$warn_rx" stderr
  46. done
  47. :