Commit 19174555 19174555385eab9054e341e5000e63635dfdc48e by Sergey Poznyakoff

New file. Implements MU_ENABLE_SUPPORT defun.

1 parent 80d358b7
1 dnl This file is part of GNU mailutils.
2 dnl Copyright (C) 2001 Free Software Foundation, Inc.
3 dnl
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 2 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 dnl
18
19 dnl MU_ENABLE_SUPPORT(feature, [action-if-true], [action-if-false])
20
21 AC_DEFUN([MU_ENABLE_SUPPORT], [
22 pushdef([mu_upcase],translit($1,[a-z],[A-Z]))
23 pushdef([mu_build_files],mu_upcase[_BUILD_FILES])
24 pushdef([mu_cache_var],[mu_cv_enable_]$1)
25 AC_SUBST(mu_build_files)
26 ifelse([$2],,,AC_SUBST(mu_build_dirs))
27 AC_ARG_ENABLE($1,
28 [ --disable-]$1[ disable ]$1[ support],
29 [case "${enableval}" in
30 yes) mu_cache_var=yes;;
31 no) mu_cache_var=no;;
32 *) AC_MSG_ERROR(bad value ${enableval} for --disable-$1) ;;
33 esac],
34 [mu_cache_var=yes])
35
36 if test x"[$]mu_cache_var" = x"yes"; then
37 AC_DEFINE([ENABLE_]mu_upcase,1,[Define this if you enable $1 support])
38 mu_build_files='[$(]mu_upcase[_FILES)]'
39 ifelse([$2],,,$2)
40 ifelse([$3],,,else
41 $2)
42 fi
43
44 popdef([mu_upcase])
45 popdef([mu_build_files])
46 popdef([mu_cache_var])
47 ])
48
49
50