pr300-ltlib.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 libtool libraries works.
  17. # PR/300
  18. required='cc libtoolize'
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CC
  22. AM_PROG_AR
  23. AC_PROG_LIBTOOL
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. lib_LTLIBRARIES = subdir/liba.la
  28. subdir_liba_la_SOURCES = a.c
  29. nobase_lib_LTLIBRARIES = subdir/libb.la
  30. subdir_libb_la_SOURCES = a.c
  31. END
  32. cat > a.c << 'END'
  33. int i = 3;
  34. END
  35. libtoolize
  36. $ACLOCAL
  37. $AUTOCONF
  38. $AUTOMAKE --copy --add-missing
  39. # We pass '--libdir' explicitly, to avoid spurious failures due to users
  40. # or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
  41. # file (for example, defining it to '${prefix}/lib64' on 64-bit systems,
  42. # as is the case with openSUSE 12.1). See automake bug#10426.
  43. cwd=$(pwd) || fatal_ "getting current working directory"
  44. ./configure --prefix "$cwd/inst" --libdir "$cwd/inst/lib"
  45. # A rule in the Makefile should create subdir.
  46. test ! -e subdir
  47. run_make -O
  48. test -d subdir
  49. grep 'liba.la .*-rpath .*lib' stdout
  50. grep 'liba.la .*-rpath .*lib/subdir' stdout && exit 1
  51. grep 'libb.la .*-rpath .*lib/subdir' stdout
  52. test -f subdir/liba.la
  53. test -f subdir/libb.la
  54. run_make -E install
  55. grep 'remember.*--finish' stderr && exit 1
  56. test -f inst/lib/liba.la
  57. test -f inst/lib/subdir/libb.la
  58. $MAKE uninstall
  59. test -f inst/lib/liba.la && exit 1
  60. test -f inst/lib/subdir/libb.la && exit 1
  61. $MAKE install-strip
  62. test -f inst/lib/liba.la
  63. test -f inst/lib/subdir/libb.la
  64. :