automake: require ABOUT-NLS only at gnits strictness.
[automake.git] / t / ccnoco.sh
blob98ca83337e6c9047e59a41933d9ffda89c34efe0
1 #! /bin/sh
2 # Copyright (C) 2001-2024 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Test to make sure we can compile when the compiler doesn't
18 # understand '-c -o'.
20 required=gcc # For cc-no-c-o.
21 . test-init.sh
23 cat >> configure.ac << 'END'
24 AC_PROG_CC
25 $CC --version || exit 1
26 $CC -v || exit 1
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 bin_PROGRAMS = wish
32 wish_SOURCES = a.c
33 # Make sure we need something strange.
34 wish_CFLAGS = -g
35 END
37 cat > a.c << 'END'
38 #include <stdio.h>
40 int main ()
42 printf ("hi\n");
44 END
46 # Make sure the compiler doesn't understand '-c -o'.
47 CC=$am_testaux_builddir/cc-no-c-o; export CC
49 $ACLOCAL
50 $AUTOCONF -Wall -Werror
51 $AUTOMAKE --copy --add-missing
53 for vpath in : false; do
54 if $vpath; then
55 srcdir=..
56 mkdir build
57 cd build
58 else
59 srcdir=.
61 $srcdir/configure >stdout || { cat stdout; exit 1; }
62 cat stdout
63 $EGREP 'understands? -c and -o together.* no$' stdout
64 # No repeated checks please.
65 test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
66 $MAKE
67 cd $srcdir
68 done
70 $MAKE distcheck