Imported Upstream version 3.1.0
[debian/amanda] / config / amanda / defaults.m4
1 # SYNOPSIS
2 #
3 #   Get default settings for various configuration and command-line options:
4 #       --with-index-server
5 #           define and substitute DEFAULT_SERVER
6 #       --with-config
7 #           define and substitute DEFAULT_CONFIG
8 #       --with-tape-server
9 #           define and substitute DEFAULT_TAPE_SERVER
10 #       --with-tape-device
11 #           define and substitute DEFAULT_TAPE_DEVICE; substitue EXAMPLE_TAPEDEV
12 #       --with-amandates
13 #           define and substitute DEFAULT_AMANDATES_FILE
14 #
15 AC_DEFUN([AMANDA_SETUP_DEFAULTS],
16 [
17     #allow configure CONFIG_CLOBBER_MY_CONFIG= to be used by make.
18     CONFIG_CLOBBER_MY_CONFIG=$CLOBBER_MY_CONFIG
19     AC_SUBST(CONFIG_CLOBBER_MY_CONFIG)
20
21     AC_ARG_WITH(index-server,
22         AS_HELP_STRING([--with-index-server=HOST],
23             [default amanda index server (default: `uname -n`)]),
24        [
25             case "$withval" in
26             "" | y | ye | yes | n | no)
27                 AC_MSG_ERROR([*** You must supply an argument to the --with-index-server option.])
28               ;;
29             *) DEFAULT_SERVER="$withval"
30               ;;
31             esac
32        ],
33        : ${DEFAULT_SERVER=`uname -n`}
34     )
35     AC_DEFINE_UNQUOTED(DEFAULT_SERVER,"$DEFAULT_SERVER",
36         [This is the default Amanda index server.])
37     AC_SUBST(DEFAULT_SERVER)
38
39     AC_ARG_WITH(config,
40         AS_HELP_STRING([--with-config=CONFIG],
41             [default amanda configuration (default: DailySet1)]),
42         [
43             case "$withval" in
44             "" | y | ye | yes | n | no)
45                 AC_MSG_ERROR([*** You must supply an argument to the --with-config option.])
46               ;;
47             *) DEFAULT_CONFIG="$withval"
48               ;;
49             esac
50         ],
51         : ${DEFAULT_CONFIG=DailySet1}
52     )
53     AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG",
54         [This is the default Amanda configuration.])
55     AC_SUBST(DEFAULT_CONFIG)
56
57     AC_ARG_WITH(tape-server,
58         AS_HELP_STRING([--with-tape-server=HOST],
59             [default tape server for restore (default: same as index-server)]),
60         [
61             case "$withval" in
62             "" | y | ye | yes | n | no)
63                 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-server option.])
64               ;;
65             *) DEFAULT_TAPE_SERVER="$withval"
66               ;;
67             esac
68         ],
69         : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
70     )
71     AC_DEFINE_UNQUOTED(DEFAULT_TAPE_SERVER,"$DEFAULT_TAPE_SERVER",
72         [This is the default restoring Amanda tape server. ])
73     AC_SUBST(DEFAULT_TAPE_SERVER)
74
75     AC_ARG_WITH(tape-device,
76         AS_HELP_STRING([--with-tape-device=DEVICE],
77             [default device on restore tape server]),
78         [
79             case "$withval" in
80             "" | y | ye | yes | n | no)
81                 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-device option.])
82               ;;
83             *) DEFAULT_TAPE_DEVICE="$withval"
84               ;;
85             esac
86         ]
87     )
88
89     AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",
90         [This is the default no-rewinding tape device. ])
91     AC_SUBST(DEFAULT_TAPE_DEVICE)
92
93     if test "${DEFAULT_TAPE_DEVICE+set}" = "set"; then
94         EXAMPLE_TAPEDEV="$DEFAULT_TAPE_DEVICE"
95     else
96         EXAMPLE_TAPEDEV="tape:/dev/YOUR-TAPE-DEVICE-HERE"
97     fi
98     AC_SUBST(EXAMPLE_TAPEDEV)
99
100     AC_ARG_WITH(changer-device,
101         AS_HELP_STRING([--with-changer-device=DEV],
102             [(deprecated)]),
103         [
104             AMANDA_MSG_WARN([--with-changer-device is no longer used.])
105         ]
106     )
107
108     AC_ARG_WITH(amandates,
109         AS_HELP_STRING([--with-amandates],
110             [default location for 'amandates' (default: $localstatedir/amanda/amandates)]),
111             [
112             case "$withval" in
113                 n | no) AC_MSG_ERROR([*** --without-amandates is not allowed.]);;
114                 y |  ye | yes) amandates='$localstatedir/amanda/amandates' ;;
115                 *) amandates="$withval";;
116             esac
117             ],
118             [amandates='$localstatedir/amanda/amandates']
119     )
120
121     AC_DEFINE_DIR([DEFAULT_AMANDATES_FILE], [amandates],
122         [Default location for 'amandates'])
123
124     DEFAULT_FSF_AFTER_FILEMARK="FALSE"
125     case "$host" in
126         *-solaris*) DEFAULT_FSF_AFTER_FILEMARK="TRUE"
127                     ;;
128     esac
129     AC_DEFINE_UNQUOTED(DEFAULT_FSF_AFTER_FILEMARK, $DEFAULT_FSF_AFTER_FILEMARK,
130         [Define if a FSF is needed on filemark.])
131 ])