libtool-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Libtool branch, master, updated. v2.4.2-58-gc6bbcb3


From: Gary V. Vaughan
Subject: [SCM] GNU Libtool branch, master, updated. v2.4.2-58-gc6bbcb3
Date: Tue, 08 Nov 2011 14:04:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  c6bbcb35f5e55890dbb0151e397b5cc18114b330 (commit)
       via  ae9967c797f5c5afe27c68d4cf3539506fe97518 (commit)
       via  55aad3797361b243e2ba9ddfdc73532bc9b1efca (commit)
       via  02d5c159f2acd670f72503c767c47b147f6d417e (commit)
       via  ab423416e99c4316769ed781b630222fb46ba2ad (commit)
       via  827d796beaaf4f72b17fc5717aaf118e2aaf9293 (commit)
       via  2a71b02b17b6d74532b38fc4fc9db0109fa83801 (commit)
       via  6df0b275b596ef6670179bca06d4e9e96cc894c4 (commit)
       via  d5393524f6f01ba02d7b61800288070184335960 (commit)
      from  0569ec6cd2df2b10136e5701411961b83142d567 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c6bbcb35f5e55890dbb0151e397b5cc18114b330
Author: Gary V. Vaughan <address@hidden>
Date:   Fri Nov 4 17:08:32 2011 +0700

    libtoolize: remove sed based configure scanning.
    
    * libtoolize (func_scan_files): Removed function and callers.
    (require_seen_ltdl, require_seen_libtool): Factor out remaining
    functionality of former sed based scanning.
    (func_check_macros): Adjust.
    * NEWS: Updated.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit ae9967c797f5c5afe27c68d4cf3539506fe97518
Author: Gary V. Vaughan <address@hidden>
Date:   Fri Nov 4 16:10:28 2011 +0700

    libtoolize: refactor ltdl_mode discovery.
    
    * libtoolize.m4sh (require_ac_ltdl_mode)
    (require_ac_ltdl_options, require_ltdl_mode): New functions
    factored out of func_scan_files for scanning and setting
    ltdl_mode and friends.
    (func_scan_files): Remove the factored out code.
    (func_install_pkgmacro_files, func_install_pkgltdl_files)
    (func_install_pkgconfig_files, func_check_macros): Adjust.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit 55aad3797361b243e2ba9ddfdc73532bc9b1efca
Author: Gary V. Vaughan <address@hidden>
Date:   Fri Nov 4 14:43:23 2011 +0700

    libtoolize: refactor ltdl_dir discovery.
    
    * libtoolize.m4sh (require_ac_ltdl_dir, require_ltdl_dir):
    New functions factored out of func_scan_files for scanning and
    setting ac_ltdl_dir and ltdl_dir resp.
    (func_scan_files): Remove the factored out code.
    (func_fixup_Makefile, func_serial_update_check)
    (func_install_pkgltdl_files, func_install_pkgconfig_subproject)
    (func_check_macros): Adjust.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit 02d5c159f2acd670f72503c767c47b147f6d417e
Author: Gary V. Vaughan <address@hidden>
Date:   Fri Nov 4 01:30:24 2011 +0700

    libtoolize: refactor aux_dir discovery.
    
    * libtoolize.m4sh (require_ac_aux_dir, require_aux_dir): New
    functions factored out of func_scan_files for scanning and
    setting aux_dir and friends.
    (func_scan_files): Remove the factored out code to scan
    configure.ac with sed, and then set macro_dir appropriately.
    (func_install_pkgconfig_subproject, func_install_pkgconfig_parent)
    (func_install_pkgmacro_files, func_check_macros): Adjust.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit ab423416e99c4316769ed781b630222fb46ba2ad
Author: Gary V. Vaughan <address@hidden>
Date:   Mon Nov 7 21:06:59 2011 +0700

    libtoolize: install autoconf macros only if there is a $configure_ac.
    
    * libtoolize.m4sh (func_install_pkgmacro_files): If there is no
    $configure_ac in the parent project directory, and libtoolize is
    in subproject mode, then the parent project has no use for
    autoconf macros, so don't install them.
    * NEWS: Updated.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit 827d796beaaf4f72b17fc5717aaf118e2aaf9293
Author: Gary V. Vaughan <address@hidden>
Date:   Mon Nov 7 20:49:53 2011 +0700

    libtoolize: display aux files output header for non-autoconf parents.
    
    * libtoolize.m4sh (func_install_pkgconfig_subproject): When the
    parent project does not use Autoconf, be sure to display an
    output header before copying auxiliary files despite not being
    able to scan for AC_CONFIG_AUX_DIR arguments.
    * NEWS: Updated.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit 2a71b02b17b6d74532b38fc4fc9db0109fa83801
Author: Gary V. Vaughan <address@hidden>
Date:   Fri Nov 4 00:44:08 2011 +0700

    libtoolize: refactor macro_dir discovery around extract-trace script.
    
    * libtoolize.m4sh (func_extract_trace): Function to call
    $aux_dir/extract-trace.  The name and footprint are the same as
    the core function in the extract-trace script file so that we
    can choose to source that file when the option processing
    becomes compatible with ours.
    (require_ac_macro_dir, require_aclocal_amflags)
    (require_am_macro_dir, require_macro_dir, require_makefile_am):
    New functions factored out of func_scan_files for scanning and
    setting macro_dir and friends.
    (func_scan_files): Remove the factored out code to scan
    configure.ac with sed, and then set macro_dir appropriately.
    (func_serial_update_check, func_install_pkgmacro_subproject)
    (func_install_pkgmacro_parent, func_install_pkgmacro_files)
    (func_check_macros): Adjust.
    * tests/libtoolize.at (Subproject ltdl without GNU M4): New test
    to ensure `libtoolize --subproject' continues to work without a
    GNU M4 dependency.
    * NEWS: Updated.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit 6df0b275b596ef6670179bca06d4e9e96cc894c4
Author: Gary V. Vaughan <address@hidden>
Date:   Thu Nov 3 21:45:15 2011 +0700

    libtoolize: refactor configure_ac discovery.
    
    Make a start on decomposing some of the giant functions at the
    heart of libtoolize into the much more flexible and manageable
    (albeit somewhat more verbose) model of self-organising
    $require_<foo> function pointers.
    * libtoolize.m4sh (require_configure_ac): New function factored
    out of func_scan_files for setting $configure_ac appropriately,
    implementation taken from extract-trace script.
    (func_autoconf_configure): And similarly for ensuring that a
    filename which matches something Autoconf would read also has
    content that appears to be destined for Autoconf processing.
    (func_scan_files): Simplified the factored out code to a single
    require_configure_ac call.
    (func_install_pkgconfig_files, func_check_macros): Ditto.
    (seen_autoconf): Removed.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

commit d5393524f6f01ba02d7b61800288070184335960
Author: Gary V. Vaughan <address@hidden>
Date:   Thu Nov 3 15:23:45 2011 +0700

    bootstrap: split into reusable parts.
    
    * bootstrap: Bourne shell has no scoping, so be extremely
    careful with namespaces, functions in `^func_' and `^require_';
    private variables in `^_G_', and public variables all well
    documented by comments.
    * libltdl/config/extract-trace: New file, containing the minimum
    of code previously in bootstrap plus a little glue to make the
    GNU M4 based autotools tracing function (as opposed to the
    kludgy sed extraction currently used everywhere else) a
    standalone script that can be executed or sourced.
    * libltdl/config/options-parser: New file, containing the
    pluggable options parser code shared between the other two.
    * bootstrap.conf: Adjust.
    * Makefile.am (EXTRA_DIST): Be sure to distribute the new
    extract-trace and options-parser scripts.
    (install-data-local): And install them where libtoolize can find
    them.
    
    Signed-off-by: Gary V. Vaughan <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                   |   10 +-
 NEWS                          |   18 +
 bootstrap                     | 1409 +++++++++++------------------------------
 bootstrap.conf                |    4 +-
 libltdl/config/extract-trace  |  407 ++++++++++++
 libltdl/config/options-parser |  790 +++++++++++++++++++++++
 libtoolize.m4sh               |  768 +++++++++++++++--------
 tests/libtoolize.at           |   72 +++
 8 files changed, 2158 insertions(+), 1320 deletions(-)
 create mode 100755 libltdl/config/extract-trace
 create mode 100644 libltdl/config/options-parser

diff --git a/Makefile.am b/Makefile.am
index 3c9e39d..5e57bfe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -92,14 +92,17 @@ CLEANFILES     += libtool libtoolize
 ## and dependencies with `$(srcdir)' consistently.
 configure_ac   = $(srcdir)/configure.ac
 config_status  = $(top_builddir)/config.status
+extract_trace  = $(srcdir)/$(aux_dir)/extract-trace
 libtoolize_in  = $(srcdir)/libtoolize.in
 ltmain_sh      = $(srcdir)/$(aux_dir)/ltmain.sh
 libtool_m4     = $(srcdir)/$(macro_dir)/libtool.m4
 ltversion_in   = $(srcdir)/$(macro_dir)/ltversion.in
 ltversion_m4   = $(srcdir)/$(macro_dir)/ltversion.m4
+options_parser = $(srcdir)/$(aux_dir)/options-parser
 
-EXTRA_DIST     += $(libtoolize_in) $(libtoolize_m4sh) $(ltmain_m4sh) \
-                 $(ltmain_sh) $(ltversion_in) $(ltversion_m4)
+EXTRA_DIST     += $(extract_trace) $(libtoolize_in) $(libtoolize_m4sh) \
+                 $(ltmain_m4sh) $(ltmain_sh) $(ltversion_in) \
+                 $(ltversion_m4) $(options_parser)
 
 ## These are the replacements that need to be made at bootstrap time,
 ## because they must be static in distributed files, and not accidentally
@@ -479,7 +482,8 @@ install-data-local: $(lt_Makefile_in)
          $(INSTALL_DATA) "$(srcdir)/$(macro_dir)/$$f" 
"$(DESTDIR)$(aclocaldir)/$$f"; \
        done
 ## install the helper scripts
-       @list='$(pkgaux_scripts)' && for p in $$list; do \
+       @list='config/extract-trace config/options-parser $(pkgaux_scripts)' && 
\
+       for p in $$list; do \
          d=`echo "$(DESTDIR)$(pkgdatadir)/$$p" |$(SED) 's,[^/]*$$,,'`; \
          test -d "$$d" || $(mkinstalldirs) "$$d"; \
          echo " $(INSTALL_SCRIPT) '$(srcdir)/$(ltdl_dir)/$$p' 
'$(DESTDIR)$(pkgdatadir)/$$p'"; \
diff --git a/NEWS b/NEWS
index 7b58384..9ecb6cd 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,13 @@ NEWS - list of user-visible changes between releases of GNU 
Libtool
 ** New features:
 
   - Moved to gnulib release infrastructure.
+
+  - M4 is now used for scanning the M4 macros in your configure.ac that
+   `libtoolize' looks at to determine what files you want, and where you
+    would like them installed.  This means that you can compose your
+    version number or any other argument that Libtoolize needs to know at
+    M4 time using git-version-gen from gnulib, for example.
+
   - The Autotest testsuite can be run without the especially time consuming
     tests with:
 
@@ -17,11 +24,22 @@ NEWS - list of user-visible changes between releases of GNU 
Libtool
   - Fix a long-standing latent bug in libtoolize which could delete lines
     from libltdl/Makefile.am in recursive mode due to underquoting in a
     sed script.
+  - Fix a long-standing bug in libtoolize, by outputting the `putting
+    auxiliary files in' header with `libtoolize --ltdl --subproject'.
+  - Fix a long-standing bug in libtoolize subproject installation, by not
+    installing a set of autoconf macro files into the parent project if
+    there is no configure.ac present to use them.
   - The libtoolize subproject mode selector is now named `--subproject'
     and is equivalent to the implied `--subproject' mode when no other
     mode is selected; `--standalone' never worked, and is no longer
     accepted.
 
+** Important incompatible changes:
+
+  - GNU M4 is required to run libtoolize in a directory with a
+    `configure.ac' (or `configure.in') that needs tracing to determine
+    what modes and directories have been specified.
+
 New in 2.4.2 2011-10-17: git version 2.4.1a, Libtool team:
 
 * New features:
diff --git a/bootstrap b/bootstrap
index ecfa39b..7e6fb4b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,11 @@
 #! /bin/sh
-# Print a version string.
-scriptversion=2011-10-22.09; # UTC
+
+# Source required external libraries.
+. `echo "$0" |${SED-sed} 's,[^/]*$,,'`"libltdl/config/options-parser"
+. `echo "$0" |${SED-sed} 's,[^/]*$,,'`"libltdl/config/extract-trace"
+
+# Set a version string for *this* script.
+scriptversion=2011-11-04.05; # UTC
 
 # Bootstrap this package from checked-out sources.
 # Written by Gary V. Vaughan, 2010
@@ -8,6 +13,8 @@ scriptversion=2011-10-22.09; # UTC
 # Copyright (C) 2010, 2011 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+##### PLEASE CHECK `--version' WORKS AFTER EDITING THE ABOVE COPYRIGHT #####
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -49,9 +56,10 @@ scriptversion=2011-10-22.09; # UTC
 # called at the wrong time by other tools that we call (`autoreconf',
 # for example).
 #
-# We also allow `LIBTOOLIZE' and `M4' to be overridden, and export the
-# result for child processes, but they are handled by the function
-# `func_find_tool' and not defaulted in this section.
+# We also allow `LIBTOOLIZE', `M4', `SHA1SUM' and some others to be
+# overridden, and export the result for child processes, but they are
+# handled by the function `func_find_tool' and not defaulted in this
+# section.
 
 : ${ACLOCAL="aclocal"}
 : ${AUTOCONF="autoconf"}
@@ -87,53 +95,6 @@ export CONFIG_SHELL
 ## Configuration. ##
 ## -------------- ##
 
-# Short help message in response to `-h'.  Add to this in `bootstrap.conf'
-# if you accept any additional options.
-usage_message="Bootstrap this package from the checked-out sources.
-
-Common Bootstrap Options:
-  -c, --copy         copy files instead of creating symbolic links.
-      --debug        enable verbose shell tracing
-  -n, --dry-run      print commands rather than running them
-  -f, --force        attempt to bootstrap even if the sources seem not to have
-                     been checked out.
-      --gnulib-srcdir=DIRNAME
-                     specify a local directory where gnulib sources reside.
-                     Use this if you already have the gnulib sources on your
-                     machine, and don't want to waste your bandwidth
-                     downloading them again.  Defaults to \$GNULIB_SRCDIR.
-      --skip-git     do not fetch files from remote repositories
-      --skip-po      do not download po files.
-  -v, --verbose      verbosely report processing
-      --version      print version information and exit
-  -W, --warnings=CATEGORY
-                     report the warnings falling in CATEGORY [all]
-  -h, --help         print short or long help message and exit
-"
-
-# Warning categories used by `bootstrap', append others if you use them
-# in your `bootstrap.conf'.
-warning_categories="recommend settings upgrade"
-
-# Additional text appended to `usage_message' in response to `--help'.
-long_help_message="
-Warning categories include:
-  \`all'           show all warnings
-  \`none'          turn off all the warnings
-  \`error'         warnings are treated as fatal errors
-  \`recommend'     show warnings about missing recommended packages
-  \`settings'      show warnings about missing \`bootstrap.conf' settings
-  \`upgrade'       show warnings about out-dated files
-
-If the file $progpath.conf exists in the same directory as this script, its
-contents are read as shell variables to configure the bootstrap.
-
-For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
-are honored.
-
-Running without arguments will suffice in most cases.
-"
-
 # A newline delimited list of triples of programs (that respond to
 # --version), the minimum version numbers required (or just `-' in the
 # version field if any version will be sufficient) and homepage URLs
@@ -246,150 +207,15 @@ copy=false
 vc_ignore=
 
 
