configure.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #! /bin/sh
  2. # Copyright (C) 2010-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. # Diagnose if the autoconf input is named configure.in.
  17. # Diagnose if both configure.in and configure.ac are present, prefer
  18. # configure.ac.
  19. . test-init.sh
  20. cat >configure.ac <<EOF
  21. AC_INIT([$me], [1.0])
  22. AM_INIT_AUTOMAKE
  23. AC_CONFIG_FILES([Makefile])
  24. EOF
  25. cat >configure.in <<EOF
  26. AC_INIT([$me], [1.0])
  27. AM_INIT_AUTOMAKE([an-invalid-automake-option])
  28. AC_CONFIG_FILES([Makefile])
  29. EOF
  30. : >Makefile.am
  31. $ACLOCAL 2>stderr && { cat stderr >&2; exit 1; }
  32. cat stderr >&2
  33. grep 'configure\.ac.*configure\.in.*both present' stderr
  34. $ACLOCAL -Wno-error 2>stderr || { cat stderr >&2; exit 1; }
  35. cat stderr >&2
  36. grep 'configure\.ac.*configure\.in.*both present' stderr
  37. grep 'proceeding.*configure\.ac' stderr
  38. # Ensure we really proceed with configure.ac.
  39. AUTOMAKE_fails -Werror
  40. grep 'configure\.ac.*configure\.in.*both present' stderr
  41. grep 'proceeding.*configure\.ac' stderr
  42. AUTOMAKE_run -Wno-error
  43. grep 'configure\.ac.*configure\.in.*both present' stderr
  44. grep 'proceeding.*configure\.ac' stderr
  45. mv -f configure.ac configure.in
  46. AUTOMAKE_fails
  47. grep "autoconf input.*'configure.ac', not 'configure.in'" stderr
  48. :