Add test for m4_cond.
[autoconf.git] / tests / foreign.at
blobe4cc89d6419f071a9d94d9bca72aeac9cb014974
1 #                                                       -*- Autotest -*-
3 AT_BANNER([Compatibility with other tools.])
5 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free
6 # 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 2, or (at your option)
11 # 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, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 # 02110-1301, USA.
24 ## --------- ##
25 ## Libtool.  ##
26 ## --------- ##
28 AT_SETUP([Libtool])
30 # Skip this test if there is no libtoolize.
31 AT_CHECK([libtoolize --version || exit 77],
32          ignore, ignore, ignore)
33 # CVS Autoconf probably does not work with too old Libtools.
34 AT_CHECK([[
35 case `libtoolize --version |
36       sed -n '/^.* \([0-9][0-9.a-z]*\)$/{
37                 s//\1/
38                 p
39                 q
40         }'` in
41   0.*          ) exit 77;;
42   1.[0123]*    ) exit 77;;
43 esac]],
44          ignore, ignore, ignore)
46 # FIXME: Once Libtool `configure.ac' aware, change this.
47 # Using a configure.in, have libtoolize confess where libtool.m4 is.
48 AT_DATA([configure.in],
49 [[AC_INIT
50 # State that we explicitly want auxiliary files here, so libtoolize
51 # won't pollute files outside the test directory.
52 AC_CONFIG_AUX_DIR(.)
53 AC_PROG_LIBTOOL
54 ]])
55 # Some libtoolize complain if you don't have an aclocal.m4.
56 AT_CHECK([touch aclocal.m4])
57 AT_CHECK([libtoolize], 0, [stdout], ignore)
59 # Some broken libtoolize fail to install a functional config.guess.
60 AT_CHECK([./config.guess || exit 77], [], [ignore], [ignore])
62 # Make sure at-path contains something valid, and let the test suite
63 # display it when verbose.  And fail, skipping would too easily hide
64 # problems.
65 AT_CHECK([sed -n ["s,^.*\`\\(/[^']*\\)'.*,\\1,p"] stdout], 0, [stdout])
66 AT_CHECK([test -f "`cat stdout`"])
68 # libtoolize installed everything but install-sh...
69 touch install-sh
71 # Build the concatenation of libtool.m4 and configure.ac.
72 cp `cat stdout` configure.in
73 cat >>configure.in <<_EOF
74 AC_INIT
75 AC_CONFIG_AUX_DIR(.)
76 AC_CANONICAL_SYSTEM
77 AC_PROG_LIBTOOL
78 _EOF
80 # FIXME: Once Libtool really fixed, stop ignoring stderr.
81 AT_CHECK_AUTOCONF([], [], [], [ignore])
83 # Ignore stderr, because ltconfig always loads the cache, which is
84 # /dev/null, and some shells choke on this.  For instance with Bash
85 # 2.05, you get:
87 #   loading cache /dev/null within ltconfig
88 #   ./ltconfig: .: /dev/null: not a regular file
90 # But the script executes properly.
91 AT_CHECK_CONFIGURE([], [], [], [ignore])
93 AT_CLEANUP