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