]> git.sommitrealweird.co.uk Git - onak.git/commitdiff
Allow setting of config file directory from configure.
authorJonathan McDowell <noodles@earth.li>
Sat, 31 Jul 2004 19:24:55 +0000 (19:24 +0000)
committerJonathan McDowell <noodles@earth.li>
Sat, 31 Jul 2004 19:24:55 +0000 (19:24 +0000)
Pick up config file directory from autoconf sysconfdir variable setting.

Makefile.in
onak-conf.c
onak-conf.h

index e5c99f3138fc4e4aeff7bbfea097ee84b9f7d2b8..fe7cfd40b8952ccb9a48034a006799fdcb3a288f 100644 (file)
@@ -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 \
index 8719235c46953bfbca15c86419a025a6ce8dbd64..81d7bdf97cc978ff2f271643a8dccb61ebf710ad 100644 (file)
@@ -6,6 +6,8 @@
  * Copyright 2002 Project Purple
  */
 
+#include "config.h"
+
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
index b0387adf657a0f5c1b35c6ba6d219b07575eeae0..03f1e8bb75ea7918440dcb6452d6653c736515a2 100644 (file)
@@ -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.