Avoid duplicated logic to get the config filename (and reduce preprocessor symbols)
authorBernd Petrovitsch <bernd@firmix.at>
Sun, 23 Nov 2008 22:28:17 +0000 (23:28 +0100)
committerBernd Petrovitsch <bernd@firmix.at>
Sun, 23 Nov 2008 22:28:17 +0000 (23:28 +0100)
Makefile.inc
src/defs.h

index 191a0c0..ce7ed73 100644 (file)
@@ -49,7 +49,8 @@ CFGNAME ?= $(EXENAME).conf
 CFGFILE ?= $(ETCDIR)/$(CFGNAME)
 
 CPPFLAGS =     $(filter-out -I./src,-Isrc -I$(TOPDIR)/src)
-CPPFLAGS +=    -DETCDIR='"$(ETCDIR)"'
+CPPFLAGS +=    -DOLSRD_CONF_FILE_NAME='"$(CFGNAME)"'
+CPPFLAGS +=    -DOLSRD_GLOBAL_CONF_FILE='"$(CFGFILE)"'
 
 # add gcc warnings and optimizations if CFLAGS not set
 ifndef CFLAGS
index df095c8..5378fb9 100644 (file)
@@ -49,11 +49,6 @@ extern const char olsrd_version[];
 extern const char build_date[]; 
 extern const char build_host[];
 
-#ifndef OLSRD_GLOBAL_CONF_FILE
-#define OLSRD_CONF_FILE_NAME   "olsrd.conf"
-#define OLSRD_GLOBAL_CONF_FILE ETCDIR "/" OLSRD_CONF_FILE_NAME
-#endif
-
 #define        MAXMESSAGESIZE          1500    /* max broadcast size */
 #define UDP_IPV4_HDRSIZE        28
 #define UDP_IPV6_HDRSIZE        62