dnl POP3Lite specific M4 macros.			-*- autoconf -*-
dnl Copyright (C) 2000, 2001 Gergely Nagy <8@free.bsd.hu>
dnl
dnl This file is part of POP3Lite.
dnl
dnl POP3Lite 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, or (at your option)
dnl any later version.
dnl
dnl POP3Lite 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
dnl 02111-1307, USA.
dnl
dnl $Id: pop3lite.m4,v 1.9.2.1 2001/04/18 10:15:33 algernon Exp $

dnl P3L_MOD(modulename, [, extra-checks [, extra-module-cmds]])
dnl
AC_DEFUN(P3L_MOD,
[
if echo "$P3L_MODULES" | grep " $1 " 2>&1 >/dev/null
then
	p3l_mod_t=yes
else
	p3l_mod_t=no
fi

if echo "$P3L_BUILTIN_LIST" | grep " $1 " 2>&1 >/dev/null
then
	p3l_mod_t="yes, builtin"
fi

p3l_mod_n=`echo "$1" | sed -e "y%abcdefghijklmnopqrstuvwxyz-%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%"`

if test "x$p3l_mod_t" != "xno" || echo "$P3L_BUILTIN_LIST" | grep " $1 " 2>&1 >/dev/null
then
	ifelse([$2], , [], [$2])
	P3L_MOD_TEST($1, ${p3l_mod_n}, ${p3l_mod_t})
fi

if echo "$P3L_BUILTIN_LIST" | grep " $1 " 2>&1 >/dev/null
then
	ifelse([$3], , [:], [$3])
fi

AC_MSG_CHECKING(wheter to build the $1 module)
AC_MSG_RESULT($p3l_mod_t)

if test "x$p3l_mod_t" = "xno"; then
	P3L_MODULES=`echo "$P3L_MODULES" | sed -e "s% $1 % %g"`
fi
])

dnl P3L_MOD_TEST(modulename, upcasename, enabled)
dnl
AC_DEFUN(P3L_MOD_TEST,
[
if test "$3" != "no"; then
	if test "$3" = "yes"; then
		DLOPEN_MODULES="$DLOPEN_MODULES \$(top_builddir)/modules/$1/$1.la"
		eval "MOD_$2_LIBS=\"$1.la\""
	else
		eval "MOD_$2_NOINST_LIBS=\"$1.la\""
	fi
fi
])

dnl P3L_MODS([modules...])
dnl
AC_DEFUN(P3L_MODS,
[
for m in $*
do
	P3L_MOD($m)
done
])


syntax highlighted by Code2HTML, v. 0.9.1