1#! /bin/sh 2# link.test - check that .lo files aren't made into programs. 3 4# Test script header. 5need_prefix=no 6if test -z "$srcdir"; then 7 srcdir=`echo "$0" | sed 's%/[^/]*$%%'` 8 test "$srcdir" = "$0" && srcdir=. 9 test "${VERBOSE+set}" != "set" && VERBOSE=yes 10fi 11. $srcdir/defs || exit 1 12 13rm -f hell.lo 14cat > hell.lo <<EOF 15# Generated by libtool 16pic_object=none 17non_pic_object=hell.o 18EOF 19 20# Try a sample link command. 21linkresult=`$libtool -n --mode=link $CC -o something foo.o hell.lo` 22 23res=$? 24 25rm -f hell.lo 26 27test $res -eq 0 || exit 1 28 29echo "$linkresult" 30case "$linkresult" in 31*".lo "*) 32 echo "$0: .lo files should not be linked into programs" 33 exit 1 34 ;; 35esac 36exit 0 37