-## -------------------- ##
-## Shell normalisation. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
-fi
-
-# NLS nuisances.
-LANGUAGE=C
-export LANGUAGE
-
-# Ensure file names are sorted consistently across platforms.
-LC_ALL=C
-export LC_ALL
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# FIXME: check that $SED accepts comments, or bail out with a pointer
-#        to GNU sed
-
-
-## ------------------------- ##
-## Hook function management. ##
-## ------------------------- ##
-
-# This section contains functions for adding, removing, and running hooks
-# to the main code.  A hook is just a named list of of function, that can
-# be run in order later on.
-
-
-# func_append VAR VALUE
-# ---------------------
-# Append VALUE onto the existing contents of VAR.
-if (eval 'x=a; x+=" b"; test "x$x" = "xa b"') 2>/dev/null
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_append ()
-  {
-    $debug_cmd
-
-    eval "$1+=\$2"
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_append ()
-  {
-    $debug_cmd
-
-    eval "$1=\$$1\$2"
-  }
-fi
-
-
-# func_hookable FUNC_NAME
-# -----------------------
-# Declare that FUNC_NAME will run hooks added with
-# `func_add_hook FUNC_NAME ...'.
-func_hookable ()
-{
-    $debug_cmd
-
-    func_append hookable_funcs " $1"
-}
-
-
-# func_add_hook FUNC_NAME HOOK_FUNC
-# ---------------------------------
-# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
-# first have been declared "hookable" by a coll to `func_hookable'.
-func_add_hook ()
-{
-    $debug_cmd
-
-    case " $hookable_funcs " in
-      *" $1 "*) ;;
-      *) func_fatal_error "error: \`$1' does not accept hook functions." ;;
-    esac
-
-    eval func_append ${1}_hooks '" $2"'
-}
-
-
-# func_remove_hook FUNC_NAME HOOK_FUNC
-# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
-func_remove_hook ()
-{
-    $debug_cmd
-
-    eval ${1}_hooks='`echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
-}
-
-
-# func_run_hooks FUNC_NAME [ARG]...
-# ---------------------------------
-# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
-# than a whitespace-delimited list of legal shell function names, and
-# no effort is wasted trying to catch shell meta-characters or preserve
-# whitespace.
-func_run_hooks ()
-{
-    $debug_cmd
-
-    case " $hookable_funcs " in
-      *" $1 "*) ;;
-      *) func_fatal_error "error: \`$1' does not support hook funcions.n" ;;
-    esac
-
-    eval hook_funcs="\$$1_hooks"
-
-    # shift away the first argument (FUNC_NAME)
-    shift
-    func_run_hooks_result=$*
-
-    for hook_func in $hook_funcs; do
-      eval $hook_func '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next `cmd' execution.
-      set dummy $func_run_hooks_result; shift
-    done
-}
-
-
 ## ------------------- ##
 ## Hookable functions. ##
 ## ------------------- ##
 
 # After `bootstrap.conf' has been sourced, execution proceeds by calling
-# `func_bootstrap'.  Where a function is decorated with `func_hookable
-# func_name', you will find a matching `func_run_hooks func_name' which
-# executes all functions added with `func_add_hook func_name my_func'.
+# `func_bootstrap'.  Wherever a function is decorated with
+# `func_hookable func_name', you will find a matching `func_run_hooks
+# func_name' which executes all functions added with `func_add_hook
+# func_name my_func'.
 #
 # You might notice that many of these functions begin with a series of
 # `$require_foo' lines.  See the docu-comments at the start of the
@@ -407,13 +233,13 @@ func_bootstrap ()
     # Save the current positional parameters to prevent them being
     # corrupted by calls to `set' in `func_init'.
     func_quote_for_eval ${1+"$@"}
-    my_saved_positional_parameters="$func_quote_for_eval_result"
+    _G_saved_positional_parameters="$func_quote_for_eval_result"
 
     # Initialisation.
     func_init
 
     # Option processing.
-    eval func_options "$my_saved_positional_parameters"
+    eval func_options "$_G_saved_positional_parameters"
 
     # Post-option preparation.
     func_prep
@@ -448,214 +274,6 @@ func_init ()
 }
 
 
-# func_options [ARG]...
-# ---------------------
-# All the functions called inside func_options are hookable. See the
-# individual implementations for details.
-func_hookable func_options
-func_options ()
-{
-    $debug_cmd
-
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options+"$func_parse_options_result"}
-
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
-
-    # save modified positional parameters for caller
-    func_options_result="$func_run_hooks_result"
-}
-
-
-# func_options_prep [ARG]...
-# --------------------------
-# All initialisations required before starting the option parse loop.
-# Note that when calling hook functions, we pass through the list of
-# positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in `func_run_hooks_result' before
-# returning.
-func_hookable func_options_prep
-func_options_prep ()
-{
-    $debug_cmd
-
-    warning_func=func_error
-
-    # Option defaults:
-    opt_copy=${copy-false}
-    opt_dry_run=false
-    opt_force=false
-    opt_gnulib_srcdir="$GNULIB_SRCDIR"
-    opt_skip_git=false
-    opt_skip_po=false
-    opt_warning=
-    opt_verbose=false
-
-    func_run_hooks func_options_prep ${1+"$@"}
-
-    # save modified positional parameters for caller
-    func_options_prep_result="$func_run_hooks_result"
-}
-
-
-# func_parse_options [ARG]...
-# ---------------------------
-# The main option parsing loop.
-#
-# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in `func_run_hooks_result', escaped suitably for `eval'.  Like
-# this:
-#
-#    my_silent_option ()
-#    {
-#        $debug_cmd
-#
-#        case $1 in
-#          --silent|-s) opt_silent=:; shift ;;
-#        esac
-#
-#        func_quote_for_eval ${1+"$@"}
-#        func_run_hooks_result="$func_quote_for_eval_result"
-#    }
-#    func_add_hook func_parse_options my_silent_option
-#
-func_hookable func_parse_options
-func_parse_options ()
-{
-    $debug_cmd
-
-    func_parse_options_result=
-
-    # this just eases exit handling
-    while test $# -gt 0; do
-
-      # Defer to hook functions for initial option parsing, so they
-      # get priority in the event of reusing an option name.
-      func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
-
-      opt="$1"
-      shift
-      case $opt in
-        --debug|-x)   debug_cmd='set -x'
-                      func_echo "enabling shell trace mode"
-                      $debug_cmd
-                      ;;
-        --dry-run|--dryrun|-n)
-                      opt_dry_run=: ;;
-        --copy|-c)    opt_copy=: ;;
-        --force|-f)   opt_force=: ;;
-
-        --gnulib-srcdir)
-                      test $# = 0 && func_missing_arg $opt && break
-                      opt_gnulib_srcdir="$1"
-                      shift
-                      ;;
-
-        --skip-git)   opt_skip_git=: ;;
-        --skip-po)    opt_skip_po=: ;;
-        --verbose|-v) opt_verbose=: ;;
-
-        --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $opt && break
-                      case " $1 " in
-                        " all ")
-                          opt_warning=" $warning_categories"
-                          ;;
-                        " none ")
-                          opt_warning=" none"
-                          warning_func=:
-                          ;;
-                        " error ")
-                          warning_func=func_fatal_error
-                          ;;
-                        *" $warning_categories "*)
-                          func_append_u opt_warning " $1"
-                          ;;
-                        *)
-                          func_fatal_error \
-                             "error: unsupported warning category: \`$1'"
-                          ;;
-                      esac
-                      shift
-                      ;;
-
-        --version)    func_version ;;
-        -\?|-h)       func_usage ;;
-        --help)       func_help ;;
-
-        # Separate optargs to long options:
-        --*=*)
-                      func_split_equals "$opt"
-                      set dummy "$func_split_equals_lhs" \
-                         "$func_split_equals_rhs" ${1+"$@"}
-                      shift
-                      ;;
-
-        # Separate optargs to short options:
-        -W*)
-                      func_split_short_opt "$opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        # Separate non-argument short options:
-        -\?*|-h*|-c*|-f*|-n*|-v*|-x*)
-                      func_split_short_opt "$opt"
-                      set dummy "$func_split_short_opt_name" \
-                          "-$func_split_short_opt_arg" ${1+"$@"}
-                      shift
-                      ;;
-
-        --)           set dummy "$opt"; shift; break ;;
-        -*)           func_fatal_help "unrecognised option: \`$opt'" ;;
-        *)            set dummy "$opt"; shift; break ;;
-      esac
-    done
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result="$func_quote_for_eval_result"
-}
-
-
-# func_validate_options [ARG]...
-# ------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-func_hookable func_validate_options
-func_validate_options ()
-{
-    $debug_cmd
-
-    # display all warnings if -W was not given
-    test -n "$opt_warning" || opt_warning="$warning_categories"
-
-    func_run_hooks func_validate_options ${1+"$@"}
-
-    # Validate options.
-    test $# -gt 0 \
-        && func_fatal_help "too many arguments"
-
-    # Bail if the options were screwed!
-    $exit_cmd $EXIT_FAILURE
-
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_validate_options_result="$func_quote_for_eval_result"
-}
-
-
 # func_prep
 # ---------
 # Function to perform preparation for remaining bootstrap process. If
@@ -860,7 +478,7 @@ func_gettext_configuration ()
       # function.  Note that adding a literal \\\ requires double escaping
       # here, once for the execution subshell, and again for the assignment,
       # which is why there are actually 12 (!!) backslashes in the script.
-      my_xgettext_options=`echo "$xgettext_options$nl" |$SED '/^$/d' |$SED '
+      _G_xgettext_options=`echo "$xgettext_options$nl" |$SED '/^$/d' |$SED '
           $b
           s|$| \\\\\\\\\\\\|'`
 
@@ -874,7 +492,7 @@ func_gettext_configuration ()
         /^XGETTEXT_OPTIONS *=/{
           s|$| \\|
           a\
-             '"$my_xgettext_options"' \\\
+             '"$_G_xgettext_options"' \\\
              $${end_of_xgettext_options+}
         }
       ' po/Makevars.template >po/Makevars || exit 1
@@ -918,11 +536,11 @@ func_libtoolize ()
     $require_libtoolize
 
     test true = "$LIBTOOLIZE" || {
-      my_libtoolize_options=
-      $opt_copy && func_append my_libtoolize_options " --copy"
-      $opt_force && func_append my_libtoolize_options " --force"
-      $opt_verbose || func_append my_libtoolize_options " --quiet"
-      func_show_eval "$LIBTOOLIZE$my_libtoolize_options" 'exit $?'
+      _G_libtoolize_options=
+      $opt_copy && func_append _G_libtoolize_options " --copy"
+      $opt_force && func_append _G_libtoolize_options " --force"
+      $opt_verbose || func_append _G_libtoolize_options " --quiet"
+      func_show_eval "$LIBTOOLIZE$_G_libtoolize_options" 'exit $?'
     }
 }
 
@@ -947,16 +565,16 @@ func_gnulib_tool_copy_file ()
       # distribution tarball), make sure that at least we have some
       # version of the required file already in place.
       test -f "$2" || func_fatal_error "\
-error: Can't find, copy or download \`$2', a required
-       gnulib supplied file, please provide the location of a
-       complete \`gnulib' tree by setting \`gnulib_path' in your
-       \`bootstrap.conf' or with the \`--gnulib-srcdir' option -
-       or else specify the location of your \`git' binary by
-       setting \`GIT' in the environment so that a fresh
-       \`gnulib' submodule can be cloned."
+Can't find, copy or download \`$2', a required
+gnulib supplied file, please provide the location of a
+complete \`gnulib' tree by setting \`gnulib_path' in your
+\`bootstrap.conf' or with the \`--gnulib-srcdir' option -
+or else specify the location of your \`git' binary by
+setting \`GIT' in the environment so that a fresh
+\`gnulib' submodule can be cloned."
     else
       test -f "$gnulib_path/$1" || {
-        func_error "error: \`$gnulib_path/$1' does not exist"
+        func_error "\`$gnulib_path/$1' does not exist"
         return 1
       }
 
@@ -1014,10 +632,10 @@ func_ensure_changelog ()
 ChangeLog is generated by gitlog-to-changelog.
 EOT
 
-    my_message="creating dummy \`ChangeLog'"
+    _G_message="creating dummy \`ChangeLog'"
     test -f ChangeLog~ \
-      && func_append my_message ' (backup in ChangeLog~)'
-    func_verbose "$my_message"
+      && func_append _G_message ' (backup in ChangeLog~)'
+    func_verbose "$_G_message"
 
     return 0
 }
@@ -1041,11 +659,11 @@ func_autoreconf ()
     save_AUTOPOINT="$AUTOPOINT"; AUTOPOINT=true
     save_LIBTOOLIZE="$LIBTOOLIZE"; LIBTOOLIZE=true
 
-    my_autoreconf_options=
-    $opt_copy || func_append my_autoreconf_options " --symlink"
-    $opt_force && func_append my_autoreconf_options " --force"
-    $opt_verbose && func_append my_autoreconf_options " --verbose"
-    func_show_eval "$AUTORECONF$my_autoreconf_options --install" 'exit $?'
+    _G_autoreconf_options=
+    $opt_copy || func_append _G_autoreconf_options " --symlink"
+    $opt_force && func_append _G_autoreconf_options " --force"
+    $opt_verbose && func_append _G_autoreconf_options " --verbose"
+    func_show_eval "$AUTORECONF$_G_autoreconf_options --install" 'exit $?'
 
     AUTOPOINT="$save_AUTOPOINT"
     LIBTOOLIZE="$save_LIBTOOLIZE"
@@ -1054,6 +672,8 @@ func_autoreconf ()
 
 # func_check_configuration VARNAME [CONFIGURE_MACRO]
 # --------------------------------------------------
+# Exit with a suitable diagnostic for an important configuration change
+# that needs to be made before bootstrap can run correctly.
 func_check_configuration ()
 {
     $debug_cmd
@@ -1061,13 +681,14 @@ func_check_configuration ()
     $require_configure_ac
 
     eval 'test -n "$'$1'"' || {
-      my_error_msg="error: please set \`$1' in \`bootstrap.conf'"
-      test -n "$2" \
-          && func_append my_error_msg "
-       or add the following (or similar) to your \`$configure_ac':
-       $2"
+      _G_error_msg="please set \`$1' in \`bootstrap.conf'"
+      if test -n "$configure_ac" && test -n "$2"; then
+        func_append _G_error_msg "
+or add the following (or similar) to your \`$configure_ac':
+$2"
+      fi
 
-      func_fatal_error "$my_error_msg"
+      func_fatal_error "$_G_error_msg"
     }
 }
 
@@ -1166,10 +787,10 @@ func_update_dotversion ()
     $debug_cmd
 
     test -f "$build_aux/git-version-gen" && {
-      my_message="updating .version"
+      _G_message="updating .version"
       test -f .version && {
         mv .version .version~
-       func_append my_message " (backup in .version~)"
+       func_append _G_message " (backup in .version~)"
       }
       func_verbose "updating .version"
 
@@ -1205,8 +826,8 @@ func_require_checkout_only_file ()
     $opt_force || {
       test -n "$checkout_only_file" && test ! -f "$checkout_only_file" \
           && func_fatal_error "\
-error: Bootstrapping from a non-checked-out distribution is risky.
-       If you wish to bootstrap anyway, use the \`--force' option."
+Bootstrapping from a non-checked-out distribution is risky.
+If you wish to bootstrap anyway, use the \`--force' option."
     }
 
     require_checkout_only_file=:
@@ -1224,15 +845,15 @@ func_require_aclocal_amflags ()
 
     $require_makefile_am
 
-    my_sed_extract_aclocal_amflags='s|#.*$||
+    _G_sed_extract_aclocal_amflags='s|#.*$||
         /^[     ]*ACLOCAL_AMFLAGS[      ]*=/ {
             s|^.*=[     ]*\(.*\)|aclocal_amflags="\1"|
             p
         }'
 
-    my_aclocal_flags_cmd=`$SED -n "$my_sed_extract_aclocal_amflags" \
+    _G_aclocal_flags_cmd=`$SED -n "$_G_sed_extract_aclocal_amflags" \
         "$makefile_am"`
