2004-09-23 Gary V. Vaughan <gary@gnu.org>
+ * configure.ac (M4SH): AC_SUBST m4sh expander.
+ * config/general.m4sh, config/getopt.m4sh: New files with factored
+ out functionality from...
+ * config/ltmain.in, libtoolize.in: ...here. m4_include the shared
+ code, and call AS_SHELL_SANITIZE. Also quote all `[' and `]' to
+ survive m4 run.
+ (func_serial): No need to double up m4sh quotes after a `#'.
+ (func_check_macros): Escape `dnl' to stop m4sh interpreting it as
+ a macro.
+ * tests/defs.in: New file expanded into tests/defs by autom4te.
+ * m4/libtool.m4 (_LT_DECL_EGREP): Also require fgrep for the tests
+ that use it.
+ * Makefile.am ($(top_srcdir)/config/ltmain.sh): Now built with
+ M4SH.
+ (libtoolize): Ditto.
+ * bootstrap: Set M4SH for call to make.
+ * HACKING: No need to sync to AS_SHELL_SANITIZE by hand any more.
+
* m4/libtool.m4: _LT_DECL uppercase ECHO.
* config/ltmain.in: Use it throughout.
(func_mkdir_p): Now matches the other implementations in
* Update NEWS, ChangeLog.
-* Make sure the 'Be Bourne compatible' shell snippet near the top of
- ./libtoolize.in, config/ltmain.in and tests/defs matches the latest
- autoconf wisdom by updating to match CVS autoconf AS_SHELL_SANITIZE in
- autoconf's lib/m4sugar/m4sh.m4.
-
* Run ./bootstrap.
* Have some tea. If you are running on less than 3.6GHz CPU, order
ACLOCAL_AMFLAGS = -I m4
edit = sed \
- -e 's,@PACKAGE\@,$(PACKAGE),g' \
- -e 's,@VERSION\@,$(VERSION),g' \
- -e 's,@MACRO_VERSION\@,$(VERSION),g' \
+ -e 's,@EGREP\@,$(EGREP),g' \
+ -e 's,@FGREP\@,$(FGREP),g' \
+ -e 's,@GREP\@,$(GREP),g' \
-e 's,@LN_S\@,$(LN_S),g' \
+ -e 's,@MACRO_VERSION\@,$(VERSION),g' \
+ -e 's,@PACKAGE\@,$(PACKAGE),g' \
-e 's,@SED\@,$(SED),g' \
+ -e 's,@VERSION\@,$(VERSION),g' \
-e 's,@prefix\@,$(prefix),g' \
-e 's,@datadir\@,$(datadir),g' \
-e 's,@pkgdatadir\@,$(pkgdatadir),g' \
SUBDIRS = $(BUILD_SUBDIRS)
DIST_SUBDIRS = $(BUILD_SUBDIRS)
+sh_files = config/general.m4sh config/getopt.m4sh
EXTRA_DIST = bootstrap libtoolize.in config/ltmain.in config/mkstamp \
- stamp-vcl ChangeLog.1996 ChangeLog.1997 ChangeLog.1998 ChangeLog.1999 \
- ChangeLog.2000 ChangeLog.2001 ChangeLog.2002 ChangeLog.2003
+ $(sh_files) stamp-vcl ChangeLog.1996 ChangeLog.1997 ChangeLog.1998 \
+ ChangeLog.1999 ChangeLog.2000 ChangeLog.2001 ChangeLog.2002 \
+ ChangeLog.2003
CLEANFILES = libtool libtoolize \
libtoolize.tmp config/ltmain.tmp m4/ltversion.tmp
## distcheck (at least) by rebuilding ltmain.sh in the source
## tree whenever config.status regenerates the Makefile.
EXTRA_DIST += config/ltmain.sh
-$(top_srcdir)/config/ltmain.sh: config/ltmain.in configure.ac stamp-vcl
+$(top_srcdir)/config/ltmain.sh: $(sh_files) config/ltmain.in configure.ac stamp-vcl
$(timestamp); \
cd $(top_srcdir); \
- rm -f config/ltmain.tmp; \
+ rm -f config/ltmain.m4sh config/ltmain.tmp config/ltmain.sh; \
+ $(M4SH) -B ./config config/ltmain.in > config/ltmain.m4sh; \
input="ltmain.in"; \
$(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
-e "s,@package_revision\@,$$1,g" \
- config/ltmain.in > config/ltmain.tmp; \
+ config/ltmain.m4sh > config/ltmain.tmp; \
+ rm -f config/ltmain.m4sh; \
chmod a-w config/ltmain.tmp; \
mv -f config/ltmain.tmp config/ltmain.sh
# The libtool distributor and the standalone libtool script.
bin_SCRIPTS = libtoolize libtool
-libtoolize: libtoolize.in Makefile
- rm -f libtoolize.tmp libtoolize
+libtoolize: $(sh_files) libtoolize.in Makefile
+ rm -f libtoolize.m4sh libtoolize.tmp libtoolize
+ $(M4SH) -B $(top_srcdir)/config \
+ $(srcdir)/libtoolize.in > libtoolize.m4sh
$(timestamp); \
input="libtoolize.in"; \
$(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
- $(srcdir)/libtoolize.in > libtoolize.tmp
+ libtoolize.m4sh > libtoolize.tmp
+ rm -f libtoolize.m4sh
chmod a+x libtoolize.tmp
chmod a-w libtoolize.tmp
mv -f libtoolize.tmp libtoolize
+check-recursive: tests/defs
+tests/defs: tests/defs.in Makefile
+ cd $(top_srcdir); \
+ rm -f tests/defs.m4sh tests/defs.tmp tests/defs; \
+ $(M4SH) -B ./config tests/defs.in > tests/defs.m4sh; \
+ input="defs.in"; \
+ $(edit) tests/defs.m4sh > tests/defs.tmp; \
+ rm -f tests/defs.m4sh; \
+ mv -f tests/defs.tmp tests/defs
+
+
# Automake doesn't want us to generate distributed files from config.status,
# but the alternative (see libtool-1.4.3) was even uglier!
libtool: $(top_builddir)/config.status config/ltmain.sh stamp-vcl
rm -f ./config/ltmain.sh ./m4/ltversion.m4
test -f Makefile || { makefile=Makefile; cp Makefile.am $makefile; }
make ./config/ltmain.sh ./m4/ltversion.m4 \
- top_srcdir=. PACKAGE="$2" VERSION="$3"
+ top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh"
test -z "$makefile" || rm -f "$makefile"
# Make a dummy libtoolize script for autoreconf:
--- /dev/null
+m4_if([# general.m4sh -- general shell script boiler plate -*- Autoconf -*-
+# Written by Gary V. Vaughan <gary@gnu.org>, 2004
+
+# Copyright (C) 2004 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+])dnl
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="@EGREP@"}
+: ${FGREP="@FGREP@"}
+: ${GREP="@GREP@"}
+: ${LN_S="@LN_S@"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="@SED@"}
+
+# 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
+: ${IFS="
+ "}
+
+dirname="s,/[[^/]]*$,,"
+basename="s,^.*/,,g"
+
+# 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" | $SED "$basename"`
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [[\\/]]*|[[A-Za-z]]:\\*) ;;
+ *) progdir=`$ECHO "$progpath" | $SED "$dirname"`
+ progdir=`cd "$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'
+# test EBCDIC or ASCII
+case `$ECHO A|tr A '\301'` in
+ A) # EBCDIC based system
+ SP2NL="tr '\100' '\n'"
+ NL2SP="tr '\r\n' '\100\100'"
+ ;;
+ *) # Assume ASCII based system
+ SP2NL="tr '\040' '\012'"
+ NL2SP="tr '\015\012' '\040\040'"
+ ;;
+esac
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO $progname${mode+: }$mode: ${1+"$@"}
+}
+
+# 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 ()
+{
+ $ECHO $progname${mode+: }$mode: ${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $ECHO $progname${mode+: }$mode: warning: ${1+"$@"} 1>&2
+}
+
+# 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 "$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
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/libtool"
+
+ 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.
+func_quote_for_eval ()
+{
+ my_arg="$1"
+
+ case $my_arg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[[\@<:@\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]]*|*@:>@*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_eval_result="$my_arg"
+}
--- /dev/null
+m4_if([# getopt.m4sh -- getopt helper functions -*- Autoconf -*-
+# Written by Gary V. Vaughan <gary@gnu.org>, 2004
+
+# Copyright (C) 2004 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+])dnl
+
+m4_include([general.m4sh])
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $SED '/^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //; s/^# *$//;
+ s/\((C)\)[[ 0-9,-]]*\( [[1-9]][[0-9]]*\)/\1\2/;
+ p;
+ }; d' < "$progpath"
+ exit $EXIT_SUCCESS
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $SED '/^# Usage:/,/# -h/ {
+ s/^# //; s/^# *$//;
+ s/\$progname/'$progname'/;
+ p;
+ }; d' < "$progpath"
+ $ECHO
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $EXIT_SUCCESS
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+ $SED '/^# Usage:/,/# Report bugs to/ {
+ s/^# //; s/^# *$//;
+ s:\$progname:'$progname':;
+ s:\$SHELL:'"$SHELL"':;
+ s:\$LTCC:'"$LTCC"':;
+ s:\$LTCFLAGS:'"$LTCFLAGS"':;
+ s:\$LD:'"$LD"':;
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/;
+ s/\$automake_version/'"`automake --version 2>/dev/null |$SED 1q`"'/;
+ s/\$autoconf_version/'"`autoconf --version 2>/dev/null |$SED 1q`"'/;
+ p;
+ }; d' < "$progpath"
+ exit $EXIT_SUCCESS
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ func_error "missing argument for $1"
+ exit_cmd=exit
+}
+
+exit_cmd=:
-# @configure_input@
+m4_define([_m4_divert(SCRIPT)], 100)
+m4_divert_push([SCRIPT])# @configure_input@
# ltmain.sh (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# Report bugs to <bug-libtool@gnu.org>.
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-: ${ECHO="echo"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,g"
-
-# 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:
-PROGRAM=ltmain.sh
-progname=`$ECHO "$progpath" | $SED "$basename"`
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *) progdir=`$ECHO "$progpath" | $SED "$dirname"`
- progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
- ;;
-esac
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-
PROGRAM=ltmain.sh
PACKAGE=@PACKAGE@
VERSION=@VERSION@
TIMESTAMP="@TIMESTAMP@"
package_revision=@package_revision@
+AS_SHELL_SANITIZE
+$as_unset CDPATH
+
# Check that we have a working $ECHO.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
exit $EXIT_SUCCESS
fi
+m4_include([getopt.m4sh])
+
default_mode=
-help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
-# 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'
-# test EBCDIC or ASCII
-case `$ECHO A|tr A '\301'` in
- A) # EBCDIC based system
- SP2NL="tr '\100' '\n'"
- NL2SP="tr '\r\n' '\100\100'"
- ;;
- *) # Assume ASCII based system
- SP2NL="tr '\040' '\012'"
- NL2SP="tr '\015\012' '\040\040'"
- ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
- save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
- save_LANG="$LANG"; LANG=C; export LANG
-fi
-
-# Make sure IFS has a sensible default
-: ${IFS="
- "}
# Global variables.
mode=$default_mode
opt_dry_run=${run-false} ## inherit $run when mdemo-dryrun.test sets it above
opt_duplicate_deps=false
-opt_help=false
# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
- $ECHO $progname${mode+: }$mode: ${1+"$@"}
-}
-
-# 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 ()
-{
- $ECHO $progname${mode+: }$mode: ${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
- $ECHO $progname${mode+: }$mode: warning: ${1+"$@"} 1>&2
-}
-
-# 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_configuration arg...
# Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit.
func_fatal_error "Fatal configuration error."
}
-# 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"
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
- func_error "missing argument for $1"
- exit_cmd=exit
-}
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
- $SED '/^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //; s/^# *$//;
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/;
- p;
- }; d' < "$progpath"
- exit $EXIT_SUCCESS
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $SED '/^# Usage:/,/# -h/ {
- s/^# //; s/^# *$//;
- s/\$progname/'$progname'/;
- p;
- }; d' < "$progpath"
- $ECHO
- $ECHO "run \`$progname --help | more' for full usage"
- exit $EXIT_SUCCESS
-}
-
-# func_help
-# Echo long help message to standard output and exit.
-func_help ()
-{
- $SED '/^# Usage:/,/# Report bugs to/ {
- s/^# //; s/^# *$//;
- s:\$progname:'$progname':;
- s:\$SHELL:'"$SHELL"':;
- s:\$LTCC:'"$LTCC"':;
- s:\$LTCFLAGS:'"$LTCFLAGS"':;
- s:\$LD:'"$LD"':;
- s/\$with_gnu_ld/'"$with_gnu_ld"'/;
- s/\$automake_version/'"`automake --version 2>/dev/null |$SED 1q`"'/;
- s/\$autoconf_version/'"`autoconf --version 2>/dev/null |$SED 1q`"'/;
- p;
- }; d' < "$progpath"
- exit $EXIT_SUCCESS
-}
# func_config
# Display the configuration for all the tags in this script.
# Validate tagname.
case $tagname in
- *[!-_A-Za-z0-9,/]*)
+ *[[!-_A-Za-z0-9,/]]*)
func_fatal_error "invalid tag name: $tagname"
;;
esac
clean)
$ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+"Usage: $progname [[OPTION]]... --mode=clean RM [[RM-OPTION]]... FILE...
Remove files from the build directory.
compile)
$ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+"Usage: $progname [[OPTION]]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Compile a source file into a libtool library object.
execute)
$ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+"Usage: $progname [[OPTION]]... --mode=execute COMMAND [[ARGS]]...
Automatically set library path, then run a program.
finish)
$ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+"Usage: $progname [[OPTION]]... --mode=finish [[LIBDIR]]...
Complete the installation of libtool libraries.
install)
$ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+"Usage: $progname [[OPTION]]... --mode=install INSTALL-COMMAND...
Install executables or libraries.
link)
$ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+"Usage: $progname [[OPTION]]... --mode=link LINK-COMMAND...
Link object files or libraries together to form another library, or to
create an executable program.
don't remove output files matching REGEX
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -R[[ ]]LIBDIR add LIBDIR to the runtime path of programs and libraries
-shared only do dynamic linking of libtool libraries
-shrext SUFFIX override the standard shared library file extension
-static do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
+ -version-info CURRENT[[:REVISION[:AGE]]]
+ specify library version info [[each variable defaults to 0]]
-weak LIBNAME declare that the target provides the LIBNAME interface
All other options (arguments beginning with \`-') are ignored.
uninstall)
$ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+"Usage: $progname [[OPTION]]... --mode=uninstall RM [[RM-OPTION]]... FILE...
Remove libraries from an installation directory.
# sed scripts:
my_sed_single_opt='1s/^\(..\).*$/\1/;q'
my_sed_single_rest='1s/^..\(.*\)$/\1/;q'
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- my_sed_long_arg='1s/^--[^=]*=//'
-
- exit_cmd=:
+ my_sed_long_opt='1s/^\(--[[^=]]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[[^=]]*=//'
# Shorthand for --mode=foo, only valid as the first argument
case $1 in
}
-# 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 "$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
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/libtool"
-
- 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.
-func_quote_for_eval ()
-{
- my_arg="$1"
-
- case $my_arg in
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- my_arg="\"$my_arg\""
- ;;
- esac
-
- func_quote_for_eval_result="$my_arg"
-}
-
-
# func_check_version_match
# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
my_outputname="$1"
my_originator="$2"
my_pic_p="${3-no}"
- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_prefix=`$ECHO "$my_originator" | sed 's%[[^a-zA-Z0-9]]%_%g'`
my_dlsyms=
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
;;
esac
else
- $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval "${SED} -e 's/\([[]][[.*^$]]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
case $host in
*cygwin | *mingw* )
$run eval "${SED} -e '1iEXPORTS'"' < "$output_objdir/$output.exp" > "$output_objdir/$output.def"'
const char *name;
void *address;
}
-lt_${my_prefix}_LTX_preloaded_symbols[] =
+lt_${my_prefix}_LTX_preloaded_symbols[[]] =
{\
{ \"$my_originator\", (void *) 0 },
"
for my_xlib in $my_oldlibs; do
# Extract the objects.
case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) my_xabs="$my_xlib" ;;
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
my_xlib=`$ECHO "X$my_xlib" | $Xsed -e 's%^.*/%%'`
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
do
- name_to=`$ECHO "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ name_to=`$ECHO "X$name_to" | $Xsed -e "s/\([[^.]]*\)/\1-$i/"`
done
$show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $MV '$name' '$name_to')"
$run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $MV '$name' '$name_to')" || exit $?
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
- xform='[cCFSifmso]'
+ xform='[[cCFSifmso]]'
case $libobj in
*.ada) xform=ada ;;
*.adb) xform=adb ;;
done
objname=`$ECHO "X$obj" | $Xsed -e 's%^.*/%%'`
- xdir=`$ECHO "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ xdir=`$ECHO "X$obj" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir=
else
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test "$compiler_c_o" = no; then
- output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[[^.]]*$%%'`.${objext}
lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile"
trap "$run $RM $removelist; exit $EXIT_FAILURE" 1 2 15
continue
fi
- dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ dir=`$ECHO "X$file" | $Xsed -e 's%/[[^/]]*$%%'`
test "X$dir" = "X$file" && dir=.
if test -f "$dir/$objdir/$dlname"; then
*.lo)
# Just add the directory containing the .lo file.
- dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ dir=`$ECHO "X$file" | $Xsed -e 's%/[[^/]]*$%%'`
test "X$dir" = "X$file" && dir=.
;;
destdir="$dest"
destname=
else
- destdir=`$ECHO "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ destdir=`$ECHO "X$dest" | $Xsed -e 's%/[[^/]]*$%%'`
test "X$destdir" = "X$dest" && destdir=.
destname=`$ECHO "X$dest" | $Xsed -e 's%^.*/%%'`
func_fatal_help "\`$dest' is not a directory"
fi
case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) ;;
*)
for file in $files; do
case $file in
esac
fi
- dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ dir=`$ECHO "X$file" | $Xsed -e 's%/[[^/]]*$%%'`/
test "X$dir" = "X$file/" && dir=
dir="$dir$objdir"
fi
else
# Install the binary that we compiled earlier.
- file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([[^/]]*\)$%$objdir/\1%"`
fi
fi
fi
# Extract subdirectory from the argument.
- xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ xdir=`$ECHO "X$arg" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
# Dry-run case.
# Extract subdirectory from the argument.
- xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ xdir=`$ECHO "X$arg" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
rpath | xrpath)
# We need an absolute path.
case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
+ -L[[A-Z]][[A-Z]]*:*)
case $with_gcc/$host in
no/*-*-irix* | /*-*-irix*)
compile_command="$compile_command $arg"
dir=`$ECHO "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path.
case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) ;;
*)
absdir=`cd "$dir" && pwd`
test -z "$absdir" && \
# Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue
;;
- *-*-rhapsody* | *-*-darwin1.[012])
+ *-*-rhapsody* | *-*-darwin1.[[012]])
# Rhapsody C and math libraries are in the System framework
deplibs="$deplibs System.ltframework"
continue
dir=`$ECHO "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
# +DA*, +DD* enable 64-bit mode on the HP compiler
# -q* pass through compiler args for the IBM compiler
# -m* pass through architecture-specific compiler args for GCC
- -64|-mips[0-9]|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+ -64|-mips[[0-9]]|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
arg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"`
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
fi
# Extract subdirectory from the argument.
- xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ xdir=`$ECHO "X$arg" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
# Dry-run case.
# Extract subdirectory from the argument.
- xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ xdir=`$ECHO "X$arg" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
- output_objdir=`$ECHO "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ output_objdir=`$ECHO "X$output" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$output_objdir" = "X$output"; then
output_objdir="$objdir"
else
# Ignore non-libtool-libs
dependency_libs=
case $lib in
- *[\\/]*.la) . $lib ;;
+ *[[\\/]]*.la) . $lib ;;
*.la) . ./$lib ;;
esac
done
if test "X$ll" = "X$old_library" ; then # only static version available
found=no
- ladir=`$ECHO "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ ladir=`$ECHO "X$lib" | $Xsed -e 's%/[[^/]]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
lib=$ladir/$old_library
if test "$linkmode,$pass" = "prog,link"; then
func_fatal_error "\`$lib' is not a valid libtool archive"
fi
- ladir=`$ECHO "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ ladir=`$ECHO "X$lib" | $Xsed -e 's%/[[^/]]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
dlname=
*-*-darwin*)
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
- inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([[^ $]]*\)/\1.ltframework/g'`
fi
- dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([[^ $]]*\).ltframework% -framework \1%g'`
;;
esac
# We need an absolute path.
case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) abs_ladir="$ladir" ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case "$libdir" in
- [\\/]*)
+ [[\\/]]*)
add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case "$libdir" in
- [\\/]*)
+ [[\\/]]*)
add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
case $deplib in
-L*) path="$deplib" ;;
*.la)
- dir=`$ECHO "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+ dir=`$ECHO "X$deplib" | $Xsed -e 's%/[[^/]]*$%%'`
test "X$dir" = "X$deplib" && dir="."
# We need an absolute path.
case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
# Check that each of the things are valid numbers.
case $current in
- 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ 0 | [[1-9]] | [[1-9]][[0-9]] | [[1-9]][[0-9]][[0-9]]) ;;
*)
func_error "CURRENT \`$current' is not a nonnegative integer"
func_fatal_error "\`$vinfo' is not valid version information"
esac
case $revision in
- 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ 0 | [[1-9]] | [[1-9]][[0-9]] | [[1-9]][[0-9]][[0-9]]) ;;
*)
func_error "REVISION \`$revision' is not a nonnegative integer"
func_fatal_error "\`$vinfo' is not valid version information"
esac
case $age in
- 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ 0 | [[1-9]] | [[1-9]][[0-9]] | [[1-9]][[0-9]][[0-9]]) ;;
*)
func_error "AGE \`$age' is not a nonnegative integer"
func_fatal_error "\`$vinfo' is not valid version information"
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
- *-*-rhapsody* | *-*-darwin1.[012])
+ *-*-rhapsody* | *-*-darwin1.[[012]])
# Rhapsody C library is in the System framework
deplibs="$deplibs System.ltframework"
;;
if test -n "$a_deplib" ; then
libname=`eval \\$ECHO \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ potential_libs=`ls $i/$libname[[.-]]* 2>/dev/null`
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null |
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[[^/]]*$,,'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
if test -n "$a_deplib" ; then
libname=`eval \\$ECHO \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ potential_libs=`ls $i/$libname[[.-]]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check above in file_magic test
if eval $ECHO \"$potent_lib\" 2>/dev/null |
none | unknown | *)
newdeplibs=""
tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
- -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+ -e 's/ -lc$//' -e 's/ -[[LR]][[^ ]]*//g'`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
for i in $predeps $postdeps ; do
# can't use Xsed below, because $i might contain '/'
tmp_deplibs=`$ECHO "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
done
fi
- if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
+ if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[[ ]]//g' |
$GREP . >/dev/null; then
$ECHO
if test "X$deplibs_check_method" = "Xnone"; then
name=$name_save
case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
+ *-*-rhapsody* | *-*-darwin1.[[012]])
# On Rhapsody replace the C library with the System framework
newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
;;
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
case $host in
*-*-darwin*)
- newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- inherited_linker_flags=`$ECHO "X $inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([[^ $]]*\).ltframework% -framework \1%g'`
+ inherited_linker_flags=`$ECHO "X $inherited_linker_flags" | $Xsed -e 's% \([[^ $]]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([[^ $]]*\).ltframework% -framework \1%g'`
;;
esac
&& test "$dlopen_support" = unknown \
&& test "$dlopen_self" = unknown \
&& test "$dlopen_self_static" = unknown && \
- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+ func_warning "\`LT_INIT([[dlopen]])' not used. Assuming no dlopen support."
case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
+ *-*-rhapsody* | *-*-darwin1.[[012]])
# On Rhapsody replace the C library is the System framework
compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
# But is supposedly fixed on 10.4 or later (yay!).
if test "$tagname" = CXX ; then
case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 10.[0123])
+ 10.[[0123]])
compile_command="$compile_command ${wl}-bind_at_load"
finalize_command="$finalize_command ${wl}-bind_at_load"
;;
esac
fi
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
- compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([[^ $]]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([[^ $]]*\).ltframework% -framework \1%g'`
;;
esac
rpath=
for dir in $temp_rpath; do
case $dir in
- [\\/]* | [A-Za-z]:[\\/]*)
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
# Absolute path.
rpath="$rpath$dir:"
;;
# Quote $ECHO for shipping.
if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
case $progpath in
- [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) qecho="$SHELL $progpath --fallback-echo";;
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
esac
qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
void lt_fatal (const char *message, ...);
int
-main (int argc, char *argv[])
+main (int argc, char *argv[[]])
{
char **newargz;
int i;
- program_name = (char *) xstrdup ((char *) basename (argv[0]));
- DEBUG("(main) argv[0] : %s\n",argv[0]);
+ program_name = (char *) xstrdup ((char *) basename (argv[[0]]));
+ DEBUG("(main) argv[[0]] : %s\n",argv[[0]]);
DEBUG("(main) program_name : %s\n",program_name);
newargz = XMALLOC(char *, argc+2);
EOF
cat >> $cwrappersource <<EOF
- newargz[0] = "$SHELL";
+ newargz[[0]] = "$SHELL";
EOF
cat >> $cwrappersource <<"EOF"
- newargz[1] = find_executable(argv[0]);
- if (newargz[1] == NULL)
- lt_fatal("Couldn't find %s", argv[0]);
- DEBUG("(main) found exe at : %s\n",newargz[1]);
+ newargz[[1]] = find_executable(argv[[0]]);
+ if (newargz[[1]] == NULL)
+ lt_fatal("Couldn't find %s", argv[[0]]);
+ DEBUG("(main) found exe at : %s\n",newargz[[1]]);
/* we know the script has the same name, without the .exe */
- /* so make sure newargz[1] doesn't end in .exe */
- strendzap(newargz[1],".exe");
+ /* so make sure newargz[[1]] doesn't end in .exe */
+ strendzap(newargz[[1]],".exe");
for (i = 1; i < argc; i++)
- newargz[i+1] = xstrdup(argv[i]);
- newargz[argc+1] = NULL;
+ newargz[[i+1]] = xstrdup(argv[[i]]);
+ newargz[[argc+1]] = NULL;
for (i=0; i<argc+1; i++)
{
- DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
+ DEBUG("(main) newargz[[%d]] : %s\n",i,newargz[[i]]);
;
}
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over the disk name in MSDOS pathnames. */
- if (isalpha (name[0]) && name[1] == ':')
+ if (isalpha (name[[0]]) && name[[1]] == ':')
name += 2;
#endif
const char* p_next;
struct stat st;
/* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
+ char tmp[[LT_PATHMAX + 1]];
int tmp_len;
char* concat_name;
/* Absolute path? */
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha (wrapper[0]) && wrapper[1] == ':')
+ if (isalpha (wrapper[[0]]) && wrapper[[1]] == ':')
{
concat_name = xstrdup (wrapper);
if (check_executable(concat_name))
else
{
#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
+ if (IS_DIR_SEPARATOR (wrapper[[0]]))
{
concat_name = xstrdup (wrapper);
if (check_executable(concat_name))
tmp_len = strlen(tmp);
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
+ concat_name[[tmp_len]] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
}
else
{
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
+ concat_name[[p_len]] = '/';
strcpy (concat_name + p_len + 1, wrapper);
}
if (check_executable(concat_name))
tmp_len = strlen(tmp);
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
+ concat_name[[tmp_len]] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
if (check_executable(concat_name))
$ECHO >> $output "\
# Find the directory that this script lives in.
- thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[[^/]]*$%%'\`
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do
- destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+ destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[[^/]]*\$%%'\`
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ [[\\\\/]]* | [[A-Za-z]]:[[\\\\/]]*) thisdir=\"\$destdir\" ;;
*) thisdir=\"\$thisdir/\$destdir\" ;;
esac
fi
newdlfiles=
for lib in $dlfiles; do
case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlfiles="$newdlfiles $abs"
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ [[\\/]]* | [[A-Za-z]]:[[\\/]]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlprefiles="$newdlprefiles $abs"
origobjdir="$objdir"
for file in $files; do
- dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ dir=`$ECHO "X$file" | $Xsed -e 's%/[[^/]]*$%%'`
if test "X$dir" = "X$file"; then
dir=.
objdir="$origobjdir"
fi
}
-exit $EXIT_SUCCESS
+exit $exit_status
# The TAGs below are defined such that we never get into a situation
dnl much older releases of autoconf and automake. See release notes.
AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2]) ## We use auto-m4_including
+dnl We use m4sh to generate libtool's portable shell scripts
+AC_SUBST([M4SH], ['autom4te -l m4sh'])
+
dnl Make sure config.status is regenerated when the version timestamp changes
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_builddir)/stamp-vcl'])
-#! /bin/sh
+m4_define([_m4_divert(SCRIPT)], 100)
+m4_divert_push([SCRIPT])#! /bin/sh
# @configure_input@
# libtoolize (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
#
# Report bugs to <bug-libtool@gnu.org>.
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-: ${CP="cp -f"}
-: ${ECHO="echo"}
-: ${LN_S="@LN_S@"}
-: ${MKDIR="mkdir"}
-: ${RM="rm -f"}
-: ${SED="@SED@"}
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,g"
-
-# 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" | $SED "$basename"`
PROGRAM=libtoolize
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *) progdir=`$ECHO "$progpath" | $SED "$dirname"`
- progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
- ;;
-esac
+AS_SHELL_SANITIZE
+$as_unset CDPATH
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
+m4_include([getopt.m4sh])
-opt_dry_run=false
+# Command line options:
opt_force=false
opt_install=false
opt_link=:
-opt_quiet=false
-opt_verbose=false
seen_libtool=false
seen_ltdl=false
# Collect flags to pass into libltdl libtoolize
libtoolize_flags=
-exit_status=$EXIT_SUCCESS
-
# Locations for important files:
prefix=@prefix@
datadir=@datadir@
configure_ac=configure.in
-# func_echo arg...
-# Echo program name prefixed message.
-func_echo ()
-{
- $ECHO $progname: ${1+"$@"}
-}
-
-# 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 ()
-{
- $ECHO $progname: ${1+"$@"} 1>&2
-}
-
-# 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 "Try \`$progname --help' for more information."
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
- func_error "missing argument for $1"
- exit_cmd=exit
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $SED '/^# Usage:/,/# -h/ {
- s/^# //; s/^# *$//;
- s/\$progname/'$progname'/;
- p;
- }; d' < "$progpath"
- $ECHO
- $ECHO "run \`$progname --help | more' for full usage"
- exit $EXIT_SUCCESS
-}
-
-# func_help
-# Echo long help message to standard output and exit.
-func_help ()
-{
- $SED '/^# Usage:/,/# Report bugs to/ {
- s/^# //; s/^# *$//;
- s:\$progname:'$progname':;
- s:\$SHELL:'"$SHELL"':;
- s:\$LTCC:'"$LTCC"':;
- s:\$LD:'"$LD"':;
- s/\$with_gnu_ld/'"$with_gnu_ld"'/;
- s/\$automake_version/'"`automake --version 2>/dev/null |$SED 1q`"'/;
- s/\$autoconf_version/'"`autoconf --version 2>/dev/null |$SED 1q`"'/;
- p;
- }; d' < "$progpath"
- exit $EXIT_SUCCESS
-}
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
- $SED '/^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //; s/^# *$//;
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/;
- p;
- }; d' < "$progpath"
- exit $EXIT_SUCCESS
-}
-
-
# Parse options once, thoroughly. This comes as soon as possible in
# the script to make things like `libtoolize --version' happen quickly.
{
# sed scripts:
my_sed_single_opt='1s/^\(..\).*$/\1/;q'
my_sed_single_rest='1s/^..\(.*\)$/\1/;q'
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- my_sed_long_arg='1s/^--[^=]*=//'
+ my_sed_long_opt='1s/^\(--[[^=]]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[[^=]]*=//'
while test "$#" -gt 0; do
opt="$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 "$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_copy srcfile destfile
# If option `--copy' was specified, or soft-linking SRCFILE to DESTFILE fails,
# then try to copy SRCFILE to DESTFILE.
IFS="$my_save_IFS"
my_srcdir=`$ECHO "$my_srcdirs" | sed 's,:.*,,g'`
- my_srcdirs=`$ECHO "$my_srcdirs" | sed 's,:*[^:][^:]*:*,,'`
+ my_srcdirs=`$ECHO "$my_srcdirs" | sed 's,:*[[^:]][[^:]]*:*,,'`
for my_filename in `cd "$my_srcdir" && ls`; do
IFS="$my_save_IFS"
}
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
- grep "$1" "$2" >/dev/null 2>&1
-}
-
# 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.
# ---------------------------------------------------- #
my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
- /AC_CONFIG_AUX_DIR[^_]/ {
- s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,auxdir=\1,; p;
+ /AC_CONFIG_AUX_DIR[[^_]]/ {
+ s,^.*AC_CONFIG_AUX_DIR([[[ ]*\([^])]]*\).*$,auxdir=\1,; p;
};
/AC_CONFIG_MACRO_DIR/ {
- s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^])]*\).*$,m4dir=\1,; p;
+ s,^.*AC_CONFIG_MACRO_DIR([[[ ]*\([^])]]*\).*$,m4dir=\1,; p;
};
- /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; };
+ /A[[CM]]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; };
/LT_INIT/ { s,^.*$,seen_libtool=:,; p; };
/LTDL_INIT/ { s,^.*$,seen_ltdl=:,; p; };
/LT_WITH_LTDL/ { s,^.*$,seen_ltdl=:,; p; };
# If AC_CONFIG_MACRO_DIR turned nothing up, we hunt for ACLOCAL_AMFLAGS
# in `Makefile.am' for a `-I' argument.
- my_sed_aclocal_flags='/^[ ]*ACLOCAL_[A-Z_]*FLAGS[ ]*=/ {
- s,^[^=]*=[ ]*\(.*\), \1,; q; }; d'
+ my_sed_aclocal_flags='/^[[ ]]*ACLOCAL_[[A-Z_]]*FLAGS[[ ]]*=/ {
+ s,^[[^=]]*=[[ ]]*\(.*\), \1,; q; }; d'
if test ! -n "$m4dir" && test -f Makefile.am; then
my_m4dir_is_next=false
for arg in `$SED "$my_sed_aclocal_flags" Makefile.am`; do
my_include_regex=
my_sed_include='
- /^m4_include(\[.*\])$/ { s,^m4_include(\[\(.*\)\])$,\1,; p; };
+ /^[m4]_include(\[[.*\]])$/ { s,^[m4]_include(\[[\(.*\)\]])$,\1,; p; };
d'
test -f "$my_searchfile" && $ECHO "$my_searchfile"
my_serial=
for my_file in `func_included_files "$my_filename"`; do
if test -z "$my_macro_regex" ||
- func_grep '^AC_DEFUN(\['"$my_macro_regex" "$my_file"
+ func_grep '^AC_DEFUN(\@<:@'"$my_macro_regex" "$my_file"
then
my_serial=`$SED -e "$my_sed_serial" "$my_file"`
break
{
# Don't trace for this, we're just checking the user didn't invoke it
# directly from configure.ac.
- $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB \
+ $SED 's,[d]nl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB \
&& func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`LT_INIT'"
$seen_libtool \
my_srcfile="$1"
my_destfile="$2"
my_sed_ltmain='
- s,^VERSION=[^0-9]*\(.*\)[ ]*$,\1,; t
- s,^TIMESTAMP=[^0-9]*\([.0-9]*\) .*$,\1,; t
+ s,^VERSION=[[^0-9]]*\(.*\)[[ ]]*$,\1,; t
+ s,^TIMESTAMP=[[^0-9]]*\([[.0-9]]*\) .*$,\1,; t
d'
if test -f "$my_srcfile"; then :
{
my_srcfile="$1"
my_destfile="$2"
- my_sed_config='s,^timestamp=[^0-9]*\([.0-9-]*\)[^0-9].*$,\1,; t; d'
+ my_sed_config='s,^timestamp=[[^0-9]]*\([[.0-9-]]*\)[[^0-9]].*$,\1,; t; d'
if test -f "$my_srcfile"; then :
else
$opt_quiet || func_echo "putting macros in AC_CONFIG_MACRO_DIR, \`$m4dir'."
func_serial_update "$libtool_m4" "$m4dir/libtool.m4" \
- LT_INIT 'A[CM]_PROG_LIBTOOL'
+ LT_INIT 'A[[CM]]_PROG_LIBTOOL'
if $seen_ltdl; then
func_serial_update "$ltdl_m4" "$m4dir/ltdl.m4" 'LTDL_INIT'
# available, choose the one first in the user's PATH.
m4_defun([_LT_DECL_EGREP],
[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
test -z "$GREP" && GREP=grep
_LT_DECL([], [GREP], [1], [A grep program that handles long line])
_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
])
-# -*- sh -*-
-# Defines for Libtool testing environment.
+m4_define([_m4_divert(SCRIPT)], 100)
+m4_divert_push([SCRIPT])# @configure_input@
+
+# defs -- Defines for Libtool testing environment.
# Gord Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Gary V. Vaughan <gary@gnu.org>, 2003
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
+AS_SHELL_SANITIZE
+$as_unset CDPATH
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+m4_include([general.m4sh])
: ${AUTOCONF="autoconf"}
-: ${ECHO="echo"}
-: ${GREP="grep"}
: ${LIBTOOL="../libtool"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${SED="sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-# FIXME: Substitute @EGREP@ and @FGREP@ from the Makefile too
-if $ECHO a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
- EGREP="$GREP -E"
-else
- EGREP='egrep'
-fi
-if $ECHO 'ab*c' | ($GREP -F 'ab*c') >/dev/null 2>&1; then
- FGREP="$GREP -F"
-else
- FGREP='fgrep'
-fi
-
-basename='s,^.*/,,g'
-dirname='s,/[^/]*$,,'
-
-# 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" | $SED "$basename"`
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *) progdir=`$ECHO "$progpath" | $SED "$dirname"`
- progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
- ;;
-esac
-
-# Check that srcdir is set to an absolute path.
-case "$srcdir" in
-/* | [A-Za-z]:\\*) ;;
-*) srcdir=`cd $srcdir && pwd` ;;
-esac
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake
# Disable usage of config.site for autoconf, unless DJGPP is present.
# The DJGPP port of autoconf requires config.site, to work correctly.
# Echo message with prefix.
func_msg ()
{
- $ECHO "=" ${1+"$@"}
-}
-
-# func_error arg...
-# Echo message to standard error.
-func_error ()
-{
- $ECHO ${1+"$@"} 1>&2
+ func_echo "=== " ${1+"$@"}
}
# func_skip arg...
# Echo message to standard error, and fail this test.
func_fail ()
{
- func_error ${1+"$@"}
- exit $EXIT_FAILURE
+ func_fatal_error ${1+"$@"}
}
# func_get_config varname_list src [failp] [regex]
func_get_config "host" "$LIBTOOL --config" ": fatal"
-# 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 "$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_mkprefixdir
func_mkprefixdir ()
{
func_mkdir_p "$my_dir"
# Change to our build directory.
- cd "$my_dir" || exit 1
+ cd "$my_dir" || func_fatal_error "couldn't cd to \`$my_dir'"
}
# Shared global variables for test scripts
prefix="./_inst"
-scripts="$srcdir/../config/ltmain.sh ../libtoolize"
+srcdir=`cd $srcdir && pwd`
+scripts="$srcdir/config/ltmain.sh ../libtoolize"
+
+func_msg "Running $progname"
-$ECHO "=== Running $progname"
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End: