3 # Get default settings for various configuration and command-line options:
5 # define and substitute DEFAULT_SERVER
7 # define and substitute DEFAULT_CONFIG
9 # define and substitute DEFAULT_TAPE_SERVER
11 # define and substitute DEFAULT_TAPE_DEVICE; substitue EXAMPLE_TAPEDEV
12 # --with-changer-device
13 # define and substitute DEFAULT_CHANGER_DEVICE
15 # define and substitute DEFAULT_AMANDATES_FILE
17 AC_DEFUN([AMANDA_SETUP_DEFAULTS],
19 AC_ARG_WITH(index-server,
20 AS_HELP_STRING([--with-index-server=HOST],
21 [default amanda index server (default: `uname -n`)]),
24 "" | y | ye | yes | n | no)
25 AC_MSG_ERROR([*** You must supply an argument to the --with-index-server option.])
27 *) DEFAULT_SERVER="$withval"
31 : ${DEFAULT_SERVER=`uname -n`}
33 AC_DEFINE_UNQUOTED(DEFAULT_SERVER,"$DEFAULT_SERVER",
34 [This is the default Amanda index server.])
35 AC_SUBST(DEFAULT_SERVER)
38 AS_HELP_STRING([--with-config=CONFIG],
39 [default amanda configuration (default: DailySet1)]),
42 "" | y | ye | yes | n | no)
43 AC_MSG_ERROR([*** You must supply an argument to the --with-config option.])
45 *) DEFAULT_CONFIG="$withval"
49 : ${DEFAULT_CONFIG=DailySet1}
51 AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG",
52 [This is the default Amanda configuration.])
53 AC_SUBST(DEFAULT_CONFIG)
55 AC_ARG_WITH(tape-server,
56 AS_HELP_STRING([--with-tape-server=HOST],
57 [default tape server for restore (default: same as index-server)]),
60 "" | y | ye | yes | n | no)
61 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-server option.])
63 *) DEFAULT_TAPE_SERVER="$withval"
67 : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
69 AC_DEFINE_UNQUOTED(DEFAULT_TAPE_SERVER,"$DEFAULT_TAPE_SERVER",
70 [This is the default restoring Amanda tape server. ])
71 AC_SUBST(DEFAULT_TAPE_SERVER)
73 AC_ARG_WITH(tape-device,
74 AS_HELP_STRING([--with-tape-device=DEVICE],
75 [default device on restore tape server]),
78 "" | y | ye | yes | n | no)
79 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-device option.])
81 *) DEFAULT_TAPE_DEVICE="$withval"
87 AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",
88 [This is the default no-rewinding tape device. ])
89 AC_SUBST(DEFAULT_TAPE_DEVICE)
91 if test "${DEFAULT_TAPE_DEVICE+set}" = "set"; then
92 EXAMPLE_TAPEDEV="$DEFAULT_TAPE_DEVICE"
94 EXAMPLE_TAPEDEV="tape:/dev/YOUR-TAPE-DEVICE-HERE"
96 AC_SUBST(EXAMPLE_TAPEDEV)
98 AC_ARG_WITH(changer-device,
99 AS_HELP_STRING([--with-changer-device=DEV],
100 [default tape changer device (default: /dev/ch0)]),
103 "" | y | ye | yes | n | no)
104 AC_MSG_ERROR([*** You must supply an argument to the --with-changer-device option.])
106 *) DEFAULT_CHANGER_DEVICE="$withval"
112 if test -z "$DEFAULT_CHANGER_DEVICE"; then
113 DEFAULT_CHANGER_DEVICE=/dev/null
114 if test -f /dev/ch0; then
115 DEFAULT_CHANGER_DEVICE=/dev/ch0
119 AC_DEFINE_UNQUOTED(DEFAULT_CHANGER_DEVICE,"$DEFAULT_CHANGER_DEVICE",
120 [This is the default changer device. ])
121 AC_SUBST(DEFAULT_CHANGER_DEVICE)
123 AC_ARG_WITH(amandates,
124 AS_HELP_STRING([--with-amandates],
125 [default location for 'amandates' (default: $localstatedir/amanda/amandates)]),
128 n | no) AC_MSG_ERROR([*** --without-amandates is not allowed.]);;
129 y | ye | yes) amandates='$localstatedir/amanda/amandates' ;;
130 *) amandates="$withval";;
133 [amandates='$localstatedir/amanda/amandates']
136 AC_DEFINE_DIR([DEFAULT_AMANDATES_FILE], [amandates],
137 [Default location for 'amandates'])