-    eval "$my_aclocal_flags_cmd"
+    eval "$_G_aclocal_flags_cmd"
 
     func_verbose "ACLOCAL_AMFLAGS='$aclocal_amflags'"
 
@@ -1253,8 +874,6 @@ func_require_autobuild_buildreq ()
     test -f "$macro_dir/autobuild.m4" \
         || printf '%s\n' "$buildreq" |func_grep_q '^[   ]*autobuild' \
         || {
-      $require_configure_ac
-
       func_extract_trace AB_INIT
       test -n "$func_extract_trace_result" && {
         func_append buildreq 'autobuild - http://josefsson.org/autobuild/
@@ -1293,16 +912,14 @@ for tool in autoconf libtoolize autopoint; do
     ${require_'$tool'-:}
 
     printf '%s\n' "$buildreq" |func_grep_q '\''^[       ]*'$tool\'' || {
-      $require_configure_ac
-
       func_extract_trace '$m'
-      my_version="$func_extract_trace_result"
-      test -n "$my_version" && {
+      _G_version="$func_extract_trace_result"
+      test -n "$_G_version" && {
         func_append buildreq "\
-            '$tool' $my_version http://www.gnu.org/s/'$b'
+            '$tool' $_G_version http://www.gnu.org/s/'$b'
 "
         func_verbose \
-            "auto-adding \`'$tool'-$my_version'\'' to build requirements"
+            "auto-adding \`'$tool'-$_G_version'\'' to build requirements"
       }
     }
 
@@ -1426,8 +1043,6 @@ func_require_build_aux ()
     $debug_cmd
 
     test -n "$build_aux" || {
-      $require_configure_ac
-
       func_extract_trace AC_CONFIG_AUX_DIR
       build_aux="$func_extract_trace_result"
       func_check_configuration build_aux \
@@ -1467,16 +1082,18 @@ func_require_buildtools_uptodate ()
     $require_autopoint_buildreq
 
     test -n "$buildreq" && {
+      _G_error_hdr=
+
       func_check_versions $buildreq
       $func_check_versions_result || {
         test -n "$buildreq_readme" \
             && test -f "$buildreq_readme" \
-            && func_error "\
-error: $buildreq_readme explains how to obtain these prerequisite programs:
+            && _G_error_hdr="\
+$buildreq_readme explains how to obtain these prerequisite programs:
 "
-        func_strtable 7 11 12 36 \
+        func_strtable 0 11 12 36 \
             "Program" "Min_version" "Homepage" $buildreq
-        func_fatal_error "$func_strtable_result"
+        func_fatal_error "$_G_error_hdr$func_strtable_result"
       }
     }
 
@@ -1484,29 +1101,6 @@ error: $buildreq_readme explains how to obtain these 
prerequisite programs:
 }
 
 
-# require_configure_ac
-# --------------------
-# Ensure that there is a `configure.ac' or `configure.in' file in the
-# current directory, and that `$configure_ac' contains its name.
-require_configure_ac=func_require_configure_ac
-func_require_configure_ac ()
-{
-    $debug_cmd
-
-    test -n "$configure_ac" || {
-      for configure_ac in configure.ac configure.in; do
-        test -f $configure_ac && break
-      done
-
-      <$configure_ac
-    }
-
-    func_verbose "found \`$configure_ac'"
-
-    require_configure_ac=:
-}
-
-
 # require_copyright_holder
 # ------------------------
 # Ensure there is a sensible non-empty default value in `$copyright_holder'.
@@ -1538,9 +1132,9 @@ func_require_dotgitmodules ()
 
     test true = "$GIT" || {
       # A gnulib entry in .gitmodules always takes precedence.
-      my_path="`$GIT config --file .gitmodules submodule.gnulib.path 
2>/dev/null`"
+      _G_path="`$GIT config --file .gitmodules submodule.gnulib.path 
2>/dev/null`"
 
-      test -n "$my_path" || {
+      test -n "$_G_path" || {
         $require_vc_ignore_files
 
         func_verbose "creating \`.gitmodules'"
@@ -1601,31 +1195,6 @@ func_require_git ()
 }
 
 
-# require_gnu_m4
-# --------------
-# Search for GNU M4, and export it in $M4.
-require_gnu_m4=func_require_gnu_m4
-func_require_gnu_m4 ()
-{
-    $debug_cmd
-
-    test -n "$M4" || {
-      # Find the first m4 binary that responds to --version.
-      func_find_tool M4 gm4 gnum4 m4
-    }
-
-    test -n "$M4" || func_fatal_error "\
-error: Please install GNU M4, or \`export M4=/path/to/gnu/m4'."
-
-    func_verbose "export M4='$M4'"
-
-    # Make sure the search result is visible to subshells
-    export M4
-
-    require_gnu_m4=:
-}
-
-
 # require_gnulib_cache
 # --------------------
 # Ensure there is a non-empty default for `$gnulib_cache', and that it
@@ -1765,7 +1334,7 @@ func_require_gnulib_submodule ()
 
       if test -f .gitmodules && test -f "$gnulib_path/gnulib-tool"; then
         func_show_eval "$GIT submodule update" \
-            'func_fatal_error "error: Unable to update gnulib submodule."'
+            'func_fatal_error "Unable to update gnulib submodule."'
 
       elif test -n "$opt_gnulib_srcdir"; then
         # Older git can't clone into an empty directory.
@@ -1774,7 +1343,7 @@ func_require_gnulib_submodule ()
                 '$gnulib_url' '$gnulib_path'" \
             && func_show_eval "$GIT submodule init" \
             && func_show_eval "$GIT submodule update" \
-            || func_fatal_error "error: Unable to fetch gnulib submodule."
+            || func_fatal_error "Unable to fetch gnulib submodule."
 
       # Without --gnulib-srcdir, and no existing checked out submodule, we
       # create a new shallow clone of the remote gnulib repository.
@@ -1883,10 +1452,10 @@ func_require_macro_dir ()
     test -n "$macro_dir" || {
       $require_aclocal_amflags
 
-      my_sed_scan='s|^.*-I[     ]*\([^  ]*\) .*|\1|'
+      _G_sed_scan='s|^.*-I[     ]*\([^  ]*\) .*|\1|'
 
       # Trailing space in echo is required by the sed script.
-      macro_dir=`echo "$aclocal_amflags " |$SED "$my_sed_scan"`
+      macro_dir=`echo "$aclocal_amflags " |$SED "$_G_sed_scan"`
     }
 
     func_verbose "macro_dir='$macro_dir'"
@@ -2029,8 +1598,8 @@ func_require_package_version ()
       case " "`echo $gnulib_modules`" " in
        *" git-version-gen "*)
          func_fatal_error "\
-error: cannot \$require_package_version in bootstrap.conf before
-       func_gnulib_tool has installed the \`git-version-gen' script."
+cannot \$require_package_version in bootstrap.conf before
+func_gnulib_tool has installed the \`git-version-gen' script."
          ;;
        *)
           func_check_configuration package_version \
@@ -2152,8 +1721,8 @@ func_cmp_s ()
 }
 
 
-# func_grep_q EXPRESSION [FILENAME..].
-# ------------------------------------
+# func_grep_q EXPRESSION [FILENAME..]
+# -----------------------------------
 # Check whether EXPRESSION matches any line of any listed FILENAME,
 # without any output at all, even error messages.
 func_grep_q ()
@@ -2175,23 +1744,23 @@ func_ifcontains ()
     $debug_cmd
 
     # The embedded echo is to squase whitespace before globbing.
-    my_wslist=`echo " "$1" "`
-    my_member=$2
-    my_yes_cmd=$3
-    my_no_cmd=${4-":"}
-
-    case $my_wslist in
-      *" $my_member "*)
-        eval "$my_yes_cmd"
-       my_status=$?
+    _G_wslist=`echo " "$1" "`
+    _G_member=$2
+    _G_yes_cmd=$3
+    _G_no_cmd=${4-":"}
+
+    case $_G_wslist in
+      *" $_G_member "*)
+        eval "$_G_yes_cmd"
+       _G_status=$?
        ;;
       *)
-       eval "$my_no_cmd"
-       my_status=$?
+       eval "$_G_no_cmd"
+       _G_status=$?
        ;;
     esac
 
-    test "$my_status" -eq 0 || exit $my_status
+    test "$_G_status" -eq 0 || exit $_G_status
 }
 
 
@@ -2209,11 +1778,11 @@ func_append_u ()
 {
     $debug_cmd
 
-    eval my_current_value='`echo $'$1'`'
-    my_delim=`expr "$2" : '\(.\)'`
+    eval _G_current_value='`echo $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
 
-    case $my_delim$my_current_value$my_delim in
-      *"$2$my_delim"*) ;;
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
       *) func_append "$@" ;;
     esac
 }
@@ -2226,10 +1795,10 @@ func_strpad ()
 {
     $debug_cmd
 
-    my_width=`expr "$2" - 1`
+    _G_width=`expr "$2" - 1`
     func_strpad_result=`echo "$1" |$SED '
         :a
-        s|^.\{0,'"$my_width"'\}$|&'"$3"'|
+        s|^.\{0,'"$_G_width"'\}$|&'"$3"'|
         ta
     '`
 }
@@ -2243,10 +1812,10 @@ func_strrpad ()
 {
     $debug_cmd
 
-    my_width=`expr "$2" - 1`
+    _G_width=`expr "$2" - 1`
     func_strrpad_result=`echo "$1" |$SED '
         :a
-        s|^.\{0,'"$my_width"'\}$|'"$3"'&|
+        s|^.\{0,'"$_G_width"'\}$|'"$3"'&|
         ta
     '`
 }
@@ -2263,15 +1832,15 @@ func_strrow ()
 
     func_strrow_linelen="$1"; shift
 
-    my_row=
+    _G_row=
     while test $# -gt 0; do
       func_strrow_linelen=`expr $func_strrow_linelen + $2`
       func_strpad "$1" $2 " "
-      func_append my_row "$func_strpad_result"
+      func_append _G_row "$func_strpad_result"
       shift; shift
     done
 
-    func_strrpad "$my_row" $func_strrow_linelen " "
+    func_strrpad "$_G_row" $func_strrow_linelen " "
     func_strrow_result="$func_strrpad_result"
 }
 
@@ -2309,27 +1878,27 @@ func_strtable ()
     $debug_cmd
 
     # Save the indent value, we'll need it for each row we render.
-    my_indent="$1"; shift
+    _G_indent="$1"; shift
 
     # Collect remaining numeric args into a list for reuse between
     # members of each row when we call func_strrow later.
-    my_widths="$1"; shift
+    _G_widths="$1"; shift
     while test 0 -lt `expr "$1" : '[1-9][0-9]*$'`; do
-      func_append my_widths " $1"; shift
+      func_append _G_widths " $1"; shift
     done
 
     # Extract the same number of positional parameters as there are
     # width elements - we'll do the header rows separately so that
     # we can insert a divider line.
-    my_header="$my_indent"
-    for my_width in $my_widths; do
-      func_append my_header " $1 $my_width"; shift
+    _G_header="$_G_indent"
+    for _G_width in $_G_widths; do
+      func_append _G_header " $1 $_G_width"; shift
     done
-    func_strrow $my_header
+    func_strrow $_G_header
 
     # Strip off the indent, and make a divider with `-' chars, then
     # reindent.
-    my_divider=`echo "$func_strrow_result" \
+    _G_divider=`echo "$func_strrow_result" \
         |$SED 's|[^ ]|-|g
             :a
             s|- |--|g
@@ -2339,89 +1908,24 @@ func_strtable ()
     # Append the header and divider to the running result.
     func_append func_strtable_result "\
 $func_strrow_result
-$my_divider
+$_G_divider
 "
 
     # The remaining rows are zipped between the width values we
     # unwound earlier just like the header row above.
     while test $# -gt 0; do
-      my_row="$my_indent"
-      for my_width in $my_widths; do
-        func_append my_row " $1 $my_width"; shift
+      _G_row="$_G_indent"
+      for _G_width in $_G_widths; do
+        func_append _G_row " $1 $_G_width"; shift
       done
-      func_strrow $my_row
+      func_strrow $_G_row
       func_append func_strtable_result "\
 $func_strrow_result
 "
     done
 
     # Mark the end of the table with a final divider line.
-    func_append func_strtable_result "$my_divider"
-}
-
-
-# func_echo ARG...
-# ----------------
-# Echo program name prefixed message, taking newlines into account.
-func_echo ()
-{
-    my_message="$*"
-
-    save_IFS="$IFS"
-    IFS="$nl"
-    for my_line in $my_message; do
-      IFS="$save_IFS"
-      echo "$progname: $my_line"
-    done
-    IFS="$save_IFS"
-}
-
-
-# func_verbose ARG...
-# -------------------
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
-}
-
-
-# func_error ARG...
-# -----------------
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    my_message="$*"
-
-    save_IFS="$IFS"
-    IFS="$nl"
-    for my_line in $my_message; do
-      IFS="$save_IFS"
-      echo "$progname: $bold_on$my_line$bold_off" 1>&2
-    done
-    IFS="$save_IFS"
-}
-
-# Allow display of bold text on terminals that support it
-bold_on=
-bold_off=
-if test -t 1; then
-  if test -n "`tput bold 2>/dev/null`" \
-      && test -n "`tput sgr0 2>/dev/null`"
-  then
-    bold_on=`tput bold`
-    bold_off=`tput sgr0`
-  fi
-fi
-
-
-# func_fatal_error ARG...
-# -----------------------
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
+    func_append func_strtable_result "$_G_divider"
 }
 
 
@@ -2430,9 +1934,9 @@ func_fatal_error ()
 # Echo program name prefixed message to standard error, and exit.
 func_internal_error ()
 {
-    func_fatal_error "INTERNAL ERROR: " ${1+"$@"} "
-                Please report this bug to address@hidden'
-                in as much detail as possible."
+    func_fatal_error "INTERNAL: " ${1+"$@"} "
+          Please report this bug to address@hidden'
+          in as much detail as possible."
 }
 
 
@@ -2444,7 +1948,7 @@ func_permissions_error ()
 {
     $debug_cmd
 
-    func_fatal_error "error: Failed to create \`$1', check permissions."
+    func_fatal_error "Failed to create \`$1', check permissions."
 }
 
 
@@ -2461,210 +1965,15 @@ func_warning ()
       *) func_internal_error "invalid warning category \`$1'" ;;
     esac
 
-    my_category="$1"
+    _G_category="$1"
     shift
 
     case " $opt_warning " in
-      *" $my_category "*) $warning_func ${1+"$@"} ;;
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
     esac
 }
 
 
