2
0

installdir.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #! /bin/sh
  2. # Copyright (C) 2001-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. # Test for PR 203.
  17. # See also automake bug#11030.
  18. #
  19. # == Original Report for PR/203 ==
  20. # Some standard targets are missing '-local' hooks. For instance,
  21. # installdirs is missing this. Ideally this would be an automatic
  22. # feature of any exported target.
  23. . test-init.sh
  24. echo AC_OUTPUT >> configure.ac
  25. cat > Makefile.am << 'END'
  26. foodir = $(datadir)/$(distdir)
  27. installdirs-local:
  28. $(MKDIR_P) $(DESTDIR)$(foodir)
  29. install-data-hook: installdirs-local
  30. END
  31. $ACLOCAL
  32. $AUTOMAKE
  33. test $(grep -c installdirs-local Makefile.in) -eq 4
  34. cwd=$(pwd) || fatal_ "getting current working directory"
  35. $AUTOCONF
  36. ./configure --prefix="$cwd/inst"
  37. $MAKE installdirs
  38. test -d inst/share/$me-1.0
  39. rm -rf inst
  40. $MAKE install
  41. test -d inst/share/$me-1.0
  42. rm -rf inst
  43. ./configure --prefix=/foo
  44. $MAKE installdirs DESTDIR="$cwd/dest"
  45. test -d dest/foo/share/$me-1.0
  46. rm -rf dest
  47. $MAKE install DESTDIR="$cwd/dest"
  48. test -d dest/foo/share/$me-1.0
  49. rm -rf dest
  50. :