ltinstloc.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/sh
  2. # Copyright (C) 2008-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 libtool errors for multiple install locations, esp. with nobase.
  17. required='libtoolize'
  18. . test-init.sh
  19. cat >>configure.ac <<'END'
  20. AC_PROG_CC
  21. AM_PROG_AR
  22. AC_PROG_LIBTOOL
  23. AM_CONDITIONAL([COND], [:])
  24. AC_OUTPUT
  25. END
  26. cat >Makefile.am <<'END'
  27. if COND
  28. lib_LTLIBRARIES = liba1.la sub/liba2.la
  29. #else
  30. pkglib_LTLIBRARIES = liba1.la
  31. nobase_lib_LTLIBRARIES = sub/liba2.la
  32. endif
  33. AUTOMAKE_OPTIONS = subdir-objects
  34. END
  35. libtoolize
  36. $ACLOCAL
  37. $AUTOCONF
  38. AUTOMAKE_fails --add-missing
  39. # libtoolize might have installed config.guess and config.sub already,
  40. # and autom4te might warn about bugs in Libtool macro files, so filter
  41. # out warnings about Makefile.am only. We don't care in this test
  42. # whether automake installs config.guess, config.sub and ar-lib.
  43. cat >expected <<'END'
  44. Makefile.am:5: error: sub/liba2.la multiply defined in condition COND
  45. Makefile.am:5: 'sub/liba2.la' should be installed below 'lib' in condition COND ...
  46. Makefile.am:2: ... and should also be installed in 'lib' in condition COND.
  47. Makefile.am:4: error: liba1.la multiply defined in condition COND
  48. Makefile.am:4: 'liba1.la' should be installed in 'pkglib' in condition COND ...
  49. Makefile.am:2: ... and should also be installed in 'lib' in condition COND.
  50. Makefile.am:2: Libtool libraries can be built for only one destination
  51. END
  52. grep '^Makefile.am' stderr | diff - expected
  53. sed 's/#//' < Makefile.am > t
  54. mv -f t Makefile.am
  55. $AUTOMAKE
  56. grep ' -rpath \$(libdir)/sub' Makefile.in
  57. :