libtool-patches
[Top][All Lists]
Advanced

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

func_infer_tag() broken on IRIX 6.5


From: Albert Chin
Subject: func_infer_tag() broken on IRIX 6.5
Date: Wed, 11 Feb 2004 10:34:20 -0600
User-agent: Mutt/1.4i

I posted the bug report for this to the libtool mailing list. Briefly,
on IRIX 6.4+, $0 in a function is the function name, not the name of
the shell script. This causes a problem for func_infer_tag() as it
uses $0. We fix this by creating a new variable, $progname_full_path,
in ltmain.in's body, setting it to $0 to use in shell functions.

Note I have only replace usage of "$0" in func_infer_tag, not
everywhere. Should I replace "$0" with "$progname_full_path"
everywhere?

-- 
albert chin (address@hidden)

-- snip snip
2004-02-11  Albert Chin-A-Young  <address@hidden>

        * ltmain.in: Work around backward compatibility issue on
        IRIX 6.5. On IRIX 6.4+, sh is ksh but when the shell is
        invoked as "sh" and the current value of the _XPG environment
        variable is not equal to 1 (one), the special positional
        parameter $0, within a function call, is the name of the
        function. So, rather than using "$0" in functions, we set
        $progname_full_path in the body and use that instead.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.334.2.23
diff -u -3 -p -r1.334.2.23 ltmain.in
--- ltmain.in   5 Feb 2004 14:50:29 -0000       1.334.2.23
+++ ltmain.in   11 Feb 2004 16:28:15 -0000
@@ -52,6 +52,13 @@ fi
 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
 modename="$progname"
 
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progname_full_path="$0"
+
 # Constants.
 PROGRAM=ltmain.sh
 address@hidden@
@@ -184,9 +191,9 @@ func_infer_tag () {
       # if we don't check for them as well.
       *)
        for z in $available_tags; do
-         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; 
then
+         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < 
"$progname_full_path" > /dev/null; then
            # Evaluate the configuration.
-           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# 
### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# 
### END LIBTOOL TAG CONFIG: '$z'$/p' < $progname_full_path`"
            CC_quoted=
            for arg in $CC; do
            # Double-quote args containing other shell metacharacters.




reply via email to

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