libtool-macros.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /bin/sh
  2. # Copyright (C) 2011-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. # Try to find the libtool '.m4' files and make them easily accessed
  17. # to the test cases requiring them.
  18. # See also automake bug#9807.
  19. . test-init.sh
  20. echo "# Automatically generated by $me." > get.sh
  21. echo : >> get.sh
  22. # The 'libtoolize' script will look into Makefile.am.
  23. echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
  24. if libtoolize --copy --install && test -f m4/libtool.m4; then
  25. echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
  26. echo "export ACLOCAL_PATH" >> get.sh
  27. else
  28. # Libtoolize from libtool < 2.0 didn't support the '--install' option,
  29. # but this doesn't mean the user hasn't made the libtool macros
  30. # available, e.g., by properly setting ACLOCAL_PATH.
  31. rm -rf m4
  32. mkdir m4
  33. echo AC_PROG_LIBTOOL >> configure.ac
  34. # See below for an explanation about the use the of '-Wno-syntax'.
  35. if $ACLOCAL -Wno-syntax -I m4 --install && test -f m4/libtool.m4; then
  36. : # Libtool macros already accessible by default.
  37. else
  38. echo "skip_all_ \"couldn't find or get libtool macros\"" >> get.sh
  39. fi
  40. fi
  41. . ./get.sh
  42. $ACLOCAL --force -I m4 || cat >> get.sh <<'END'
  43. # We need to use '-Wno-syntax', since we do not want our test suite
  44. # to fail merely because some third-party '.m4' file is underquoted.
  45. ACLOCAL="$ACLOCAL -Wno-syntax"
  46. END
  47. # The file libtoolize might have just copied in the 'm4' subdirectory of
  48. # the test directory are going to be needed by other tests, so we must
  49. # not remove the test directory.
  50. keep_testdirs=yes
  51. :