summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2012-10-11 12:43:03 +0700
committerGary V. Vaughan <gary@gnu.org>2012-10-12 20:18:30 +0700
commitbbfb7d0580475e6bf907f913862cda474c7c50c7 (patch)
treef928535fd7fb7fd5b4c3a208a8af47b642626ee5
parent0a42997c6032b9550a009a271552e811bfbcc430 (diff)
downloadlibtool-bbfb7d0580475e6bf907f913862cda474c7c50c7.tar.gz
maint: remove m4sh support.
Now that the code base has coalesced around a single option parser, there's no need for the unused getopt.m4sh and support. * build-aux/getopt.m4sh, build-aux/general.m4sh, tests/getopt-m4sh.at: Remove. * Makefile.am (m4sh_dir, LT_M4SH, general_m4sh, getopt_m4sh) (sh_files): Remove. (TESTSUITE_AT): Remove tests/getopt-m4sh.at. (TESTS_ENVIRONMENT): Remove M4SH. * bootstrap.conf (libtool_build_prerequisites): Remove M4SH. * configure.ac (M4SH): Remove. * HACKING (Editing `.m4sh' Files): Remove and renumber following sections.
-rw-r--r--HACKING67
-rw-r--r--Makefile.am18
-rw-r--r--bootstrap.conf7
-rw-r--r--build-aux/general.m4sh743
-rw-r--r--build-aux/getopt.m4sh665
-rw-r--r--configure.ac5
-rw-r--r--tests/getopt-m4sh.at220
7 files changed, 19 insertions, 1706 deletions
diff --git a/HACKING b/HACKING
index ce155eea..1ff96087 100644
--- a/HACKING
+++ b/HACKING
@@ -153,50 +153,7 @@ and is not part of a release distribution.
and will be fixed in the `libtoolize --ltdl --(non)recursive' stage.
-7. Editing `.m4sh' Files
-========================
-
-* Use shell functions, but be careful not to assume local scope for
- variable names. Don't use `return', instead echo the result of a
- function and call it from within backquotes.
-
-* Function names should be prefixed `func_', the function header should
- look like this:
-
- # func_foo [ OPTIONS ]
- # Description of what func_foo does and returns.
- func_foo ()
- {
- $opt_debug
- # contents of func_foo ...
- }
-
- The `$opt_debug' is used to enable shell tracing (Korn shells reset
- this on function entry).
-
-* For functions that are called frequently, if you need to return a
- value, don't cause unneccessary forking of the shell using echo as
- described above; instead set the return value in a variable named
- after the called function with a suffix of `_result'. For example
- the function `func_quote_for_eval' stores its return value in the
- variable `$func_quote_for_eval_result'.
-
-* Although sh-indentation is set to 2 (by the `Local Variables:' block
- at the end of .m4sh files), the left margin of the body of shell
- functions should begin indented by 4 spaces.
-
-* Where there are large blocks of shell code with no m4 or m4sh
- expansions, put the entire block in an M4SH_VERBATIM call. This
- saves both on copy-and-paste errors, and needing to remember to
- internally double the m4 quoting characters:
-
- M4SH_VERBATIM([[
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- ...
- ]])
-
-
-8. Editing `.m4' Files
+7. Editing `.m4' Files
======================
* Be careful with both `echo' and `$ECHO'. As the latter may be one of
@@ -222,7 +179,7 @@ and is not part of a release distribution.
be updated in all newer versions.
-9. Abstraction layers in libltdl
+8. Abstraction layers in libltdl
=================================
* The libltdl API uses a layered approach to differentiate internal and
@@ -323,18 +280,18 @@ and is not part of a release distribution.
loading: preopen.c, dlopen.c etc.
-10. Licensing Rules
-===================
+9. Licensing Rules
+==================
GNU Libtool uses 3 different licenses for various of the files distributed
herein, with several variations on license text. It is important that
you use the correct license text in each new file added. Here are the
texts along with some notes on when each is appropriate. Appropriate
-commenting (shell, C etc) and decoration (m4sh etc) assumed throughout.
+commenting (shell, C etc) and decoration (m4 etc) assumed throughout.
-10.1. Notice preservation
+9.1. Notice preservation
Autoconf macros and files used to generate them need this license, along
with files such as HACKING, NEWS, README, README.alpha, TODO and
@@ -350,7 +307,7 @@ without warranty of any kind.
-10.2. GPL
+9.2. GPL
Everything else in the distribution has the following license text
unless there is good reason to use one of the other license texts
@@ -379,9 +336,9 @@ or obtained by writing to the Free Software Foundation, Inc.,
-10.3. GPL with self extracting version
+9.3. GPL with self extracting version
-Some of the sources built atop the getopt.m4sh framework use
+Some of the sources built atop the options-parser framework use
func_version() to extract their --version output from the copyright
block. Those files also need the --version copyright text paragraph as
follows:
@@ -413,9 +370,9 @@ or obtained by writing to the Free Software Foundation, Inc.,
-10.4. GPL with self extracting version and Libtool exception clause
+9.4. GPL with self extracting version and Libtool exception clause
-Although the libtool script is generated from `ltmain.m4sh' according
+Although the libtool script is generated from `ltmain.in' according
to the rules in the preceding subsection, it also needs the Libtool
exception clause so that it can be redistributed by other projects
that use libtool:
@@ -452,7 +409,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
-10.5. LGPL with Libtool exception clause
+9.5. LGPL with Libtool exception clause
Finally, not only is Libltdl is LGPLed, but it is routinely
redistributed inside projects that use it, so its sources need to use
diff --git a/Makefile.am b/Makefile.am
index f01837fe..176325cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,10 +43,6 @@ noinst_LTLIBRARIES =
lib_LTLIBRARIES =
EXTRA_LTLIBRARIES =
-m4sh_dir = $(aux_dir)
-
-LT_M4SH = $(M4SH) -B '$(srcdir)/$(m4sh_dir)'
-
# Using `cd' in backquotes may print the directory name, use this instead:
lt__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
@@ -58,10 +54,6 @@ rebuild = rebuild=:; revision=`$(lt__cd) $(srcdir) && $(git_version_gen) | sed '
# Bootstrap. #
# ---------- #
-general_m4sh = $(srcdir)/$(m4sh_dir)/general.m4sh
-getopt_m4sh = $(srcdir)/$(m4sh_dir)/getopt.m4sh
-
-sh_files = $(general_m4sh) $(getopt_m4sh)
build_scripts = $(srcdir)/$(aux_dir)/announce-gen \
$(srcdir)/$(aux_dir)/do-release-commit-and-tag \
$(srcdir)/$(aux_dir)/gendocs.sh \
@@ -72,7 +64,7 @@ build_scripts = $(srcdir)/$(aux_dir)/announce-gen \
$(srcdir)/$(aux_dir)/vc-list-files
EXTRA_DIST += bootstrap bootstrap.conf $(build_scripts) cfg.mk maint.mk \
- $(sh_files) GNUmakefile
+ GNUmakefile
CLEANFILES += libtool libtoolize
## If a file is named several times below, and especially if it
@@ -157,7 +149,7 @@ $(ltversion_m4): $(ltversion_in) $(dotversion)
## should make this rule depend on Makefile but that will break
## distcheck (at least) by rebuilding ltmain.sh in the source
## tree whenever config.status regenerates the Makefile.
-$(ltmain_sh): $(ltmain_in) $(sh_files) $(dotversion)
+$(ltmain_sh): $(ltmain_in) $(dotversion)
@$(rebuild); \
if test -f '$@'; then \
eval `'$(SED)' -n '/^package_revision=/p' '$@'`; \
@@ -220,9 +212,6 @@ bootstrap-deps-prep:
test -z '$(srcdir)' \
&& echo "ERROR: don't call $(MAKE) with srcdir unset." \
&& exit_cmd=exit; \
- test -z '$(M4SH)' \
- && echo "ERROR: don't call $(MAKE) with M4SH unset." \
- && exit_cmd=exit; \
test -z '$(PACKAGE)' \
&& echo "ERROR: don't call $(MAKE) with PACKAGE unset." \
&& exit_cmd=exit; \
@@ -621,7 +610,6 @@ testsuite = $(tests_dir)/testsuite
# The testsuite files are evaluated in the order given here.
TESTSUITE = tests/testsuite
TESTSUITE_AT = tests/testsuite.at \
- tests/getopt-m4sh.at \
tests/libtoolize.at \
tests/libtool.at \
tests/demo.at \
@@ -702,7 +690,7 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
AR="$(AR)" \
- M4SH="$(M4SH)" SED="$(SED)" STRIP="$(STRIP)" lt_INSTALL="$(INSTALL)" \
+ SED="$(SED)" STRIP="$(STRIP)" lt_INSTALL="$(INSTALL)" \
MANIFEST_TOOL="$(MANIFEST_TOOL)" \
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
diff --git a/bootstrap.conf b/bootstrap.conf
index 2ab7a77c..2c6101f7 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -211,10 +211,9 @@ libtool_build_prerequisites ()
func_echo "running: $MAKE bootstrap-deps ..."
$opt_dry_run || {
output=`$MAKE bootstrap-deps \
- M4SH="$AUTOM4TE --language=m4sh" PACKAGE="$package" \
- PACKAGE_BUGREPORT="$package_bugreport" PACKAGE_NAME="$package_name" \
- PACKAGE_URL="$package_url" SED="$SED" srcdir=. \
- VERSION="$package_version" 2>&1`
+ PACKAGE="$package" PACKAGE_BUGREPORT="$package_bugreport" \
+ PACKAGE_NAME="$package_name" PACKAGE_URL="$package_url" \
+ SED="$SED" srcdir=. VERSION="$package_version" 2>&1`
}
status=$?
diff --git a/build-aux/general.m4sh b/build-aux/general.m4sh
deleted file mode 100644
index d930acec..00000000
--- a/build-aux/general.m4sh
+++ /dev/null
@@ -1,743 +0,0 @@
-m4_divert_push([KILL]) -*- Autoconf -*-
-# general.m4sh -- general shell script boiler plate
-#
-# Copyright (C) 2004-2005, 2007-2008, 2010-2012 Free Software
-# Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool 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 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES 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 GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-m4_define([M4SH_VERBATIM], [$1])
-
-m4_ifndef([M4SH_IN_HEADER],
-[m4_define([M4SH_IN_HEADER],
-[m4_divert_text([HEADER-COPYRIGHT], [$1])])])
-
-m4_divert_pop([KILL])M4SH_IN_HEADER([dnl
-# 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
-])
-
-M4SH_VERBATIM([[
-: ${CP="cp -f"}
-test set = "${ECHO+set}" || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="@EGREP@"}
-: ${FGREP="@FGREP@"}
-: ${GREP="@GREP@"}
-: ${LN_S="@LN_S@"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SED="@SED@"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-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.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-dirname='s|/[^/]*$||'
-basename='s|^.*/||'
-
-
-# We should try to minimise forks, especially on Windows where they are
-# unreasonably slow, so skip the feature probes when bash or zsh are
-# being used:
-if test set = "${BASH_VERSION+set}$ZSH_VERSION"; then
- : ${lt_HAVE_ARITH_OP="yes"}
- : ${lt_HAVE_XSI_OPS="yes"}
- # The += operator was introduced in bash 3.1
- case $BASH_VERSION in
- [12].* | 3.0 | 3.0.*) ;;
- *) lt_HAVE_PLUSEQ_OP=yes ;;
- esac
-fi
-
-
-# lt_HAVE_PLUSEQ_OP
-# Can be empty, in which case the shell is probed, "yes" if += is useable
-# or anything else if += does not work.
-test -z "$lt_HAVE_PLUSEQ_OP" \
- && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
- && lt_HAVE_PLUSEQ_OP=yes
-
-if test yes = "$lt_HAVE_PLUSEQ_OP"; then
- # func_append var value
- # Append VALUE to the end of shell variable VAR.
- eval 'func_append ()
- {
- eval "$1+=\$2"
- }'
-
- # func_append_quoted var value
- # Quote VALUE and append to the end of shell variable VAR, separated
- # by a space.
- eval 'func_append_quoted ()
- {
- func_quote_for_eval "$2"
- eval "$1+=\\ \$func_quote_for_eval_result"
- }'
-else
- func_append ()
- {
- eval "$1=\$$1\$2"
- }
-
- func_append_quoted ()
- {
- func_quote_for_eval "$2"
- eval "$1=\$$1\\ \$func_quote_for_eval_result"
- }
-fi
-
-
-# lt_HAVE_ARITH_OP
-# Can be empty, in which case the shell is probed, "yes" if $((...)) is
-# useable or anything else if it does not work.
-test -z "$lt_HAVE_ARITH_OP" \
- && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
- && lt_HAVE_ARITH_OP=yes
-
-# func_arith arithmetic-term...
-if test yes = "$lt_HAVE_ARITH_OP"; then
- eval 'func_arith ()
- {
- func_arith_result=$(( $* ))
- }'
-else
- func_arith ()
- {
- func_arith_result=`expr "$@"`
- }
-fi
-
-
-# lt_HAVE_XSI_OPS
-# Can be empty, in which case the shell is probed, "yes" if XSI length
-# and matching operators are useable or anything else if they do not work.
-test -z "$lt_HAVE_XSI_OPS" \
- && (eval 'x=a/b/c;
- test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
- && lt_HAVE_XSI_OPS=yes
-
-
-# func_len string
-# STRING may not start with a hyphen.
-if test yes = "$lt_HAVE_XSI_OPS"; then
- eval 'func_len ()
- {
- func_len_result=${#1}
- }'
-else
- func_len ()
- {
- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
- }
-fi
-
-
-if test yes = "$lt_HAVE_XSI_OPS"; then
- # If this shell supports suffix pattern removal, then use it to avoid
- # forking. Hide the definitions single quotes in case the shell chokes
- # on unsupported syntax...
-
- _b='func_basename_result=${1##*/}'
- _d='case $1 in
- */*) func_dirname_result=${1%/*}$2 ;;
- * ) func_dirname_result=$3 ;;
- esac'
-
-else
- # ...otherwise fall back to using sed.
-
- _b='func_basename_result=`$ECHO "$1" |$SED "$basename"`'
- _d='func_dirname_result=`$ECHO "$1" |$SED "$dirname"`
- if test "X$func_dirname_result" = "X$1"; then
- func_dirname_result=$3
- else
- func_append func_dirname_result "$2"
- fi'
-fi
-
-
-# func_basename file
-eval 'func_basename ()
-{
- $debug_cmd
- '"$_b"'
-}'
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-eval 'func_dirname ()
-{
- $debug_cmd
- '"$_d"'
-}'
-
-# func_dirname_and_basename file append nondir_replacement perform
-# func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# For efficiency, we do not delegate to the functions above but instead
-# duplicate the functionality here.
-eval 'func_dirname_and_basename ()
-{
- $debug_cmd
- '"$_b"'
- '"$_d"'
-}'
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-if test yes = "$lt_HAVE_XSI_OPS"; then
- eval 'func_stripname ()
- {
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary variable first.
- func_stripname_result=$3
- func_stripname_result=${func_stripname_result#"$1"}
- func_stripname_result=${func_stripname_result%"$2"}
- }'
-else
- func_stripname ()
- {
- case $2 in
- .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;;
- *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;;
- esac
- }
-fi
-
-
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s|^/\([^/]*\).*$|\1|'
-pathcdr='s|^/[^/]*||'
-removedotparts=':dotsl
- s|/\./|/|g
- t dotsl
- s|/\.$|/|'
-collapseslashes='s|/\{1,\}|/|g'
-finalslash='s|/*$|/|'
-
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-# value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
- # Start from root dir and reassemble the path.
- func_normal_abspath_result=
- func_normal_abspath_tpath=$1
- func_normal_abspath_altnamespace=
- case $func_normal_abspath_tpath in
- "")
- # Empty path, that just means $cwd.
- func_stripname '' '/' "`pwd`"
- func_normal_abspath_result=$func_stripname_result
- return
- ;;
- # The next three entries are used to spot a run of precisely
- # two leading slashes without using negated character classes;
- # we take advantage of case's first-match behaviour.
- ///*)
- # Unusual form of absolute path, do nothing.
- ;;
- //*)
- # Not necessarily an ordinary path; POSIX reserves leading '//'
- # and for example Cygwin uses it to access remote file shares
- # over CIFS/SMB, so we conserve a leading double slash if found.
- func_normal_abspath_altnamespace=/
- ;;
- /*)
- # Absolute path, do nothing.
- ;;
- *)
- # Relative path, prepend $cwd.
- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
- ;;
- esac
- # Cancel out all the simple stuff to save iterations. We also want
- # the path to end with a slash for ease of parsing, so make sure
- # there is one (and only one) here.
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
- while :; do
- # Processed it all yet?
- if test / = "$func_normal_abspath_tpath"; then
- # If we ascended to the root using ".." the result may be empty now.
- if test -z "$func_normal_abspath_result"; then
- func_normal_abspath_result=/
- fi
- break
- fi
- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcar"`
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcdr"`
- # Figure out what to do with it
- case $func_normal_abspath_tcomponent in
- "")
- # Trailing empty path component, ignore it.
- ;;
- ..)
- # Parent dir; strip last assembled component from result.
- func_dirname "$func_normal_abspath_result"
- func_normal_abspath_result=$func_dirname_result
- ;;
- *)
- # Actual path component, append it.
- func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
- ;;
- esac
- done
- # Restore leading double-slash if one was found on entry.
- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR.
-# value returned in "$func_relative_path_result"
-func_relative_path ()
-{
- func_relative_path_result=
- func_normal_abspath "$1"
- func_relative_path_tlibdir=$func_normal_abspath_result
- func_normal_abspath "$2"
- func_relative_path_tbindir=$func_normal_abspath_result
-
- # Ascend the tree starting from libdir
- while :; do
- # check if we have found a prefix of bindir
- case $func_relative_path_tbindir in
- $func_relative_path_tlibdir)
- # found an exact match
- func_relative_path_tcancelled=
- break
- ;;
- $func_relative_path_tlibdir*)
- # found a matching prefix
- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
- func_relative_path_tcancelled=$func_stripname_result
- if test -z "$func_relative_path_result"; then
- func_relative_path_result=.
- fi
- break
- ;;
- *)
- func_dirname $func_relative_path_tlibdir
- func_relative_path_tlibdir=$func_dirname_result
- if test -z "$func_relative_path_tlibdir"; then
- # Have to descend all the way to the root!
- func_relative_path_result=../$func_relative_path_result
- func_relative_path_tcancelled=$func_relative_path_tbindir
- break
- fi
- func_relative_path_result=../$func_relative_path_result
- ;;
- esac
- done
-
- # Now calculate path; take care to avoid doubling-up slashes.
- func_stripname '' '/' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- func_stripname '/' '/' "$func_relative_path_tcancelled"
- if test -n "$func_stripname_result"; then
- func_append func_relative_path_result "/$func_stripname_result"
- fi
-
- # Normalisation. If bindir is libdir, return `.' else relative path.
- if test -n "$func_relative_path_result"; then
- func_stripname './' '' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- fi
-
- test -n "$func_relative_path_result" || func_relative_path_result=.
-}
-
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *[\\/]*)
- progdir=$func_dirname_result
- progdir=`cd "$progdir" && pwd`
- progpath=$progdir/$progname
- ;;
- *)
- save_IFS=$IFS
- IFS=${PATH_SEPARATOR-:}
- for progdir in $PATH; do
- IFS=$save_IFS
- test -x "$progdir/$progname" && break
- done
- IFS=$save_IFS
- test -n "$progdir" || progdir=`pwd`
- progpath=$progdir/$progname
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="$SED -e 1s/^X//"
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
-
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes. A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
- s/$bs4/&\\
-/g
- s/^$bs2$dollar/$bs&/
- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
- $opt_verbose && func_echo ${1+"$@"}
-
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
-}
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
-
- # bash bug again:
- :
-}
-
-# 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 ()
-{
- func_error ${1+"$@"}
- func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information." ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
- $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
- my_directory_path=$1
- my_dir_list=
-
- if test -n "$my_directory_path" && test : != "$opt_dry_run"; then
-
- # Protect directory names starting with `-'
- case $my_directory_path in
- -*) my_directory_path=./$my_directory_path ;;
- esac
-
- # While some portion of DIR does not yet exist...
- while test ! -d "$my_directory_path"; do
- # ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
- my_dir_list=$my_directory_path:$my_dir_list
-
- # If the last portion added has no slash in it, the list is done
- case $my_directory_path in */*) ;; *) break ;; esac
-
- # ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
- done
- my_dir_list=`$ECHO "$my_dir_list" | $SED 's|:*$||'`
-
- save_mkdir_p_IFS=$IFS; IFS=:
- for my_dir in $my_dir_list; do
- IFS=$save_mkdir_p_IFS
- # mkdir can fail with a `File exist' error if two processes
- # try to create one of the directories concurrently. Don't
- # stop in that case!
- $MKDIR "$my_dir" 2>/dev/null || :
- done
- IFS=$save_mkdir_p_IFS
-
- # Bail out if we (or some other process) failed to create a directory.
- test -d "$my_directory_path" || \
- func_fatal_error "Failed to create \`$1'"
- fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template=${TMPDIR-/tmp}/${1-$progname}
-
- if test : = "$opt_dry_run"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir=$my_template-$$
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "$my_template-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir=$my_template-${RANDOM-0}$$
-
- save_mktempdir_umask=`umask`
- umask 0077
- $MKDIR "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || \
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
- fi
-
- $ECHO "$my_tmpdir"
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG 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.
-func_quote_for_eval ()
-{
- case $1 in
- *[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result=$1 ;;
- esac
-
- case $func_quote_for_eval_unquoted_result 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.
- *[\@<:@\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*@:>@*|"")
- func_quote_for_eval_result=\"$func_quote_for_eval_unquoted_result\"
- ;;
- *)
- func_quote_for_eval_result=$func_quote_for_eval_unquoted_result
- esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- case $1 in
- *[\\\`\"]*)
- my_arg=`$ECHO "$1" | $SED \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- my_arg=$1 ;;
- esac
-
- case $my_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\@<:@\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*@:>@*|"")
- my_arg=\"$my_arg\"
- ;;
- esac
-
- func_quote_for_expand_result=$my_arg
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
- my_cmd=$1
- my_fail_exp=${2-':'}
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$my_cmd"
- my_status=$?
- if test 0 -eq "$my_status"; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it. Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
- my_cmd=$1
- my_fail_exp=${2-':'}
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$lt_user_locale
- $my_cmd"
- my_status=$?
- eval "$lt_safe_locale"
- if test 0 -eq "$my_status"; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result. All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
- case $1 in
- [0-9]* | *[!a-zA-Z0-9_]*)
- func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
- ;;
- * )
- func_tr_sh_result=$1
- ;;
- esac
-}
-]])
diff --git a/build-aux/getopt.m4sh b/build-aux/getopt.m4sh
deleted file mode 100644
index 3ba78a62..00000000
--- a/build-aux/getopt.m4sh
+++ /dev/null
@@ -1,665 +0,0 @@
-m4_include([general.m4sh])m4_divert_push([KILL]) -*- Autoconf -*-
-# getopt.m4sh -- getopt helper functions
-#
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool 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 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program or library that contains
-# a configuration script generated by Autoconf, you may include this
-# file under the same distribution terms that you use for the rest
-# of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES 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 GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# This file provides the M4SH_GETOPTS option processing compiler, and
-# all necessary support at the m4 and shell-script levels.
-#
-# An m4sh script can include this file, and an M4SH_GETOPTS invocation
-# that expands to a shell script option processing loop with similar
-# abilites to a C program the uses getopt_long() to process it's command
-# line options - although, unlike the C API, M4SH_GETOPTS also supplies
-# the loop to step through and process the options.
-#
-# See the comment above M4SH_GETOPTS, below, for details.
-
-
-# All internal macros begin with `m4go_'.
-m4_pattern_forbid([^_?m4go_])
-
-
-## --------------------------- ##
-## 1. Backwards compatibility. ##
-## --------------------------- ##
-
-# We prefer m4sugar.m4 from Autoconf-2.64, but have fallbacks in this
-# section that work back as far as Autoconf-2.62. This file is used
-# at bootstrap time to generate the shell processing loop for ltmain.sh
-# and libtoolize.in, so it's okay for the requirement to be tighter
-# than the configure time Autoconf prerequisite version.
-m4_version_prereq([2.62])
-
-# m4_chomp(STRING)
-# ----------------
-# m4_chomp was not introduced until Autoconf-2.64. Currently we
-# only use it indirectly via m4go_expand, below. This implementation
-# is taken from Autoconf-2.65.
-m4_ifndef([m4_chomp],
-[m4_define([m4_chomp],
-[m4_format([[%.*s]], m4_index(m4_translit([[$1]], [
-/.], [/ ])[./.], [/.]), [$1])])])
-
-# m4go_expand(ARG)
-# ----------------
-# M4SH_GETOPTS wants to pass unbalanced parentheses to m4_expand to
-# build the branches of a shell `case' statement. That is only
-# supported by the implementation of m4_expand in Autoconf-2.64 and
-# newer. Since we want to be compatible back to at least
-# Autoconf-2.62, reimplement our own 2.64 based m4_expand in the
-# m4go_ namespace so that we can be compatible with Autoconf versions
-# supporting either semantic.
-m4_define([m4go_expand],
-[m4_chomp(_$0([$1
-]))])
-
-m4_define([_m4go_expand], [$0_([$1], [(], -=<{($1)}>=-, [}>=-])])
-
-m4_define([_m4go_ignore])
-
-m4_define([_m4go_expand_],
-[m4_if([$4], [}>=-],
- [m4_changequote([-=<{$2], [)}>=-])$3m4_changequote([, ])],
- [$0([$1], [($2], -=<{($2$1)}>=-, [}>=-])_m4go_ignore$2])])
-
-
-## --------------------------------- ##
-## 2. Low level string manipulation. ##
-## --------------------------------- ##
-
-# m4go_slice(STRING, BEGIN, END)
-# ------------------------------
-# Just like m4_substr(), except that both the BEGIN and END of the
-# substring are given as offsets from the beginning of STRING, as
-# returned by m4_index().
-m4_define([m4go_slice],
-[m4_substr([$1], [$2], m4_eval([$3-$2]))])
-
-# m4go_trimn(STRING)
-# -------------------
-# Trim all leading and trailing newlines from STRING.
-#
-# Inspite of careful quoting, this macro is NOT robust to active
-# symbols:
-# | m4_define(active, ACTV)
-# | m4go_trimn([[
-# | start active finish
-# | ]])
-# => start ACTV fini
-# The interaction between index counting and macro expansion also
-# results in overtrimming in this example by 2 characters (the
-# difference between the lengths of `active' and `ACTV'). Translation
-# into French is just a coincidence.
-#
-# The implementation is surprisingly finicky: We use m4go_slice() to
-# extract the middle section of the string, while using m4_bregexp() to
-# return offset counts for the first and last non-newlines in STRING.
-# But there are a number of corner cases:
-# 1. Double quoted STRING works, (i.e m4go_trimn([[\nthe string\n]]. We
-# achieve that by transliterating quote characters as well as
-# newlines to the same character before counting off the offsets.
-# 2. This needs a slightly different transliteration for each
-# m4_bregexp() invocation, because we need to maintain balanced
-# quotes in the argument and we don't want to swallow leading ']' or
-# trailing '[' characters. So, we turn the quote we don't want to
-# strip into a harmless ' '.
-# 3. Because we're now effectively stripping the quotation with the
-# m4_translit() calls, embedded commas can fool m4_bregexp() into
-# thinking there are more arguments than we intended, so we turn
-# them into spaces too.
-# 4. Unbalanced parentheses would also confuse m4_bregexp(), so we also
-# turn them into spaces. The upshot of that if STRING contains a
-# macro invocation with arguments, it will be expanded in the result
-# as if no arguments had been passed.
-# 5. Comments are not ignored after stripping quote marks, so we have
-# to turn them off for the duration.
-# 6. Finally, we need to requote the result to account for the quotes
-# we probably stripped. m4_quote() doesn't handle commas well, so
-# we use m4go_expand() to requote without losing whitespace after
-# any embedded commas.
-m4_define([m4go_trimn],
-[m4_changecom()m4go_expand([m4go_slice([$1], m4_bregexp(m4_translit([$1],[
-[/,()]], [// ]), [[^/]]), m4_bregexp(m4_translit([$1], [
-[/,()]], [/ /]), [/*$]))])[]m4_changecom([#])])
-
-# m4go_untab(STRING)
-# ------------------
-# Trim leading TABs from each line of STRING.
-m4_define([m4go_untab],
-[m4_bpatsubst([$1], [^[ ]*], [])])
-
-# m4go_unindent(STRING)
-# ---------------------
-# Completely unindent STRING: Remove the leading TABs from each line of
-# STRING; trim leading newlines and trailing whitespace from STRING as
-# a whole.
-m4_define([m4go_unindent],
-[m4_ifval([$1], [m4go_untab([m4go_trimn([$1])])])])
-
-
-## ------------------------------ ##
-## 3. Option processing compiler. ##
-## ------------------------------ ##
-
-# Shell fragments are piecemeal added to these macros for each
-# invocation of m4go_option; eventually to be expanded into the compiled
-# option parsing shell script by M4SH_GETOPTS:
-
-m4_define([m4go_defaults], []) # initial shell option variable setings
-m4_define([m4go_branches], []) # case branches to process options
-
-# The initial entries in m4go_shortnoargs represent the (non-argument)
-# options that are always accepted by the expanded processing loop. We
-# also keep a list of short options that accept an option argument in
-# the macro `m4go_shortargs', but we use `m4_append([m4go_shortargs],
-# OPTION, [|])' to insert the separator pipe symbols - which requires
-# that `m4go_shortargs' be undefined if the first option appended is not
-# prefixed by a leading `|'.
-m4_define([m4go_shortnoargs], [-\?*|-h*])
-
-
-# M4SH_GETOPTS(SHORT-SPEC1, LONG-MATCH1, DEF1, INIT1,
-# SHORT-SPEC2, LONG-MATCH2, DEF2, INIT2, ... [VALIDATION])
-# ---------------------------------------------------------------------
-# Declare a series of command line options with one letter (`-m') or
-# long form `--message' formats, along with optional default values
-# incase a given option is not provided by the user when the script is
-# invoked, and validation code, for example to prevent specifying
-# mutually exclusive options or omitting required options.
-#
-# After this macro has been called, the value of each option is
-# available in a shell variable named `opt_' followed by the first part
-# (i.e. up to the first '|' symbol) of the LONG-MATCHn argument with the
-# leading `--` removed, and any further `-' converted to `_', or else if
-# no long form option was provided, simple `opt_' followed by the short
-# option letter. For example, the value supplied by the user as an
-# argument to an option `--gpg-key-id' will be available in the shell
-# variable $opt_gpg_key_id, `-c' with no long form option will be
-# available as $opt_c and so on. Where an option doesn't take an
-# argument, then the shell variable will be set to either `:' or `false'
-# depending on whether the user set that option on the script command
-# line - with one important exception: If the long form option name
-# begins with `--no-', and does not require an option argument, then the
-# variable name will be `opt_' followed by the rest of the option name
-# with the leading `no_' removed; and it's value will be `false' if
-# `--no-foo' was given on the command line, and `:' otherwise.
-#
-# Each option is declared by a set of 4 arguments as follows:
-#
-# SHORT-SPECn
-# The short option letter, if any, for the nth option followed by
-# any flags to denote special processing for this option. For
-# example, `f?@'. See below for a list of the supported flags and
-# their meaning. If you specify `h', `v' or `x', then the
-# automatic processing of those short options for `--help',
-# `--version' and `--debug' (resp.) will be overridden.
-# LONG-MATCHn
-# The long option list, including leading dashes for the nth
-# option. The value for this option is used directly as a shell
-# `case' branch to match the option, so you can specify multiple
-# matches. For example, `--message|--mes*|--msg'. If you specify
-# neither this argument nor a short option letter with
-# SHORT-SPECn, then invalid shell code will be generated.
-# DEFn If there is a default value for the nth option to take when it
-# is not given on the command line when the script is executed,
-# specify it here. Double quotes are added in the expanded shell
-# script, so it is safe to use shell variables. For example,
-# `$HOME/.foorc'.
-# INITn Any option specific initialisation for the nth option should be
-# specified in this argument. The shell code it contains is added
-# directly to the case branch that matches the nth option, after
-# the `opt_NAME' variable has been set, with the option argument
-# (if any) still left in `$1'. This allows neat tricks such as
-# injecting new arguments into the command line before the
-# processing loop terminates. For example:
-#
-# eval set dummy `cat $rcfile` ${1+"$@"}; shift
-#
-# Note that, because we look inside the content of INITn to
-# determine whether there are newlines to be stripped, double
-# quoting the whele thing doesn't work. Instead, you'll need to
-# quote active symbols yourself. Generally, you'll only need to
-# worry about $n and $@, although if you use symbols that can be
-# expanded by m4 you'll need to quote those too.
-# VALIDATION
-# The final argument, if any, should contain shell code to
-# validate correctness of the processed options. This code is
-# expanded after the option processing loop has exited, and before
-# the conditional script exit if errors have been found. Try to
-# show as many errors as possible before exiting the shell rather
-# than bailing out on the first error discovered so that the user
-# can correct all of them at once rather than just one between
-# each reinvocation of the script.
-#
-# In addition to an option short form letter (e.g. `m'), each
-# SHORT-SPECn argument can also list one or more of the following flags
-# to place additional constraints on that option (only one of `?', `+'
-# and `@' can be given in any SHORT-SPECn):
-#
-# =STRING
-# The option does not take an argument, but when specified on the
-# command line the `opt_' variable is set to STRING.
-# ? The option takes an optional argument. Unless the next command
-# line argument begins with a `-' it will be the value stored in
-# this option's `opt_' shell variable. Otherwise the `opt_'
-# variable will contain the INITn value.
-# ! The option requires an argument. The next command line argument
-# will be stored in this option's `opt_' shell variable, or else
-# the INITn value, if any, will be stored if this option is not
-# given on the command line.
-# ; The same as `!', except that when the argument is given multiple
-# times on the command line, each argument is appended to the
-# `opt_' shell variable, along with a new-line to separate it from
-# the previous argument.
-# + The same as `!', except that each time the argument is supplied
-# on the command line, it's value is stored in an `opt_' variable
-# with `_n' appended to the variable name - where `n' is `1' for
-# the first argument, `2, for the second and so on.
-# @ The option argument must point to an existing file. The
-# processing loop will automatically contain an additional check
-# to ensure that the named file exists. `@' can be added to a
-# SHORT-SPECn argument in addition to any other flags.
-# ^ The value stored in the `opt_' variable is quoted by passing it
-# through the shell function `func_quote_for_eval'.
-#
-# The M4SH_GETOPTS macro is implemented by first delegating to
-# `_M4SH_GETOPTS', a shift4-loop that repeatedly calls `m4go_options',
-# shifts away the 4 processed arguments, checks the number of remaining
-# args and loops again until only 1 argument (VALIDATION) or 0 arguments
-# (no VALIDATION code) remain. When all the processing is complete, we
-# expand 'm4go_printopts' to write out the complete command line
-# processing shell loop.
-#
-# Generally, you can combine the SHORT-SPECn flags in sensible ways,
-# but no error checking is done. If you choose a combination that makes
-# no sense, you'll probably end up with broken shell code.
-m4_define([M4SH_GETOPTS],
-[_$0($@)[]m4go_printopts])
-m4_define([_M4SH_GETOPTS],
-[m4_if([$#], 0, [],
- [$#], 1, [m4_define([m4go_validation],[$1])],
- [$#], 2, [m4_fatal([$0: too few arguments: $#: $2])],
- [$#], 3, [m4_fatal([$0: too few arguments: $#: $3])],
- [m4go_option($@)[]$0(m4_shiftn(4, $@))])])
-
-
-# m4go_option(SHORT-SPEC, LONG-MATCH, DEFAULT, INIT)
-# --------------------------------------------------
-# This macro is a wrapper for `_m4go_option', which first extracts the
-# short option letter (if any) from SHORT-SPEC, and then calculates the
-# full `opt_' shell variable name for this option before delegating
-# those results along with all of its own arguments to `_m4go_option'.
-#
-# Note that when the LONG-MATCH begins with `--no-', we add `~' to the
-# list of SHORT-SPEC flags before calling `_m4go_option' to denote that
-# the name of the `opt_' variable is reversed in the sense of the option
-# name itself.That is, we want to start with the option being true, and
-# set it to false if `--no-foo' is given on the command line.
-#
-# `m4_do' is used here to separate out the pushdef and popdef of the
-# temporary `_short' macro used to held the extracted short option
-# letter, if any.
-m4_define([m4go_option],
-[m4_do(
- [m4_pushdef([_short],
- m4_bmatch([$1],
- [[?!;+@^]], m4_bpatsubst([$1], [[?!;+@^]*], []),
- [^=], [],
- [.], [[$1]],
- []))],
- [_$0(opt_[]m4_ifval([$2],
- m4_translit(m4_bpatsubst([$2], [^--\(no-\)?\([^|]+\).*$],
- [\2]), -, _),
- _short),
- _short,
- [$1]m4_bmatch([$2], [^--no-], [~]),
- [$2],
- [$3],
- [$4])],
- [m4_popdef([_short])])])
-
-
-# _m4go_option(OPTION-NAME, SHORT-OPTION, SHORT-SPEC, LONG-MATCH,
-# DEFAULT, INIT)
-#----------------------------------------------------------------
-# For this option, append the appropriate shell code fragments to:
-# `m4go_defaults'
-# A shell script fragment containing `opt_' variable
-# initialisation according to DEFAULT, if necessary;
-# `m4go_branches'
-# The case branch to match any SHORT-OPTION or LONG-MATCH command
-# line option, along with any automatic processing implied by
-# SHORT-SPEC flags, and additional code from INIT;
-# `m4go_shortargs'
-# This match string accumulates all of the short options that
-# accept option arguments, so that we can generate some additional
-# code to split apart compacted option strings (`-xfoo' will be
-# treated as if `-x foo' had been passed) in `m4go_printopts'.
-# `m4go_shortnoargs'
-# Similarly, accumulate short options that do not take option
-# arguments, so that we can generate the code to split apart
-# compacted options strings in `m4go_printopts' (`-xfoo' will be
-# treated as if `-x -f -o -o' had been passed).
-#
-# The core of this macro switches the `m4go_branches' processing to an
-# appropriate macro depending on what flags are present in SHORT-SPEC.
-
-m4_define([_m4go_option],
-[m4_do(
- [m4_append([m4go_defaults],
- m4_bmatch([$3],
- [[?!;+@^]], [m4_ifval([$5], [m4_n([$1="$5"])])],
- [~], [m4_n([$1=:])],
- [m4_n([$1=false])]))],
- [m4_append([m4go_branches], [[]dnl (
- m4_join([|], [$4], m4_ifval([$2], [-$2])))
-])],
- [m4_append([m4go_branches],
- [m4_bmatch([$3], [[!+@]],
-[ test [$]# = 0 && func_missing_arg $opt && break
-])m4_n(m4_bmatch([$3],
- [\^], [ func_quote_for_eval "[$]1"
- optarg=$func_quote_for_eval_result],
- [[?!;+@]], [ optarg=[$]1]))[]dnl
-m4_n(m4_bmatch([$3],
- [+], [ $1_num=`expr 1 + ${$1_num-0}`
- eval $1_${$1_num}=\"$optarg\"],
- [?], [m4_bmatch([$3],
- [@], [m4go_expand([m4go_optional_file_arg([$1])])],
- [m4go_expand([m4go_optional_arg([$1])])])],
- [[!@]], [ $1=$optarg],
- [;], [ $1="${$1+[$]$1
-}$optarg"],
- [~], [ $1=false],
- [=.], [ $1="m4_bpatsubst([$3], [^.*=], [])"],
- [ $1=:]))[]dnl
-dnl only write the file_arg fragment when we didn't already write opt_file_arg:
-m4_bmatch([$3], [@], [m4_bmatch([$3], [?], [],
- [m4go_expand([m4go_file_arg([$1])])
-])])m4_n(m4go_unindent([$6]))[]dnl
-m4_bmatch([$3], [[!+;]], [ shift
-]) ;;
-])],
- [m4_ifval([$2],
- [m4_bmatch([$3],
- [[?!;+@^~]], [m4_append([m4go_shortargs], [-$2*], [|])],
- [m4_append([m4go_shortnoargs], [-$2*],
- [|])])])])])
-
-
-# m4go_optional_arg(OPTION-NAME)
-# ------------------------------
-# Expand to the case branch core code for processing a flag that takes
-# an optional argument, and sets the `opt_' variable named by
-# OPTION-NAME appropriately.
-m4_define([m4go_optional_arg],
-[ if test [$]# -gt 0; then
- case $optarg in # ((
- -*) ;;
- *) $1=$optarg; shift ;;
- esac
- fi])
-
-# m4go_file_arg(OPTION-NAME)
-# --------------------------
-# As above, but for flags that require the name of an existing file as
-# an argument.
-m4_define([m4go_file_arg],
-[ test -r "$optarg" || {
- func_error "$opt: cannot read file \`$optarg'."
- exit_cmd=exit
- }])
-
-# m4go_optional_file_arg(OPTION-NAME)
-# -----------------------------------
-# As above, but for options that optionally takes the name of an
-# existing file as its argument.
-m4_define([m4go_optional_file_arg],
-[ if test [$]# -gt 0; then
- case $optarg in # ((
- -*) ;;
- *) $1=$optarg
- test -r "$optarg" || {
- func_error "$opt: cannot read file \`$optarg'."
- exit_cmd=exit
- }
- shift ;;
- esac
- fi])
-
-
-# m4go_printopts
-# --------------
-# This macro expands to the complete command line option processing
-# loop, providing for user declared options from `M4SH_GETOPTS' as well
-# as support for `-x|--debug', `-\?|-h|--help' and `--version'. The
-# latter two extract their output from a stylized comment at the start
-# of the script, and will not work correctly if the format is not
-# followed precisely.
-m4_define([m4go_printopts],
-[
-# Option defaults:
-debug_cmd=${debug_cmd-':'}
-m4go_defaults
-
-# Parse options once, thoroughly. This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
-{
- # this just eases exit handling
- while test [$]# -gt 0; do
- opt=[$]1
- shift
- case $opt in
- --debug|-x) debug_cmd='set -x'
- func_echo "enabling shell trace mode"
- $debug_cmd
- ;;
-m4go_branches
- -\?|-h) func_usage ;;
- --help) func_help ;;
- --version) func_version ;;
-
- # Separate optargs to long options:
- --*=*)
- func_split_long_opt "$opt"
- set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"[$]@"}
- shift
- ;;
-
-m4_ifset([m4go_shortargs], dnl (
-[ # Separate optargs to short options:
- ]m4go_shortargs[)
- func_split_short_opt "$opt"
- set dummy "$func_split_short_opt_name" "$func_split_short_opt_arg" ${1+"[$]@"}
- shift
- ;;
-
-])m4_ifset([m4go_shortnoargs], dnl (
-[ # Separate non-argument short options:
- ]m4go_shortnoargs[)
- func_split_short_opt "$opt"
- set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"[$]@"}
- shift
- ;;
-
-]) --) break ;;
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
- *) set dummy "$opt" ${1+"[$]@"}; shift; break ;;
- esac
- done
-m4_ifset([m4go_validation],
-[
- # Validate options:
-m4go_validation
-])
- # Bail if the options were screwed
- $exit_cmd $EXIT_FAILURE
-}
-])
-
-
-## ------------------------- ##
-## 4. Supporting Shell Code. ##
-## ------------------------- ##
-
-# The shell functions below are expanded verbatim into the shell script
-# at `m4_include([getopt.m4sh]', which are necessary for the correct
-# operation of the automatic `--version' and `--help' options, among
-# others.
-
-m4_divert_pop([KILL])M4SH_VERBATIM([[
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
- $debug_cmd
-
- $SED -n '/(C)/!b go
- :more
- /\./!{
- N
- s/\n# / /
- b more
- }
- :go
- /^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- p
- }' < "$progpath"
- exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $debug_cmd
-
- $SED -n '/^# Usage:/,/^# *.*--help/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- echo
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
-}
-
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
-func_help ()
-{
- $debug_cmd
-
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- :print
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- s*\$host*'"$host"'*
- s*\$SHELL*'"$SHELL"'*
- s*\$LTCC*'"$LTCC"'*
- s*\$LTCFLAGS*'"$LTCFLAGS"'*
- s*\$LD*'"$LD"'*
- s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
- p
- d
- }
- /^# .* home page:/b print
- /^# General help using/b print
- ' < "$progpath"
- ret=$?
- if test -z "$1"; then
- exit $ret
- fi
-}
-
-# 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
-}
-
-
-# If this shell supports prefix and suffix pattern removal, then
-# use them to avoid forking. Hide the definition in an eval in case
-# the shell chokes on unsupported syntax...
-if test yes = "$lt_HAVE_XSI_OPS"; then
- # 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.
- eval 'func_split_short_opt ()
- {
- $debug_cmd
-
- func_split_short_opt_arg=${1#??}
- func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
- }'
-
- # func_split_long_opt longopt
- # Set func_split_long_opt_name and func_split_long_opt_arg shell
- # variables after splitting LONGOPT at the `=' sign.
- eval 'func_split_long_opt ()
- {
- func_split_long_opt_name=${1%%=*}
- func_split_long_opt_arg=${1#*=}
- }'
-else
- # ...otherwise fall back to using sed.
- func_split_short_opt ()
- {
- my_sed_short_opt='1s/^\(..\).*$/\1/;q'
- my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
-
- func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
- func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
- }
-
- func_split_long_opt ()
- {
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- my_sed_long_arg='1s/^--[^=]*=//'
-
- func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
- func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
- }
-fi
-
-exit_cmd=:
-]])
diff --git a/configure.ac b/configure.ac
index 37e65e6d..3902519c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@
####
-AC_PREREQ(2.62)dnl Some m4sh scripts use $as_echo
+AC_PREREQ(2.62)
dnl Oldest automake required for bootstrap is below in AM_INIT_AUTOMAKE.
@@ -98,9 +98,6 @@ AB_VERSION='AC_PACKAGE_VERSION'
AB_INIT([$autobuild_mode])
-dnl We use m4sh to generate libtool's portable shell scripts
-AC_SUBST([M4SH], ['$(AUTOM4TE) --language=m4sh'])
-
dnl Make sure config.status is regenerated when the version timestamp changes
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(srcdir)/.version'])
diff --git a/tests/getopt-m4sh.at b/tests/getopt-m4sh.at
deleted file mode 100644
index 8da48ed3..00000000
--- a/tests/getopt-m4sh.at
+++ /dev/null
@@ -1,220 +0,0 @@
-# getopts-m4sh.at -- test getopts.m4sh option parsers -*- Autotest -*-
-#
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2010
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool 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 2 of
-# the License, or (at your option) any later version.
-#
-# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-####
-
-AT_BANNER([Shell option parser generator.])
-
-
-# _LT_AT_GETOPT_M4SH_SETUP
-# ------------------------
-m4_define([_LT_AT_GETOPT_M4SH_SETUP],
-[m4_pattern_allow([AS_INIT])
-m4_pattern_allow([m4_include])
-AT_DATA([options.m4sh],
-[[AS_INIT[]m4_include([getopt.m4sh])
-nl='
-'
-list=
-opts=
-M4SH_GETOPTS(
- [a!], [--append], [], [func_append list "$optarg$nl"],
- [f], [--force], [], [opts="$opts force"],
- [i], [--install], [], [opts="$opts install"],
- [l;], [--length], [], [],
- [p!], [--path], [], [func_dirname_and_basename "$optarg"],
- [v], [--verbose], [], [opts="$opts verbose"],
- [!], [--ltdl], [false],[opts="$opts ltdl=$optarg"],
-[test -z "$opt_length" || {
- for s in $opt_length; do
- func_len "$s"
- func_arith ${len-0} + $func_len_result; len=$func_arith_result
- done
- echo len=$len
-}
-test -z "$opt_path" || {
- func_stripname b_ .d "$func_basename_result"
- echo "$func_dirname_result:$func_stripname_result"
-}
-test -z "$list$opts" || echo "$list" $opts])
-]])
-m4_pattern_forbid([m4_include])
-m4_pattern_forbid([AS_INIT])
-AT_CHECK([$M4SH --version || exit 77], [], [ignore], [ignore])
-AT_CHECK([$M4SH -B $abs_top_srcdir/build-aux options.m4sh > t-options],
- [], [], [], [AT_CHECK([test 63 -eq "$at_status" && exit 77])])
-$SED "s|@LN_S\@|$LN_S|g;s|@SED\@|$SED|g" t-options > options
-])# _LT_AT_GETOPT_M4SH_SETUP
-
-
-## ----------------------- ##
-## Short option splitting. ##
-## ----------------------- ##
-
-AT_SETUP([fallback short option splitting])
-
-AT_DATA(expout,
-[[ force verbose install
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([lt_HAVE_XSI_OPS=no $SHELL ./options -fvi], 0, [expout])
-
-AT_CLEANUP
-
-
-AT_SETUP([enhanced short option splitting])
-
-AT_DATA(expout,
-[[ force verbose install
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([$SHELL ./options -fvi], 0, [expout])
-
-AT_CLEANUP
-
-
-## ---------------------- ##
-## Long option splitting. ##
-## ---------------------- ##
-
-AT_SETUP([fallback long option splitting])
-
-AT_DATA(expout,
-[[ ltdl=long
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([lt_HAVE_XSI_OPS=no $SHELL ./options --ltdl=long], 0, [expout])
-
-AT_CLEANUP
-
-
-AT_SETUP([enhanced long option splitting])
-
-AT_DATA(expout,
-[[ ltdl=long
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([$SHELL ./options --ltdl=long], 0, [expout])
-
-AT_CLEANUP
-
-
-## ----------------- ##
-## Option appending. ##
-## ----------------- ##
-
-AT_SETUP([fallback option appending])
-
-AT_DATA(expout,
-[[first --append second
-third
-
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([lt_HAVE_PLUSEQ_OP=no $SHELL ./options -a "first --append second" -athird], 0, [expout])
-
-AT_CLEANUP
-
-
-AT_SETUP([enhanced option appending])
-
-AT_DATA(expout,
-[[first --append second
-third
-
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([$SHELL ./options -a "first --append second" -athird], 0, [expout])
-
-AT_CLEANUP
-
-
-## ----------------- ##
-## Shell arithmetic. ##
-## ----------------- ##
-
-AT_SETUP([fallback arithmetic])
-
-AT_DATA(expout,
-[[len=9
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([lt_HAVE_ARITH_OP=no $SHELL ./options -l short --length long], 0, [expout])
-
-AT_CLEANUP
-
-
-AT_SETUP([enhanced arithmetic])
-
-AT_DATA(expout,
-[[len=9
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([$SHELL ./options -l short --length long], 0, [expout])
-
-AT_CLEANUP
-
-
-## ------------- ##
-## Path slicing. ##
-## ------------- ##
-
-AT_SETUP([fallback path slicing])
-
-AT_DATA(expout,
-[[a:c
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([lt_HAVE_XSI_OPS=no $SHELL ./options -p a/b_c.d], 0, [expout])
-
-AT_CLEANUP
-
-
-AT_SETUP([enhanced path slicing])
-
-AT_DATA(expout,
-[[a:c
-]])
-
-_LT_AT_GETOPT_M4SH_SETUP
-
-AT_CHECK([$SHELL ./options -p a/b_c.d], 0, [expout])
-
-AT_CLEANUP