get-sysconf.sh 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. # Dummy test case, aimed at reporting useful system information in the
  17. # final 'test-suite.log'. This way, if a user experiences a failure in
  18. # the Automake test suite and then only sends us the 'test-suite.log',
  19. # we won't have to ask him for more information to start analyzing the
  20. # failure (that had happened too many times in the past!).
  21. . test-init.sh
  22. st=0
  23. if test -d "$am_top_srcdir"/.git; then
  24. # We are running from a git checkout.
  25. (cd "$am_top_srcdir" && git log -1) || st=1
  26. elif test -f "$am_top_srcdir"/ChangeLog; then
  27. # We are probably running from a distribution tarball.
  28. awk '
  29. BEGIN { first = 1 }
  30. (first == 1) { print; first = 0; next; }
  31. /^[^\t]/ { exit(0); }
  32. { print }
  33. ' "$am_top_srcdir"/ChangeLog || st=1
  34. else
  35. # Some non-common but possibly valid setup (see for example the Homebrew
  36. # problem reported in automake bug#10866); so just give an harmless
  37. # warning instead of failing.
  38. warn_ "no .git directory nor ChangeLog file found, some info won't" \
  39. "be available"
  40. fi
  41. $PERL -V || st=1
  42. # It's OK for the user not to have the TAP::Parser module; this can
  43. # happen with older perl installation, or on MinGW/MSYS.
  44. $PERL -e 'use TAP::Parser; print $TAP::Parser::VERSION, "\n"' || :
  45. # It's OK if the selected Lex and Yacc programs don't know how to print
  46. # the version number or the help screen; those are usually available only
  47. # for Flex and Bison.
  48. $LEX --version || :
  49. $LEX --help || :
  50. $YACC --version || :
  51. $YACC --help || :
  52. cat "$am_top_builddir/config.log" || st=1
  53. cat "$am_top_builddir/t/wrap/aclocal-$APIVERSION" || st=1
  54. cat "$am_top_builddir/t/wrap/automake-$APIVERSION" || st=1
  55. if test $st -eq 0; then
  56. # This test SKIPs, so that all the information it has gathered and
  57. # printed will get unconditionally copied into the 'test-suite.log'
  58. # file.
  59. exit 77
  60. fi
  61. # Some unexpected error occurred; this must be reported as an hard
  62. # error by the testsuite driver.
  63. exit 99