From bfce27f5247e5cc3ccaf9e580c17cf87e3715a3b Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Thu, 23 Sep 2004 01:16:41 +0000 Subject: [PATCH] * 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. --- ChangeLog | 18 ++ HACKING | 5 - Makefile.am | 43 +++- bootstrap | 2 +- config/general.m4sh | 247 ++++++++++++++++++++ config/getopt.m4sh | 84 +++++++ config/ltmain.in | 483 +++++++++------------------------------- configure.ac | 3 + libtoolize.in | 235 ++----------------- m4/libtool.m4 | 2 + tests/{defs => defs.in} | 148 ++---------- 11 files changed, 530 insertions(+), 740 deletions(-) create mode 100644 config/general.m4sh create mode 100644 config/getopt.m4sh rename tests/{defs => defs.in} (63%) diff --git a/ChangeLog b/ChangeLog index ab76958f8..098fbf546 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2004-09-23 Gary V. Vaughan + * 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 diff --git a/HACKING b/HACKING index b4c88b868..e6b6ca806 100644 --- a/HACKING +++ b/HACKING @@ -130,11 +130,6 @@ and is not part of a release distribution. * 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 diff --git a/Makefile.am b/Makefile.am index 37f6e8f43..daaceb84f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,11 +20,14 @@ 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' \ @@ -42,9 +45,11 @@ BUILD_SUBDIRS = . libltdl doc tests 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 @@ -110,30 +115,46 @@ $(top_srcdir)/m4/ltversion.m4: m4/ltversion.in configure.ac stamp-vcl ## 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 diff --git a/bootstrap b/bootstrap index e163ea83e..0fa423fa4 100755 --- a/bootstrap +++ b/bootstrap @@ -59,7 +59,7 @@ set -- `sed '/AC_INIT/{s/[][,()]/ /g; p;};d' configure.ac` 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: diff --git a/config/general.m4sh b/config/general.m4sh new file mode 100644 index 000000000..ef1e6f082 --- /dev/null +++ b/config/general.m4sh @@ -0,0 +1,247 @@ +m4_if([# general.m4sh -- general shell script boiler plate -*- Autoconf -*- +# Written by Gary V. Vaughan , 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" +} diff --git a/config/getopt.m4sh b/config/getopt.m4sh new file mode 100644 index 000000000..abd14f3b2 --- /dev/null +++ b/config/getopt.m4sh @@ -0,0 +1,84 @@ +m4_if([# getopt.m4sh -- getopt helper functions -*- Autoconf -*- +# Written by Gary V. Vaughan , 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=: diff --git a/config/ltmain.in b/config/ltmain.in index 812799f1b..60a2ecd41 100644 --- a/config/ltmain.in +++ b/config/ltmain.in @@ -1,4 +1,5 @@ -# @configure_input@ +m4_define([_m4_divert(SCRIPT)], 100) +m4_divert_push([SCRIPT])# @configure_input@ # ltmain.sh (GNU @PACKAGE@@TIMESTAMP@) @VERSION@ # Written by Gordon Matzigkeit , 1996 @@ -68,63 +69,15 @@ # # Report bugs to . -# 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. @@ -149,41 +102,11 @@ EOF 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 @@ -196,50 +119,12 @@ o2lo="s/\\.${objext}\$/.lo/" 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. @@ -250,68 +135,6 @@ func_fatal_configuration () 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. @@ -365,7 +188,7 @@ func_enable_tag () # Validate tagname. case $tagname in - *[!-_A-Za-z0-9,/]*) + *[[!-_A-Za-z0-9,/]]*) func_fatal_error "invalid tag name: $tagname" ;; esac @@ -404,7 +227,7 @@ func_mode_help () 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. @@ -418,7 +241,7 @@ with it are deleted. Otherwise, only FILE itself is deleted using RM." 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. @@ -441,7 +264,7 @@ library object suffix, \`.lo'." execute) $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... +"Usage: $progname [[OPTION]]... --mode=execute COMMAND [[ARGS]]... Automatically set library path, then run a program. @@ -461,7 +284,7 @@ Then, COMMAND is executed, with ARGS as arguments." finish) $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... +"Usage: $progname [[OPTION]]... --mode=finish [[LIBDIR]]... Complete the installation of libtool libraries. @@ -473,7 +296,7 @@ the \`--dry-run' option if you just want to see what would be executed." install) $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... +"Usage: $progname [[OPTION]]... --mode=install INSTALL-COMMAND... Install executables or libraries. @@ -490,7 +313,7 @@ BSD-compatible install options are recognized)." 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. @@ -521,12 +344,12 @@ The following components of LINK-COMMAND are treated specially: 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. @@ -548,7 +371,7 @@ is created, otherwise an executable program is created." 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. @@ -577,10 +400,8 @@ Otherwise, only FILE itself is deleted using RM." # 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 @@ -720,104 +541,6 @@ Otherwise, only FILE itself is deleted using RM." } -# 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. @@ -958,7 +681,7 @@ func_generate_dlsyms () { 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 @@ -1026,7 +749,7 @@ extern \"C\" { ;; 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"' @@ -1096,7 +819,7 @@ const struct { const char *name; void *address; } -lt_${my_prefix}_LTX_preloaded_symbols[] = +lt_${my_prefix}_LTX_preloaded_symbols[[]] = {\ { \"$my_originator\", (void *) 0 }, " @@ -1196,7 +919,7 @@ func_extract_archives () { 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%^.*/%%'` @@ -1267,7 +990,7 @@ func_extract_archives () { 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 $? @@ -1385,7 +1108,7 @@ func_mode_compile () # 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 ;; @@ -1441,7 +1164,7 @@ func_mode_compile () 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 @@ -1476,7 +1199,7 @@ func_mode_compile () # 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 @@ -1727,7 +1450,7 @@ func_mode_execute () 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 @@ -1739,7 +1462,7 @@ func_mode_execute () *.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=. ;; @@ -1987,7 +1710,7 @@ func_mode_install () 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%^.*/%%'` @@ -1997,7 +1720,7 @@ func_mode_install () 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 @@ -2054,7 +1777,7 @@ func_mode_install () 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" @@ -2284,7 +2007,7 @@ func_mode_install () 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 @@ -2577,7 +2300,7 @@ func_mode_link () 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 @@ -2635,7 +2358,7 @@ func_mode_link () # 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 @@ -2669,7 +2392,7 @@ func_mode_link () 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" ;; @@ -2786,7 +2509,7 @@ func_mode_link () # 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" @@ -2800,7 +2523,7 @@ func_mode_link () 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" && \ @@ -2841,7 +2564,7 @@ func_mode_link () # 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 @@ -2923,7 +2646,7 @@ func_mode_link () 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" ;; @@ -3024,7 +2747,7 @@ func_mode_link () # +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" @@ -3069,7 +2792,7 @@ func_mode_link () 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 @@ -3127,7 +2850,7 @@ func_mode_link () # 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 @@ -3206,7 +2929,7 @@ func_mode_link () 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 @@ -3320,7 +3043,7 @@ func_mode_link () # Ignore non-libtool-libs dependency_libs= case $lib in - *[\\/]*.la) . $lib ;; + *[[\\/]]*.la) . $lib ;; *.la) . ./$lib ;; esac @@ -3408,7 +3131,7 @@ func_mode_link () 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 @@ -3571,7 +3294,7 @@ func_mode_link () 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= @@ -3596,9 +3319,9 @@ func_mode_link () *-*-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 @@ -3666,7 +3389,7 @@ func_mode_link () # 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 @@ -3980,7 +3703,7 @@ func_mode_link () # 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 @@ -4052,7 +3775,7 @@ func_mode_link () # 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 @@ -4160,11 +3883,11 @@ func_mode_link () 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 @@ -4461,7 +4184,7 @@ func_mode_link () # 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" @@ -4469,7 +4192,7 @@ func_mode_link () 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" @@ -4477,7 +4200,7 @@ func_mode_link () 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" @@ -4709,7 +4432,7 @@ func_mode_link () *-*-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" ;; @@ -4869,7 +4592,7 @@ EOF 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 | @@ -4885,8 +4608,8 @@ EOF 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 | @@ -4938,7 +4661,7 @@ EOF 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 | @@ -4975,14 +4698,14 @@ EOF 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 @@ -5002,7 +4725,7 @@ EOF 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 /'` ;; @@ -5056,9 +4779,9 @@ EOF # 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 @@ -5577,10 +5300,10 @@ EOF && 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 /'` @@ -5593,15 +5316,15 @@ EOF # 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 @@ -5732,7 +5455,7 @@ EOF rpath= for dir in $temp_rpath; do case $dir in - [\\/]* | [A-Za-z]:[\\/]*) + [[\\/]]* | [[A-Za-z]]:[[\\/]]*) # Absolute path. rpath="$rpath$dir:" ;; @@ -5840,7 +5563,7 @@ EOF # 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"` @@ -5955,36 +5678,36 @@ char * strendzap(char *str, const char *pat); 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 <> $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> $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 @@ -6589,7 +6312,7 @@ 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" @@ -6598,7 +6321,7 @@ fi\ 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" @@ -6698,7 +6421,7 @@ func_mode_uninstall () 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" @@ -6901,7 +6624,7 @@ func_mode_uninstall () fi } -exit $EXIT_SUCCESS +exit $exit_status # The TAGs below are defined such that we never get into a situation diff --git a/configure.ac b/configure.ac index 0e13cd996..6bff3bef8 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,9 @@ dnl These are bootstrap requirements, once built, libtool may work with 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']) diff --git a/libtoolize.in b/libtoolize.in index b1e467d75..f8f608a7a 100644 --- a/libtoolize.in +++ b/libtoolize.in @@ -1,4 +1,5 @@ -#! /bin/sh +m4_define([_m4_divert(SCRIPT)], 100) +m4_divert_push([SCRIPT])#! /bin/sh # @configure_input@ # libtoolize (GNU @PACKAGE@@TIMESTAMP@) @VERSION@ @@ -57,63 +58,17 @@ # # Report bugs to . -# 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 @@ -121,8 +76,6 @@ seen_ltdl=false # Collect flags to pass into libltdl libtoolize libtoolize_flags= -exit_status=$EXIT_SUCCESS - # Locations for important files: prefix=@prefix@ datadir=@datadir@ @@ -134,106 +87,14 @@ ltdldir= 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" @@ -308,51 +169,6 @@ func_version () } -# 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. @@ -409,7 +225,7 @@ func_copy_all_files () 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 @@ -469,13 +285,6 @@ func_copy_some_files () 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. @@ -510,13 +319,13 @@ func_scan_files () # ---------------------------------------------------- # 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; }; @@ -564,8 +373,8 @@ func_scan_files () # 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 @@ -591,7 +400,7 @@ func_included_files () 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" @@ -619,7 +428,7 @@ func_serial () 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 @@ -701,7 +510,7 @@ func_check_macros () { # 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 \ @@ -718,8 +527,8 @@ func_ltmain_update () 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 : @@ -745,7 +554,7 @@ func_config_update () { 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 @@ -812,7 +621,7 @@ func_config_update () $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' diff --git a/m4/libtool.m4 b/m4/libtool.m4 index c847dda05..5252ff5d4 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -5773,9 +5773,11 @@ AU_DEFUN([LT_AC_PROG_RC], [LT_PROG_RC]) # 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]) ]) diff --git a/tests/defs b/tests/defs.in similarity index 63% rename from tests/defs rename to tests/defs.in index 9d183fa6a..cf675e81b 100644 --- a/tests/defs +++ b/tests/defs.in @@ -1,5 +1,7 @@ -# -*- 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 , 1996 # Gary V. Vaughan , 2003 @@ -23,76 +25,15 @@ # 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. @@ -113,14 +54,7 @@ esac # 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... @@ -135,8 +69,7 @@ func_skip () # 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] @@ -177,57 +110,6 @@ func_get_config "CC" "$LIBTOOL --config" ": fatal" 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 () { @@ -253,7 +135,7 @@ func_cd () 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'" } @@ -405,6 +287,12 @@ func_exec () # 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: -- 2.47.2