From: Ben Pfaff <blp@nicira.com>
Date: Sat, 9 Jul 2011 00:03:17 +0000 (-0700)
Subject: dirs: Make sysconfdir available via ovs_sysconfdir().
X-Git-Tag: v1.2.0~38
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2fad9ebd12e03a4be9d6f0227b32242287a8bec2;p=sliver-openvswitch.git

dirs: Make sysconfdir available via ovs_sysconfdir().

This will be used in upcoming patches.
---

diff --git a/lib/automake.mk b/lib/automake.mk
index 8d93c7a1d..d55465bb6 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -263,6 +263,7 @@ lib/dirs.c: lib/dirs.c.in Makefile
 		-e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
 		-e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
 		-e 's,[@]bindir[@],"$(bindir)",g' \
+		-e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
 		-e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
 	     > lib/dirs.c.tmp
 	mv lib/dirs.c.tmp lib/dirs.c
diff --git a/lib/dirs.c.in b/lib/dirs.c.in
index a174ab386..5b6b8748a 100644
--- a/lib/dirs.c.in
+++ b/lib/dirs.c.in
@@ -1,6 +1,6 @@
 #line 2 "@srcdir@/lib/dirs.c.in"
 /*
- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,6 +37,13 @@ get_dir(struct directory *d)
     return d->value;
 }
 
+const char *
+ovs_sysconfdir(void)
+{
+    static struct directory d = { NULL, @sysconfdir@, "OVS_SYSCONFDIR" };
+    return get_dir(&d);
+}
+
 const char *
 ovs_pkgdatadir(void)
 {
diff --git a/lib/dirs.h b/lib/dirs.h
index 303530598..57107ff50 100644
--- a/lib/dirs.h
+++ b/lib/dirs.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 #ifndef DIRS_H
 #define DIRS_H 1
 
+const char *ovs_sysconfdir(void); /* /usr/local/etc */
 const char *ovs_pkgdatadir(void); /* /usr/local/share/openvswitch */
 const char *ovs_rundir(void);     /* /usr/local/var/run/openvswitch */
 const char *ovs_logdir(void);     /* /usr/local/var/log/openvswitch */