-# func_fatal_help ARG...
-# ----------------------
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    $debug_cmd
-
-    func_error ${1+"$@"}
-    func_fatal_error "$fatal_help"
-}
-fatal_help="Try \`$progname --help' for more information."  ## default
-
-
-# func_version
-# ------------
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $debug_cmd
-
-    printf '%s\n' "$progname $scriptversion"
-    $SED -n '/(C)/!b go
-        :more
-        /\./!{
-          N
-          s|\n# | |
-          b more
-        }
-        :go
-        /^# Written by /,/# warranty; / {
-          s|^# ||
-          s|^# *$||
-          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
-          p
-        }
-        /^# Written by / {
-          s|^# ||
-          p
-        }' < "$progpath"
-
-    exit $?
-}
-
-
-# func_usage_message
-# ------------------
-# Echo short help message to standard output.
-func_usage_message ()
-{
-    $debug_cmd
-
-    echo "$progpath [OPTION]..."
-    echo ""
-    echo "$usage_message"
-}
-
-
-# func_usage
-# ----------
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $debug_cmd
-
-    func_usage_message
-    echo "Run \`$progname --help |more' for full usage"
-    exit 0
-}
-
-
-# func_help
-# ---------
-# Echo long help message to standard output and exit.
-func_help ()
-{
-    $debug_cmd
-
-    func_usage_message
-    echo "$long_help_message"
-    exit 0
-}
-
-
-# func_missing_arg ARGNAME
-# ------------------------
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    $debug_cmd
-
-    func_error "error: Missing argument for \`$1'."
-    exit_cmd=exit
-}
-
-
-# func_split_short_opt SHORTOPT
-# -----------------------------
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-if (eval 'x=-abc; y=${x#??}; z=${x%$y}; test x$y$z = xbc-a') 2>/dev/null
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_arg=${1#??}
-      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_short_opt ()
-  {
-      $debug_cmd
-
-      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
-      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
-  }
-fi #func_split_short_opt
-
-
-# func_split_equals STRING
-# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the `=' sign.
-if (eval 'x='--ab=cd'; y=${x#*=}; z=${x%%=*}; test x$y$z = xcd--ab') 
2>/dev/null
-then
-  # This is an XSI compatible shell, allowing a faster implementation...
-  eval 'func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=${1%%=*}
-      func_split_equals_rhs=${1#*=}
-      test "x$func_split_equals_lhs" = "x$1" \
-        && func_split_equals_rhs=""
-  }'
-else
-  # ...otherwise fall back to using expr, which is often a shell builtin.
-  func_split_equals ()
-  {
-      $debug_cmd
-
-      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*)'`
-      func_split_equals_rhs=""
-      test "x$func_split_equals_lhs" = "x$1" \
-        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
-  }
-fi #func_split_equals
-
-
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
-func_quote_for_eval ()
-{
-    $debug_cmd
-
-    func_quote_for_eval_result=
-
-    while test $# -gt 0; do
-      case $1 in
-        *[\\\`\"\$]*)
-          my_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          my_unquoted_arg="$1" ;;
-      esac
-
-      case $my_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \  ]*|*]*|"")
-          my_quoted_arg="\"$my_unquoted_arg\""
-          ;;
-        *)
-          my_quoted_arg="$my_unquoted_arg" ;;
-      esac
-      test -n "$func_quote_for_eval_result" \
-          && func_append func_quote_for_eval_result " "
-      func_append func_quote_for_eval_result "$my_quoted_arg"
-      shift
-    done
-}
-
-
 # func_show_eval CMD [FAIL_EXP]
 # -----------------------------
 # Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
@@ -2674,19 +1983,19 @@ func_show_eval ()
 {
     $debug_cmd
 
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    _G_cmd="$1"
+    _G_fail_exp="${2-:}"
 
     ${opt_silent-false} || {
-      func_quote_for_eval $my_cmd
+      func_quote_for_eval $_G_cmd
       eval func_truncate_cmd $func_quote_for_eval_result
       func_echo "running: $func_truncate_cmd_result"
     }
 
     ${opt_dry_run-false} || {
-      eval "$my_cmd"
-      my_status=$?
-      test "$my_status" -eq 0 || eval "(exit $my_status); $my_fail_exp"
+      eval "$_G_cmd"
+      _G_status=$?
+      test "$_G_status" -eq 0 || eval "(exit $_G_status); $_G_fail_exp"
     }
 }
 
@@ -2700,26 +2009,26 @@ func_truncate_cmd ()
 {
     $debug_cmd
 
-    my_last_arg_opt_p=false
+    _G_last_arg_opt_p=false
     func_truncate_cmd_result=
 
     set dummy "$@"; shift
 
     while test $# -gt 0; do
-      my_opt="$1"; shift
+      _G_opt="$1"; shift
 
       test -n "$func_truncate_cmd_result" \
           && func_append func_truncate_cmd_result ' '
-      func_append func_truncate_cmd_result "$my_opt"
+      func_append func_truncate_cmd_result "$_G_opt"
 
       func_len "x$func_truncate_cmd_result"
 
-      case $my_opt in
-        -*) my_last_arg_opt_p=: ;;
-        *)  $my_last_arg_opt_p \
+      case $_G_opt in
+        -*) _G_last_arg_opt_p=: ;;
+        *)  $_G_last_arg_opt_p \
                 || test $min_cmd_len -gt $func_len_result \
                 || break
-            my_last_arg_opt_p=false
+            _G_last_arg_opt_p=false
             ;;
       esac
     done
@@ -2728,114 +2037,6 @@ func_truncate_cmd ()
 }
 
 
-# func_extract_trace MACRO_NAME [FILENAME]...
-# -------------------------------------------
-# set `$func_extract_trace_result' to a colon delimited list of
-# arguments to MACRO_NAME in FILENAME. If no FILENAME is not given,
-# then `configure.ac' is assumed.
-func_extract_trace ()
-{
-    $debug_cmd
-
-    $require_configure_ac
-    $require_gnu_m4
-
-    my_macro="$1"; shift
-    test $# -gt 0 || {
-      set dummy $configure_ac
-      shift
-    }
-
-    # Generate an error if the first file is missing
-    <"$1"
-
-    # Sadly, we can't use `autom4te' tracing to extract macro
-    # arguments, because it complains about things we want to
-    # ignore at bootstrap time - like missing m4_include files;
-    # AC_PREREQ being newer than the installed autoconf; and
-    # returns nothing when tracing `AM_INIT_AUTOMAKE' when
-    # aclocal hasn't been generated yet.
-    #
-    # The following tries to emulate a less persnickety version
-    # of (and due to not having to wait for Perl startup on
-    # every invocation, it's probably faster too):
-    #
-    #    autom4te --language=Autoconf --trace=$my_macro:\$% "$@"
-    #
-    # First we give a minimal set of macro declarations to M4
-    # to prime it for reading Autoconf macros, while still
-    # providing some of the functionality generally used at
-    # m4-time to supply dynamic arguments to Autocof functions,
-    # but without following `m4_s?include' files.
-    #
-    # We discard M4's stdout, but the M4 trace output from reading
-    # our "autoconf.mini" followed by any other files passed to
-    # this function is then scanned by sed to transform it into
-    # a colon delimited argument list assigned to a shell variable.
-    #
-    # Finally, we `eval' the sed generated assignment to get
-    # the result back into this script for further use by callers
-    # of this function.
-
-    func_extract_trace_result=
-    eval `echo '
-        # Initialisation.
-        m4_changequote([,])
-        m4_define([m4_copy],   [m4_define([$2], m4_defn([$1]))])
-        m4_define([m4_rename], [m4_copy([$1], [$2])m4_undefine([$1])])
-
-        # Disable these macros.
-        m4_undefine([m4_dnl])
-        m4_undefine([m4_include])
-        m4_undefine([m4_m4exit])
-        m4_undefine([m4_m4wrap])
-        m4_undefine([m4_maketemp])
-
-        # Copy and rename macros not handled by "m4 --prefix".
-        m4_define([dnl],         [m4_builtin([dnl])])
-        m4_copy([m4_define],     [m4_defun])
-        m4_rename([m4_ifelse],   [m4_if])
-        m4_ifdef([m4_mkstemp],   [m4_undefine([m4_mkstemp])])
-        m4_rename([m4_patsubst], [m4_bpatsubst])
-        m4_rename([m4_regexp],   [m4_bregexp])
-
-        # "m4sugar.mini" - useful m4-time macros for dynamic arguments.
-        # If we discover packages that need more m4 macros defined in
-        # order to bootstrap correctly, add them here:
-        m4_define([m4_bmatch],
-            [m4_if([$#], 0, [], [$#], 1, [], [$#], 2, [$2],
-                   [m4_if(m4_bregexp([$1], [$2]), -1,
-                          [$0([$1], m4_shift3($@))], [$3])])])
-        m4_define([m4_ifndef], [m4_ifdef([$1], [$3], [$2])])
-        m4_define([m4_ifset],
-            [m4_ifdef([$1], [m4_ifval(m4_defn([$1]), [$2], [$3])], [$3])])
-        m4_define([m4_require], [$1])
-        m4_define([m4_shift3], [m4_shift(m4shift(m4shift($@)))])
-
-        # "autoconf.mini" - things from autoconf macros we care about.
-        m4_copy([m4_defun], [AC_DEFUN])
-
-        # Dummy definition for the macro we want to trace.
-        # AM_INIT_AUTOMAKE at least produces no trace without this.
-        AC_DEFUN(['"$my_macro"'])' \
-    |$M4 -daq --prefix --trace="$my_macro" - "$@" 2>&1 1>/dev/null \
-    |$SED -n 's|#.*$||
-        /^m4trace: -1- '"$my_macro"'/ {
-          s|^m4trace: -1- '"$my_macro"'[([]*|func_extract_trace_result='\''|
-          s|], [[]|:|g
-          s|[])]*$|:'\''|
-          s|[^'\'']$|\&'\''|
-          p
-        }'`
-
-    # Leave the ':' sentinel in place for successfully traced macros
-    # without arguments, otherwise remove it so that the results of
-    # single-argument macros can be used without additional parsing.
-    test : = "$func_extract_trace_result" \
-        || func_extract_trace_result=`echo "$func_extract_trace_result" |$SED 
's|:$||'`
-}
-
-
 # func_insert_sorted_if_absent STR FILE...
 # ----------------------------------------
 # If $STR is not already on a line by itself in $FILE, insert it,
@@ -2915,13 +2116,11 @@ func_get_version ()
 {
     $debug_cmd
 
-    app=$1
-
-    { $app --version || $app --version </dev/null; } >/dev/null 2>&1 \
-      || return 1
+    _G_app=$1
 
-    $app --version 2>&1 \
-    |$SED -n '# extract version within line
+    # Rather than uncomment the sed script in-situ, strip the comments
+    # programatically before passing the result to $SED for evaluation.
+    sed_get_version=`echo '# extract version within line
           s|.*[v ]\{1,\}\([0-9]\{1,\}\.[.a-z0-9-]*\).*|\1|
           t done
 
@@ -2932,10 +2131,19 @@ func_get_version ()
           d
 
           :done
-          #the following essentially does s|5.005|5.5|
+          # the following essentially does s|5.005|5.5|
           s|\.0*\([1-9]\)|.\1|g
           p
-          q'
+          q' \
+    |$SED '/^[  ]*#.*$/d'`
+
+    func_tool_version_output $_G_app >/dev/null
+    _G_status=$?
+
+    test $_G_status -ne 0 \
+      || $_G_app --version 2>&1 |$SED -n "$sed_get_version"
+
+    (exit $_G_status)
 }
 
 
@@ -2948,31 +2156,31 @@ func_check_versions ()
     func_check_versions_result=:
 
     while test $# -gt 0; do
-      my_app="$1"; shift
-      my_reqver="$1"; shift
-      my_url="$1"; shift
+      _G_app="$1"; shift
+      _G_reqver="$1"; shift
+      _G_url="$1"; shift
 
       # Honor $APP variables ($TAR, $AUTOCONF, etc.)
-      my_appvar=`echo $my_app |tr '[a-z]' '[A-Z]'`
-      test "$my_appvar" = TAR && my_appvar=AMTAR
-      eval "my_app=\${$my_appvar-$my_app}"
-      my_instver=`func_get_version $my_app`
+      _G_appvar=`echo $_G_app |tr '[a-z]' '[A-Z]'`
+      test "$_G_appvar" = TAR && _G_appvar=AMTAR
+      eval "_G_app=\${$_G_appvar-$_G_app}"
+      _G_instver=`func_get_version $_G_app`
 
-      test -z "$my_instver" \
-          || func_verbose "found \`$my_app' version $my_instver"
+      test -z "$_G_instver" \
+          || func_verbose "found \`$_G_app' version $_G_instver"
 
       # Fail if --version didn't work.
-      if test -z "$my_instver"; then
-        func_error "error: \`$my_app' not found"
+      if test -z "$_G_instver"; then
+        func_error "\`$_G_app' not found"
         func_check_versions_result=false
 
       # Fail if a new version than what we have is required.
-      elif test "$my_reqver" != "-"; then
-        my_newer=`func_sort_ver $my_reqver $my_instver |cut -d' ' -f2`
-        test "$my_newer" != "$my_instver" && {
+      elif test "$_G_reqver" != "-"; then
+        _G_newer=`func_sort_ver $_G_reqver $_G_instver |cut -d' ' -f2`
+        test "$_G_newer" != "$_G_instver" && {
           func_error "\
-error: \`$my_app' version == $my_instver is too old
-       \`$my_app' version >= $my_reqver is required"
+\`$_G_app' version == $_G_instver is too old
+\`$_G_app' version >= $_G_reqver is required"
           func_check_versions_result=false
         }
       fi
@@ -2988,9 +2196,9 @@ func_cleanup_gnulib ()
 {
     $debug_cmd
 
-    my_status=$?
+    _G_status=$?
     $RM -fr "$gnulib_path"
-    exit $my_status
+    exit $_G_status
 }
 
 
@@ -3001,46 +2209,8 @@ func_download_po_files ()
     $debug_cmd
 
     func_echo "getting translations into $1 for $2..."
-    cmd=`printf "$po_download_command_format" "$2" "$1"`
-    eval "$cmd"
-}
-
-
-# func_find_tool ENVVAR NAMES...
-# ------------------------------
-# Search for a required program.  Use the value of ENVVAR, if set,
-# otherwise find the first of the NAMES that can be run (i.e.,
-# supports --version).  If found, set ENVVAR to the program name,
-# die otherwise.
-func_find_tool ()
-{
-    $debug_cmd
-
-    find_tool_envvar=$1
-    shift
-    find_tool_names=$@
-    eval "find_tool_res=\$$find_tool_envvar"
-    if test x"$find_tool_res" = x; then
-      for i
-      do
-        if ($i --version </dev/null) >/dev/null 2>&1; then
-          find_tool_res=$i
-          break
-        fi
-      done
-    else
-      find_tool_error_prefix="\$$find_tool_envvar: "
-    fi
-    test x"$find_tool_res" = x && func_fatal_error "\
-error: One of these is required:
-       $find_tool_names"
-
-    ($find_tool_res --version </dev/null) >/dev/null 2>&1 \
-      || func_fatal_error "\
-error: ${find_tool_error_prefix}Cannot run \`$find_tool_res --version'"
-
-    eval "$find_tool_envvar=\$find_tool_res"
-    eval "export $find_tool_envvar"
+    _G_cmd=`printf "$po_download_command_format" "$2" "$1"`
+    eval "$_G_cmd"
 }
 
 
@@ -3056,71 +2226,220 @@ func_update_po_files ()
 
     # Directory containing primary .po files.
     # Overwrite them only when we're sure a .po file is new.
-    po_dir=$1
-    domain=$2
+    _G_po_dir=$1
+    _G_domain=$2
 
     # Mirror *.po files into this dir.
     # Usually contains *.s1 checksum files.
-    ref_po_dir="$po_dir/.reference"
+    _G_ref_po_dir="$_G_po_dir/.reference"
 
-    test -d $ref_po_dir || mkdir $ref_po_dir || return
-    func_download_po_files $ref_po_dir $domain \
-      && ls "$ref_po_dir"/*.po 2>/dev/null \
-         |$SED 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
+    test -d $_G_ref_po_dir || mkdir $_G_ref_po_dir || return
+    func_download_po_files $_G_ref_po_dir $_G_domain \
+      && ls "$_G_ref_po_dir"/*.po 2>/dev/null \
+         |$SED 's|.*/||; s|\.po$||' > "$_G_po_dir/LINGUAS" || return
 
-    # Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6.
+    # Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6+.
     func_find_tool SHA1SUM sha1sum gsha1sum shasum
 
-    langs=`cd $ref_po_dir && echo *.po|$SED 's|\.po||g'`
-    test "$langs" = '*' && langs=x
-    for po in $langs; do
-      case $po in x) continue;; esac
-      new_po="$ref_po_dir/$po.po"
-      cksum_file="$ref_po_dir/$po.s1"
-      if ! test -f "$cksum_file" ||
-          ! test -f "$po_dir/$po.po" ||
-          ! $SHA1SUM -c --status "$cksum_file" \
-              < "$new_po" > /dev/null; then
-        echo "updated $po_dir/$po.po..."
-        cp "$new_po" "$po_dir/$po.po" \
-          && $SHA1SUM < "$new_po" > "$cksum_file"
+    _G_langs=`cd $_G_ref_po_dir && echo *.po|$SED 's|\.po||g'`
+    test "$_G_langs" = '*' && _G_langs=x
+    for _G_po in $_G_langs; do
+      case $_G_po in x) continue;; esac
+      _G_new_po="$_G_ref_po_dir/$_G_po.po"
+      _G_cksum_file="$_G_ref_po_dir/$_G_po.s1"
+      if ! test -f "$_G_cksum_file" ||
+          ! test -f "$_G_po_dir/$_G_po.po" ||
+          ! $SHA1SUM -c --status "$_G_cksum_file" \
+              < "$_G_new_po" > /dev/null; then
+        echo "updated $_G_po_dir/$_G_po.po..."
+        cp "$_G_new_po" "$_G_po_dir/$_G_po.po" \
+          && $SHA1SUM < "$_G_new_po" > "$_G_cksum_file"
       fi
     done
 }
 
 
 
-## ----------------- ##
-## Global variables. ##
-## ----------------- ##
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
 
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+# Short help message in response to `-h'.  Add to this in `bootstrap.conf'
+# if you accept any additional options.
+usage_message='Common Bootstrap Options:
+  -c, --copy         copy files instead of creating symbolic links.
+      --debug        enable verbose shell tracing
+  -n, --dry-run      print commands rather than running them
+  -f, --force        attempt to bootstrap even if the sources seem not
+                     to have been checked out.
+      --gnulib-srcdir=DIRNAME
+                     specify a local directory where gnulib sources
+                     reside. Use this if you already have the gnulib
+                     sources on your machine, and don'\''t want to waste
+                     your bandwidth downloading them again.  Defaults to
+                     \$GNULIB_SRCDIR.
+      --skip-git     do not fetch files from remote repositories
+      --skip-po      do not download po files.
+  -v, --verbose      verbosely report processing
+      --version      print version information and exit
+  -W, --warnings=CATEGORY
+                     report the warnings falling in CATEGORY [all]
+  -h, --help         print short or long help message and exit
+'
 
-exit_status=$EXIT_SUCCESS
+# Additional text appended to `usage_message' in response to `--help'.
+long_help_message="
+Warning categories include:
+  \`all'         show all warnings
+  \`none'        turn off all the warnings
+  \`error'       warnings are treated as fatal errors
+  \`recommend'   show warnings about missing recommended packages
+  \`settings'    show warnings about missing \`bootstrap.conf' settings
+  \`upgrade'     show warnings about out-dated files
 
-# Allow overriding, eg to get a function call trace:
-#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash bootstrap
-debug_cmd="${debug_cmd-:}"
-exit_cmd=:
+If the file $progpath.conf exists in the same directory as this script,
+its contents are read as shell variables to configure the bootstrap.
 
-dirname='s|/[^/]*$||'
-basename='s|^.*/||'
+For build prerequisites, environment variables like \$AUTOCONF and
+\$AMTAR are honored.
 
-nl='
-'
+Running without arguments will suffice in most cases.
+"
 
-# 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.
-progpath="$0"
+# Warning categories used by `bootstrap', append others if you use them
+# in your `bootstrap.conf'.
+warning_categories='recommend settings upgrade'
+
+
+# bootstrap_options_prep [ARG]...
+# -------------------------------
+# Preparation for options parsed by Bootstrap.
+bootstrap_options_prep ()
+{
+    $debug_cmd
+
+    warning_func=func_error
+
+    # Option defaults:
+    opt_copy=${copy-false}
+    opt_dry_run=false
+    opt_force=false
+    opt_gnulib_srcdir="$GNULIB_SRCDIR"
+    opt_skip_git=false
+    opt_skip_po=false
+    opt_warning=
+
+    # Pass back the list of options we consumed.
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result="$func_quote_for_eval_result"
+}
+func_add_hook func_options_prep bootstrap_options_prep
+
+
+# bootstrap_parse_options [ARG]...
+# --------------------------------
+# Provide handling for Bootstrap specific options.  Note
+# `func_parse_options' passes in the unconsumed positional parameters, and
+# this function has to pass back whatever remains after its own
+# processing in the `func_run_hooks_result' variable.
+bootstrap_parse_options ()
+{
+    $debug_cmd
+
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt="$1"
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                      opt_dry_run=: ;;
+        --copy|-c)    opt_copy=: ;;
+        --force|-f)   opt_force=: ;;
+
+        --gnulib-srcdir)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      opt_gnulib_srcdir="$1"
+                      shift
+                      ;;
+
+        --skip-git)   opt_skip_git=: ;;
+        --skip-po)    opt_skip_po=: ;;
+
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $1 " in
+                        " all ")
+                          opt_warning=" $warning_categories"
+                          ;;
+                        " none ")
+                          opt_warning=" none"
+                          warning_func=:
+                          ;;
+                        " error ")
+                          warning_func=func_fatal_error
+                          ;;
+                        *" $warning_categories "*)
+                          func_append_u opt_warning " $1"
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: \`$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -c*|-f*|-n*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result="$func_quote_for_eval_result"
+}
+func_add_hook func_parse_options bootstrap_parse_options
+
+
+# bootstrap_validate_options [ARG]...
+# -----------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+bootstrap_validate_options ()
+{
+    $debug_cmd
+
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning" || opt_warning="$warning_categories"
+
+    # Validate options.
+    test $# -gt 0 \
+        && func_fatal_help "too many arguments"
+
+    # Pass back the list of unconsumed options left.
+    func_quote_for_eval ${1+"$@"}
+    func_validate_options_result="$func_quote_for_eval_result"
+}
 
-# The name of this program.
-progname=`echo "$progpath" |$SED "$basename"`
 
 ## -------------------------------------------------- ##
 ## Source package customisations in `bootstrap.conf'. ##
