instdir.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #! /bin/sh
  2. # Copyright (C) 2009-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. # If $(foodir) is the empty string, then nothing should be installed there.
  17. # This test only ensures this if $(foo_PRIMARY) is also empty, see
  18. # 'instdir2.sh' and siblings 'instdir-*.sh' for nonempty contents.
  19. . test-init.sh
  20. cat >>configure.ac <<'END'
  21. AC_SUBST([foodir], ['${datadir}'/foo])
  22. AC_OUTPUT
  23. END
  24. cat >Makefile.am <<'END'
  25. bin_SCRIPTS =
  26. nobase_bin_SCRIPTS =
  27. data_DATA =
  28. nobase_data_DATA =
  29. include_HEADERS =
  30. nobase_include_HEADERS =
  31. foo_DATA =
  32. nobase_foo_DATA =
  33. bardir = $(datadir)/bar
  34. bar_DATA =
  35. nobase_bar_DATA =
  36. man1_MANS =
  37. man_MANS =
  38. notrans_man1_MANS =
  39. notrans_man_MANS =
  40. END
  41. $ACLOCAL
  42. $AUTOCONF
  43. $AUTOMAKE --add-missing
  44. cwd=$(pwd) || fatal_ "getting current working directory"
  45. instdir=$cwd/inst
  46. destdir=$cwd/dest
  47. mkdir build
  48. cd build
  49. ../configure --prefix="$instdir"
  50. $MAKE
  51. nulldirs='bindir= datadir= includedir= foodir= bardir= man1dir= man2dir='
  52. null_install
  53. :