1AC_DEFUN([AX_STUBDOM_DEFAULT_ENABLE], [
2AC_ARG_ENABLE([$1],
3AS_HELP_STRING([--disable-$1], [Build and install $1 (default is ENABLED)]),[
4AX_STUBDOM_INTERNAL([$1], [$2])
5],[
6AX_ENABLE_STUBDOM([$1], [$2])
7])
8AC_SUBST([$2])
9])
10
11AC_DEFUN([AX_STUBDOM_DEFAULT_DISABLE], [
12AC_ARG_ENABLE([$1],
13AS_HELP_STRING([--enable-$1], [Build and install $1 (default is DISABLED)]),[
14AX_STUBDOM_INTERNAL([$1], [$2])
15],[
16AX_DISABLE_STUBDOM([$1], [$2])
17])
18AC_SUBST([$2])
19])
20
21AC_DEFUN([AX_STUBDOM_CONDITIONAL], [
22AC_ARG_ENABLE([$1],
23AS_HELP_STRING([--enable-$1], [Build and install $1]),[
24AX_STUBDOM_INTERNAL([$1], [$2])
25])
26])
27
28AC_DEFUN([AX_STUBDOM_CONDITIONAL_FINISH], [
29AS_IF([test "x$$2" = "xy" || test "x$$2" = "x"], [
30AX_ENABLE_STUBDOM([$1],[$2])
31],[
32AX_DISABLE_STUBDOM([$1],[$2])
33])
34AC_SUBST([$2])
35])
36
37AC_DEFUN([AX_STUBDOM_AUTO_DEPENDS], [
38AS_IF([test "x$$1" = "x" && test "x$$2" = "xn"], [
39$1="n"
40])
41])
42
43
44AC_DEFUN([AX_ENABLE_STUBDOM], [
45$2=y
46STUBDOM_TARGETS="$STUBDOM_TARGETS $2"
47STUBDOM_BUILD="$STUBDOM_BUILD $1"
48STUBDOM_INSTALL="$STUBDOM_INSTALL install-$2"
49STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-$2"
50])
51
52AC_DEFUN([AX_DISABLE_STUBDOM], [
53$2=n
54])
55
56dnl Don't call this outside of this file
57AC_DEFUN([AX_STUBDOM_INTERNAL], [
58AS_IF([test "x$enableval" = "xyes"], [
59AX_ENABLE_STUBDOM([$1], [$2])
60],[
61AS_IF([test "x$enableval" = "xno"],[
62AX_DISABLE_STUBDOM([$1], [$2])
63])
64])
65])
66
67AC_DEFUN([AX_STUBDOM_FINISH], [
68AC_SUBST(STUBDOM_TARGETS)
69AC_SUBST(STUBDOM_BUILD)
70AC_SUBST(STUBDOM_INSTALL)
71AC_SUBST(STUBDOM_UNINSTALL)
72echo "Will build the following stub domains:"
73for x in $STUBDOM_BUILD; do
74	echo "  $x"
75done
76])
77
78AC_DEFUN([AX_STUBDOM_LIB], [
79AC_ARG_VAR([$1_URL], [Download url for $2])
80AS_IF([test "x$$1_URL" = "x"], [
81	AS_IF([test "x$extfiles" = "xy"],
82		[$1_URL=\@S|@\@{:@XEN_EXTFILES_URL\@:}@],
83		[$1_URL="$4"])
84	])
85$1_VERSION="$3"
86AC_SUBST($1_URL)
87AC_SUBST($1_VERSION)
88])
89
90AC_DEFUN([AX_STUBDOM_LIB_NOEXT], [
91AC_ARG_VAR([$1_URL], [Download url for $2])
92AS_IF([test "x$$1_URL" = "x"], [
93	$1_URL="$4"
94	])
95$1_VERSION="$3"
96AC_SUBST($1_URL)
97AC_SUBST($1_VERSION)
98])
99