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 #allow configure CONFIG_CLOBBER_MY_CONFIG= to be used by make.
20 CONFIG_CLOBBER_MY_CONFIG=$CLOBBER_MY_CONFIG
21 AC_SUBST(CONFIG_CLOBBER_MY_CONFIG)
23 AC_ARG_WITH(index-server,
24 AS_HELP_STRING([--with-index-server=HOST],
25 [default amanda index server (default: `uname -n`)]),
28 "" | y | ye | yes | n | no)
29 AC_MSG_ERROR([*** You must supply an argument to the --with-index-server option.])
31 *) DEFAULT_SERVER="$withval"
35 : ${DEFAULT_SERVER=`uname -n`}
37 AC_DEFINE_UNQUOTED(DEFAULT_SERVER,"$DEFAULT_SERVER",
38 [This is the default Amanda index server.])
39 AC_SUBST(DEFAULT_SERVER)
42 AS_HELP_STRING([--with-config=CONFIG],
43 [default amanda configuration (default: DailySet1)]),
46 "" | y | ye | yes | n | no)
47 AC_MSG_ERROR([*** You must supply an argument to the --with-config option.])
49 *) DEFAULT_CONFIG="$withval"
53 : ${DEFAULT_CONFIG=DailySet1}
55 AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG",
56 [This is the default Amanda configuration.])
57 AC_SUBST(DEFAULT_CONFIG)
59 AC_ARG_WITH(tape-server,
60 AS_HELP_STRING([--with-tape-server=HOST],
61 [default tape server for restore (default: same as index-server)]),
64 "" | y | ye | yes | n | no)
65 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-server option.])
67 *) DEFAULT_TAPE_SERVER="$withval"
71 : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
73 AC_DEFINE_UNQUOTED(DEFAULT_TAPE_SERVER,"$DEFAULT_TAPE_SERVER",
74 [This is the default restoring Amanda tape server. ])
75 AC_SUBST(DEFAULT_TAPE_SERVER)
77 AC_ARG_WITH(tape-device,
78 AS_HELP_STRING([--with-tape-device=DEVICE],
79 [default device on restore tape server]),
82 "" | y | ye | yes | n | no)
83 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-device option.])
85 *) DEFAULT_TAPE_DEVICE="$withval"
91 AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",
92 [This is the default no-rewinding tape device. ])
93 AC_SUBST(DEFAULT_TAPE_DEVICE)
95 if test "${DEFAULT_TAPE_DEVICE+set}" = "set"; then
96 EXAMPLE_TAPEDEV="$DEFAULT_TAPE_DEVICE"
98 EXAMPLE_TAPEDEV="tape:/dev/YOUR-TAPE-DEVICE-HERE"
100 AC_SUBST(EXAMPLE_TAPEDEV)
102 AC_ARG_WITH(changer-device,
103 AS_HELP_STRING([--with-changer-device=DEV],
104 [default tape changer device (default: /dev/ch0)]),
107 "" | y | ye | yes | n | no)
108 AC_MSG_ERROR([*** You must supply an argument to the --with-changer-device option.])
110 *) DEFAULT_CHANGER_DEVICE="$withval"
116 if test -z "$DEFAULT_CHANGER_DEVICE"; then
117 DEFAULT_CHANGER_DEVICE=/dev/null
118 if test -f /dev/ch0; then
119 DEFAULT_CHANGER_DEVICE=/dev/ch0
123 AC_DEFINE_UNQUOTED(DEFAULT_CHANGER_DEVICE,"$DEFAULT_CHANGER_DEVICE",
124 [This is the default changer device. ])
125 AC_SUBST(DEFAULT_CHANGER_DEVICE)
127 AC_ARG_WITH(amandates,
128 AS_HELP_STRING([--with-amandates],
129 [default location for 'amandates' (default: $localstatedir/amanda/amandates)]),
132 n | no) AC_MSG_ERROR([*** --without-amandates is not allowed.]);;
133 y | ye | yes) amandates='$localstatedir/amanda/amandates' ;;
134 *) amandates="$withval";;
137 [amandates='$localstatedir/amanda/amandates']
140 AC_DEFINE_DIR([DEFAULT_AMANDATES_FILE], [amandates],
141 [Default location for 'amandates'])