python2.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #! /bin/sh
  2. # Copyright (C) 2002-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. # Make sure that Automake suggests using AM_PATH_PYTHON.
  17. . test-init.sh
  18. $ACLOCAL
  19. echo 1. pythondir not defined
  20. cat > Makefile.am <<'END'
  21. PYTHON = x
  22. python_PYTHON = foo.py
  23. END
  24. AUTOMAKE_fails -a
  25. grep 'pythondir.*undefined' stderr
  26. grep AM_PATH_PYTHON stderr
  27. echo 2. pkgpythondir not defined
  28. cat > Makefile.am <<'END'
  29. PYTHON = x
  30. pkgpython_PYTHON = foo.py
  31. END
  32. AUTOMAKE_fails -a
  33. grep 'pkgpythondir.*undefined' stderr
  34. grep AM_PATH_PYTHON stderr
  35. echo 3. pyexecdir not defined
  36. cat > Makefile.am <<'END'
  37. PYTHON = x
  38. pyexec_PYTHON = foo.py
  39. END
  40. AUTOMAKE_fails -a
  41. grep 'pyexecdir.*undefined' stderr
  42. grep AM_PATH_PYTHON stderr
  43. echo 4. pkgpyexecdir not defined
  44. cat > Makefile.am <<'END'
  45. PYTHON = x
  46. pkgpyexec_PYTHON = foo.py
  47. END
  48. AUTOMAKE_fails -a
  49. grep 'pkgpyexecdir.*undefined' stderr
  50. grep AM_PATH_PYTHON stderr
  51. echo 5. PYTHON not defined.
  52. cat > Makefile.am <<'END'
  53. pkgpyexecdir = /here/we/go
  54. pkgpyexec_PYTHON = foo.py
  55. END
  56. AUTOMAKE_fails -a
  57. grep 'PYTHON.*undefined' stderr
  58. grep AM_PATH_PYTHON stderr
  59. echo 6. Ok.
  60. cat > Makefile.am <<'END'
  61. PYTHON = x
  62. pkgpyexecdir = /here/we/go
  63. pkgpyexec_PYTHON = foo.py
  64. END
  65. rm -f py-compile
  66. $AUTOMAKE -a
  67. test -f py-compile
  68. echo 7. Ok again.
  69. cat > Makefile.am <<'END'
  70. PYTHON = x
  71. fubardir = /here/we/go
  72. fubar_PYTHON = foo.py
  73. END
  74. $AUTOMAKE -a
  75. :