dnl enfle local macro dnl (C)Copyright 1999, 2000 by Hiroshi Takekawa dnl This file is part of Enfle. dnl dnl Last Modified: Wed Jun 28 23:56:41 2000. dnl $Id: acinclude.m4,v 1.8 2000/08/01 20:55:00 sian Exp $ dnl dnl Enfle is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl Enfle is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA AC_DEFUN(ENFLE_APPEND, [ $1="$$1 $2" ]) AC_DEFUN(ENFLE_PREPEND, [ $1="$2 $$1" ]) AC_DEFUN(ENFLE_REMOVE, [ $1=`echo $$1 | sed "s%$2 *%%g"` ]) AC_DEFUN(ENFLE_PLUGIN_ENABLE, [ pp=`echo $p | sed 's/^-//'` if test "$pp" = "$p"; then eval "count_$3=\`expr 0\$count_$3 + 1\`" ENFLE_APPEND($1, $3/$pp) else eval "count_$3=\`expr 0\$count_$3 - 1\`" ENFLE_REMOVE($1, $3/$pp) fi ]) AC_DEFUN(ENFLE_PLUGIN_ENABLER, [ AC_ARG_ENABLE($3$2, [ --enable-$3$2$4 Enable $3$2 plugins.], [ for p in $enableval; do ENFLE_PLUGIN_ENABLE($1, $p, $3) done]) ]) AC_DEFUN(ENFLE_PLUGIN_NORMAL_ENABLER, [ ENFLE_PLUGIN_ENABLER(Compiled_plugins, [], $1, [$2]) ]) AC_DEFUN(ENFLE_PLUGIN_STATIC_ENABLER, [ ENFLE_PLUGIN_ENABLER(Static_plugins, -static, $1, [$2]) ]) AC_DEFUN(ENFLE_REMOVE_DUP, [ $1=`echo "$$1" | tr -s " " "\n" | sort | uniq | tr "\n" " " | sed 's/^ *//' | sed 's/ *$//'` ])