2001-06-30 Gary V. Vaughan <gary@gnu.org>
+ Porting test improvements from multi-language-branch:
+ * tests/defs: Find and set the value of CC probed by libtool.m4
+ * tests/link-2.test: Use a .lo wrapper script, and the value of
+ CC set by defs instead of hardcoding gcc.
+ * tests/link.test: Use the value of CC set by defs instead of
+ hardcoding gcc.
+ * tests/quote.test: Ditto.
+ * tests/suffix.test: Ditto.
+
* libtool.m4 (_LT_AC_LTCONFIG_HACK) [aix*]: Always set
lt_prog_compiler_wl to `-Wl'.
Reported by Albert Chin-A-Young <china@thewrittenword.com>
libtool="../libtool"
make="${MAKE-make}"
+SHELL="${CONFIG_SHELL-/bin/sh}"
prefix="./_inst"
if test "$need_prefix" = yes; then
prefix=NONE
fi
+# Extract CC from the libtool configuration
+eval `$libtool --config | grep '^CC='`
+
# See how redirections should work.
case "$VERBOSE" in
NO | no | 0 | "")
fi
. $srcdir/defs || exit 1
+rm -f hell.lo
+cat > hell.lo <<EOF
+# Generated by libtool
+pic_object=none
+non_pic_object=hell.o
+EOF
+
# Try a sample link command.
-linkresult=`$libtool -n --mode=link gcc -o something foo.o hell.lo`
+linkresult=`$libtool -n --mode=link $CC -o something foo.o hell.lo`
+
+res=$?
+
+rm -f hell.lo
-test $? -eq 0 || exit 1
+test $res -eq 0 || exit 1
echo "$linkresult"
case "$linkresult" in
. $srcdir/defs || exit 1
# Try a sample link command.
-linkresult=`$libtool -n --mode=link gcc -o gettext ../lib/libnlsut.a`
+linkresult=`$libtool -n --mode=link $CC -o gettext ../lib/libnlsut.a`
test $? -eq 0 || exit 1
echo "$linkresult"
# This shell has a builtin print -r that does the trick.
echo='print -r'
elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running $0 again with it.
+ # If we have ksh, try running ltconfig again with it.
CONFIG_SHELL=/bin/ksh
export CONFIG_SHELL
exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
# preargs and postargs need to go through libtool unmodified.
case "$mode" in
compile)
- preargs="gcc -c"
+ preargs="$CC -c"
preflag=
flag="-DVAR="
postargs="foo.c"
;;
link)
- preargs="gcc -o hell -g -O"
+ preargs="$CC -o hell -g -O"
preflag=-Wl,
flag="-someflag="
postargs="foo.o"
for name in $bad_names; do
if ($libtool -n --mode=compile compiler -c $name 2>&1; exit 0) | grep 'cannot'; then :
else
- echo "recognized $name as a valid source file"
+ echo "incorrectly recognized $name as a valid source file"
status=1
fi
done