instfail.sh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #! /bin/sh
  2. # Copyright (C) 2008-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. # The install rule should honor failures of the install program.
  17. # Some of these are already caught by 'instmany.sh'.
  18. # This test has a few sister tests, for java, info, libtool.
  19. required=cc
  20. . test-init.sh
  21. cat >>configure.ac <<END
  22. AC_PROG_CC
  23. AM_PROG_AR
  24. AC_PROG_RANLIB
  25. AM_PATH_LISPDIR
  26. AC_OUTPUT
  27. END
  28. cat >Makefile.am <<'END'
  29. bin_PROGRAMS = prog1 prog2 prog3
  30. nobase_bin_PROGRAMS = progn1 progn2 progn3
  31. lisp_LISP = lisp1.el lisp2.el lisp3.el
  32. nobase_lisp_LISP = lispn1.el lispn2.el lispn3.el
  33. lib_LIBRARIES = lib1.a lib2.a lib3.a
  34. nobase_lib_LIBRARIES = libn1.a libn2.a libn3.a
  35. unreadable-prog:
  36. chmod a-r prog1$(EXEEXT)
  37. readable-prog:
  38. chmod a+r prog1$(EXEEXT)
  39. unreadable-progn:
  40. chmod a-r progn1$(EXEEXT)
  41. readable-progn:
  42. chmod a+r progn1$(EXEEXT)
  43. END
  44. for n in 1 2 3; do
  45. echo "int main () { return 0; }" > prog$n.c
  46. echo "int main () { return 0; }" > progn$n.c
  47. echo "int foo$n () { return 0; }" > lib$n.c
  48. echo "int foon$n () { return 0; }" > libn$n.c
  49. echo >lisp$n.el
  50. echo >lispn$n.el
  51. done
  52. $ACLOCAL
  53. $AUTOCONF
  54. $AUTOMAKE --add-missing
  55. instdir=$(pwd)/inst || fatal_ "getting current working directory"
  56. ./configure --prefix="$instdir"
  57. $MAKE
  58. $MAKE install
  59. $MAKE uninstall
  60. for file in lib1.a libn1.a
  61. do
  62. chmod a-r $file
  63. test ! -r $file || skip_ "cannot drop file read permissions"
  64. $MAKE install-exec && exit 1
  65. chmod u+r $file
  66. done
  67. $MAKE unreadable-prog
  68. $MAKE install-exec && exit 1
  69. $MAKE readable-prog
  70. $MAKE unreadable-progn
  71. $MAKE install-exec && exit 1
  72. $MAKE readable-progn
  73. if ! grep "^EMACS = no" Makefile; then
  74. for file in lisp1.el lisp1.elc; do
  75. chmod a-r $file
  76. $MAKE install-data && exit 1
  77. chmod u+r $file
  78. done
  79. fi
  80. :