dirs: Make sysconfdir available via ovs_sysconfdir().
authorBen Pfaff <blp@nicira.com>
Sat, 9 Jul 2011 00:03:17 +0000 (17:03 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 26 Jul 2011 23:50:08 +0000 (16:50 -0700)
This will be used in upcoming patches.

lib/automake.mk
lib/dirs.c.in
lib/dirs.h

index 8d93c7a..d55465b 100644 (file)
@@ -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
index a174ab3..5b6b874 100644 (file)
@@ -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)
 {
index 3035305..57107ff 100644 (file)
@@ -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 */