libtool-patches
[Top][All Lists]
Advanced

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

Re: [patch 04/19] 286-gary-libtoolize-recursive-ltdl.diff Queue


From: Ralf Wildenhues
Subject: Re: [patch 04/19] 286-gary-libtoolize-recursive-ltdl.diff Queue
Date: Tue, 11 Oct 2005 18:37:48 +0200
User-agent: Mutt/1.5.11

Hi Gary,

* Gary V. Vaughan wrote on Mon, Oct 10, 2005 at 12:26:28PM CEST:
> Another step towards fixing LT_WITH_LTDL.  Here we add an optional mode
> argument to libtoolize so that the user can tell libtoolize whether she
> is going to subconfigure libltdl as always, or use either a non-recursive
> automake (like libtool itself), or a recursive automake with a top-level
> configure.  This patch *doesn't* attempt to clean up the m4 macros.
> 
> Incidentally, this also removes the troublesome '## %%% BEGIN' magic from
> Makefile.am.

Very nice patch!  But it mixes up two things, and at that quite heavily:
Do you want the (non)recursive/subproject info as argument to
  LT_WITH_LTDL
or
  LT_CONFIG_LTDL_DIR
or possibly both?  Please redo `libtoolize' output based on the answer
of this (I did not finishing testing, but will do again after this is
fixed).

I have found more nits, see inline.  Also, please remember:
- adjust doc plus makefiles for whatever you agree on wrt. *_LTLIBRARIES
  DEFS, AM_CPPFLAGS, AM_CFLAGS: `+=' vs `='.

And please actually do the commit only together with the followup
patches needed to implement the functionality, so CVS HEAD is not in
broken state for long.  Thank you.

Cheers,
Ralf

>  Makefile.am          |  122 ++-------------------------------------------
>  NEWS                 |    4 +
>  bootstrap            |    5 +
>  doc/libtool.texi     |   46 +++++++++++++++++
>  libltdl/Makefile.inc |  137 
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>  libltdl/m4/ltdl.m4   |    8 ++
>  libtoolize.m4sh      |   71 ++++++++++++++++++++++++--
>  7 files changed, 269 insertions(+), 124 deletions(-)
> 
> Index: libtool--devo--1.0/ChangeLog
> from  Gary V. Vaughan  <address@hidden>
>       * libltdl/Makefile.inc: New file, factored out of Makefile.am for
>       use in non-recursive libltdl installations.
>       * Makefile.am: include it.
>       (libltdl/Makefile.am): Adjust to build from the new
>       libltdl/Makefile.inc.
>       * bootstrap: Adjust.
>       * doc/libtool.texi (Invoking libtoolize): Document the new modes
>       and libtoolize option to select them.
>       * libtoolize.m4sh: Parse new options, --nonrecursive, --recursive
>       and --subproject.  Install the appropriate files with --ltdl
>       according to the selected mode.
>       (func_scan_files): If --subproject, --recursive or --nonrecursive
>       options were not given, use the value from LT_CONFIG_LTDL_DIR; if
>       a mode was given, and there is also an argument to
>       LT_CONFIG_LTDL_DIR, ensure they are the same.
>       * NEWS: Updated.

First nit: the patch changes (a comment in) libltdl/m4/ltdl.m4, but the
log entry does not mention this.

*big snip*
> Index: libtool--devo--1.0/doc/libtool.texi
> ===================================================================
> --- libtool--devo--1.0.orig/doc/libtool.texi
> +++ libtool--devo--1.0/doc/libtool.texi
> @@ -2249,11 +2249,57 @@ also specify a subdirectory name here if
>  for example.  If @command{libtoolize} can't determine the target
>  directory, @samp{libltdl} is used as the default.
>  
> address@hidden --nonrecursive
> +If passed in conjunction with @option{--ltdl}, this option will cause
> +the @command{libtoolize} installed @samp{libltdl} to be set up for use

Hypen between `libtoolize' and `installed'?  Alternatively:
 .. the libltdl installed by libtoolize..?

> +with a non-recursive @command{automake} build.  To make use of it, you
> +will need to add the following to the @file{Makefile.am} of the parent
> +project (adjusted to include the file from whatever directory you
> +installed libltdl to):
> +
> address@hidden
> +include libltdl/Makefile.inc
> address@hidden example

