]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Porting test improvements from multi-language-branch:
authorGary V. Vaughan <gary@gnu.org>
Sat, 30 Jun 2001 20:27:42 +0000 (20:27 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sat, 30 Jun 2001 20:27:42 +0000 (20:27 +0000)
* 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.

ChangeLog
tests/defs
tests/link-2.test
tests/link.test
tests/quote.test
tests/suffix.test

index 270fc43b5db00496e76c4bd3adbeebe89cff9c23..a621937689301ac8dd3006914b2153a5d33ef1a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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>
index 214207de65f62e2b86672a4be20830293f439ae9..971091169f85b6bb61c57e2f5fd41cdfe700357e 100644 (file)
@@ -12,6 +12,7 @@ progname=`echo "$0" | sed 's%^.*/%%'`
 
 libtool="../libtool"
 make="${MAKE-make}"
+SHELL="${CONFIG_SHELL-/bin/sh}"
 
 prefix="./_inst"
 if test "$need_prefix" = yes; then
@@ -23,6 +24,9 @@ else
   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 | "")
index df3c00e9707591af1872cfc19fffbf8e0108b545..55f360a2429b9bfdb549031be4a5967aaf83877e 100755 (executable)
@@ -10,10 +10,21 @@ if test -z "$srcdir"; then
 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
index 5d1000bb0144787a99eb62cad430c901f443140c..4b208487c10e4ee1dcfe8fc70d1c8c7c7cac5604 100755 (executable)
@@ -11,7 +11,7 @@ fi
 . $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"
index 13e7da43db1aadc946f211ac5d4f8d8d660726d6..6866281ff4f8046bdb42f87727478a62922bc539 100755 (executable)
@@ -36,7 +36,7 @@ else
       # 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+"$@"}
@@ -62,14 +62,14 @@ for mode in compile link install; do
   # 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"
index a93732f3596fb4916152dd3cc98e48e4e566c6c2..11498e05bde3adf0e343a6321d4851defca053a8 100755 (executable)
@@ -29,7 +29,7 @@ done
 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