Remove ability to change the name of the default configuration file

This feature will only confuse us during support, if users come to
us with a Tinyproxy build which has a differently named default config
file. This feature is not that useful anyway.
This commit is contained in:
Mukund Sivaraman 2009-09-20 12:33:47 +05:30
parent 6f9fa5287f
commit 90e7d07f44
4 changed files with 4 additions and 31 deletions

2
README
View File

@ -46,8 +46,6 @@ INSTALLATION
Options for file locations etc. Options for file locations etc.
--with-stathost=HOST Set the default name of the stats host --with-stathost=HOST Set the default name of the stats host
--with-config=FILE Set the default location of the
configuration file
SUPPORT SUPPORT

View File

@ -76,32 +76,6 @@ AC_ARG_WITH(stathost,
dnl Set the default configuration file location dnl Set the default configuration file location
test "$prefix" = "NONE" && prefix=/usr/local test "$prefix" = "NONE" && prefix=/usr/local
AH_TEMPLATE([DEFAULT_CONF_FILE],
[This is the default file name for the configuration file.])
AC_ARG_WITH(config,
[AC_HELP_STRING([--with-config=FILE],
[Set the default location of the config file])],
[tp_config_file="$withval"],
[tp_config_file="tinyproxy.conf"])
# If the first character is a slash, it's an absolute path
if [[ `echo $tp_config_file | cut -c1` = "/" ]]; then
TINYPROXY_CONFIG_DIR=`echo "$tp_config_file" | sed 's/^\(.*\)\/[[^\/]]*$/\1/'`
TINYPROXY_CONFIG_FILE=`echo "$tp_config_file" | sed 's/^.*\/\([[^\/]]*\)$/\1/'`
else
# If sysconfdir is /usr/etc, change it to /etc (since /usr/etc doesn't exist)
if [[ "/usr/etc" = `eval echo $sysconfdir` -a "/usr" = "$prefix" ]]; then
TINYPROXY_CONFIG_DIR="/etc/tinyproxy"
else
TINYPROXY_CONFIG_DIR=`eval echo $sysconfdir/tinyproxy`
fi
TINYPROXY_CONFIG_FILE="$tp_config_file"
fi
AC_DEFINE_UNQUOTED(DEFAULT_CONF_FILE, "$TINYPROXY_CONFIG_DIR/$TINYPROXY_CONFIG_FILE")
AC_MSG_NOTICE([Default config location and file is: $TINYPROXY_CONFIG_DIR/$TINYPROXY_CONFIG_FILE])
dnl Add compiler-specific optimization flags dnl Add compiler-specific optimization flags
TP_ARG_ENABLE(debug, TP_ARG_ENABLE(debug,
[Enable debugging support code and methods (default is NO)], [Enable debugging support code and methods (default is NO)],
@ -343,8 +317,6 @@ AC_SUBST(LDFLAGS)
AC_SUBST(CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(LIBS) AC_SUBST(LIBS)
AC_SUBST(ADDITIONAL_OBJECTS) AC_SUBST(ADDITIONAL_OBJECTS)
AC_SUBST(TINYPROXY_CONFIG_DIR)
AC_SUBST(TINYPROXY_CONFIG_FILE)
# Check for asciidoc # Check for asciidoc
AC_PATH_PROG(A2X, a2x, no) AC_PATH_PROG(A2X, a2x, no)

View File

@ -17,6 +17,9 @@
sbin_PROGRAMS = tinyproxy sbin_PROGRAMS = tinyproxy
AM_CPPFLAGS = \
-DSYSCONFDIR=\"${sysconfdir}\"
tinyproxy_SOURCES = \ tinyproxy_SOURCES = \
acl.c acl.h \ acl.c acl.h \
anonymous.c anonymous.h \ anonymous.c anonymous.h \

View File

@ -287,7 +287,7 @@ main (int argc, char **argv)
*/ */
umask (0177); umask (0177);
config.config_file = DEFAULT_CONF_FILE; config.config_file = SYSCONFDIR "/tinyproxy.conf";
config.godaemon = TRUE; config.godaemon = TRUE;
process_cmdline (argc, argv); process_cmdline (argc, argv);