/[autoconf]/autoconf/lib/m4sugar/m4sh.m4
ViewVC logotype

Diff of /autoconf/lib/m4sugar/m4sh.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by eggert, Fri Oct 26 19:52:43 2001 UTC revision 1.68 by eggert, Wed Oct 31 19:23:37 2001 UTC
# Line 474  m4_define([_AS_LINENO_WORKS], Line 474  m4_define([_AS_LINENO_WORKS],
474  # _AS_LINENO_PREPARE  # _AS_LINENO_PREPARE
475  # ------------------  # ------------------
476  # If LINENO is not supported by the shell, produce a version of this  # If LINENO is not supported by the shell, produce a version of this
477  # script where LINENO is hard coded.  Rewrite if not up to date only.  # script where LINENO is hard coded.
478  # Comparing LINENO against _oline_ is not a good solution, since in  # Comparing LINENO against _oline_ is not a good solution, since in
479  # the case of embedded executables (such as config.status within  # the case of embedded executables (such as config.status within
480  # configure) you'd compare LINENO wrt config.status vs. _oline_ vs  # configure) you'd compare LINENO wrt config.status vs. _oline_ vs
481  # configure.  Hence a useless rewrite (not to mention the risk of  # configure.
 # ``infinite'' rewrites.  Merely check that LINENO is incremented  
 # between two lines, which is a property guaranteed for _oline_, hence  
 # it protects us from repetitive rewrites.  Be sure to have a test  
 # that does detect non LINENO support...  
482  m4_define([_AS_LINENO_PREPARE],  m4_define([_AS_LINENO_PREPARE],
483  [_AS_LINENO_WORKS || {  [_AS_LINENO_WORKS || {
484    # Find who we are.  Look in the path if we contain no path at all    # Find who we are.  Look in the path if we contain no path at all
# Line 515  m4_define([_AS_LINENO_PREPARE], Line 511  m4_define([_AS_LINENO_PREPARE],
511           esac           esac
512         done]);;         done]);;
513    esac    esac
514    if test ! -f "$as_me.lineno" ||  
515       test x`ls -1dt "$as_me.lineno" "$as_myself" 2>/dev/null | sed 1q` \    # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
516                  != x"$as_me.lineno"; then    # uniformly replaced by the line number.  The first 'sed' inserts a
517       # Be sure to write the pattern so that it doesn't replace itself:    # line-number line before each line; the second 'sed' does the real
518       # it must not match itself.    # work.  The second script uses 'N' to pair each line-number line
519       awk <$as_myself '    # with the numbered line, and appends trailing '-' during
520             /[[$]]LINENO/ { printf "%d:", NR }    # substitution so that $LINENO is not a special case at line end.
521                           { print }    # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
522           ' |    # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
523         sed ['/[$]LINENO/s/^\([0-9][0-9]*\):\(.*\)[$]LINENO/\2\1/'] \    sed '=' <$as_myself |
524           >$as_me.lineno      sed '
525      chmod +x $as_me.lineno        N
526    fi        s,$,-,
527          : loop
528          s,^\([[0-9]]*\)\(.*\)[[$]]LINENO\([[^a-zA-Z0-9_]]\),\1\2\1\3,
529          t loop
530          s,-$,,
531          s,^[[0-9]]*\n,,
532        ' >$as_me.lineno &&
533      chmod +x $as_me.lineno ||
534        AS_ERROR([cannot create $as_me.lineno; rerun with a POSIX shell])
535    
536    # Don't try to exec as it changes $[0], causing all sort of problems    # Don't try to exec as it changes $[0], causing all sort of problems
537    # (the dirname of $[0] is not the place where we might find the    # (the dirname of $[0] is not the place where we might find the

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26