@@ -3142,7 +2461,7 @@ esac
 func_bootstrap ${1+"$@"}
 
 # The End.
-exit $exit_status
+exit ${exit_status-$EXIT_SUCCESS}
 
 # Local variables:
 # mode: shell-script
diff --git a/bootstrap.conf b/bootstrap.conf
index 116023c..0f89559 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -1,4 +1,4 @@
-# bootstrap.conf (GNU Libtool) version 2011-10-20
+# bootstrap.conf (GNU Libtool) version 2011-11-02
 #
 # Copyright (C) 2010, 2011 Free Software Foundation, Inc.
 # Written by Gary V. Vaughan, 2010
@@ -108,7 +108,7 @@ require_bootstrap_uptodate=:
 ## ------------------- ##
 
 # func_reconfigure
-# ----------------
+# ------------------
 # In addition to needing to autoreconf several directories, Libtool
 # provides `libtoolize' and doesn't use `autopoint', so we can use a
 # somewhat simpler `func_reconfigure' implementation.
diff --git a/libltdl/config/extract-trace b/libltdl/config/extract-trace
new file mode 100755
index 0000000..a230140
--- /dev/null
+++ b/libltdl/config/extract-trace
@@ -0,0 +1,407 @@
+#! /bin/sh
+
+# Make sure we've evaluated the option-parser library.
+test -n "$progpath" || . `echo "$0" |${SED-sed} 's,[^/]*$,,'`"/options-parser"
+
+# Set a version string.
+scriptversion=2011-11-04.09; # UTC
+
+# Extract macro arguments from autotools input with GNU M4.
+# Written by Gary V. Vaughan, 2010
+#
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+##### PLEASE CHECK `--version' WORKS AFTER EDITING THE ABOVE COPYRIGHT #####
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run `./extract-trace --help' for help with using this script from the
+# command line.
+#
+# Or source first `options-parser' and then this file into your own
+# scripts in order to make use of the function and variable framework
+# they define, and also to avoid the overhead of forking to run this
+# script in its own process on every call.
+
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+usage='$progname MACRO_NAME FILE [...]'
+
+long_help_message='
+The first argument to this program is the name of an autotools macro
+whose arguments you want to extract by examining the files listed in the
+remaining arguments using the same tool that Autoconf and Automake use,
+GNU M4.
+
+The arguments are returned separated by colons, with each traced call
+on a separate line.'
+
+
+
+## ------------------##
+## Helper functions. ##
+## ------------------##
+
+# This section contains the helper functions used by the rest of
+# `extract-trace'.
+
+
+# func_autoconf_configure MAYBE-CONFIGURE-FILE
+# --------------------------------------------
+# Ensure that MAYBE-CONFIGURE-FILE is the name of a file in the current
+# directory which contains an uncommented call to AC_INIT.
+func_autoconf_configure ()
+{
+    $debug_cmd
+
+    _G_sed_no_comment='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;'
+    _G_ac_init=
+
+    # If we were passed a genuine file, make sure it calls AC_INIT.
+    test -f "$1" \
+      && _G_ac_init=`$SED "$_G_sed_no_comment" "$1" |grep AC_INIT`
+
+    # Otherwise it is not a genuine Autoconf input file.
+    test -n "$_G_ac_init"
+    _G_status=$?
+
+    test $_G_status -ne 0 \
+      && func_verbose "\`$1' not using Autoconf"
+
+    (exit $_G_status)
+}
+
+
+# func_find_tool ENVVAR NAMES...
+# ------------------------------
+# Search for a required program.  Use the value of ENVVAR, if set,
+# otherwise find the first of the NAMES that can be run (i.e.,
+# supports --version).  If found, set ENVVAR to the program name,
+# die otherwise.
+func_find_tool ()
+{
+    $debug_cmd
+
+    _G_find_tool_envvar=$1
+    shift
+    _G_find_tool_names=$@
+    eval "_G_find_tool_res=\$$_G_find_tool_envvar"
+    if test -n "$_G_find_tool_res"; then
+      _G_find_tool_error_prefix="\$$find_tool_envvar: "
+    else
+      for _G_prog
+      do
+        if func_tool_version_output $_G_prog >/dev/null; then
+          _G_find_tool_res=$_G_prog
+          break
+        fi
+      done
+    fi
+    if test -n "$_G_find_tool_res"; then
+      func_tool_version_output >/dev/null $_G_find_tool_res "\
+${_G_find_tool_error_prefix}Cannot run \`$_G_find_tool_res --version'"
+
+      # Make sure the result is exported to the environment for children
+      # to use.
+      eval "$_G_find_tool_envvar=\$_G_find_tool_res"
+      eval "export $_G_find_tool_envvar"
+    else
+      func_error "\
+One of these is required:
+       $_G_find_tool_names"
+    fi
+}
+
+
+# func_tool_version_output CMD [FATAL-ERROR-MSG]
+# ----------------------------------------------
+# Attempt to run `CMD --version', discarding errors.  The output can be
+# ignored by redirecting stdout, and this function used simply to test
+# whether the command exists and exits normally when passed a
+# `--version' argument. 
+# When FATAL-ERROR-MSG is given, then this function will display the
+# message and exit if running `CMD --version' returns a non-zero exit
+# status.
+func_tool_version_output ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fatal_error_msg=$2
+
+    # Some tools, like `git2cl' produce thousands of lines of output
+    # unless stdin is /dev/null - in that case we want to return
+    # successfully without saving all of that output.  Other tools,
+    # such as `help2man' exit with a non-zero status when stdin comes
+    # from /dev/null, so we re-execute without /dev/null if that
+    # happens.  This means that occasionally, the output from both calls
+    # ends up in the result, but the alternative would be to discard the
+    # output from one call, and hope the other produces something useful.
+    { $_G_cmd --version </dev/null || $_G_cmd --version; } 2>/dev/null
+    _G_status=$?
+
+    test $_G_status -ne 0 && test -n "$_G_fatal_error_msg" \
+        && func_fatal_error "$_G_fatal_error_msg"
+
+    (exit $_G_status)
+}
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files.  Where a variable already has a non-
+# empty value (as set by the package's `bootstrap.conf'), that value is
+# used in preference to deriving the default. Call them using their
+# associated `require_*' variable to ensure that they are executed, at
+# most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_configure_ac
+# --------------------
+# Ensure that there is a `configure.ac' or `configure.in' file in the
+# current directory which contains an uncommented call to AC_INIT, and
+# that `$configure_ac' contains its name.
+require_configure_ac=func_require_configure_ac
+func_require_configure_ac ()
+{
+    $debug_cmd
+
+    test -z "$configure_ac" \
+      && func_autoconf_configure configure.ac && configure_ac=configure.ac
+    test -z "$configure_ac" \
+      && func_autoconf_configure configure.in && configure_ac=configure.in
+    test -z "$configure_ac" \
+      || func_verbose "found \`$configure_ac'"
+
+    require_configure_ac=:
+}
+
+
+# require_gnu_m4
+# --------------
+# Search for GNU M4, and export it in $M4.
+require_gnu_m4=func_require_gnu_m4
+func_require_gnu_m4 ()
+{
+    $debug_cmd
+
+    test -n "$M4" || {
+      # Find the first m4 binary that responds to --version.
+      func_find_tool M4 gm4 gnum4 m4
+    }
+
+    test -n "$M4" || func_fatal_error "\
+Please install GNU M4, or \`export M4=/path/to/gnu/m4'."
+
+    func_verbose "export M4='$M4'"
+
+    # Make sure the search result is visible to subshells
+    export M4
+
+    require_gnu_m4=:
+}
+
+
+## --------------- ##
+## Core functions. ##
+## --------------- ##
+
+# This section contains the high level functions used when calling this
+# file as a script. `func_extract_trace' is probably the only one that you
+# won't want to replace if you source this file into your own script.
+
+
+# func_extract_trace MACRO_NAMES [FILENAME]...
+# --------------------------------------------
+# set `$func_extract_trace_result' to a colon delimited list of arguments
+# to any of the comma separated list of MACRO_NAMES in FILENAME. If no
+# FILENAME is given, then `$configure_ac' is assumed.
+func_extract_trace ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+    $require_gnu_m4
+
+    _G_m4_traces=`echo "--trace=$1" |$SED 's%,% --trace=%g'`
+    _G_re_macros=`echo "($1)" |$SED 's%,%|%g'`
+    _G_macros="$1"; shift
+    test $# -gt 0 || {
+      set dummy $configure_ac
+      shift
+    }
+
+    # Generate an error if the first file is missing
+    <"$1"
+
+    # Sadly, we can't use `autom4te' tracing to extract macro arguments,
+    # because it complains about things we want to ignore at bootstrap
+    # time - like missing m4_include files; AC_PREREQ being newer than
+    # the installed autoconf; and returns nothing when tracing
+    # `AM_INIT_AUTOMAKE' when aclocal hasn't been generated yet.
+    #
+    # The following tries to emulate a less persnickety version of (and
+    # due to not having to wait for Perl startup on every invocation,
+    # it's probably faster too):
+    #
+    #    autom4te --language=Autoconf --trace=$my_macro:\$% "$@"
+    #
+    # First we give a minimal set of macro declarations to M4 to prime
+    # it for reading Autoconf macros, while still providing some of the
+    # functionality generally used at m4-time to supply dynamic
+    # arguments to Autocof functions, but without following
+    # `m4_s?include' files.
+    _G_mini='
+        # Initialisation.
+        m4_changequote([,])
+        m4_define([m4_copy],   [m4_define([$2], m4_defn([$1]))])
+        m4_define([m4_rename], [m4_copy([$1], [$2])m4_undefine([$1])])
+
+        # Disable these macros.
+        m4_undefine([m4_dnl])
+        m4_undefine([m4_include])
+        m4_undefine([m4_m4exit])
+        m4_undefine([m4_m4wrap])
+        m4_undefine([m4_maketemp])
+
+        # Copy and rename macros not handled by "m4 --prefix".
+        m4_define([dnl],         [m4_builtin([dnl])])
+        m4_copy([m4_define],     [m4_defun])
+        m4_rename([m4_ifelse],   [m4_if])
+        m4_ifdef([m4_mkstemp],   [m4_undefine([m4_mkstemp])])
+        m4_rename([m4_patsubst], [m4_bpatsubst])
+        m4_rename([m4_regexp],   [m4_bregexp])
+
+        # "m4sugar.mini" - useful m4-time macros for dynamic arguments.
+        # If we discover packages that need more m4 macros defined in
+        # order to bootstrap correctly, add them here:
+        m4_define([m4_bmatch],
+            [m4_if([$#], 0, [], [$#], 1, [], [$#], 2, [$2],
+                   [m4_if(m4_bregexp([$1], [$2]), -1,
+                          [$0([$1], m4_shift3($@))], [$3])])])
+        m4_define([m4_ifndef], [m4_ifdef([$1], [$3], [$2])])
+        m4_define([m4_ifset],
+            [m4_ifdef([$1], [m4_ifval(m4_defn([$1]), [$2], [$3])], [$3])])
+        m4_define([m4_require], [$1])
+        m4_define([m4_shift3], [m4_shift(m4shift(m4shift($@)))])
+
+        # "autoconf.mini" - things from autoconf macros we care about.
+        m4_copy([m4_defun], [AC_DEFUN])
+
+        # Dummy definitions for the macros we want to trace.
+        # AM_INIT_AUTOMAKE at least produces no trace without this.
+    '
+    
+    _G_save=$IFS
+    IFS=,
+    for _G_macro in $_G_macros; do
+      IFS=$_G_save
+      func_append _G_mini "AC_DEFUN([$_G_macro])$nl"
+    done
+    IFS=$_G_save
+
+    # We discard M4's stdout, but the M4 trace output from reading our
+    # "autoconf.mini" followed by any other files passed to this
+    # function is then scanned by sed to transform it into a colon
+    # delimited argument list assigned to a shell variable.
+    _G_transform='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;'
+
+    # Unfortunately, alternation in regexp addresses doesn't work in at
+    # least BSD (and hence Mac OS X) sed, so we have to append a capture
+    # and print block for each traced macro to the sed transform script.
+    _G_save=$IFS
+    IFS=,
+    for _G_macro in $_G_macros; do
+      IFS=$_G_save
+      func_append _G_transform '
+        /^m4trace: -1- '"$_G_macro"'/ {
+          s,^m4trace: -1- '"$_G_macro"'[([]*,,
+          s|], [[]|:|g
+          s|[])]*$|:|
+          s|\(.\):$|\1|
+          p
+        }'
+    done
+    IFS=$_G_save
+
+    # Save the command pipeline results for further use by callers of
+    # this function.
+    func_extract_trace_result=`echo "$_G_mini" \
+      |$M4 -daq --prefix $_G_m4_traces - "$@" 2>&1 1>/dev/null \
+      |$SED -n -e "$_G_transform"`
+}
+
+
+# func_main [ARG]...
+# ------------------
+func_main ()
+{
+    $debug_cmd
+
+    # Option processing.
+    func_options "$@"
+    eval set dummy "$func_options_result"; shift
+
+    # Validate remaining non-option arguments.
+    test $# -gt 1 \
+        || func_fatal_help "not enough arguments"
+
+    # Pass non-option arguments to extraction function.
+    func_extract_trace "$@"
+
+    # Display results.
+    test -n "$func_extract_trace_result" \
+        && echo "$func_extract_trace_result"
+
+    # The End.
+    exit $EXIT_SUCCESS
+}
+
+
+## --------------------------- ##
+## Actually perform the trace. ##
+## --------------------------- ##
+
+# Only call `func_main' if this script was called directly.
+test extract-trace = "$progname" && func_main "$@"
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/libltdl/config/options-parser b/libltdl/config/options-parser
new file mode 100644
index 0000000..4f03dce
--- /dev/null
+++ b/libltdl/config/options-parser
@@ -0,0 +1,790 @@
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2011-11-04.03; # UTC
+
+# A pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to address@hidden
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the `--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For `-h' and `--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support `--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and `--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# `--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the `Configuration' section
+# below, and following the instructions in the `Option parsing'
+# section further down.
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
+fi
+
+# NLS nuisances.
+LANGUAGE=C
+export LANGUAGE
+
+# Ensure file names are sorted consistently across platforms.
+LC_ALL=C
+export LC_ALL
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
+: ${SED="sed"}
+
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of `-h' and
+# `--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to `-h' and `--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+      --debug        enable verbose shell tracing
+  -v, --verbose      verbosely report processing
+      --version      print version information and exit
+  -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to `usage_message' in response to `--help'.
+long_help_message=""
+
+# Help message printed before fatal option parsing errors.
+fatal_help='Try \`$progname --help'\'' for more information.'
+
+
+
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
+
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the `Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the `^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
+
+# Allow overriding, eg assuming that you follow the convention of
+# putting `$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash bootstrap
+debug_cmd="${debug_cmd-:}"
+exit_cmd=:
+
+dirname="$SED -e "'s|/[^/]*$||'
+basename="$SED -e "'s|^.*/||'
+
+nl='
+'
+
+# 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.
+progpath="$0"
+
+# The name of this program.
+progname=`echo "$progpath" |$basename`
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+if (eval 'x=a; x+=" b"; test "x$x" = "xa b"') 2>/dev/null
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# `func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to `func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "\`$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "\`$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns="\$$1_hooks"
+
+    # shift away the first argument (FUNC_NAME)
+    shift
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next `cmd' execution.
+      eval set dummy $func_run_hooks_result; shift
+    done
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in `func_run_hooks_result', escaped suitably for `eval'.  Like
+# this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message="$usage_message"'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        func_run_hooks_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter. 
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        func_run_hooks_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    \`--silent' and \`--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        func_run_hooks_result=$func_quote_for_eval_result
+#    }
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result="$func_run_hooks_result"
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in `func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+    $debug_cmd
+
+    # Option defaults:
+    opt_verbose=false
+
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+    $debug_cmd
+
+    func_parse_options_result=
+
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
+
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy $func_run_hooks_result; shift
+
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)     func_usage ;;
+        --help)       func_help ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           set dummy "$_G_opt" "*"; shift; break ;;
+        -*)           func_fatal_help "unrecognised option: \`$_G_opt'" ;;
+        *)            set dummy "$_G_opt" "$*"; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+    $debug_cmd
+
+    func_run_hooks func_validate_options ${1+"$@"}
+
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# `require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
+{
+  $debug_cmd
+
+  test -t 1 && {
+    test -n "`tput sgr0 2>/dev/null`" && {
+      tc_reset=`tput sgr0`
+      test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+      tc_standout=$tc_bold
+      test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+      test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+      test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+      test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+      test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+    }
+  }
+
+  require_term_colors=:
+}
+
+
+## ------------------##
+## Helper functions. ##
+## ------------------##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message, taking newlines into account.
+func_echo ()
+{
+    _G_message=$*
+
+    save_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$save_IFS
+      echo "$progname: $_G_line"
+    done
+    IFS=$save_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $require_term_colors
+
+    _G_message=$*
+    _G_prefix="$progname: ${tc_standout}${tc_red}error${tc_reset}: "
+
+    save_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$save_IFS
+      echo "$_G_prefix${tc_bold}$_G_line${tc_reset}" 1>&2
+      _G_prefix="$progname:        "
+    done
+    IFS=$save_IFS
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    $debug_cmd
+
+    eval echo \""Usage: $usage"\"
+    eval echo \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    echo "$long_help_message"
+    exit 0
+}
+
+
+# func_missing_arg ARGNAME
+# ------------------------
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $debug_cmd
+
+    func_error "Missing argument for \`$1'."
+    exit_cmd=exit
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values: FN_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FN_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    _G_sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+    func_quote_for_eval_result=
+    while test $# -gt 0; do
+      case $1 in
+        *[\\\`\"\$]*)
+          _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$_G_sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg="$1" ;;
+      esac
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \  ]*|*]*|"")
+          _G_quoted_arg="\"$_G_unquoted_arg\""
+          ;;
+        *)
+          _G_quoted_arg="$_G_unquoted_arg" ;;
+      esac
+      test -n "$func_quote_for_eval_result" \
+          && func_append func_quote_for_eval_result " "
+      func_append func_quote_for_eval_result "$_G_quoted_arg"
+      shift
+    done
+}
+
+
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the `=' sign.
+if (eval 'x='--ab=cd'; y=${x#*=}; z=${x%%=*}; test x$y$z = xcd--ab') 
2>/dev/null
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=""
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*)'`
+      func_split_equals_rhs=""
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+if (eval 'x=-abc; y=${x#??}; z=${x%$y}; test x$y$z = xbc-a') 2>/dev/null
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $debug_cmd
+
+    func_usage_message
+    echo "Run \`$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
+
+
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
+{
+    $debug_cmd
+
+    eval echo \""$usage"\"
+    echo
+    $SED -n 's|^# ||;/^Written by/{x;p;x;};h' < "$progpath"
+    echo
+    eval echo \""$usage_message"\"
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+}
+
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
+
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '/(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }' < "$progpath"
+
+    exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 1857ad9..10e8a25 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -75,14 +75,6 @@ m4_divert_pop
 m4_include([getopt.m4sh])
 
 M4SH_VERBATIM([[
-# 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:
-ltdldir=
-
 # Parse environment options
 {
   my_sed_env_opt='1s/^\([^,:; ]*\).*$/\1/;q'
@@ -131,12 +123,12 @@ M4SH_GETOPTS(
   [?],         [--ltdl],                       [false],                [
        # This is tricky, since we're overloading $opt_ltdl to be the
        # optarg for --ltdl during option processing, but then stashing
-       # the (optional) optarg in $ltdldir and reusing $opt_ltdl to
+       # the (optional) optarg in $ltdl_dir and reusing $opt_ltdl to
        # indicate that --ltdl was seen during option processing.  Also,
-       # be careful that --ltdl=foo --ltdl=bar results in ltdldir=bar:
+       # be careful that --ltdl=foo --ltdl=bar results in ltdl_dir=bar:
        case $opt_ltdl in
           false|:) ;;  # a bare '--ltdl' followed by another option
-         *)       ltdldir=`$ECHO "$optarg" | $SED 's,/*$,,'` ;;
+         *)       ltdl_dir=`$ECHO "$optarg" |$SED 's,/*$,,'` ;;
        esac
        opt_ltdl=:],
 [
@@ -321,6 +313,8 @@ func_fixup_Makefile ()
 {
     $debug_cmd
 
+    $require_ltdl_dir
+
     my_filename="$1"
     my_srcdir="$2"
     my_destdir="$3"
@@ -341,7 +335,7 @@ func_fixup_Makefile ()
                sed 's,libltdl/,,'`
        my_fixup_inc_paths_script= ;;
       Makefile.inc)
-       repl=$ltdldir
+       repl=$ltdl_dir
        repl_uscore=`$ECHO "$repl" | $SED 's,[/.+-],_,g'`
        my_fixup_inc_paths_script="\
          s,libltdl_,@address@hidden,
@@ -366,235 +360,24 @@ func_fixup_Makefile ()
     fi
 }
 
-# func_scan_files
-# Scan configure.(ac|in) and aclocal.m4 (if present) for use of libltdl
-# and libtool.  Possibly running some of these tools if necessary.
-# Libtoolize affects the contents of aclocal.m4, and should be run before
-# aclocal, so we can't use configure --trace which relies on a consistent
-# configure.(ac|in) and aclocal.m4.
-func_scan_files ()
-{
-    $debug_cmd
-
-    # Prefer configure.ac to configure.in
-    test -f configure.ac && configure_ac=configure.ac
-    test -f "$configure_ac" || configure_ac=
-
-    # Set local variables to reflect contents of configure.ac
-    my_sed_scan_configure_ac='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
-       /AC_INIT/ {
-           s,^.*$,seen_autoconf=:,
-           p
-       }
-       d'
-    test -z "$configure_ac" \
-        || eval `$SED "$my_sed_scan_configure_ac" "$configure_ac"`
-
-    $seen_autoconf || {
-       my_configure_ac=
-       test -n "$configure_ac" && my_configure_ac="$configure_ac: "
-        func_verbose "${my_configure_ac}not using Autoconf"
-
-       # Make sure ltdldir and ltdl_mode have sensible defaults
-        # since we return early here:
-       test -n "$ltdldir" || ltdldir=libltdl
-       test -n "$ltdl_mode" || ltdl_mode=subproject
-
-       return
-    }
-
-    # ---------------------------------------------------- #
-    # Probe macro usage in configure.ac and/or aclocal.m4. #
-    # ---------------------------------------------------- #
-
-    my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,
-        s,^.*AC_REQUIRE(.*$,,; s,^.*m4@&address@hidden(.*$,,;
-       s,^.*m4@&address@hidden(.*$,,
-       s,^.*A[CU]_DEFUN(.*$,,; s,^.*m4@&address@hidden(.*$,,
-       /AC_CONFIG_AUX_DIR(/ {
-           s,^.*AC_CONFIG_AUX_DIR([[    ]*\([^])]*\).*$,ac_aux_dir=\1,
-           p
-        }
-       /AC_CONFIG_MACRO_DIR(/ {
-           s,^.*AC_CONFIG_MACRO_DIR([[  ]*\([^])]*\).*$,ac_macro_dir=\1,
-           p
-        }
-       /_LT_CONFIG_LTDL_DIR(/d
-       /LT_CONFIG_LTDL_DIR(/ {
-           s,^.*LT_CONFIG_LTDL_DIR([[   ]*\([^])]*\).*$,ac_ltdldir=\1,
-           p
-       }
-       /\@<:@A[CM]_PROG_LIBTOOL/d
-       /A[CM]_PROG_LIBTOOL/ {
-           s,^.*$,seen_libtool=:,
-           p
-       }
-       /the.*option into.*LT_INIT.*parameter/d
-       /\@<:@LT_INIT/d
-       /LT_INIT/                {
-           s,^.*$,seen_libtool=:,
-           p
-       }
-       /\@<:@LTDL_INIT/d
-       /LTDL_INIT/          {
-           s,^.*LTDL_INIT([[    ]*\([^])]*\).*$,ltdl_options="\1",
-           s,^.*LTDL_INIT[      ]*$,seen_ltdl=:,
-           p
-       }
-       /LT_WITH_LTDL/       {
-           s,^.*$,seen_ltdl=:,
-           p
-       }
-       /AC_LIB_LTDL/        {
-           s,^.*$,seen_ltdl=:,
-           p
-       }
-       /AC_WITH_LTDL/       {
-           s,^.*$,seen_ltdl=:,
-           p
-       }
-       d'
-    eval `cat aclocal.m4 "$configure_ac" 2>/dev/null | $SED "$my_sed_traces"`
 
+# func_extract_trace macro_name [filename ...]
+# set `$func_extract_trace_result' to a colon delimited list of arguments
+# to MACRO_NAME in FILENAME. If no FILENAME is given, then
+# `configure.ac' is assumed.
+func_extract_trace ()
+{
+    $opt_debug
 
-    # ----------------- #
-    # Validate ltdldir. #
-    # ----------------- #
-
-    ac_ltdldir=`$ECHO "$ac_ltdldir" | $SED 's,/*$,,'`
-
-    # If $configure_ac contains AC_CONFIG_LTDL_DIR, check that its
-    # arguments were not given in terms of a shell variable!
-    case "$ac_ltdldir" in
-      *\$*)
-        func_fatal_error "can not handle variables in LT_CONFIG_LTDL_DIR"
-        ;;
-    esac
-
-    # If neither --ltdl nor LT_CONFIG_LTDL_DIR are specified, default to
-    # `libltdl'.  If both are specified, they must be the same.  Otherwise,
-    # take the one that is given! (If LT_CONFIG_LTDL_DIR is not specified
-    # we suggest adding it later in this code.)
-    case x$ac_ltdldir,x$ltdldir in
-      x,x)     ltdldir=libltdl         ;;
-      x*,x)    ltdldir=$ac_ltdldir     ;;
-      x,x*)    ltdldir=$ltdldir        ;;
-      *)
-        test x"$ac_ltdldir" = x"$ltdldir" || \
-           func_fatal_error "--ltdl='$ltdldir' does not match 
LT_CONFIG_LTDL_DIR($ac_ltdldir)"
-       ;;
-    esac
-
-
-    # ------------------- #
-    # Validate ltdl_mode. #
-    # ------------------- #
-
-    test -n "$ltdl_options" && seen_ltdl=:
-
-    # If $configure_ac contains LTDL_INIT, check that its
-    # arguments were not given in terms of a shell variable!
-    case "$ltdl_options" in
-      *\$*)
-        func_fatal_error "can not handle variables in LTDL_INIT"
-        ;;
-    esac
-
-    # Extract mode name from ltdl_options
-    # FIXME: Diagnose multiple conflicting modes in ltdl_options
-    ac_ltdl_mode=
-    case " $ltdl_options " in
-      *" nonrecursive "*)  ac_ltdl_mode=nonrecursive   ;;
-      *" recursive "*)     ac_ltdl_mode=recursive      ;;
-      *" subproject "*)    ac_ltdl_mode=subproject     ;;
-    esac
-
-    # If neither --ltdl nor an LTDL_INIT mode 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 
LTDL_INIT($ac_ltdl_mode)"
-       ;;
-    esac
-
-    # ----------------- #
-    # Validate aux_dir. #
-    # ----------------- #
-
-    if test -n "$ac_aux_dir"; then
-      # If $configure_ac contains AC_CONFIG_AUX_DIR, check that it was
-      # not given in terms of a shell variable!
-      case "$ac_aux_dir" in
-      *\$*)
-        func_fatal_error "can not handle variables in AC_CONFIG_AUX_DIR"
-        ;;
-      *)
-       aux_dir=$ac_aux_dir
-       ;;
-      esac
-    else
-      # Try to discover aux_dir the same way it is discovered by configure.
-      # Note that we default to the current directory.
-      for dir in . .. ../..; do
-        if test -f "$dir/install-sh"; then
-          aux_dir=$dir
-          break
-        elif test -f "$dir/install.sh"; then
-          aux_dir="$dir"
-          break
-        fi
-      done
-    fi
-
-    # Just use the current directory if all else fails.
-    test -n "$aux_dir" || aux_dir=.
-
-
-    # ------------------------------ #
-    # Find local m4 macro directory. #
-    # ------------------------------ #
-
-    # Hunt for ACLOCAL_AMFLAGS in `Makefile.am' for a `-I' argument.
-
-    my_sed_aclocal_flags='
-        /^[     ]*ACLOCAL_[A-Z_]*FLAGS[         ]*=[    ]*/ {
-           s,,,
-           q
-       }
-       d'
-    if test -f Makefile.am; then
-      my_macro_dir_is_next=false
-      for arg in `$SED "$my_sed_aclocal_flags" Makefile.am`; do
-        if $my_macro_dir_is_next; then
-          am_macro_dir="$arg"
-          break
-        else
-         case $arg in
-           -I) my_macro_dir_is_next=: ;;
-           -I*)
-             am_macro_dir=`$ECHO "$arg" | sed 's,^-I,,'`
-             break
-             ;;
-           *) my_macro_dir_is_next=false ;;
-         esac
-        fi
-      done
+    if test 1 -eq $#; then
+      test -n "$configure_ac" || return
+      set dummy "$@" "$configure_ac"; shift
     fi
 