Now, how's that gonna work if the user uses a name different from
`libltdl/' as subdir?  The paths in `libltdl/Makefile.inc' are pretty
hardcoded to start with `libltdl/'!

No need to change the implementation IMHO, but it may be good to adjust
above paragraph to match the limitation to firmly state: if you use
nonrecursive, that subdir better be named `libltdl' and nothing else!

> +
>  @item --quiet
>  @itemx -q
>  Work silently.  @samp{libtoolize --quiet} is used by @sc{gnu} Automake
>  to add libtool files to your package if necessary.
>  
> address@hidden --recursive
> +If passed in conjunction with @option{--ltdl}, this option will cause
> +the @command{libtoolize} installed @samp{libltd} to be set up for use
> +with a recursive @command{automake} build.  To make use of it, you
> +will need to adjust the parent project's @file{configure.ac}:
> +
> address@hidden
> +AC_CONFIG_FILES([libltdl/Makefile])
> address@hidden example
> +
> address@hidden
> +and @file{Makefile.am}:
> +
> address@hidden
> +SUBDIRS += libltdl
> address@hidden example
> +
> address@hidden --subproject
> +If passed in conjunction with @option{--ltdl}, this option will cause
> +the @command{libtoolize} installed @samp{libltd} to be set up for

  s/libltd/&l/

> +independent configuration and compilation as a self-contained
> +subproject.  To make use of it, you should arrange for your build to
> +call @command{libltdl/configure}, and then run @command{make} in the
> address@hidden directory (or the subdirectory you put libltdl into).
> +If your project uses Autoconf, you can use the supplied
> address@hidden macro, or else call @samp{AC_CONFIG_SUBDIRS}
> +directly.
> +
> +Previous releases of @samp{libltdl} built exclusively in this mode,
> +but now it is the default mode both for backwards compatibility and
> +because, for example, it is suitable for use in projects that wish to
> +use @samp{libltdl}, but not use the Autotools for their own build
> +process.
> +
>  @item --verbose
>  @itemx -v
>  Work noisily!  Give a blow by blow account of what
*big snip*

