3 AT_BANNER([Compatibility with other tools.])
5 # Copyright (C) 2000-2007, 2009-2017 Free Software Foundation, Inc.
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <https://www.gnu.org/licenses/>.
27 # Skip this test if there is no libtoolize.
28 AT_CHECK([libtoolize --version || exit 77],
29 [ignore], [ignore], [ignore])
30 # Modern Libtool has further tests for compatibility with older autoconf;
31 # from the Autoconf side, we will merely assume newer libtool.
33 case `libtoolize --version |
34 sed -n '/^.* \([0-9][0-9.a-z]*\)$/{
42 [ignore], [ignore], [ignore])
44 # Using a configure.ac, have libtoolize confess where libtool.m4 is.
45 AT_DATA([configure.ac],
47 # State that we explicitly want auxiliary files here, so libtoolize
48 # won't pollute files outside the test directory.
49 AC_CONFIG_AUX_DIR([.])
52 AT_CHECK([LC_ALL=C libtoolize -i], [0], [stdout], [ignore])
54 # Some broken libtoolize fail to install a functional config.guess.
55 AT_CHECK([LC_ALL=C ./config.guess || exit 77], [], [ignore], [ignore])
57 # Make sure at-path contains something valid, and let the test suite
58 # display it when verbose. And fail, skipping would too easily hide
60 AT_CHECK([sed -n ["s,^[^']*[\`']\\(/[^']*\\)'.*,\\1,p"] stdout], [0], [stdout])
61 AT_CHECK([test -f "`sed -n 1p stdout`"])
63 # Older libtoolize installed everything but install-sh...
64 AT_CHECK([test -f install-sh || touch install-sh])
66 # Build the concatenation of libtool.m4 and configure.ac.
67 AT_CHECK([[sed 's/.*/m4''_include([&])/' stdout]], [0], [stdout])
68 AT_CHECK([mv stdout aclocal.m4])
69 cat >configure.ac <<_EOF
71 AC_CONFIG_AUX_DIR([.])
76 # FIXME: Once Libtool really fixed, stop ignoring stderr.
77 AT_CHECK_AUTOCONF([], [], [], [ignore])
79 # Ignore stderr, because ltconfig always loads the cache, which is
80 # /dev/null, and some shells choke on this. For instance with Bash
83 # loading cache /dev/null within ltconfig
84 # ./ltconfig: .: /dev/null: not a regular file
86 # But the script executes properly.
87 AT_CHECK_CONFIGURE([], [], [], [ignore])
94 AT_DATA([configure.ac],
95 [[AC_INIT([shtool test], [1.0])
96 AC_CONFIG_AUX_DIR([build-aux])
97 AC_PATH_PROG([SHTOOL], [shtool], [false])
99 AC_SUBST([ac_install_sh])
100 AC_CONFIG_FILES([Makefile])
104 AT_DATA([Makefile.in],
106 # fake these, so that we use shtool wherever possible.
107 INSTALL_PROGRAM = $(ac_install_sh)
108 INSTALL_DATA = $(ac_install_sh) -m 644
110 ac_install_sh = @ac_install_sh@
113 $(INSTALL_PROGRAM) file1 $(prefix)/file1
114 $(INSTALL_DATA) file2 $(prefix)/file2
117 test '$(SHTOOL)' != false
118 cp '$(SHTOOL)' build-aux
128 cp "$abs_top_srcdir/build-aux/install-sh" build-aux
130 AT_CHECK([$MAKE copy-shtool], [], [ignore], [ignore],
131 [AT_CHECK([: >build-aux/shtool])])
132 rm -f build-aux/install-sh
133 AT_CHECK_CONFIGURE([--prefix="$instdir" ac_cv_path_SHTOOL=false])
134 AT_CHECK([grep '^ac_install_sh = .*shtool install -c' Makefile], [], [ignore])
135 if test -s build-aux/shtool; then
136 AT_CHECK([$MAKE install], [], [ignore], [ignore])
137 AT_CHECK([test -f inst/file1 && test -f inst/file2 && test -x inst/file1])