3 # AMANDA_WITH_ASSERTIONS
7 # Handles the --with-assertions flag. Defines and substitutes ASSERTIONS
8 # if the flag is given.
10 AC_DEFUN([AMANDA_WITH_ASSERTIONS],
13 AC_ARG_WITH(assertions,
14 AS_HELP_STRING([--with-assertions],
15 [compile assertions into code]),
21 AC_DEFINE(ASSERTIONS,1,
22 [Define if you want assertion checking. ])
24 *) AC_MSG_ERROR([*** You must not supply an argument to --with-assertions option.])
34 # AMANDA_WITH_DEBUGGING
38 # Handles the --with[out]-debugging flag. If debugging is not disabled, then define
39 # DEBUG_CODE, and define and substitute AMANDA_DBGDIR to either the location the
40 # user gave, or AMANDA_TMPDIR.
42 AC_DEFUN([AMANDA_WITH_DEBUGGING],
44 AC_REQUIRE([AMANDA_WITH_TMPDIR])
45 AC_ARG_WITH(debugging,
46 AS_HELP_STRING([--with-debugging=DIR]
47 [put debug logs in DIR (default same as --with-tmpdir)]),
48 [ debugging="$withval" ],
53 n | no) AC_MSG_ERROR([Amanda no longer supports building with debugging disabled]);;
54 y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
55 *) AMANDA_DBGDIR="$debugging";;
58 # evaluate any extra variables in the directory
59 AC_DEFINE_DIR([AMANDA_DBGDIR], [AMANDA_DBGDIR],
60 [Location of Amanda directories and files. ])
65 # AMANDA_GLIBC_BACKTRACE
69 # Check for glibc's backtrace support, and define HAVE_GLIBC_BACKTRACE if it is present.
70 AC_DEFUN([AMANDA_GLIBC_BACKTRACE],
72 AC_CHECK_HEADER([execinfo.h], [
73 AC_CHECK_FUNC([backtrace_symbols_fd], [
74 AC_DEFINE(HAVE_GLIBC_BACKTRACE, 1,
75 [Define this if glibc's backtrace functionality (execinfo.h) is present])
82 # AMANDA_WITH_DEBUG_DAYS
86 # Handles the --with-debug-days flag. Defines and substitutes AMANDA_DEBUG_DAYS.
88 AC_DEFUN([AMANDA_WITH_DEBUG_DAYS],
90 AC_ARG_WITH(debug_days,
91 AS_HELP_STRING([--with-debug-days=NN],
92 [number of days to keep debugging files (default: 4)]),
101 AMANDA_DEBUG_DAYS=0 ;;
103 AMANDA_DEBUG_DAYS=4 ;;
104 [[0-9]] | [[0-9]][[0-9]] | [[0-9]][[0-9]][[0-9]])
105 AMANDA_DEBUG_DAYS="$debug_days" ;;
106 *) AC_MSG_ERROR([*** --with-debug-days value not numeric or out of range.])
109 AC_DEFINE_UNQUOTED(AMANDA_DEBUG_DAYS,$AMANDA_DEBUG_DAYS,
110 [Number of days to keep debugging files. ])
111 AC_SUBST(AMANDA_DEBUG_DAYS)
116 # AMANDA_WITH_TESTING
120 # Handles the --with-testing flag. Defines and substitutes SERVICE_SUFFIX, and
121 # defines AMANDA_SERVICE_NAME and KAMANDA_SERVICE_NAME.
123 AC_DEFUN([AMANDA_WITH_TESTING],
126 AS_HELP_STRING([--with-testing@<:@=SUFFIX@:>@],
127 [use alternate service names with suffix (default 'test')]),
135 n | no) SERVICE_SUFFIX="";;
136 y | ye | yes) SERVICE_SUFFIX="-test";;
137 *) SERVICE_SUFFIX="-$TESTING";;
140 AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
141 KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
143 AC_SUBST(SERVICE_SUFFIX)
144 AC_DEFINE_UNQUOTED(SERVICE_SUFFIX, "$SERVICE_SUFFIX",
145 [A suffix that will be appended to service names.
146 * Useful for testing in parallel with a working version. ])
147 AC_DEFINE_UNQUOTED(AMANDA_SERVICE_NAME, "$AMANDA_SERVICE_NAME",
148 [The name for the Amanda service. ])
149 AC_DEFINE_UNQUOTED(KAMANDA_SERVICE_NAME, "$KAMANDA_SERVICE_NAME",
150 [The name for the Kerberized Amanda service. ])
155 # AMANDA_ENABLE_SYNTAX_CHECKS
159 # Handles the --enable-syntax-checks flag, which triggers syntax checks
160 # for most 'make' targets, but causes spurious errors in all but the most
161 # carefully-constructed build environments.
163 AC_DEFUN([AMANDA_DISABLE_SYNTAX_CHECKS],
165 AC_ARG_ENABLE(syntax-checks,
166 AS_HELP_STRING([--enable-syntax-checks],
167 [Perform syntax checks when installing - developers only]),
170 no) SYNTAX_CHECKS=false;;
173 AMANDA_MSG_WARN([--enable-syntax-checks can cause build failures and should only be used by developers])
180 AM_CONDITIONAL(SYNTAX_CHECKS, $SYNTAX_CHECKS)