Fix typo in previous patch.
[autoconf.git] / tests / foreign.at
blob18aef31a332eaf8fbddfcea8699d10c4bde6a4dd
1 #                                                       -*- Autotest -*-
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/>.
22 ## --------- ##
23 ## Libtool.  ##
24 ## --------- ##
26 AT_SETUP([Libtool])
28 # Skip this test if there is no libtoolize.
29 AT_CHECK([libtoolize --version || exit 77],
30          ignore, ignore, ignore)
31 # CVS Autoconf probably does not work with too old Libtools.
32 AT_CHECK([[
33 case `libtoolize --version |
34       sed -n '/^.* \([0-9][0-9.a-z]*\)$/{
35                 s//\1/
36                 p
37                 q
38         }'` in
39   0.*          ) exit 77;;
40   1.[0123]*    ) exit 77;;
41 esac]],
42          ignore, ignore, ignore)
44 # FIXME: Once Libtool `configure.ac' aware, change this.
45 # Using a configure.in, have libtoolize confess where libtool.m4 is.
46 AT_DATA([configure.in],
47 [[AC_INIT
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(.)
51 AC_PROG_LIBTOOL
52 ]])
53 # Some libtoolize complain if you don't have an aclocal.m4.
54 AT_CHECK([touch aclocal.m4])
55 AT_CHECK([libtoolize], 0, [stdout], ignore)
57 # Some broken libtoolize fail to install a functional config.guess.
58 AT_CHECK([./config.guess || exit 77], [], [ignore], [ignore])
60 # Make sure at-path contains something valid, and let the test suite
61 # display it when verbose.  And fail, skipping would too easily hide
62 # problems.
63 AT_CHECK([sed -n ["s,^.*\`\\(/[^']*\\)'.*,\\1,p"] stdout], 0, [stdout])
64 AT_CHECK([test -f "`cat stdout`"])
66 # libtoolize installed everything but install-sh...
67 touch install-sh
69 # Build the concatenation of libtool.m4 and configure.ac.
70 cp "`cat stdout`" configure.in
71 cat >>configure.in <<_EOF
72 AC_INIT
73 AC_CONFIG_AUX_DIR(.)
74 AC_CANONICAL_SYSTEM
75 AC_PROG_LIBTOOL
76 _EOF
78 # FIXME: Once Libtool really fixed, stop ignoring stderr.
79 AT_CHECK_AUTOCONF([], [], [], [ignore])
81 # Ignore stderr, because ltconfig always loads the cache, which is
82 # /dev/null, and some shells choke on this.  For instance with Bash
83 # 2.05, you get:
85 #   loading cache /dev/null within ltconfig
86 #   ./ltconfig: .: /dev/null: not a regular file
88 # But the script executes properly.
89 AT_CHECK_CONFIGURE([], [], [], [ignore])
91 AT_CLEANUP
94 AT_SETUP([shtool])
96 AT_DATA([configure.ac],
97 [[AC_INIT([shtool test], [1.0])
98 AC_CONFIG_AUX_DIR([build-aux])
99 AC_PATH_PROG([SHTOOL], [shtool], [false])
100 AC_PROG_INSTALL
101 AC_SUBST([ac_install_sh])
102 AC_CONFIG_FILES([Makefile])
103 AC_OUTPUT
106 AT_DATA([Makefile.in],
107 [[SHTOOL = @SHTOOL@
108 # fake these, so that we use shtool whereever possible.
109 INSTALL_PROGRAM = $(ac_install_sh)
110 INSTALL_DATA = $(ac_install_sh) -m 644
111 prefix = @prefix@
112 ac_install_sh = @ac_install_sh@
114 install:
115         $(INSTALL_PROGRAM) file1 $(prefix)/file1
116         $(INSTALL_DATA) file2 $(prefix)/file2
118 copy-shtool:
119         test '$(SHTOOL)' != false
120         cp '$(SHTOOL)' build-aux
123 : >file1
124 : >file2
125 chmod +x file1
126 : ${MAKE=make}
127 mkdir build-aux inst
128 instdir=`pwd`/inst
129 AT_CHECK_AUTOCONF
130 cp "$abs_top_srcdir/build-aux/install-sh" build-aux
131 AT_CHECK_CONFIGURE
132 AT_CHECK([$MAKE copy-shtool], [], [ignore], [ignore],
133          [AT_CHECK([: >build-aux/shtool])])
134 rm -f build-aux/install-sh
135 AT_CHECK_CONFIGURE([--prefix="$instdir" ac_cv_path_SHTOOL=false])
136 AT_CHECK([grep '^ac_install_sh = .*shtool install -c' Makefile], [], [ignore])
137 if test -s build-aux/shtool; then
138   AT_CHECK([$MAKE install], [], [ignore], [ignore])
139   AT_CHECK([test -f inst/file1 && test -f inst/file2 && test -x inst/file1])
142 AT_CLEANUP