#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-03-05.13; # UTC
+scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
lib=$dir/$lib.lib
break
fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
done
IFS=$save_IFS
./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
-# cl expects archives to be named foo.lib, not libfoo.a so
-# make a simple copy here if needed. This is a severe case
-# of badness, but ignore that since this is not what is
-# being tested here...
-if test -f sub/libfoo.a; then
- cp sub/libfoo.a sub/foo.lib
-fi
-
# POSIX mandates that the compiler accepts a space between the -I,
# -l and -L options and their respective arguments. Traditionally,
# this should work also without a space. Try both usages.
mkdir lib
: > lib/bar.lib
: > lib/bar.dll.lib
+ : > lib/libbar.a
+ : > lib/libbaz.a
# Check if compile library search correctly
opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
: > syslib/bar.lib
: > syslib/bar.dll.lib
+ : > syslib/libbar.a
# Check if compile finds bar.dll.lib in syslib
opts=$(./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo)
opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
+ # Check if compile falls back to finding classic libname.a style libraries
+ # when name.lib or name.dll.lib isn't available.
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}baz)
+ test x"$opts" = x"foo.c -Fefoo lib/libbaz.a -link -LIBPATH:lib"
+
mkdir lib2
: > lib2/bar.dll.lib
syslib2="$(pwd)/sys lib2"
LIB="$syslib2;$LIB"
- # Check if compile handles spaces in $LIB and that it prefers the order
+ # Check if compile handles spaces in $LIB and that it obeys the order
# in a multi-component $LIB.
opts=$(./compile ./cl foo.c -o foo -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"