Add a configure option to disable all default plugins
[strongswan.git] / m4 / macros / enable-disable.m4
1
2 # ARG_ENABL_SET(option, help)
3 # ---------------------------
4 # Create a --enable-$1 option with helptext, set a variable $1 to true/false
5 AC_DEFUN([ARG_ENABL_SET],
6         [AC_ARG_ENABLE(
7                 [$1],
8                 AS_HELP_STRING([--enable-$1], [$2]),
9                 [patsubst([$1], [-], [_])_given=true
10                 if test x$enableval = xyes; then
11                         patsubst([$1], [-], [_])=true
12                  else
13                         patsubst([$1], [-], [_])=false
14                 fi],
15                 [patsubst([$1], [-], [_])=false
16                 patsubst([$1], [-], [_])_given=false]
17         )]
18 )
19
20 # ARG_DISBL_SET(option, help)
21 # ---------------------------
22 # Create a --disable-$1 option with helptext, set a variable $1 to true/false
23 # All $1 are collected in the variable $enabled_by_default
24 AC_DEFUN([ARG_DISBL_SET],
25         [AC_ARG_ENABLE(
26                 [$1],
27                 AS_HELP_STRING([--disable-$1], [$2]),
28                 [patsubst([$1], [-], [_])_given=true
29                 if test x$enableval = xyes; then
30                         patsubst([$1], [-], [_])=true
31                  else
32                         patsubst([$1], [-], [_])=false
33                 fi],
34                 [patsubst([$1], [-], [_])=true
35                 patsubst([$1], [-], [_])_given=false]
36         )
37         enabled_by_default=${enabled_by_default}" patsubst([$1], [-], [_])"]
38 )