compile: implement library search to support MSVC static linking
[automake.git] / tests / ccnoco3.test
blob2e9cd37d2a330721994006e368669b6897222443
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2008, 2009 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 <http://www.gnu.org/licenses/>.
17 # Test to make sure `compile' doesn't call 'mv SRC SRC'.
19 required=gcc
20 . ./defs || Exit 1
22 set -e
24 cat >> configure.in << 'END'
25 AC_PROG_CC
26 AM_PROG_CC_C_O
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 AUTOMAKE_OPTIONS = subdir-objects
32 bin_PROGRAMS = wish
33 wish_SOURCES = a.c
34 END
36 mkdir sub
38 cat > a.c << 'END'
39 #include <stdio.h>
41 int main ()
43 printf ("hi\n");
45 END
47 cat > Mycomp << 'END'
48 #!/bin/sh
50 case " "$* in
51 *\ -c*\ -o* | *\ -o*\ -c*)
52 exit 1
54 esac
56 exec gcc "$@"
57 END
59 chmod +x Mycomp
61 # Ignore user CFLAGS.
62 CFLAGS=
63 export CFLAGS
65 $ACLOCAL
66 $AUTOCONF
67 $AUTOMAKE --copy --add-missing
69 mkdir build
70 cd build
72 # Make sure the compiler doesn't understand `-c -o'
73 CC=`pwd`/../Mycomp
74 export CC
76 ../configure
77 $MAKE 2>stderr || { cat stderr >&2; Exit 1; }
78 cat stderr >&2
79 grep 'mv.*the same file' stderr && Exit 1
81 Exit 0