summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-05-08 18:42:44 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-05-08 18:42:44 +0000
commitf58a34ed3436a3f9b7ddc5a51e2b7e3d418a5f5f (patch)
tree91a6666f5ed8baed5ee62141dc65599e36c0f5e7
parent3138b239f6de965d79611bdfd0151699edc43b97 (diff)
--with-config now supports absolute paths as per James Flemer's request.
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac36
2 files changed, 29 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 299655d..9a32d30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-08 Robert James Kaes <rjkaes@flarenet.com>
+
+ * configure.ac: The --with-config option now supports absolute
+ paths. If an absolute path is given, the full directory path and
+ file name are extracted into their appropriate parts.
+
2002-05-07 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (connect_to_tunnel): Removed request logging code in
diff --git a/configure.ac b/configure.ac
index 165ab8d..be5e7fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-dnl $Id: configure.ac,v 2.27 2002-05-02 18:22:15 rjkaes Exp $
+dnl $Id: configure.ac,v 2.28 2002-05-08 18:42:44 rjkaes Exp $
dnl Devlopers, please strive to achieve this order:
dnl
@@ -14,7 +14,7 @@ dnl 8. System services
dnl
dnl Read the Autoconf manual for details.
-AC_INIT([tinyproxy], [1.5.0rc8], [rjkaes@users.sourceforge.net])
+AC_INIT([tinyproxy], [1.5.0rc9], [rjkaes@users.sourceforge.net])
AC_CONFIG_SRCDIR([src/tinyproxy.c])
AC_PREREQ(2.52)
@@ -50,23 +50,33 @@ AC_ARG_WITH(stathost,
dnl Set the default configuration file location
test "$prefix" = "NONE" && prefix=/usr/local
-# 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
-AC_SUBST(TINYPROXY_CONFIG_DIR)
-
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])],
- [TINYPROXY_CONFIG_FILE="$withval"],
- [TINYPROXY_CONFIG_FILE="tinyproxy.conf"])
-AC_DEFINE_UNQUOTED(DEFAULT_CONF_FILE, "$TINYPROXY_CONFIG_DIR/$TINYPROXY_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_SUBST(TINYPROXY_CONFIG_DIR)
AC_SUBST(TINYPROXY_CONFIG_FILE)
+
+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