libtool/config/getopt.m4sh
Gary V. Vaughan bfce27f524 * 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.
2004-09-23 01:16:41 +00:00

85 lines
2.6 KiB
Plaintext

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=: