3 # AMANDA_WITH_ASSERTIONS
7 # Handles the --with-assertions flag. Defines ASSERTIONS if the flag is given.
9 AC_DEFUN([AMANDA_WITH_ASSERTIONS],
11 AC_ARG_WITH(assertions,
12 AS_HELP_STRING([--with-assertions],
13 [compile assertions into code]),
18 AC_DEFINE(ASSERTIONS,1,
19 [Define if you want assertion checking. ])
21 *) AC_MSG_ERROR([*** You must not supply an argument to --with-assertions option.])
30 # AMANDA_WITH_DEBUGGING
34 # Handles the --with[out]-debugging flag. If debugging is not disabled, then define
35 # DEBUG_CODE, and define and substitute AMANDA_DBGDIR to either the location the
36 # user gave, or AMANDA_TMPDIR.
38 AC_DEFUN([AMANDA_WITH_DEBUGGING],
40 AC_REQUIRE([AMANDA_WITH_TMPDIR])
41 AC_ARG_WITH(debugging,
42 AS_HELP_STRING([--with-debugging=DIR]
43 [put debug logs in DIR (default same as --with-tmpdir)]),
44 [ debugging="$withval" ],
49 n | no) AC_MSG_ERROR([Amanda no longer supports building with debugging disabled]);;
50 y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
51 *) AMANDA_DBGDIR="$debugging";;
54 # evaluate any extra variables in the directory
55 AC_DEFINE_DIR([AMANDA_DBGDIR], [AMANDA_DBGDIR],
56 [Location of Amanda directories and files. ])
61 # AMANDA_GLIBC_BACKTRACE
65 # Check for glibc's backtrace support, and define HAVE_GLIBC_BACKTRACE if it is present.
66 AC_DEFUN([AMANDA_GLIBC_BACKTRACE],
68 AC_CHECK_HEADER([execinfo.h], [
69 AC_CHECK_FUNC([backtrace_symbols_fd], [
70 AC_DEFINE(HAVE_GLIBC_BACKTRACE, 1,
71 [Define this if glibc's backtrace functionality (execinfo.h) is present])
78 # AMANDA_WITH_DEBUG_DAYS
82 # Handles the --with-debug-days flag. Defines and substitutes AMANDA_DEBUG_DAYS.
84 AC_DEFUN([AMANDA_WITH_DEBUG_DAYS],
86 AC_ARG_WITH(debug_days,
87 AS_HELP_STRING([--with-debug-days=NN],
88 [number of days to keep debugging files (default: 4)]),
97 AMANDA_DEBUG_DAYS=0 ;;
99 AMANDA_DEBUG_DAYS=4 ;;
100 [[0-9]] | [[0-9]][[0-9]] | [[0-9]][[0-9]][[0-9]])
101 AMANDA_DEBUG_DAYS="$debug_days" ;;
102 *) AC_MSG_ERROR([*** --with-debug-days value not numeric or out of range.])
105 AC_DEFINE_UNQUOTED(AMANDA_DEBUG_DAYS,$AMANDA_DEBUG_DAYS,
106 [Number of days to keep debugging files. ])
107 AC_SUBST(AMANDA_DEBUG_DAYS)
112 # AMANDA_WITH_TESTING
116 # Handles the --with-testing flag. Defines and substitutes SERVICE_SUFFIX, and
117 # defines AMANDA_SERVICE_NAME and KAMANDA_SERVICE_NAME.
119 AC_DEFUN([AMANDA_WITH_TESTING],
122 AS_HELP_STRING([--with-testing@<:@=SUFFIX@:>@],
123 [use alternate service names with suffix (default 'test')]),
131 n | no) SERVICE_SUFFIX="";;
132 y | ye | yes) SERVICE_SUFFIX="-test";;
133 *) SERVICE_SUFFIX="-$TESTING";;
136 AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
137 KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
139 AC_SUBST(SERVICE_SUFFIX)
140 AC_DEFINE_UNQUOTED(SERVICE_SUFFIX, "$SERVICE_SUFFIX",
141 [A suffix that will be appended to service names.
142 * Useful for testing in parallel with a working version. ])
143 AC_DEFINE_UNQUOTED(AMANDA_SERVICE_NAME, "$AMANDA_SERVICE_NAME",
144 [The name for the Amanda service. ])
145 AC_DEFINE_UNQUOTED(KAMANDA_SERVICE_NAME, "$KAMANDA_SERVICE_NAME",
146 [The name for the Kerberized Amanda service. ])