/libs/m4/shell.m4.in
Autoconf | 63 lines | 58 code | 5 blank | 0 comment | 1 complexity | 2a858c2c394e5146a6c9f2fd151b28dc MD5 | raw file
Possible License(s): GPL-2.0
- m4_dnl
- m4_dnl Copyright (C) 2008, 2009 Francesco Salvestrini
- m4_dnl
- m4_dnl This program is free software; you can redistribute it and/or modify
- m4_dnl it under the terms of the GNU General Public License as published by
- m4_dnl the Free Software Foundation; either version 2 of the License, or
- m4_dnl (at your option) any later version.
- m4_dnl
- m4_dnl This program is distributed in the hope that it will be useful,
- m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
- m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- m4_dnl GNU General Public License for more details.
- m4_dnl
- m4_dnl You should have received a copy of the GNU General Public License along
- m4_dnl with this program; if not, write to the Free Software Foundation, Inc.,
- m4_dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- m4_dnl
- m4_dnl
- m4_dnl CT_EXIT(EXIT-VALUE)
- m4_dnl
- m4_define([CT_EXIT],[m4_dnl
- exit $1
- ])
- m4_define([_CT_IF],[
- m4_ifval([$2$3],[
- elif $1 ; then
- m4_default([$2], [:])
- m4_ifval([$3], [$0(m4_shiftn(2, $@))])
- ],[
- m4_ifval([$1],[
- else
- $1
- ])
- ])
- ])
- m4_define([CT_IF],[
- m4_ifval([$2$3],[
- if $1; then
- m4_default([$2], [:])
- m4_ifval([$3], [_$0(m4_shiftn(2, $@))])
- fi
- ])
- ])
- m4_define([_CT_CASE],[
- m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
- [$#], 1, [ *) $1 ;;],
- [$#], 2, [ $1) m4_default([$2], [:]) ;;],
- [ $1) m4_default([$2], [:]) ;;
- $0(m4_shiftn(2, $@))
- ])
- ])
- m4_define([CT_CASE],[
- m4_ifval([$2$3],[
- case $1 in
- _CT_CASE(m4_shift($@))
- esac
- ])
- ])