pr300-prog.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 installing subdirectory programs works.
  17. # PR/300
  18. required=cc
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CC
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am << 'END'
  25. bin_PROGRAMS = subdir/wish
  26. subdir_wish_SOURCES = a.c
  27. nobase_bin_PROGRAMS = subdir/want
  28. subdir_want_SOURCES = a.c
  29. test-all: all
  30. test -f subdir/wish$(EXEEXT)
  31. test -f subdir/want$(EXEEXT)
  32. test-install: install
  33. test -f inst/bin/wish$(EXEEXT)
  34. test -f inst/bin/subdir/want$(EXEEXT)
  35. test-uninstall: uninstall
  36. test ! -f inst/bin/wish$(EXEEXT)
  37. test ! -f inst/bin/subdir/want$(EXEEXT)
  38. test-install-strip: install-strip
  39. test -f inst/bin/wish$(EXEEXT)
  40. test -f inst/bin/subdir/want$(EXEEXT)
  41. END
  42. cat > a.c << 'END'
  43. #include <stdio.h>
  44. int main ()
  45. {
  46. printf ("hi liver!\n");
  47. return 0;
  48. }
  49. END
  50. ## A rule in the Makefile should create subdir
  51. # mkdir subdir
  52. $ACLOCAL
  53. $AUTOCONF
  54. $AUTOMAKE --copy --add-missing
  55. ./configure --prefix "$(pwd)/inst"
  56. $MAKE test-all
  57. $MAKE test-install
  58. $MAKE test-uninstall
  59. $MAKE test-install-strip
  60. :