nobase-libtool.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. # Make sure nobase_* works for libtool libraries and programs as well.
  17. # This is just the libtool equivalent of 'nobase.sh', split up to allow
  18. # greater exposure of that test.
  19. required='cc libtoolize'
  20. . test-init.sh
  21. cat >> configure.ac <<'EOF'
  22. AC_PROG_CC
  23. AM_PROG_AR
  24. AC_PROG_LIBTOOL
  25. AC_OUTPUT
  26. EOF
  27. cat > Makefile.am << 'EOF'
  28. fooexecdir = $(prefix)/foo
  29. fooexec_LTLIBRARIES = sub/libbase.la
  30. nobase_fooexec_LTLIBRARIES = sub/libnobase.la
  31. fooexec_PROGRAMS = sub/base
  32. nobase_fooexec_PROGRAMS = sub/nobase
  33. sub_libbase_la_SOURCES = source2.c
  34. sub_libnobase_la_SOURCES = source2.c
  35. sub_base_SOURCES = source.c
  36. sub_nobase_SOURCES = source.c
  37. test-install-data: install-data
  38. test ! -f inst/foo/sub/libnobase.la
  39. test ! -f inst/foo/libbase.la
  40. test-install-exec: install-exec
  41. test -f inst/foo/sub/libnobase.la
  42. test ! -f inst/foo/libnobase.la
  43. test -f inst/foo/libbase.la
  44. .PHONY: test-install-exec test-install-data
  45. EOF
  46. mkdir sub
  47. cat >source.c <<'EOF'
  48. int main (int argc, char *argv[])
  49. {
  50. return 0;
  51. }
  52. EOF
  53. cp source.c source2.c
  54. rm -f install-sh
  55. libtoolize
  56. $ACLOCAL
  57. $AUTOCONF
  58. $AUTOMAKE -a --copy
  59. ./configure --prefix "$(pwd)/inst" --program-prefix=p
  60. $MAKE
  61. $MAKE test-install-data
  62. $MAKE test-install-exec
  63. $MAKE uninstall
  64. test $(find inst/foo -type f -print | wc -l) -eq 0
  65. $MAKE install-strip
  66. # Likewise, in a VPATH build.
  67. $MAKE uninstall
  68. $MAKE distclean
  69. mkdir build
  70. cd build
  71. ../configure --prefix "$(pwd)/inst" --program-prefix=p
  72. $MAKE
  73. $MAKE test-install-data
  74. $MAKE test-install-exec
  75. $MAKE uninstall
  76. test $(find inst/foo -type f -print | wc -l) -eq 0
  77. :