mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-01-24 14:24:59 +08:00
a967d9d23b
* libltdl/config/getopt.m4sh (func_version): Remove space in `/\./! {' sed command, to please HP-UX sed. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
108 lines
2.7 KiB
Plaintext
108 lines
2.7 KiB
Plaintext
m4_if([getopt.m4sh -- getopt helper functions -*- Autoconf -*-
|
|
|
|
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software
|
|
Foundation, Inc.
|
|
Written by Gary V. Vaughan, 2004
|
|
|
|
This file is part of GNU Cvs-utils.
|
|
|
|
GNU Cvs-utils 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 you option) any later version.
|
|
|
|
As a special exception to the GNU General Public License, if you
|
|
distribute this file as part of a program or library that contains
|
|
a configuration script generated by Autoconf, you may include this
|
|
file under the same distribution terms that you use for the rest
|
|
of that program.
|
|
|
|
GNU Cvs-utils is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
|
|
General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GNU Libtool; see the file COPYING. If not, a copy
|
|
can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
|
or obtained by writing to the Free Software Foundation, Inc.,
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
])dnl
|
|
|
|
m4_include([general.m4sh])
|
|
|
|
M4SH_VERBATIM([[
|
|
# func_version
|
|
# Echo version message to standard output and exit.
|
|
func_version ()
|
|
{
|
|
$SED -n '/(C)/!b go
|
|
:more
|
|
/\./!{
|
|
N
|
|
s/\n# //
|
|
b more
|
|
}
|
|
:go
|
|
/^# '$PROGRAM' (GNU /,/# warranty; / {
|
|
s/^# //
|
|
s/^# *$//
|
|
s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
|
|
p
|
|
}' < "$progpath"
|
|
exit $?
|
|
}
|
|
|
|
# func_usage
|
|
# Echo short help message to standard output and exit.
|
|
func_usage ()
|
|
{
|
|
$SED -n '/^# Usage:/,/^# *-h/ {
|
|
s/^# //
|
|
s/^# *$//
|
|
s/\$progname/'$progname'/
|
|
p
|
|
}' < "$progpath"
|
|
echo
|
|
$ECHO "run \`$progname --help | more' for full usage"
|
|
exit $?
|
|
}
|
|
|
|
# func_help [NOEXIT]
|
|
# Echo long help message to standard output and exit,
|
|
# unless 'noexit' is passed as argument.
|
|
func_help ()
|
|
{
|
|
$SED -n '/^# Usage:/,/# Report bugs to/ {
|
|
s/^# //
|
|
s/^# *$//
|
|
s*\$progname*'$progname'*
|
|
s*\$host*'"$host"'*
|
|
s*\$SHELL*'"$SHELL"'*
|
|
s*\$LTCC*'"$LTCC"'*
|
|
s*\$LTCFLAGS*'"$LTCFLAGS"'*
|
|
s*\$LD*'"$LD"'*
|
|
s/\$with_gnu_ld/'"$with_gnu_ld"'/
|
|
s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
|
|
s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
|
|
p
|
|
}' < "$progpath"
|
|
ret=$?
|
|
if test -z "$1"; then
|
|
exit $ret
|
|
fi
|
|
}
|
|
|
|
# func_missing_arg argname
|
|
# Echo program name prefixed message to standard error and set global
|
|
# exit_cmd.
|
|
func_missing_arg ()
|
|
{
|
|
func_error "missing argument for $1"
|
|
exit_cmd=exit
|
|
}
|
|
|
|
exit_cmd=:
|
|
]])
|
|
|