-    macro_dir="$ac_macro_dir"
-    test -z "$macro_dir" && macro_dir="$am_macro_dir"
-
-    if test -n "$am_macro_dir" && test -n "$ac_macro_dir"; then
-      test "$am_macro_dir" = "$ac_macro_dir" \
-        || func_fatal_error "AC_CONFIG_MACRO_DIR([$ac_macro_dir]) conflicts 
with ACLOCAL_AMFLAGS=-I $am_macro_dir."
-    fi
+    func_extract_trace_result=`$extract_trace ${1+"$@"}`
 }
 
+
 # func_included_files searchfile
 # Output INCLUDEFILE if SEARCHFILE m4_includes it, else output SEARCHFILE.
 func_included_files ()
@@ -717,6 +500,9 @@ func_serial_update_check ()
 {
     $debug_cmd
 
+    $require_ac_ltdl_dir
+    $require_ac_macro_dir
+
     my_srcfile="$1"
     my_src_serial="$2"
     my_destfile="$3"
@@ -738,7 +524,7 @@ func_serial_update_check ()
 
       if test "X$my_dest_serial" = "X$func_serial_max_result"; then
         func_verbose "\`$my_srcfile' is serial $my_src_serial, less than 
$my_dest_serial in \`$my_destfile'"
-       $opt_force || if test -n "$ac_macro_dir$ac_ltdldir"; then
+       $opt_force || if test -n "$ac_macro_dir$ac_ltdl_dir"; then
            func_error "\`$my_destfile' is newer: use \`--force' to overwrite"
         fi
       fi
@@ -1016,6 +802,8 @@ func_install_pkgmacro_subproject ()
 {
     $debug_cmd
 
+    $require_macro_dir
+
     # Remove any lingering files that my have been installed by some
     # previous libtoolize release:
     $opt_force && for file in $all_pkgmacro_files; do
@@ -1044,6 +832,9 @@ func_install_pkgmacro_parent ()
 {
     $debug_cmd
 
+    $require_ac_macro_dir
+    $require_macro_dir
+
     # Remove any lingering files that my have been installed by some
     # previous libtoolize release:
     $opt_force && for file in $all_pkgmacro_files; do
@@ -1055,7 +846,7 @@ func_install_pkgmacro_parent ()
     # user specified a macro_dir.
     $opt_quiet || if test -n "$ac_macro_dir"; then
       my_pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, 
\`$ac_macro_dir'."
-    elif test -n "$macro_dir"; then
+    else
       my_pkgmacro_header="putting macros in \`$macro_dir'."
     fi
 
@@ -1093,14 +884,22 @@ func_install_pkgmacro_files ()
 {
     $debug_cmd
 
+    $require_ac_macro_dir
+    $require_am_macro_dir
+    $require_configure_ac
+    $require_ltdl_mode
+    $require_macro_dir
+
     # argz.m4, libtool.m4 and ltdl.m4 are handled specially:
     func_massage_aclocal_DATA 'argz.m4|libtool.m4|ltdl.m4'
 
   # 1. Parent has separate macro_dir to subproject ltdl:
     if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" &&
-       test -n "$macro_dir" && test "x$macro_dir" != "x$subproject_macro_dir"
+       test "x$macro_dir" != "x$subproject_macro_dir"
     then
-      func_install_pkgmacro_parent
+      # No point installing configure macros in the parent project when
+      # there's no $configure_ac to use them.
+      test -f "$configure_ac" && func_install_pkgmacro_parent
       func_install_pkgmacro_subproject
 
   # 2. Parent shares macro_dir with subproject ltdl:
@@ -1110,7 +909,7 @@ func_install_pkgmacro_files ()
       func_install_pkgmacro_subproject
 
   # 3. Not a subproject, but macro_dir was specified in parent:
-    elif test -n "$macro_dir"; then
+    elif test -n "$ac_macro_dir$am_macro_dir"; then
       func_install_pkgmacro_parent
 
   # 4. AC_CONFIG_MACRO_DIR was not specified:
@@ -1166,19 +965,23 @@ func_install_pkgltdl_files ()
 
     $opt_ltdl || return
 
+    $require_ac_ltdl_dir
+    $require_ltdl_dir
+    $require_ltdl_mode
+
     # Remove any lingering files that my have been installed by some
     # previous libtoolize release:
     $opt_force && for file in $all_pkgltdl_files; do
-      test -f "$ltdldir/$file" && func_verbose "rm -f '$ltdldir/$file'"
-      rm -f "$ltdldir/$file"
+      test -f "$ltdl_dir/$file" && func_verbose "rm -f '$ltdl_dir/$file'"
+      rm -f "$ltdl_dir/$file"
     done
 
     # Copy all the files from installed libltdl to this project, if the
     # user specified `--ltdl'.
-    $opt_quiet || if test -n "$ac_ltdldir"; then
-      pkgltdl_header="putting libltdl files in LT_CONFIG_LTDL_DIR, 
\`$ac_ltdldir'."
-    elif test -n "$ltdldir"; then
-      pkgltdl_header="putting libltdl files in \`$ltdldir'."
+    $opt_quiet || if test -n "$ac_ltdl_dir"; then
+      pkgltdl_header="putting libltdl files in LT_CONFIG_LTDL_DIR, 
\`$ac_ltdl_dir'."
+    else
+      pkgltdl_header="putting libltdl files in \`$ltdl_dir'."
     fi
 
     # These files are handled specially, depending on ltdl_mode:
@@ -1189,15 +992,15 @@ func_install_pkgltdl_files ()
     fi
 
     func_copy_some_files "$pkgltdl_files" \
-      "$pkgltdldir/libltdl" "$ltdldir" pkgltdl_header
+      "$pkgltdldir/libltdl" "$ltdl_dir" pkgltdl_header
 
     # For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
     case $ltdl_mode in
       recursive)
-        func_fixup_Makefile "Makefile.am" "$pkgltdldir/libltdl" "$ltdldir"
+        func_fixup_Makefile "Makefile.am" "$pkgltdldir/libltdl" "$ltdl_dir"
         ;;
       nonrecursive)
-        func_fixup_Makefile "Makefile.inc" "$pkgltdldir/libltdl" "$ltdldir"
+        func_fixup_Makefile "Makefile.inc" "$pkgltdldir/libltdl" "$ltdl_dir"
         ;;
     esac
 }
@@ -1243,6 +1046,10 @@ func_install_pkgconfig_subproject ()
 {
     $debug_cmd
 
+    $require_ac_aux_dir
+    $require_aux_dir
+    $require_ltdl_dir
+
     # Remove any lingering files that my have been installed by some
     # previous libtoolize release:
     $opt_force && for file in $all_pkgconfig_files; do
@@ -1254,12 +1061,14 @@ func_install_pkgconfig_subproject ()
     # user specified an aux_dir.
     $opt_quiet || if test "x$ac_aux_dir" = "x$subproject_aux_dir"; then
       pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$subproject_aux_dir'."
-    elif test -n "$aux_dir"; then
+    elif test -n "$ac_aux_dir"; then
       pkgconfig_header="putting auxiliary files in \`$aux_dir'."
+    else
+      pkgconfig_header="putting auxiliary files in \`$subproject_aux_dir'."
     fi
 
     func_copy_some_files "$pkgconfig_files" \
-      "$pkgdatadir" "$ltdldir" pkgconfig_header
+      "$pkgdatadir" "$ltdl_dir" pkgconfig_header
 }
 
 
@@ -1271,6 +1080,9 @@ func_install_pkgconfig_parent ()
 {
     $debug_cmd
 
+    $require_ac_aux_dir
+    $require_aux_dir
+
     # Remove any lingering files that my have been installed by some
     # previous libtoolize release:
     $opt_force && for file in $all_pkgconfig_files; do
@@ -1280,7 +1092,7 @@ func_install_pkgconfig_parent ()
 
     if test -n "$ac_aux_dir"; then
       pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, 
\`$ac_aux_dir'."
-    elif test -n "$aux_dir" || test "x$ltdldir" = "x."; then
+    else
       pkgconfig_header="putting auxiliary files in \`$aux_dir'."
     fi
 
@@ -1305,11 +1117,15 @@ func_install_pkgconfig_files ()
 {
     $debug_cmd
 
+    $require_aux_dir
+    $require_configure_ac
+    $require_ltdl_mode
+
     func_massage_pkgconfig_files
 
   # 1. Parent shares aux_dir with subproject ltdl:
     if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" &&
-       test "x$ac_aux_dir" = "x$subproject_aux_dir"
+       test "x$aux_dir" = "x$subproject_aux_dir"
     then
       func_install_pkgconfig_subproject
 
@@ -1317,7 +1133,7 @@ func_install_pkgconfig_files ()
     elif $opt_ltdl && test "x$ltdl_mode" = "xsubproject"
        # && test "x$aux_dir" != "x$subproject_aux_dir" is implied
     then
-      if $seen_autoconf; then
+      if test -n "$configure_ac"; then
        func_install_pkgconfig_parent
       fi
       func_install_pkgconfig_subproject
@@ -1359,12 +1175,23 @@ func_check_macros ()
 {
     $debug_cmd
 
+    $require_ac_ltdl_dir
+    $require_ac_macro_dir
+    $require_am_macro_dir
+    $require_aux_dir
+    $require_configure_ac
+    $require_ltdl_dir
+    $require_ltdl_mode
+    $require_macro_dir
+    $require_seen_ltdl
+    $require_seen_libtool
+
     $opt_quiet && return
-    $seen_autoconf || return
+    test -n "$configure_ac" || return
 
     ac_config_macro_dir_advised=false
 
-    if test -n "$ac_macro_dir$ltdldir" && test -z "$macro_dir"; then
+    if test -n "$ac_macro_dir$ltdl_dir" && test -z 
"$ac_macro_dir$am_macro_dir"; then
       my_ac_config_macro_srcdir="$aclocaldir"
       if $opt_ltdl && test "$macro_dir" != "$subproject_macro_dir"; then
        my_ac_config_macro_srcdir="$subproject_macro_dir"
@@ -1416,8 +1243,8 @@ func_check_macros ()
 
     if $opt_ltdl; then
       # Remind the user to call LT_CONFIG_LTDL_DIR:
-      test -n "$ac_ltdldir" ||
-        func_echo "Remember to add \`LT_CONFIG_LTDL_DIR([$ltdldir])' to 
\`$configure_ac'."
+      test -n "$ac_ltdl_dir" ||
+        func_echo "Remember to add \`LT_CONFIG_LTDL_DIR([$ltdl_dir])' to 
\`$configure_ac'."
 
       # For subproject mode, offer some suggestions for avoiding duplicate
       # files in a project that uses libltdl:
@@ -1436,13 +1263,13 @@ func_check_macros ()
       func_echo "rerunning $progname, to keep the correct libtool macros 
in-tree."
       ac_config_macro_dir_advised=:
 
-    elif test -z "$ac_macro_dir$ltdldir"; then
+    elif test -z "$ac_macro_dir"; then
       func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([$macro_dir])' to 
$configure_ac,"
       func_echo "and rerunning $progname and aclocal."
       ac_config_macro_dir_advised=:
     fi
 
-    if test -z "$am_macro_dir$macro_dir"; then
+    if test -z "$am_macro_dir$ac_macro_dir"; then
       func_echo "Consider adding \`-I m4' to ACLOCAL_AMFLAGS in Makefile.am."
 
     elif test -z "$am_macro_dir"; then
@@ -1462,6 +1289,412 @@ func_check_macros ()
 }
 
 
+
+## ------------------##
+## Helper functions. ##
+## ------------------##
+
+# This section contains the helper functions used by the rest of
+# this script.
+
+
+# func_autoconf_configure MAYBE-CONFIGURE-FILE
+# ------------------------------------------
+# Ensure that MAYBE-CONFIGURE-FILE is the name of a file in the current
+# directory which contains an uncommented call to AC_INIT.
+func_autoconf_configure ()
+{
+    $debug_cmd
+
+    _G_sed_no_comment='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;'
+    _G_ac_init=
+
+    # If we were passed a genuine file, make sure it calls AC_INIT.
+    test -f "$1" \
+      && _G_ac_init=`$SED "$_G_sed_no_comment" "$1" |grep AC_INIT`
+
+    # Otherwise it is not a genuine Autoconf input file.
+    test -n "$_G_ac_init"
+    _G_status=$?
+
+    test "$_G_status" -ne 0 \
+      && func_verbose "\`$1' not using Autoconf"
+
+    (exit $_G_status)
+}
+
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files.  Where a variable already has a non-
+# empty value (as set by the package's `bootstrap.conf'), that value is
+# used in preference to deriving the default. Call them using their
+# associated `require_*' variable to ensure that they are executed, at
+# most, once.
+
+
+# require_ac_aux_dir
+# ------------------
+# Extract ac_aux_dir from AC_CONFIG_AUX_DIR.
+require_ac_aux_dir=func_require_ac_aux_dir
+func_require_ac_aux_dir ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace AC_CONFIG_AUX_DIR
+      ac_aux_dir=$func_extract_trace_result
+
+      case $ac_aux_dir in
+        *\$*)
+          func_fatal_error "\
+can not expand unknown variable in AC_CONFIG_AUX_DIR argument."
+          ;;
+      esac
+    fi
+
+    require_ac_aux_dir=:
+}
+
+
+# require_ac_ltdl_dir
+# -------------------
+# Extract ac_ltdl_dir from LT_CONFIG_LTDL_DIR.
+require_ac_ltdl_dir=func_require_ac_ltdl_dir
+func_require_ac_ltdl_dir ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace LT_CONFIG_LTDL_DIR
+      ac_ltdl_dir=`expr "$func_extract_trace_result" : '\([^:]*\)'`
+
+      case $ac_ltdl_dir in
+        *\$*)
+          func_fatal_error "\
+can not expand unknown variable in LT_CONFIG_LTDL_DIR argument."
+          ;;
+      esac
+    fi
+
+    # Strip trailing slashes.
+    ac_ltdl_dir=`echo "$ac_ltdl_dir" |$SED 's,/*$,,'`
+
+    require_ac_ltdl_dir=:
+}
+
+
+# require_ac_ltdl_mode
+# --------------------
+# Extract mode name from LTDL_INIT options.
+require_ac_ltdl_mode=func_require_ac_ltdl_mode
+func_require_ac_ltdl_mode ()
+{
+    $debug_cmd
+
+    $require_ac_ltdl_options
+
+    case " $ac_ltdl_options " in
+      *" nonrecursive "*) ac_ltdl_mode=nonrecursive ;;
+      *" recursive "*)    ac_ltdl_mode=recursive    ;;
+      *" subproject "*)   ac_ltdl_mode=subproject   ;;
+    esac
+      
+    require_ac_ltdl_mode=:
+}
+
+
+# require_ac_ltdl_options
+# -----------------------
+# Extract ac_ltdl_options from LTDL_INIT.
+require_ac_ltdl_options=func_require_ac_ltdl_options
+func_require_ac_ltdl_options ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace LTDL_INIT
+      ac_ltdl_options=$func_extract_trace_result
+
+      case $ac_ltdl_options in
+        *\$*)
+          func_fatal_error "\
+can not expand unknown variable in LTDL_INIT argument."
+          ;;
+      esac
+    fi
+
+    require_ac_ltdl_mode=:
+}
+
+
+# require_ac_macro_dir
+# --------------------
+# Extract ac_macro_dir from AC_CONFIG_MACRO_DIR.
+require_ac_macro_dir=func_require_ac_macro_dir
+func_require_ac_macro_dir ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace AC_CONFIG_MACRO_DIR
+      ac_macro_dir=$func_extract_trace_result
+    fi
+
+    require_ac_macro_dir=:
+}
+
+
+# require_aclocal_amflags
+# -----------------------
+# Extract `$aclocal_amflags' from `Makefile.am' if present.
+require_aclocal_amflags=func_require_aclocal_amflags
+func_require_aclocal_amflags ()
+{
+    $debug_cmd
+
+    $require_makefile_am
+
+    test -n "$makefile_am" && {
+      _G_sed_extract_aclocal_amflags='s|#.*$||
+        /^[     ]*ACLOCAL_AMFLAGS[      ]*=/ {
+            s|^.*=[     ]*\(.*\)|aclocal_amflags="\1"|
+            p
+        }'
+
+      _G_aclocal_flags_cmd=`$SED -n "$_G_sed_extract_aclocal_amflags" \
+          "$makefile_am"`
+      eval "$_G_aclocal_flags_cmd"
+
+      func_verbose "ACLOCAL_AMFLAGS='$aclocal_amflags'"
+    }
+
+    require_aclocal_amflags=:
+}
+
+
+# require_am_macro_dir
+# --------------------
+# Set am_macro_dir to the first directory specified in ACLOCAL_AMFLAGS.
+require_am_macro_dir=func_require_am_macro_dir
+func_require_am_macro_dir ()
+{
+    $debug_cmd
+
+    $require_aclocal_amflags
+
+    _G_minus_I_seen=false
+    for _G_arg in $aclocal_amflags; do
+      case $_G_minus_I_seen,$_G_arg in
+        :,*)   am_macro_dir=$_G_arg; break ;;
+        *,-I)  _G_minus_I_seen=: ;;
+        *,-I*) am_macro_dir=`expr x$_G_opt : 'x-I\(.*\)$'`; break ;;
+      esac
+    done
+
+    require_am_macro_dir=:
+}
+
+
+# require_aux_dir
+# ---------------
+# Set aux_dir according to AC_CONFIG_AUX_DIR or else use the same
+# heuristics as Autoconf to intuit an appropriate setting.
+require_aux_dir=func_require_aux_dir
+func_require_aux_dir ()
+{
+    $debug_cmd
+
+    $require_ac_aux_dir
+
+    test -n "$aux_dir" || aux_dir=$ac_aux_dir
+    test -n "$aux_dir" || {
+      # Try to intuit aux_dir using the same heuristic as Autoconf.
+      for _G_dir in . .. ../..; do
+        if test -f "$_G_dir/install-sh" || test -f "$_G_dir/install.sh"
+        then
+          aux_dir=$_G_dir
+          break
+        fi
+      done
+    }
+
+    # Use the current directory if all else fails.
+    test -n "$aux_dir" || aux_dir=.
+
+    require_aux_dir=:
+}
+
+
+# require_configure_ac
+# --------------------
+# Ensure that there is a `configure.ac' or `configure.in' file in the
+# current directory, and that `$configure_ac' contains its name.
+require_configure_ac=func_require_configure_ac
+func_require_configure_ac ()
+{
+    $debug_cmd
+
+    test -z "$configure_ac" \
+      && func_autoconf_configure configure.ac && configure_ac=configure.ac
+    test -z "$configure_ac" \
+      && func_autoconf_configure configure.in && configure_ac=configure.in
+    test -z "$configure_ac" \
+      || func_verbose "found \`$configure_ac'"
+
+    require_configure_ac=:
+}
+
+
+# require_ltdl_dir
+# ----------------
+# If both are specified, ensure both --ltdl=LTDL_DIR and
+# LT_CONFIG_LTDL_DIR agree, and set ltdl_dir to the value of either.
+require_ltdl_dir=func_require_ltdl_dir
+func_require_ltdl_dir ()
+{
+    $debug_cmd
+
+    $require_ac_ltdl_dir
+
+    test -n "$ltdl_dir" || ltdl_dir=$ac_ltdl_dir
+    test -n "$ltdl_dir" || ltdl_dir=libltdl
+
+    if test -n "$ac_ltdl_dir"; then
+      test "$ac_ltdl_dir" = "$ltdl_dir" || func_fatal_error "\
+--ltdl='$ltdl_dir' does not match LT_CONFIG_LTDL_DIR($ac_ltdl_dir)"
+    fi
+
+    require_ltdl_dir=:
+}
+
+
+# require_ltdl_mode
+# -----------------
+# If both are specified, ensure both command line setting and LTDL_INIT
+# option agree, and set ltdl_mode to the value of either.
+require_ltdl_mode=func_require_ltdl_mode
+func_require_ltdl_mode ()
+{
+    $debug_cmd
+
+    $require_ac_ltdl_mode
+
+    test -n "$ltdl_mode" || ltdl_mode=$ac_ltdl_mode
+    test -n "$ltdl_mode" || ltdl_mode=subproject
+
+    if test -n "$ac_ltdl_mode"; then
+      test "$ac_ltdl_mode" = "$ltdl_mode" || func_fatal_error "\
+--$ltdl_mode does not match LTDL_INIT($ac_ltdl_mode)"
+    fi
+
+    require_ltdl_mode=:
+}
+
+
+# require_macro_dir
+# -----------------
+# If both are specified, ensure both ACLOCAL_AMFLAGS and
+# AC_CONFIG_MACRO_DIR agree, and set macro_dir to the value of either.
+require_macro_dir=func_require_macro_dir
+func_require_macro_dir ()
+{
+    $debug_cmd
+
+    $require_ac_macro_dir
+    $require_am_macro_dir
+
+    macro_dir=$ac_macro_dir
+    test -n "$macro_dir" || macro_dir=$am_macro_dir
+    test -n "$macro_dir" || macro_dir=m4
+
+    if test -n "$ac_macro_dir" && test -n "$am_macro_dir"; then
+      test "$ac_macro_dir" = "$am_macro_dir" || func_fatal_error "\
+AC_CONFIG_MACRO_DIR([$ac_macro_dir]) conflicts with ACLOCAL_AMFLAGS=-I 
$am_macro_dir."
+    fi
+
+    require_macro_dir=:
+}
+
+
+# require_makefile_am
+# -------------------
+# If not already set, set makefile_am to `Makefile.am' if that file is
+# present in the current directory.
+require_makefile_am=func_require_makefile_am
+func_require_makefile_am ()
+{
+    $debug_cmd
+
+    test -n "$makefile_am" || makefile_am=Makefile.am
+
+    if test -f Makefile.am; then
+      func_verbose "found \`$makefile_am'"
+    else
+      makefile_am=
+    fi
+
+    require_makefile_am=:
+}
+
+
+# require_seen_ltdl
+# -----------------
+# Determine from contents of $configure_ac whether this project contains
+# libltdl.
+require_seen_ltdl=func_require_seen_ltdl
+func_require_seen_ltdl ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace AC_LIB_LTDL,AC_WITH_LTDL,LT_WITH_LTDL,LTDL_INIT
+      test -n "$func_extract_trace_result" && seen_ltdl=:
+    fi
+    test -n "$seen_ltdl" || seen_ltdl=false
+
+    require_seen_ltdl=:
+}
+
+
+# require_seen_libtool
+# --------------------
+# Determine from contents of $configure_ac whether this project is using
+# Libtool to compile (some of) its objects.
+require_seen_libtool=func_require_seen_libtool
+func_require_seen_libtool ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace AM_PROG_LIBTOOL,AC_PROG_LIBTOOL,LT_INIT
+      test -n "$func_extract_trace_result" && seen_libtool=:
+    fi
+    test -n "$seen_libtool" || seen_libtool=false
+
+    require_seen_libtool=:
+}
+
+
+
 ## ----------- ##
 ##    Main.    ##
 ## ----------- ##
