libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: pointless code removal


From: Robert Boehne
Subject: Re: PATCH: pointless code removal
Date: Mon, 01 Apr 2002 16:45:33 -0600

Bruce,

Ok, I found the problem.  Before your recent patch, either
$base_compile never had a space as it's first character, or
it was stripped out somewhere (maybe by accident?).
Regardless, the problem was that in the check for a valid
tag, $base_compile=" $CC ..." was not checked for, and THAT
was what caused it to fail.
This patch removes the "default" (which actually overrides
all tags!) setting of tagname, and adds cases to check for
base_compile with a space prepended.

This is an obvious bug fix, so I'm checking it in now.

ChangeLog entry:
2002-04-01  Robert Boehne  <address@hidden>

        * ltmain.in : Handle the case when no tag is explicitly set, and
        $base_compile has a space in front of $CC, and revert the setting
        of tagname checked in on 2002-3-14.

-- 
Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  address@hidden
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.290
diff -u -r1.290 ltmain.in
--- ltmain.in   14 Mar 2002 21:43:50 -0000      1.290
+++ ltmain.in   1 Apr 2002 22:27:49 -0000
@@ -105,9 +105,6 @@
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
 
-# set the tag name so that it defaults to CC
-tagname="CC"
-
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -470,11 +467,15 @@
     # Only attempt this if the compiler in the base compile
     # command doesn't match the default compiler.
     if test -n "$available_tags" && test -z "$tagname"; then
-      case "$base_compile " in
-      "$CC "*) ;;
+      case $base_compile in
       # Blanks in the command may have been stripped by the calling shell,
       # but not from the CC environment variable when ltconfig was run.
+      "$CC "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      " $CC "*) ;;
       "`$echo $CC` "*) ;;
+      " `$echo $CC` "*) ;;
       *)
        for z in $available_tags; do
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; 
then
@@ -1520,10 +1521,14 @@
     # command doesn't match the default compiler.
     if test -n "$available_tags" && test -z "$tagname"; then
       case $base_compile in
-      "$CC "*) ;;
       # Blanks in the command may have been stripped by the calling shell,
       # but not from the CC environment variable when ltconfig was run.
+      "$CC "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      " $CC "*) ;;
       "`$echo $CC` "*) ;;
+      " `$echo $CC` "*) ;;
       *)
        for z in $available_tags; do
          if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; 
then

reply via email to

[Prev in Thread] Current Thread [Next in Thread]