libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] getopt.m4sh generated libtool option parser, and XSI improve


From: Ralf Wildenhues
Subject: Re: [PATCH] getopt.m4sh generated libtool option parser, and XSI improvements.
Date: Sat, 26 Jun 2010 19:44:45 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

* Gary V. Vaughan wrote on Tue, Jun 22, 2010 at 10:23:39PM CEST:
> This is the improved (and renamed) `Use getopt.m4sh to generate libtool
> option parser.' patch I promised yesterday.  I'm pretty happy with this,
> save that even though _LT_PROG_XSI_REPLACE correctly generates sed
> scripts in config.status of the form:
> 
>   sed -i .tmp -e '/^func_name ()$/,/^} # func_name/c\
> func_name ()\
> {\
>   indented code\
>     over several\
>   lines\
> } # XSI func_name implementation' $cfgfile || ...
> 
> which, when run from the command line, retains the indentation of the
> function body, but somehow deletes that indentation when run from
> config.status.  It doesn't affect the functionality of the patch which
> passes the testsuite with and without the XSI replacements in effect.
> 
> Other than that, this allows us to put the fallback implementations of
> functions in the files which depend on them, and eliminate a fixme in
> libtool.m4.
> 
> Any ideas why the indentation is lost like this?

Yes: 'info Autoconf --index sed', scroll down to

     Many `sed' implementations (e.g., MacOS X 10.4, OpenBSD 3.9,
     Solaris 10 `/usr/ucb/sed') strip leading white space from the text
     of `a', `c', and `i' commands.  Prepend a backslash to work around
     this incompatibility with Posix:

          $ echo flushleft | sed 'a\
          >    indented
          > '
          flushleft
          indented
          $ echo foo | sed 'a\
          > \   indented
          > '
          flushleft
             indented

For all of the variable names that you changed in ltmain.m4sh in order
to comply with getopt.m4sh requirements: did you check whether any of
these variables are referred to in libtool.m4 macros?  There are some of
those kinds of hacks on some systems, and testing isn't necessarily
gonna show.

> And in any case, okay to push?

No.  Well, you did already, time has passed already, but I can't review
this patch because it doesn't build for me (see other mail).


> * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Moved portable
> shell versions of various utility functions from here...
> * libltdl/config/getopt.m4sh (func_split_long_opt): ...to here...
> * libltdl/config/general.m4sh (func_dirname, func_basename)
> (func_dirname_and_basename, func_strip_name): ...here...
> * libltdl/config/ltmain.m4sh (func_append, func_arith, func_len)
> (func_lo2o, func_xform): ...and here.
> * libltdl/config/libtool.m4 (_LT_PROG_XSI_REPLACE): New macro that
> expands into a sed command for replacing the contents of a
> suitably decorated shell function with an alternate XSI
> implementation.
> (_LT_PROG_XSI_SHELLFNS): Use it to replace the portable shell
> versions of the functions above with equivalent XSI
> implementations that avoid unnecessary forks if the host shell
> supports that.
> * libltdl/config/ltmain.m4sh: Replace hand written shell code
> with a call to M4SH_GETOPTS. Rename some option variables in
> the client code to match the generated option parser settings.
> * libltdl/config/general.m4sh (func_echo, func_error)
> (func_warning): Use $opt_mode instead of obsoleted $mode in
> message leader.

Cheers,
Ralf



reply via email to

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