@@ -1482,13 +1715,6 @@ func_check_macros ()
   address@hidden@
   address@hidden@
   address@hidden@
-  aux_dir=
-  macro_dir=
-  configure_ac=configure.in
-
-  seen_autoconf=false
-  seen_libtool=false
-  seen_ltdl=false
 
   # test EBCDIC or ASCII
   case `echo X|tr X '\101'` in
@@ -1513,11 +1739,12 @@ func_check_macros ()
   func_nonemptydir_p pkgdatadir
   func_nonemptydir_p aclocaldir
 
-  func_scan_files
+  extract_trace=$pkgdatadir/config/extract-trace
 
-  case $ltdldir in
+  $require_ltdl_dir
+  case $ltdl_dir in
   .) ltdlprefix= ;;
-  *) ltdlprefix=$ltdldir/ ;;
+  *) ltdlprefix=$ltdl_dir/ ;;
   esac
   subproject_aux_dir=${ltdlprefix}config
   subproject_macro_dir=${ltdlprefix}m4
@@ -1528,6 +1755,7 @@ func_check_macros ()
   # conditions, or that check will be impossible.   No need to clutter the
   # rest of the code with '$opt_ltdl || $seen_ltdl' though, because we CAN
   # safely set opt_ltdl to true if LTDL_INIT was seen:
