libtool-patches
[Top][All Lists]
Advanced

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

Re: 304-gary-add-libtool-macro-file-serial-tags.diff


From: Ralf Wildenhues
Subject: Re: 304-gary-add-libtool-macro-file-serial-tags.diff
Date: Fri, 28 Oct 2005 14:56:21 +0200
User-agent: Mutt/1.5.11

Hi Gary,

* Gary V. Vaughan wrote on Thu, Oct 27, 2005 at 03:37:35PM CEST:
> I believe this to be the correct fix for the bug uncovered by your
> test with openMPI.  I've also added a new test batch to save us from
> regressing later.

Thanks.

> Okay to commit?  (This is now at the front of my queue btw)

Hmm.  I've got some questions before answering that one.
This patch actually makes several logical changes:

- put some ugliness with _lt_pkgdatadir in libtoolize's output instead
  of replacing AT_DATA with
   cat >expout <<EOF
   something containing $_lt_pkgdatadir ..
   EOF
  I don't care much, but I don't like it much either.

- equip all libtool m4 files with named serials.

- use that to find out versions in hand-maintained aclocal.m4.
  (Would that work with `acinclude.m4' as well, by the way?)

- treat argz.m4 like ltdl.m4.  This is the most troublesome.
`aclocal' is actually smart enough not to include argz.m4 in the case
that libltdl is a subproject, because *then*, the user doesn't actually
need the argz tests in the toplevel project; but she does need other
stuff in ltdl.m4.

I get the impression that we are trying to outsmart something which, in
the end, may just as well break again with the next change in aclocal.
Why not just tell those users that hand-maintain aclocal.m4 to get their
act together and take care of keeping it up-to-date themselves.  No need
to try to be any smarter than that.

I am somewhat undecided on that matter, and you certainly have more
experience.  What do you think?

Other than that, see a nit below.

Cheers,
Ralf

>  libltdl/m4/argz.m4      |    2 
>  libltdl/m4/ltoptions.m4 |    2 
>  libltdl/m4/ltsugar.m4   |    2 
>  libltdl/m4/ltversion.in |    2 
>  libtoolize.m4sh         |   39 +++++++++++---
>  tests/libtoolize.at     |  131 
> +++++++++++++++++++++++++++++++++++++++++++-----
>  6 files changed, 155 insertions(+), 23 deletions(-)
> 
> Index: libtool--devo--1.0/ChangeLog
> from  Gary V. Vaughan  <address@hidden>
>       * libltdl/m4/argz.m4, libltdl/m4/ltoptions.m4, libltdl/ltsugar.m4,
>       libltdl/m4/ltversion.in: Add serial number tags, and bump serial
>       number.
>       * libtoolize.m4sh: Use the tags to locate the correct serial
>       numbers when deciding whether to update.
>       * tests/libtoolize.at: More tests for old-style verbatim copying
>       of macros into aclocal.m4.
>       (func_serial): Allow for macro_regex argument to be originating
>       file name.
>       (func_serial_update): Use NL2SP to flatten list of extracted
>       m4_include files.
>       (func_check_macros): In test mode ($_lt_pkgdatadir is set), output
>       a hardcoded string that the testsuite can match regardless of the
>       location of the build tree.
>       (#Main#): Handle argz.m4 specially like ltdl.m4, so that it isn't
>       copied unless libltdl is being used.  Copy other macro files
>       according to their tagged serial numbers.
*snip*
> Index: libtool--devo--1.0/libtoolize.m4sh
> ===================================================================
> --- libtool--devo--1.0.orig/libtoolize.m4sh
> +++ libtool--devo--1.0/libtoolize.m4sh
> @@ -566,6 +566,8 @@ func_serial ()
>      my_serial=
>      for my_file in `func_included_files "$my_filename"`; do
>        if test -z "$my_macro_regex" ||
> +         test "$my_filename" = aclocal.m4 ||
> +         test "$my_macro_regex" = `echo "$my_filename" | $SED "$basename"` ||
>           func_grep '^AC_DEFUN(\@<:@'"$my_macro_regex" "$my_file"
>        then
>          my_serial=`$SED -e "$my_sed_serial" "$my_file"`
> @@ -716,8 +718,15 @@ func_serial_update ()
>      # it has `m4_include([DESTFILE])', so the copy effectively already
>      # updated `aclocal.m4'.
>      my_included_files=`func_included_files aclocal.m4`
> -    case `echo " "$my_included_files" "` in
> +    case `echo " "$my_included_files" " | $NL2SP` in

You can simplify this to either
       case `echo " $my_included_files " | $NL2SP` in
or
       case `echo " "$my_included_files" "` in
In the first case, word splitting will not occur, but NL2SP will help
you; in the second case, word splitting will occur on $my_included_files
before `echo' is called.  The fact that the first resulting word there
starts with a space is fine.

If there is any shell which fails to do this: which one?

> +
> +      # Skip included files:
>        *" $my_destfile "*) ;;
> +
> +      # Otherwise compare to aclocal.m4 serial number (func_serial
> +      # returns 0 for older macro serial numbers before we provided
> +      # serial tags, so the update message will be correctly given
> +      # if aclocal.m4 contains an untagged --i.e older-- macro file):
>        *)
>          if test -f aclocal.m4; then
>            func_serial_max \
> @@ -851,7 +860,9 @@ func_check_macros ()
>       func_echo "and rerunning libtoolize."
>        fi
>      elif test -z "$m4dir"; then
> -      if test "$ltdldir/m4" != "$m4dir"; then
> +      if test -n "$_lt_pkgdatadir"; then
> +     acmacrodir="\$_lt_pkgdatadir"
> +      elif $opt_ltdl && test "$ltdldir/m4" != "$m4dir"; then
>       acmacrodir="$ltdldir/m4"
>        else
>       acmacrodir="$aclocaldir"
*snip*




reply via email to

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