1AC_DEFUN([AX_ENABLE_SUBSYSTEM], [
2$1=y
3SUBSYSTEMS="$SUBSYSTEMS $1"
4])
5
6AC_DEFUN([AX_DISABLE_SUBSYSTEM], [
7$1=n
8])
9
10AC_DEFUN([AX_SUBSYSTEM_DEFAULT_ENABLE], [
11AC_ARG_ENABLE([$1],
12AS_HELP_STRING([--disable-$1], [Disable build and install of $1]),[
13AX_SUBSYSTEM_INTERNAL([$1])
14],[
15AX_ENABLE_SUBSYSTEM([$1])
16])
17AX_SUBSYSTEM_CONFIGURE([$1])
18AC_SUBST([$1])
19])
20
21AC_DEFUN([AX_SUBSYSTEM_DEFAULT_DISABLE], [
22AC_ARG_ENABLE([$1],
23AS_HELP_STRING([--enable-$1], [Enable build and install of $1]),[
24AX_SUBSYSTEM_INTERNAL([$1])
25],[
26AX_DISABLE_SUBSYSTEM([$1])
27])
28AX_SUBSYSTEM_CONFIGURE([$1])
29AC_SUBST([$1])
30])
31
32AC_DEFUN([AX_SUBSYSTEM_CONDITIONAL], [
33AC_ARG_ENABLE([$1],
34AS_HELP_STRING([--enable-$1], [Enable build and install of $1]),[
35AX_SUBSYSTEM_INTERNAL([$1])
36],[
37AS_IF([test "x$2" = "xy"],[
38AX_ENABLE_SUBSYSTEM([$1])
39],[
40AX_DISABLE_SUBSYSTEM([$1])
41])
42])
43AX_SUBSYSTEM_CONFIGURE([$1])
44AC_SUBST($1)
45])
46
47AC_DEFUN([AX_SUBSYSTEM_FINISH], [
48AC_SUBST(SUBSYSTEMS)
49echo "Will build the following subsystems:"
50for x in $SUBSYSTEMS; do
51	echo "  $x"
52done
53])
54
55AC_DEFUN([AX_SUBSYSTEM_INTERNAL], [
56AS_IF([test "x$enableval" = "xyes"], [
57AX_ENABLE_SUBSYSTEM([$1])
58],[
59AS_IF([test "x$enableval" = "xno"],[
60AX_DISABLE_SUBSYSTEM([$1])
61])
62])
63])
64
65AC_DEFUN([AX_SUBSYSTEM_CONFIGURE], [
66AS_IF([test -e "$1/configure"], [
67if test "x$$1" = "xy" || test "x$$1" = "x" ; then
68    AC_CONFIG_SUBDIRS([$1])
69fi
70])
71])
72