2 # Copyright (C) 2010, 2011 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)
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 # Make sure `compile' wraps the Microsoft C/C++ compiler (cl) correctly
19 am_create_testdir
=empty
20 required
=xsi-lib-shell
23 get_shell_script compile
25 # Use a dummy cl, since cl isn't readily available on all systems
33 # Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
34 opts
=`LIB= ./compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker foobar -Wl,-foo,bar`
35 test x
"$opts" = x
"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
37 # Check if compile handles "-o foo.obj"
38 opts
=`./compile ./cl -c foo.c -o foo.obj -Ibaz`
39 test x
"$opts" = x
"-c foo.c -Fofoo.obj -Ibaz"
41 # Check if compile handles "-o foo.o"
42 opts
=`./compile ./cl -c foo.c -o foo.o -Ibaz`
43 test x
"$opts" = x
"-c foo.c -Fofoo.o -Ibaz"
45 # Check if compile handles "foo.cc" as C++.
46 opts
=`./compile ./cl -c foo.cc -o foo.o -Ibaz`
47 test x
"$opts" = x
"-c -Tpfoo.cc -Fofoo.o -Ibaz"
49 # Check if compile clears the "eat" variable properly.
50 opts
=`eat=1 ./compile ./cl -c foo.c -o foo.obj -Ibaz`
51 test x
"$opts" = x
"-c foo.c -Fofoo.obj -Ibaz"