From 6f0d21388eeeb33893728d92dfc0f3a3a6d6aafe Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Sat, 31 Jul 2004 19:24:55 +0000 Subject: [PATCH] Allow setting of config file directory from configure. Pick up config file directory from autoconf sysconfdir variable setting. --- Makefile.in | 4 ++++ onak-conf.c | 2 ++ onak-conf.h | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index e5c99f3..fe7cfd4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -10,6 +10,7 @@ LDFLAGS += @LDFLAGS@ DBTYPE = @DBTYPE@ # LIBS = @LIBS@ +prefix ?= @prefix@ PROGS = add lookup gpgwww onak splitkeys CORE_OBJS = armor.o charfuncs.o decodekey.o getcgi.o hash.o keydb_$(DBTYPE).o \ @@ -50,6 +51,9 @@ onak: onak.o merge.o cleankey.o $(CORE_OBJS) $(CC) $(LDFLAGS) -o onak onak.o merge.o cleankey.o \ $(CORE_OBJS) $(LIBS) +onak-conf.o: onak-conf.c onak-conf.h + $(CC) $(CFLAGS) -DCONFIGFILE=\"@sysconfdir@/onak.conf\" -c onak-conf.c + clean: $(RM) -f $(PROGS) $(OBJS) Makefile.bak testparse maxpath *.core core \ gpgwww.o add.o lookup.o main.o maxpath.o onak.o sixdegrees \ diff --git a/onak-conf.c b/onak-conf.c index 8719235..81d7bdf 100644 --- a/onak-conf.c +++ b/onak-conf.c @@ -6,6 +6,8 @@ * Copyright 2002 Project Purple */ +#include "config.h" + #include #include #include diff --git a/onak-conf.h b/onak-conf.h index b0387ad..03f1e8b 100644 --- a/onak-conf.h +++ b/onak-conf.h @@ -10,7 +10,6 @@ #define __ONAK_CONF_H_ #define VERSION "0.2.1" -#define CONFIGFILE "/home/noodles/projects/onak/onak.conf" /* * struct onak_config - Runtime configuration for onak. -- 2.39.5