> Index: libtool--devo--1.0/libltdl/m4/ltdl.m4
> ===================================================================
> --- libtool--devo--1.0.orig/libltdl/m4/ltdl.m4
> +++ libtool--devo--1.0/libltdl/m4/ltdl.m4
> @@ -138,13 +138,17 @@ dnl aclocal-1.4 backwards compatibility:
>  dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
>  
>  
> -# LT_WITH_LTDL
> -# ------------
> +# LT_WITH_LTDL([LTDL-MODE])
> +# -------------------------
>  # Clients of libltdl can use this macro to allow the installer to
>  # choose between a shipped copy of the ltdl sources or a preinstalled
>  # version of the library.  If the shipped ltdl sources are not in a
>  # subdirectory named libltdl, the directory name must be given by
>  # LT_CONFIG_LTDL_DIR.
> +# LTDL-MODE can be either 'recursive', 'nonrecursive' or the default
> +# for backwards compatibility, 'subproject'.  Each affects the way
> +# libtoolize installs libltdl, and the way libltdl can be incorporated
> +# into its parent project.
>  AC_DEFUN([LT_WITH_LTDL],
>  [dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
>  dnl was called yet, then for old times' sake, we assume libltdl is in an
> Index: libtool--devo--1.0/libtoolize.m4sh
> ===================================================================
> --- libtool--devo--1.0.orig/libtoolize.m4sh
> +++ libtool--devo--1.0/libtoolize.m4sh
> @@ -40,7 +40,10 @@ m4_divert_push([SCRIPT])#! /bin/sh
>  # -f, --force           replace existing files
>  # -i, --install         copy missing auxiliary files
>  #     --ltdl[=DIR]      install libltdl sources [default: libltdl]
> +#     --nonrecursive prepare ltdl for non-recursive make
>  # -q, --quiet           work silently
> +#     --recursive    prepare ltdl for recursive make
> +#     --subproject      prepare ltdl to configure and build independently
>  # -v, --verbose         verbosely report processing
>  #     --version         print version information and exit
>  # -h, --help            print short or long help message
> @@ -78,6 +81,11 @@ seen_autoconf=false
>  seen_libtool=false
>  seen_ltdl=false
>  
> +# ltdl can be installed to be self-contained (subproject, the default);
> +# or to be configured by a parent project, either with a recursive or
> +# nonrecursive automake driven make:
> +ltdl_mode=
> +
>  # Locations for important files:
>  address@hidden@
>  address@hidden@
> @@ -135,10 +143,18 @@ configure_ac=configure.in
>                       fi
>                       ;;
>  
> +      --nonrecursive|--non-recursive)
> +                             ltdl_mode=nonrecursive
> +                     ;;
> +
>        --quiet|--automake|-q) # --automake is for 1.5 compatibility
>                       opt_quiet=:
>                       ;;
>  
> +      --recursive)   ltdl_mode=recursive ;;
> +
> +      --subproject)  ltdl_mode=subproject ;;
> +
>        --verbose|-v)  opt_verbose=: ;;
>  
>        # Separate optargs to long options:
> @@ -386,7 +402,9 @@ func_scan_files ()
>          };
>       /_LT_CONFIG_LTDL_DIR(/d;
>       /LT_CONFIG_LTDL_DIR(/ {
> -         s,^.*LT_CONFIG_LTDL_DIR([[[  ]*\([^])]]*\).*$,ac_ltdldir=\1,; p;
> +         s/^.*LT_CONFIG_LTDL_DIR([[[  ]*\([^]),]*\)[^,]]*/ac_ltdldir=\1%%/;
> +         s/%%[[[,    ]*\([^])]]*\).*$/ ac_ltdl_mode=\1%%/;
> +         s/%%.*$//; p;
>       };
>       /A[[CM]]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; };
>       /LT_INIT/            { s,^.*$,seen_libtool=:,; p; };
> @@ -398,6 +416,34 @@ func_scan_files ()
>      eval `cat aclocal.m4 "$configure_ac" 2>/dev/null | $SED "$my_sed_traces"`
>  
>  
> +    # ------------------- #
> +    # Validate ltdl_mode. #
> +    # ------------------- #
> +
> +    test -n "$ac_ltdl_mode" && seen_ltdl=:
> +
> +    # If $configure_ac contains an LT_WITH_LTDL mod argument, check that it
> +    # was not given in terms of a shell variable!
> +    case "$ac_ltdl_mode" in
> +      *\$*)
> +        func_fatal_error "can not handle variables in LT_WITH_LTDL"
> +        ;;
> +    esac
> +
> +    # If neither --ltdl nor LT_WITH_LTDL are specified, default to
> +    # `subproject'.  If both are specified, they must be the same.  
> Otherwise,
> +    # take the one that is given!
> +    case x$ac_ltdl_mode,x$ltdl_mode in
> +      x,x)   ltdl_mode=subproject    ;;
> +      x*,x)  ltdl_mode=$ac_ltdl_mode ;;
> +      x,x*)  ltdl_mode=$ltdl_mode    ;;
> +      *)
> +        test x"$ac_ltdl_mode" = x"$ltdl_mode" || \
> +         func_fatal_error "--$ltdl_mode does not match 
> LT_WITH_LTDL($ac_ltdl_mode)"
> +     ;;
> +    esac
> +
> +
>      # ----------------- #
>      # Validate ltdldir. #
>      # ----------------- #
> @@ -972,7 +1018,19 @@ func_nonemptydir_p ()
>    func_nonemptydir_p pkgdatadir
>    func_nonemptydir_p aclocaldir
>  
> -  func_massage_pkgltdl_files
> +  func_scan_files
> +
> +  # These files are handled specially, depending on ltdl_mode:
> +  case $ltdl_mode in
> +    *recursive)
> +      
> glob_exclude_pkgltdl_files='Makefile.am|Makefile.in*|aclocal.m4|config*'
> +      ;;
> +    *)
> +      glob_exclude_pkgltdl_files='Makefile.inc'
> +      ;;
> +  esac
> +
> +  func_massage_pkgltdl_files "$glob_exclude_pkgltdl_files"
>    func_massage_pkgconfig_files
>  
>    # libtool.m4 and ltdl.m4 are handled specially below
> @@ -980,11 +1038,16 @@ func_nonemptydir_p ()
>  
>    glob_exclude_pkgaux_files='config.guess|config.sub|install-sh|ltmain.sh'
>  
> -  func_scan_files
> -
>    # Copy all the files from installed libltdl to this project, if the
>    # user specified `--ltdl'.
>    if $opt_ltdl; then
> +
> +    # For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
> +    case $ltdl_mode in
> +      recursive)    pkgltdl_files="Makefile.am:$pkgltdl_files"  ;;
> +      nonrecursive) pkgltdl_files="Makefile.inc:$pkgltdl_files" ;;
> +    esac
> +
>      func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir"
>  
>      # Unless we share CONFIG_MACRO_DIR with our parent project,
> 




reply via email to

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