3 # AMANDA_CHECK_COMPONENTS
7 # Defines --without-client, --without-server, --without-restore, and
8 # --without-amrecover, and checks the results.
10 # Sets the AM_CONDITIONALs WANT_CLIENT, WANT_SERVER, WANT_RESTORE,
13 # AM_CONDITIONAL WANT_TAPE is set if either server or restore support is
16 AC_DEFUN([AMANDA_CHECK_COMPONENTS], [
17 AC_REQUIRE([AMANDA_WITHOUT_SERVER])
18 AC_REQUIRE([AMANDA_WITHOUT_CLIENT])
19 AC_REQUIRE([AMANDA_WITHOUT_RESTORE])
20 AC_REQUIRE([AMANDA_WITHOUT_AMRECOVER])
21 AC_REQUIRE([AMANDA_WITH_CLIENT_ONLY]) dnl deprecated
22 AC_REQUIRE([AMANDA_WITH_SERVER_ONLY]) dnl deprecated
24 # detect invalid combinations of components
25 if ! ${WANT_SERVER-true} && ${WANT_RESTORE-true}; then
26 AC_MSG_ERROR([--without-server requires --without-restore])
28 if ! ${WANT_CLIENT-true} && ${WANT_RECOVER-true}; then
29 AC_MSG_ERROR([--without-client requires --without-amrecover])
32 AM_CONDITIONAL(WANT_CLIENT, $WANT_CLIENT)
33 AM_CONDITIONAL(WANT_RESTORE, $WANT_RESTORE)
34 AM_CONDITIONAL(WANT_SERVER, $WANT_SERVER)
35 AM_CONDITIONAL(WANT_RECOVER, $WANT_RECOVER)
37 AM_CONDITIONAL(WANT_TAPE, $WANT_SERVER || $WANT_RESTORE)
43 # AMANDA_WITHOUT_SERVER
47 # Add option --without-server, and set WANT_SERVER to true or false,
50 AC_DEFUN([AMANDA_WITHOUT_SERVER], [
53 AS_HELP_STRING([--without-server], [do not build server stuff (set --without-restore)]), [
55 y | ye | yes) WANT_SERVER=true;;
56 n | no) WANT_SERVER=false;;
57 *) AC_MSG_ERROR([You must not supply an argument to the --without-server option.]) ;;
64 # AMANDA_WITHOUT_CLIENT
68 # Add option --without-client, and set WANT_CLIENT to true or false,
71 AC_DEFUN([AMANDA_WITHOUT_CLIENT], [
74 AS_HELP_STRING([--without-client], [do not build client stuff]), [
76 y | ye | yes) WANT_CLIENT=true;;
77 n | no) WANT_CLIENT=false;;
78 *) AC_MSG_ERROR([You must not supply an argument to the --without-client option.]) ;;
85 # AMANDA_WITHOUT_RESTORE
89 # Add option --without-restore, and set WANT_RESTORE to true or false,
92 AC_DEFUN([AMANDA_WITHOUT_RESTORE], [
93 AC_REQUIRE([AMANDA_WITHOUT_SERVER])
94 WANT_RESTORE=${WANT_SERVER-true}
96 AS_HELP_STRING([--without-restore], [do not build amrestore nor amidxtaped]), [
98 y | ye | yes) WANT_RESTORE=true;;
99 n | no) WANT_RESTORE=false;;
100 *) AC_MSG_ERROR([You must not supply an argument to --with-restore option.]) ;;
107 # AMANDA_WITHOUT_AMRECOVER
111 # Add option --without-amrecover, and set WANT_RECOVER (not WANT_AMRECOVER) to
112 # true or false, accordingly.
114 AC_DEFUN([AMANDA_WITHOUT_AMRECOVER], [
115 AC_REQUIRE([AMANDA_WITHOUT_CLIENT])
116 WANT_RECOVER=${WANT_CLIENT-true}
117 AC_ARG_WITH(amrecover,
118 AS_HELP_STRING([--without-amrecover],
119 [do not build amrecover]), [
121 y | ye | yes) WANT_RECOVER=false;;
122 n | no) WANT_RECOVER=false;;
123 *) AC_MSG_ERROR([You must not supply an argument to --with-amrecover option.]) ;;
128 ## deprecated --with-* options
130 AC_DEFUN([AMANDA_WITH_CLIENT_ONLY], [
131 AC_ARG_WITH(client-only,
132 AS_HELP_STRING([--with-client-only], [deprecated: use --without-server]),
133 [ AC_MSG_ERROR([--with-client-only is deprecated, use --without-server instead.])
137 AC_DEFUN([AMANDA_WITH_SERVER_ONLY], [
138 AC_ARG_WITH(server-only,
139 AS_HELP_STRING([--with-server-only], [deprecated: use --without-client]),
140 [ AC_MSG_ERROR([--with-server-only is deprecated, use --without-client instead.])
146 # AMANDA_SHOW_COMPONENTS_SUMMARY
150 # Show a summary of the settings from this file.
152 AC_DEFUN([AMANDA_SHOW_COMPONENTS_SUMMARY],
155 if $WANT_SERVER; then
156 components="$components server";
158 components="$components (no server)";
160 if $WANT_RESTORE; then
161 components="$components restore";
163 components="$components (no restore)";
165 if $WANT_CLIENT; then
166 components="$components client";
168 components="$components (no client)";
170 if $WANT_RECOVER; then
171 components="$components amrecover";
173 components="$components (no amrecover)";
176 echo "Amanda Components: $components"