diff options
-rw-r--r-- | src/Makefile | 2 | ||||
-rwxr-xr-x | src/configure | 16 | ||||
-rw-r--r-- | src/options.c | 5 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/Makefile b/src/Makefile index 43c0857..ee2c7f1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -67,7 +67,7 @@ distclean: cleanall find . -name *.o -exec rm -f {} \; find . -name "*.\~*" -exec rm -rf {} \; rm -f include.mk - rm -f version.h + rm -f config.h clean: rm -f *.o diff --git a/src/configure b/src/configure index c87f3c2..d1fa13d 100755 --- a/src/configure +++ b/src/configure @@ -105,7 +105,6 @@ rm -f version.h rm -f include.mk case $TARGET in Linux) - LDFLAGS=$LDFLAGS' -ldl' ;; OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD) CFLAGS=$CFLAGS' -I/usr/local/include' @@ -175,23 +174,28 @@ fi HOSTNAME=`hostname` DATE=`date +"%d.%m.%Y %H:%M:%S %Z"` -cat >> version.h <<EOF +cat >> config.h <<EOF /* - * tcpproxy version info + * tcpproxy config header * * this file was created automatically * do not edit this file directly * use ./configure instead */ -#ifndef TCPPROXY_version_h_INCLUDED -#define TCPPROXY_version_h_INCLUDED +#ifndef TCPPROXY_config_h_INCLUDED +#define TCPPROXY_config_h_INCLUDED #define VERSION_STRING_0 "tcpproxy version $VERSION" #define VERSION_STRING_1 "built on $HOSTNAME, $DATE" -#endif +#define TARGET "$TARGET" +#define PREFIX "$PREFIX" +#define SBINDIR "$SBINDIR" +#define ETCDIR "$ETCDIR" +#define CONFFILE "$ETCDIR/tcpproxy.conf" +#endif EOF exit 0 diff --git a/src/options.c b/src/options.c index 175507b..27c97d0 100644 --- a/src/options.c +++ b/src/options.c @@ -26,7 +26,7 @@ */ #include "datatypes.h" -#include "version.h" +#include "config.h" #include "options.h" @@ -222,8 +222,7 @@ void options_default(options_t* opt) opt->local_port_ = NULL; opt->remote_addr_ = NULL; opt->remote_port_ = NULL; - // TODO set system config dir - opt->config_file_ = strdup("/etc/tcpproxy.conf"); + opt->config_file_ = strdup(CONFFILE); string_list_init(&opt->log_targets_); opt->debug_ = 0; } |