2
0

foreign.at 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. # -*- Autotest -*-
  2. AT_BANNER([Compatibility with other tools.])
  3. # Copyright (C) 2000-2007, 2009-2012 Free Software Foundation, Inc.
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ## --------- ##
  18. ## Libtool. ##
  19. ## --------- ##
  20. AT_SETUP([Libtool])
  21. # Skip this test if there is no libtoolize.
  22. AT_CHECK([libtoolize --version || exit 77],
  23. [ignore], [ignore], [ignore])
  24. # Modern Libtool has further tests for compatibility with older autoconf;
  25. # from the Autoconf side, we will merely assume newer libtool.
  26. AT_CHECK([[
  27. case `libtoolize --version |
  28. sed -n '/^.* \([0-9][0-9.a-z]*\)$/{
  29. s//\1/
  30. p
  31. q
  32. }'` in
  33. 0.* ) exit 77;;
  34. 1.* ) exit 77;;
  35. esac]],
  36. [ignore], [ignore], [ignore])
  37. # Using a configure.ac, have libtoolize confess where libtool.m4 is.
  38. AT_DATA([configure.ac],
  39. [[AC_INIT
  40. # State that we explicitly want auxiliary files here, so libtoolize
  41. # won't pollute files outside the test directory.
  42. AC_CONFIG_AUX_DIR([.])
  43. AC_PROG_LIBTOOL
  44. ]])
  45. AT_CHECK([libtoolize -i], [0], [stdout], [ignore])
  46. # Some broken libtoolize fail to install a functional config.guess.
  47. AT_CHECK([./config.guess || exit 77], [], [ignore], [ignore])
  48. # Make sure at-path contains something valid, and let the test suite
  49. # display it when verbose. And fail, skipping would too easily hide
  50. # problems.
  51. AT_CHECK([sed -n ["s,^.*\`\\(/[^']*\\)'.*,\\1,p"] stdout], [0], [stdout])
  52. AT_CHECK([test -f "`sed -n 1p stdout`"])
  53. # Older libtoolize installed everything but install-sh...
  54. AT_CHECK([test -f install-sh || touch install-sh])
  55. # Build the concatenation of libtool.m4 and configure.ac.
  56. AT_CHECK([[sed 's/.*/m4''_include([&])/' stdout]], [0], [stdout])
  57. AT_CHECK([mv stdout aclocal.m4])
  58. cat >configure.ac <<_EOF
  59. AC_INIT
  60. AC_CONFIG_AUX_DIR([.])
  61. AC_CANONICAL_SYSTEM
  62. AC_PROG_LIBTOOL
  63. _EOF
  64. # FIXME: Once Libtool really fixed, stop ignoring stderr.
  65. AT_CHECK_AUTOCONF([], [], [], [ignore])
  66. # Ignore stderr, because ltconfig always loads the cache, which is
  67. # /dev/null, and some shells choke on this. For instance with Bash
  68. # 2.05, you get:
  69. #
  70. # loading cache /dev/null within ltconfig
  71. # ./ltconfig: .: /dev/null: not a regular file
  72. #
  73. # But the script executes properly.
  74. AT_CHECK_CONFIGURE([], [], [], [ignore])
  75. AT_CLEANUP
  76. AT_SETUP([shtool])
  77. AT_DATA([configure.ac],
  78. [[AC_INIT([shtool test], [1.0])
  79. AC_CONFIG_AUX_DIR([build-aux])
  80. AC_PATH_PROG([SHTOOL], [shtool], [false])
  81. AC_PROG_INSTALL
  82. AC_SUBST([ac_install_sh])
  83. AC_CONFIG_FILES([Makefile])
  84. AC_OUTPUT
  85. ]])
  86. AT_DATA([Makefile.in],
  87. [[SHTOOL = @SHTOOL@
  88. # fake these, so that we use shtool wherever possible.
  89. INSTALL_PROGRAM = $(ac_install_sh)
  90. INSTALL_DATA = $(ac_install_sh) -m 644
  91. prefix = @prefix@
  92. ac_install_sh = @ac_install_sh@
  93. install:
  94. $(INSTALL_PROGRAM) file1 $(prefix)/file1
  95. $(INSTALL_DATA) file2 $(prefix)/file2
  96. copy-shtool:
  97. test '$(SHTOOL)' != false
  98. cp '$(SHTOOL)' build-aux
  99. ]])
  100. : >file1
  101. : >file2
  102. chmod +x file1
  103. : "${MAKE=make}"
  104. mkdir build-aux inst
  105. instdir=`pwd`/inst
  106. AT_CHECK_AUTOCONF
  107. cp "$abs_top_srcdir/build-aux/install-sh" build-aux
  108. AT_CHECK_CONFIGURE
  109. AT_CHECK([$MAKE copy-shtool], [], [ignore], [ignore],
  110. [AT_CHECK([: >build-aux/shtool])])
  111. rm -f build-aux/install-sh
  112. AT_CHECK_CONFIGURE([--prefix="$instdir" ac_cv_path_SHTOOL=false])
  113. AT_CHECK([grep '^ac_install_sh = .*shtool install -c' Makefile], [], [ignore])
  114. if test -s build-aux/shtool; then
  115. AT_CHECK([$MAKE install], [], [ignore], [ignore])
  116. AT_CHECK([test -f inst/file1 && test -f inst/file2 && test -x inst/file1])
  117. fi
  118. AT_CLEANUP