1dnl paths.m4 -- Configure various paths used by INN.
2dnl $Id: paths.m4 8495 2009-05-24 12:28:19Z iulius $
3dnl
4dnl INN has quite a few more configurable paths than autoconf supports by
5dnl default.  The regular --*dir options are honored where appropriate, but
6dnl for the rest that are non-standard, add --with-*-dir options.
7dnl
8dnl Also set the output variables PATH_CONFIG and PATH_TMP with fully expanded
9dnl versions of tmpdir and sysconfdir, suitable for use in C code.
10
11dnl This is the generic macro for those arguments; it takes the name of the
12dnl directory, the path relative to $prefix if none given to configure, the
13dnl variable to set, and the help string.
14AC_DEFUN([_INN_ARG_DIR],
15[AC_ARG_WITH([$1-dir], [$4], [$3=$with_$1_dir], [$3=$2])
16AC_SUBST($3)])
17
18dnl And here are all the paths.
19AC_DEFUN([INN_ARG_PATHS],
20[_INN_ARG_DIR([control], ['${bindir}/control'], [CONTROLDIR],
21    [AS_HELP_STRING([--with-control-dir=PATH],
22        [Path for control programs [PREFIX/bin/control]])])
23_INN_ARG_DIR([db], ['${prefix}/db'], [DBDIR],
24    [AS_HELP_STRING([--with-db-dir=PATH],
25        [Path for news database files [PREFIX/db]])])
26_INN_ARG_DIR([doc], ['${prefix}/doc'], [docdir],
27    [AS_HELP_STRING([--with-doc-dir=PATH],
28        [Path for news documentation [PREFIX/doc]])])
29_INN_ARG_DIR([filter], ['${bindir}/filter'], [FILTERDIR],
30    [AS_HELP_STRING([--with-filter-dir=PATH],
31        [Path for embedded filters [PREFIX/bin/filter]])])
32_INN_ARG_DIR([http], ['${prefix}/http'], [HTTPDIR],
33    [AS_HELP_STRING([--with-http-dir=PATH],
34        [Path for web pages [PREFIX/http]])])
35_INN_ARG_DIR([libperl], ['${libdir}/perl'], [LIBPERLDIR],
36    [AS_HELP_STRING([--with-libperl-dir=PATH],
37        [Path for Perl modules [PREFIX/lib/perl]])])
38_INN_ARG_DIR([log], ['${prefix}/log'], [LOGDIR],
39    [AS_HELP_STRING([--with-log-dir=PATH],
40        [Path for news logs [PREFIX/log]])])
41_INN_ARG_DIR([run], ['${prefix}/run'], [RUNDIR],
42    [AS_HELP_STRING([--with-run-dir=PATH],
43        [Path for news PID/runtime files [PREFIX/run]])])
44_INN_ARG_DIR([spool], ['${prefix}/spool'], [SPOOLDIR],
45    [AS_HELP_STRING([--with-spool-dir=PATH],
46        [Path for news storage [PREFIX/spool]])])
47_INN_ARG_DIR([tmp], ['${prefix}/tmp'], [tmpdir],
48    [AS_HELP_STRING([--with-tmp-dir=PATH],
49        [Path for temporary files [PREFIX/tmp]])])
50
51dnl Some additional paths used by inn/paths.h.
52eval PATH_CONFIG="$sysconfdir"
53eval PATH_TMP="$tmpdir"
54AC_SUBST([PATH_CONFIG])
55AC_SUBST([PATH_TMP])])
56