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
23 AC_REQUIRE([AMANDA_WITHOUT_NDMP])
25 # detect invalid combinations of components
26 if ! ${WANT_SERVER-true} && ${WANT_RESTORE-true}; then
27 AC_MSG_ERROR([--without-server requires --without-restore])
29 if ! ${WANT_CLIENT-true} && ${WANT_RECOVER-true}; then
30 AC_MSG_ERROR([--without-client requires --without-amrecover])
33 AM_CONDITIONAL(WANT_CLIENT, $WANT_CLIENT)
34 AM_CONDITIONAL(WANT_RESTORE, $WANT_RESTORE)
35 AM_CONDITIONAL(WANT_SERVER, $WANT_SERVER)
36 AM_CONDITIONAL(WANT_RECOVER, $WANT_RECOVER)
37 AM_CONDITIONAL(WANT_NDMP, $WANT_NDMP)
39 AM_CONDITIONAL(WANT_TAPE, $WANT_SERVER || $WANT_RESTORE)
41 # AMANDA_COMPONENTS goes to Amanda::Constants; missing_components is just for the
47 AMANDA_COMPONENTS="$AMANDA_COMPONENTS server";
49 missing_components="$missing_components (no server)";
51 if $WANT_RESTORE; then
52 AMANDA_COMPONENTS="$AMANDA_COMPONENTS restore";
54 missing_components="$missing_components (no restore)";
57 AMANDA_COMPONENTS="$AMANDA_COMPONENTS client";
59 missing_components="$missing_components (no client)";
61 if $WANT_RECOVER; then
62 AMANDA_COMPONENTS="$AMANDA_COMPONENTS amrecover";
64 missing_components="$missing_components (no amrecover)";
67 AMANDA_COMPONENTS="$AMANDA_COMPONENTS ndmp";
69 missing_components="$missing_components (no ndmp)";
72 AC_SUBST(AMANDA_COMPONENTS)
78 # AMANDA_WITHOUT_SERVER
82 # Add option --without-server, and set WANT_SERVER to true or false,
85 AC_DEFUN([AMANDA_WITHOUT_SERVER], [
88 AS_HELP_STRING([--without-server], [do not build server stuff (set --without-restore)]), [
90 y | ye | yes) WANT_SERVER=true;;
91 n | no) WANT_SERVER=false;;
92 *) AC_MSG_ERROR([You must not supply an argument to the --without-server option.]) ;;
99 # AMANDA_WITHOUT_CLIENT
103 # Add option --without-client, and set WANT_CLIENT to true or false,
106 AC_DEFUN([AMANDA_WITHOUT_CLIENT], [
109 AS_HELP_STRING([--without-client], [do not build client stuff]), [
111 y | ye | yes) WANT_CLIENT=true;;
112 n | no) WANT_CLIENT=false;;
113 *) AC_MSG_ERROR([You must not supply an argument to the --without-client option.]) ;;
120 # AMANDA_WITHOUT_RESTORE
124 # Add option --without-restore, and set WANT_RESTORE to true or false,
127 AC_DEFUN([AMANDA_WITHOUT_RESTORE], [
128 AC_REQUIRE([AMANDA_WITHOUT_SERVER])
129 WANT_RESTORE=${WANT_SERVER-true}
131 AS_HELP_STRING([--without-restore], [do not build amrestore nor amidxtaped]), [
133 y | ye | yes) WANT_RESTORE=true;;
134 n | no) WANT_RESTORE=false;;
135 *) AC_MSG_ERROR([You must not supply an argument to --with-restore option.]) ;;
142 # AMANDA_WITHOUT_AMRECOVER
146 # Add option --without-amrecover, and set WANT_RECOVER (not WANT_AMRECOVER) to
147 # true or false, accordingly.
149 AC_DEFUN([AMANDA_WITHOUT_AMRECOVER], [
150 AC_REQUIRE([AMANDA_WITHOUT_CLIENT])
151 WANT_RECOVER=${WANT_CLIENT-true}
152 AC_ARG_WITH(amrecover,
153 AS_HELP_STRING([--without-amrecover],
154 [do not build amrecover]), [
156 y | ye | yes) WANT_RECOVER=true;;
157 n | no) WANT_RECOVER=false;;
158 *) AC_MSG_ERROR([You must not supply an argument to --with-amrecover option.]) ;;
165 # AMANDA_WITHOUT_NDMP
169 # Add option --without-ndmp, and set WANT_NDMP to
170 # true or false, accordingly.
172 AC_DEFUN([AMANDA_WITHOUT_NDMP], [
173 WANT_NDMP=${WANT_NDMP-true}
175 AS_HELP_STRING([--without-ndmp],
176 [do not build ndmp]), [
178 y | ye | yes) WANT_NDMP=true;;
179 n | no) WANT_NDMP=false;;
180 *) AC_MSG_ERROR([You must not supply an argument to --with-ndmp option.]) ;;
185 ## deprecated --with-* options
187 AC_DEFUN([AMANDA_WITH_CLIENT_ONLY], [
188 AC_ARG_WITH(client-only,
189 AS_HELP_STRING([--with-client-only], [deprecated: use --without-server]),
190 [ AC_MSG_ERROR([--with-client-only is deprecated, use --without-server instead.])
194 AC_DEFUN([AMANDA_WITH_SERVER_ONLY], [
195 AC_ARG_WITH(server-only,
196 AS_HELP_STRING([--with-server-only], [deprecated: use --without-client]),
197 [ AC_MSG_ERROR([--with-server-only is deprecated, use --without-client instead.])
203 # AMANDA_SHOW_COMPONENTS_SUMMARY
207 # Show a summary of the settings from this file.
209 AC_DEFUN([AMANDA_SHOW_COMPONENTS_SUMMARY],
211 echo "Amanda Components:$AMANDA_COMPONENTS$missing_components"