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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 -n '/^# '$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 # Echo long help message to standard output and exit. func_help () { $SED -n '/^# 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; }' < "$progpath" exit $? } # 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=: