Added code to figure out and install the configuration file.

This commit is contained in:
Robert James Kaes 2002-05-02 04:44:03 +00:00
parent c89813d5d7
commit 82f7a5cba6
3 changed files with 41 additions and 18 deletions

View File

@ -1,3 +1,12 @@
2002-05-02 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac: Added code to figure out exactly where to install
the configuration file.
* Makefile.am (install-data-local): Added a new install run to
install the configuration file to the location specified in
DEFAULT_CONF_FILE.
2002-04-28 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (process_client_headers):

View File

@ -1,2 +1,17 @@
EXTRA_DIST = TODO
SUBDIRS = src doc
install-data-local:
mkdir -p @TINYPROXY_CONFIG_DIR@
$(INSTALL) doc/tinyproxy.conf @TINYPROXY_CONFIG@-dist
test ! -f @TINYPROXY_CONFIG@ && $(INSTALL) doc/tinyproxy.conf @TINYPROXY_CONFIG@
echo ""
echo "A configuration file has been copied to:"
echo "@TINYPROXY_CONFIG@-dist"
echo "You will need to rename this file to:"
echo "@TINYPROXY_CONFIG@"
echo "and modify the values to suit your local system."
echo ""
echo "All the configuration directives are commented in the file, so"
echo "you should not have any problems configuring your system."
echo ""

View File

@ -1,4 +1,4 @@
dnl $Id: configure.ac,v 2.23 2002-04-29 16:32:20 rjkaes Exp $
dnl $Id: configure.ac,v 2.24 2002-05-02 04:44:03 rjkaes Exp $
dnl Devlopers, please strive to achieve this order:
dnl
@ -37,30 +37,29 @@ dnl Command line options
dnl
dnl Set the URL name for find the statistics of tinyproxy
AH_VERBATIM([DEFAULT_STATHOST],
[/*
* This controls remote proxy stats deplay. For example, the default
* DEFAULT_STATHOST of "tinyproxy.stats" means that where you access
* "http://tinyproxy.stats/" you will be shown the proxy stats. Use "" to
* disable.
*/
#ifndef DEFAULT_STATHOST
# define DEFAULT_STATHOST "tinyproxy.stats"
#endif])
AH_TEMPLATE([DEFAULT_STATHOST],
[This controls remote proxy stats display.])
AC_ARG_WITH(stathost,
[AC_HELP_STRING([--with-stathost=HOST], [Default status host])],
[AC_DEFINE_UNQUOTED(DEFAULT_STATHOST, ["$withval"])])
[AC_DEFINE_UNQUOTED(DEFAULT_STATHOST, "$withval")],
[AC_DEFINE_UNQUOTED(DEFAULT_STATHOST, "tinyproxy.stats")])
dnl Set the default configuration file location
AH_VERBATIM([DEFAULT_CONF_FILE],
[/* This is the default location of the configuation file. */
#ifndef DEFAULT_CONF_FILE
# define DEFAULT_CONF_FILE "/etc/tinyproxy/tinyproxy.conf"
#endif])
test "$prefix" = "NONE" && prefix=/usr/local
TINYPROXY_CONFIG_DIR=`eval echo $sysconfdir/tinyproxy`
AC_SUBST(TINYPROXY_CONFIG_DIR)
AH_TEMPLATE([DEFAULT_CONF_FILE],
[This is the default location of the configuration file.])
AC_ARG_WITH(config,
[AC_HELP_STRING([--with-config=FILE],
[Set the default location of the config file])],
[AC_DEFINE_UNQUOTED(DEFAULT_CONF_FILE, ["$withval"])])
[TINYPROXY_CONFIG="$withval"],
[TINYPROXY_CONFIG="$TINYPROXY_CONFIG_DIR/tinyproxy.conf"])
AC_DEFINE_UNQUOTED(DEFAULT_CONF_FILE, "$TINYPROXY_CONFIG")
AC_SUBST(TINYPROXY_CONFIG)
# [AC_DEFINE_UNQUOTED(DEFAULT_CONF_FILE, "$withval")],
# [AC_DEFINE_UNQUOTED(DEFAULT_CONF_FILE, "/etc/tinyproxy/tinyproxy.conf")])
dnl Add compiler-specific optimization flags
AC_ARG_ENABLE(debug,