+  $require_seen_ltdl
   $seen_ltdl && opt_ltdl=:
 
   func_install_pkgconfig_files
diff --git a/tests/libtoolize.at b/tests/libtoolize.at
index 541753b..77525f4 100644
--- a/tests/libtoolize.at
+++ b/tests/libtoolize.at
@@ -938,6 +938,78 @@ LT_AT_CHECK_LIBTOOLIZE([--copy --install], 0, expout)
 AT_CLEANUP
 
 
+## ------------------------------------------- ##
+## Create a working subproject without GNU M4. ##
+## ------------------------------------------- ##
+
+AT_SETUP([Subproject ltdl without GNU M4])
+
+AT_DATA(expout,
+[[libtoolize: putting auxiliary files in `ltdl/config'.
+libtoolize: linking file `ltdl/config/compile'
+libtoolize: linking file `ltdl/config/config.guess'
+libtoolize: linking file `ltdl/config/config.sub'
+libtoolize: linking file `ltdl/config/depcomp'
+libtoolize: linking file `ltdl/config/install-sh'
+libtoolize: linking file `ltdl/config/missing'
+libtoolize: linking file `ltdl/config/ltmain.sh'
+libtoolize: putting macros in `ltdl/m4'.
+libtoolize: linking file `ltdl/m4/argz.m4'
+libtoolize: linking file `ltdl/m4/libtool.m4'
+libtoolize: linking file `ltdl/m4/ltdl.m4'
+libtoolize: linking file `ltdl/m4/ltoptions.m4'
+libtoolize: linking file `ltdl/m4/ltsugar.m4'
+libtoolize: linking file `ltdl/m4/ltversion.m4'
+libtoolize: linking file `ltdl/m4/lt~obsolete.m4'
+libtoolize: putting libltdl files in `ltdl'.
+libtoolize: linking file `ltdl/COPYING.LIB'
+libtoolize: linking file `ltdl/README'
+libtoolize: linking file `ltdl/Makefile.am'
+libtoolize: linking file `ltdl/configure.ac'
+libtoolize: copying file `ltdl/aclocal.m4'
+libtoolize: linking file `ltdl/Makefile.in'
+libtoolize: linking file `ltdl/config-h.in'
+libtoolize: linking file `ltdl/configure'
+libtoolize: linking file `ltdl/argz_.h'
+libtoolize: linking file `ltdl/argz.c'
+libtoolize: linking file `ltdl/loaders/dld_link.c'
+libtoolize: linking file `ltdl/loaders/dlopen.c'
+libtoolize: linking file `ltdl/loaders/dyld.c'
+libtoolize: linking file `ltdl/loaders/load_add_on.c'
+libtoolize: linking file `ltdl/loaders/loadlibrary.c'
+libtoolize: linking file `ltdl/loaders/shl_load.c'
+libtoolize: linking file `ltdl/lt__dirent.c'
+libtoolize: linking file `ltdl/lt__strl.c'
+libtoolize: linking file `ltdl/libltdl/lt__alloc.h'
+libtoolize: linking file `ltdl/libltdl/lt__dirent.h'
+libtoolize: linking file `ltdl/libltdl/lt__glibc.h'
+libtoolize: linking file `ltdl/libltdl/lt__private.h'
+libtoolize: linking file `ltdl/libltdl/lt__strl.h'
+libtoolize: linking file `ltdl/libltdl/lt_dlloader.h'
+libtoolize: linking file `ltdl/libltdl/lt_error.h'
+libtoolize: linking file `ltdl/libltdl/lt_system.h'
+libtoolize: linking file `ltdl/libltdl/slist.h'
+libtoolize: linking file `ltdl/loaders/preopen.c'
+libtoolize: linking file `ltdl/lt__alloc.c'
+libtoolize: linking file `ltdl/lt_dlloader.c'
+libtoolize: linking file `ltdl/lt_error.c'
+libtoolize: linking file `ltdl/ltdl.c'
+libtoolize: linking file `ltdl/ltdl.h'
+libtoolize: linking file `ltdl/slist.c'
+]])
+
+AT_DATA([no-m4],
+[[#! /bin/sh
+echo 'error: do not call m4' >&2
+exit 1
+]])
+chmod a+x ./no-m4
+
+AT_CHECK([PATH=`pwd`:$PATH M4=`pwd`/no-m4 $LIBTOOLIZE --ltdl=ltdl], 0, expout)
+
+AT_CLEANUP
+
+
 ## --------------------------- ##
 ## Garbled LIBTOOLIZE_OPTIONS. ##
 ## --------------------------- ##


hooks/post-receive
-- 
GNU Libtool



reply via email to

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