]> xenbits.xensource.com Git - libvirt.git/commitdiff
maint: use gnulib configmake rather than open-coding things
authorEric Blake <eblake@redhat.com>
Tue, 16 Nov 2010 14:54:17 +0000 (07:54 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 17 Nov 2010 15:58:58 +0000 (08:58 -0700)
* bootstrap.conf (gnulib_modules): Add configmake.
* daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by
gnulib.
* src/Makefile.am (INCLUDES): Likewise.
* tests/Makefile.am (INCLUDES): Likewise.
* tools/Makefile.am (virsh_CFLAGS): Likewise.
* daemon/libvirtd.c (qemudInitPaths, usage, main): Update
clients.
* src/cpu/cpu_map.c (CPUMAPFILE): Likewise.
* src/driver.c (DEFAULT_DRIVER_DIR): Likewise.
* src/internal.h (_): Likewise.
* src/libvirt.c (virInitialize): Likewise.
* src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR):
Likewise.
* src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig):
Likewise.
* src/network/bridge_driver.c (NETWORK_PID_DIR)
(NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise.
* src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup):
Likewise.
* src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise.
* src/qemu/qemu_driver.c (qemudStartup): Likewise.
* src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET)
(LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE)
(LIBVIRT_PKI_DIR): Likewise.
* src/secret/secret_driver.c (secretDriverStartup): Likewise.
* src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise.
* src/security/virt-aa-helper.c (main): Likewise.
* src/storage/storage_backend_disk.c (PARTHELPER): Likewise.
* src/storage/storage_driver.c (storageDriverStartup): Likewise.
* src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise.
* src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise.
* tools/virsh.c (main): Likewise.
* docs/hooks.html.in: Likewise.

26 files changed:
bootstrap.conf
daemon/Makefile.am
daemon/libvirtd.c
docs/hooks.html.in
src/Makefile.am
src/cpu/cpu_map.c
src/driver.c
src/internal.h
src/libvirt.c
src/lxc/lxc_conf.c
src/lxc/lxc_conf.h
src/network/bridge_driver.c
src/nwfilter/nwfilter_driver.c
src/qemu/qemu_conf.c
src/qemu/qemu_driver.c
src/remote/remote_driver.h
src/secret/secret_driver.c
src/security/security_apparmor.c
src/security/virt-aa-helper.c
src/storage/storage_backend_disk.c
src/storage/storage_driver.c
src/uml/uml_driver.c
src/util/hooks.c
tests/Makefile.am
tools/Makefile.am
tools/virsh.c

index 12f64c8659c2093768ef7a88903d0b46e3a97426..2ad1957b0cba59fc3bc02fe68389425b1978dd49 100644 (file)
@@ -25,6 +25,7 @@ c-ctype
 canonicalize-lgpl
 close
 connect
+configmake
 count-one-bits
 crypto/md5
 dirname-lgpl
index 88082269b90cf68042116edc39750dd1b5cbeede..72778e50af0505d64a327c762571e8a22acbf450 100644 (file)
@@ -85,12 +85,10 @@ libvirtd_CFLAGS = \
        -I$(top_srcdir)/src/remote \
        $(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
        $(POLKIT_CFLAGS) \
-       $(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
+       $(WARN_CFLAGS) \
        $(COVERAGE_CFLAGS) \
-       -DSYSCONF_DIR="\"$(sysconfdir)\"" \
        -DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
-       -DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
-       -DGETTEXT_PACKAGE=\"$(PACKAGE)\"
+       -DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
 
 libvirtd_LDFLAGS =                                     \
        $(WARN_CFLAGS)                                  \
index 6c2d3c372b36375662055c7f75445ef866270496..dcd9f247541545a76a095fc1bf3c1279c4f48134 100644 (file)
@@ -137,6 +137,8 @@ static int unix_sock_ro_mask = 0777; /* Allow world */
 
 #endif /* __sun */
 
+#include "configmake.h"
+
 static int godaemon = 0;        /* -d: Be a daemon */
 static int verbose = 0;         /* -v: Verbose mode */
 static int timeout = -1;        /* -t: Shutdown timeout */
@@ -745,7 +747,7 @@ static int qemudInitPaths(struct qemud_server *server,
     /* The base_dir_prefix is the base under which all libvirtd
      * files live */
     if (server->privileged) {
-        if (!(base_dir_prefix = strdup (LOCAL_STATE_DIR)))
+        if (!(base_dir_prefix = strdup (LOCALSTATEDIR)))
             goto no_memory;
     } else {
         uid_t uid = geteuid();
@@ -3038,9 +3040,9 @@ libvirt management daemon:\n\
       %s\n\
 \n"),
                argv0,
-               SYSCONF_DIR,
-               LOCAL_STATE_DIR,
-               LOCAL_STATE_DIR,
+               SYSCONFDIR,
+               LOCALSTATEDIR,
+               LOCALSTATEDIR,
                LIBVIRT_CACERT,
                LIBVIRT_SERVERCERT,
                LIBVIRT_SERVERKEY,
@@ -3137,7 +3139,7 @@ int main(int argc, char **argv) {
 
     if (remote_config_file == NULL) {
         static const char *default_config_file
-            = SYSCONF_DIR "/libvirt/libvirtd.conf";
+            = SYSCONFDIR "/libvirt/libvirtd.conf";
         remote_config_file =
             (access(default_config_file, R_OK) == 0
              ? default_config_file
@@ -3169,7 +3171,7 @@ int main(int argc, char **argv) {
 
     /* Ensure the rundir exists (on tmpfs on some systems) */
     if (geteuid() == 0) {
-        const char *rundir = LOCAL_STATE_DIR "/run/libvirt";
+        const char *rundir = LOCALSTATEDIR "/run/libvirt";
 
         if (mkdir (rundir, 0755)) {
             if (errno != EEXIST) {
index 2ce785ff0709466d9d7ced3b4f0632715ceac473..3503f8c2ad2501a233e02a4656d88ea7ee26e718 100644 (file)
@@ -19,7 +19,7 @@
 
     <h2><a name="location">Script location</a></h2>
     <p>The libvirt hook scripts are located in the directory
-       <code>$SYSCONF_DIR/libvirt/hooks/</code>.</p>
+       <code>$SYSCONFDIR/libvirt/hooks/</code>.</p>
     <ul>
       <li>In Linux distributions such as Fedora and RHEL, this is
           <code>/etc/libvirt/hooks/</code>.  Other Linux distributions may do
index 20c0c9f4a701494af3cad5cbba516984609494cf..a9a1986c6d802c302d6629925a4747829ba609cd 100644 (file)
@@ -11,14 +11,6 @@ INCLUDES =                                                   \
                -I@top_srcdir@/include                          \
                $(DRIVER_MODULE_CFLAGS)                         \
                $(LIBXML_CFLAGS)                                \
-               -DLIBDIR=\""$(libdir)"\"                        \
-               -DBINDIR=\""$(libexecdir)"\"                    \
-               -DSBINDIR=\""$(sbindir)"\"                      \
-               -DSYSCONF_DIR="\"$(sysconfdir)\""               \
-               -DLOCALEBASEDIR=\""$(datadir)/locale"\"         \
-               -DPKGDATADIR=\""$(pkgdatadir)"\"                \
-               -DLOCAL_STATE_DIR=\""$(localstatedir)"\"        \
-               -DGETTEXT_PACKAGE=\"$(PACKAGE)\"                \
                $(WARN_CFLAGS)                                  \
                $(LOCK_CHECKING_CFLAGS)                 \
                -DIN_LIBVIRT                            \
index 263bb9e93ec777a3b025c0597f8fe9cca72e1af9..0c5ff8a421bfd77aaefca858017ea455811258ed 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * cpu_map.c: internal functions for handling CPU mapping configuration
  *
- * Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2009-2010 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -26,7 +26,7 @@
 #include "memory.h"
 #include "cpu.h"
 #include "cpu_map.h"
-
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_CPU
 
index a6f55580ab286b3b9b4b47369ad121cf01270229..d83b1fddfa688791fe665a4770ad7ca9fcf0b764 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * driver.c: Helpers for loading drivers
  *
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2010 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -28,6 +28,7 @@
 #include "memory.h"
 #include "logging.h"
 #include "util.h"
+#include "configmake.h"
 
 #define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/drivers"
 
index fab3e111ccfdbc767f2bac8145e3a67f94b8ddc5..a98daa3180ecc976e55aa19ac85a41ee8b16e69a 100644 (file)
@@ -52,7 +52,7 @@
 #  define INET_ADDRSTRLEN 16
 # endif
 
-# define _(str) dgettext(GETTEXT_PACKAGE, (str))
+# define _(str) dgettext(PACKAGE, (str))
 # define N_(str) str
 
 /* String equality tests, suggested by Jim Meyering. */
index 3c8bf30a3df71ff7f7552d966b831a6e96b71894..eba0deee596865b38270aba766bd9ebeb1d837eb 100644 (file)
@@ -39,6 +39,7 @@
 #include "uuid.h"
 #include "util.h"
 #include "memory.h"
+#include "configmake.h"
 
 #ifndef WITH_DRIVER_MODULES
 # ifdef WITH_TEST
@@ -342,7 +343,7 @@ virInitialize(void)
     if (winsock_init () == -1) return -1;
 #endif
 
-    if (!bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR))
+    if (!bindtextdomain(PACKAGE, LOCALEDIR))
         return (-1);
 
     /*
index f4479e68ed2b258a441e745c68aac455420624ae..59d11619168b8675ea42b28e1c9f00e22e4e5487 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2010 Red Hat, Inc.
  * Copyright IBM Corp. 2008
  *
  * lxc_conf.c: config functions for managing linux containers
@@ -34,7 +35,7 @@
 #include "memory.h"
 #include "logging.h"
 #include "uuid.h"
-
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_LXC
 
@@ -73,7 +74,7 @@ virCapsPtr lxcCapsInit(void)
                                          "exe",
                                          utsname.machine,
                                          sizeof(int) == 4 ? 32 : 8,
-                                         BINDIR "/libvirt_lxc",
+                                         LIBEXECDIR "/libvirt_lxc",
                                          NULL,
                                          0,
                                          NULL)) == NULL)
@@ -114,7 +115,7 @@ int lxcLoadDriverConfig(lxc_driver_t *driver)
         goto no_memory;
 
 
-    if ((filename = strdup(SYSCONF_DIR "/libvirt/lxc.conf")) == NULL)
+    if ((filename = strdup(SYSCONFDIR "/libvirt/lxc.conf")) == NULL)
         goto no_memory;
 
     /* Avoid error from non-existant or unreadable file. */
index e4c2c528cd49a638226c1ccbe78891d0b1c3511d..f820d6dd603446899692048031defadd57617f70 100644 (file)
 # include "capabilities.h"
 # include "threads.h"
 # include "cgroup.h"
+# include "configmake.h"
 
-# define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc"
-# define LXC_STATE_DIR LOCAL_STATE_DIR "/run/libvirt/lxc"
-# define LXC_LOG_DIR LOCAL_STATE_DIR "/log/libvirt/lxc"
+# define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc"
+# define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc"
+# define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
 # define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
 
 typedef struct __lxc_driver lxc_driver_t;
index 631fbf1f68ba29b4f355c1f40c2874c89fa91316..54890f93cbbcd82e991ce2350c26251458752c6e 100644 (file)
 #include "logging.h"
 #include "dnsmasq.h"
 #include "util/network.h"
+#include "configmake.h"
 
-#define NETWORK_PID_DIR LOCAL_STATE_DIR "/run/libvirt/network"
-#define NETWORK_STATE_DIR LOCAL_STATE_DIR "/lib/libvirt/network"
+#define NETWORK_PID_DIR LOCALSTATEDIR "/run/libvirt/network"
+#define NETWORK_STATE_DIR LOCALSTATEDIR "/lib/libvirt/network"
 
-#define DNSMASQ_STATE_DIR LOCAL_STATE_DIR "/lib/libvirt/dnsmasq"
+#define DNSMASQ_STATE_DIR LOCALSTATEDIR "/lib/libvirt/dnsmasq"
 
 #define VIR_FROM_THIS VIR_FROM_NETWORK
 
@@ -209,10 +210,10 @@ networkStartup(int privileged) {
 
     if (privileged) {
         if (virAsprintf(&driverState->logDir,
-                        "%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1)
+                        "%s/log/libvirt/qemu", LOCALSTATEDIR) == -1)
             goto out_of_memory;
 
-        if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
+        if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
             goto out_of_memory;
     } else {
         char *userdir = virGetUserDirectory(uid);
index 4efeb3a23cf04471745b57d4a6cb2244d1772435..a305de63ea4d687f55ee3e39ed49d2056fc3d223 100644 (file)
@@ -2,7 +2,7 @@
  * nwfilter_driver.c: core driver for network filter APIs
  *                    (based on storage_driver.c)
  *
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2010 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  * Copyright (C) 2010 IBM Corporation
  * Copyright (C) 2010 Stefan Berger
@@ -37,7 +37,7 @@
 #include "nwfilter_conf.h"
 #include "nwfilter_driver.h"
 #include "nwfilter_gentech_driver.h"
-
+#include "configmake.h"
 
 #include "nwfilter_learnipaddr.h"
 
@@ -83,7 +83,7 @@ nwfilterDriverStartup(int privileged) {
     nwfilterDriverLock(driverState);
 
     if (privileged) {
-        if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
+        if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
             goto out_of_memory;
     } else {
         uid_t uid = geteuid();
index 83a117aade8388a7a0f2840590bd9b71355f5c22..35caccc81b8882faa13a43be7b8a796f65df818f 100644 (file)
@@ -56,6 +56,7 @@
 #include "cpu/cpu.h"
 #include "domain_nwfilter.h"
 #include "files.h"
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
@@ -112,7 +113,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
         virReportOOMError();
         return -1;
     }
-    if (!(driver->vncTLSx509certdir = strdup(SYSCONF_DIR "/pki/libvirt-vnc"))) {
+    if (!(driver->vncTLSx509certdir = strdup(SYSCONFDIR "/pki/libvirt-vnc"))) {
         virReportOOMError();
         return -1;
     }
@@ -121,7 +122,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
         virReportOOMError();
         return -1;
     }
-    if (!(driver->spiceTLSx509certdir = strdup(SYSCONF_DIR "/pki/libvirt-spice"))) {
+    if (!(driver->spiceTLSx509certdir
+          = strdup(SYSCONFDIR "/pki/libvirt-spice"))) {
         virReportOOMError();
         return -1;
     }
index 449534aeb653018ef2c69b3cf2afd44a0ab37d2f..ed1ea6b71526deaa27145517d462e6ca0395cbc1 100644 (file)
@@ -84,7 +84,7 @@
 #include "virtaudit.h"
 #include "files.h"
 #include "fdstream.h"
-
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
@@ -1762,28 +1762,28 @@ qemudStartup(int privileged) {
 
     if (privileged) {
         if (virAsprintf(&qemu_driver->logDir,
-                        "%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1)
+                        "%s/log/libvirt/qemu", LOCALSTATEDIR) == -1)
             goto out_of_memory;
 
-        if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
+        if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
             goto out_of_memory;
 
         if (virAsprintf(&qemu_driver->stateDir,
-                      "%s/run/libvirt/qemu", LOCAL_STATE_DIR) == -1)
+                      "%s/run/libvirt/qemu", LOCALSTATEDIR) == -1)
             goto out_of_memory;
 
         if (virAsprintf(&qemu_driver->libDir,
-                      "%s/lib/libvirt/qemu", LOCAL_STATE_DIR) == -1)
+                      "%s/lib/libvirt/qemu", LOCALSTATEDIR) == -1)
             goto out_of_memory;
 
         if (virAsprintf(&qemu_driver->cacheDir,
-                      "%s/cache/libvirt/qemu", LOCAL_STATE_DIR) == -1)
+                      "%s/cache/libvirt/qemu", LOCALSTATEDIR) == -1)
             goto out_of_memory;
         if (virAsprintf(&qemu_driver->saveDir,
-                      "%s/lib/libvirt/qemu/save", LOCAL_STATE_DIR) == -1)
+                      "%s/lib/libvirt/qemu/save", LOCALSTATEDIR) == -1)
             goto out_of_memory;
         if (virAsprintf(&qemu_driver->snapshotDir,
-                        "%s/lib/libvirt/qemu/snapshot", LOCAL_STATE_DIR) == -1)
+                        "%s/lib/libvirt/qemu/snapshot", LOCALSTATEDIR) == -1)
             goto out_of_memory;
     } else {
         uid_t uid = geteuid();
index 49a63bd4a155693a5b946089842f84a9d4997d2c..1504eecc6391d816f437722a3480fd7a3aeca34e 100644 (file)
@@ -2,7 +2,7 @@
  * remote_internal.h: driver to provide access to libvirtd running
  *   on a remote machine
  *
- * Copyright (C) 2006-2007 Red Hat, Inc.
+ * Copyright (C) 2006-2007, 2010 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,8 @@
 
 # include "libvirt/virterror.h"
 
+# include "configmake.h"
+
 int remoteRegister (void);
 
 unsigned long remoteVersion(void);
@@ -33,13 +35,13 @@ unsigned long remoteVersion(void);
 # define LIBVIRTD_LISTEN_ADDR NULL
 # define LIBVIRTD_TLS_PORT "16514"
 # define LIBVIRTD_TCP_PORT "16509"
-# define LIBVIRTD_PRIV_UNIX_SOCKET LOCAL_STATE_DIR "/run/libvirt/libvirt-sock"
-# define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCAL_STATE_DIR "/run/libvirt/libvirt-sock-ro"
+# define LIBVIRTD_PRIV_UNIX_SOCKET LOCALSTATEDIR "/run/libvirt/libvirt-sock"
+# define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCALSTATEDIR "/run/libvirt/libvirt-sock-ro"
 # define LIBVIRTD_USER_UNIX_SOCKET "/.libvirt/libvirt-sock"
-# define LIBVIRTD_CONFIGURATION_FILE SYSCONF_DIR "/libvirtd.conf"
+# define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirtd.conf"
 
 /* Defaults for PKI directory. */
-# define LIBVIRT_PKI_DIR SYSCONF_DIR "/pki"
+# define LIBVIRT_PKI_DIR SYSCONFDIR "/pki"
 # define LIBVIRT_CACERT LIBVIRT_PKI_DIR "/CA/cacert.pem"
 # define LIBVIRT_CLIENTKEY LIBVIRT_PKI_DIR "/libvirt/private/clientkey.pem"
 # define LIBVIRT_CLIENTCERT LIBVIRT_PKI_DIR "/libvirt/clientcert.pem"
index 2b5a7c6e75c45d0bf982c4dd21a9c7f534153360..c5a876bed17ca1c1b6160d10481c181bbac64a56 100644 (file)
@@ -42,6 +42,7 @@
 #include "uuid.h"
 #include "virterror_internal.h"
 #include "files.h"
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_SECRET
 
@@ -994,7 +995,7 @@ secretDriverStartup(int privileged)
     secretDriverLock(driverState);
 
     if (privileged) {
-        base = strdup(SYSCONF_DIR "/libvirt");
+        base = strdup(SYSCONFDIR "/libvirt");
         if (base == NULL)
             goto out_of_memory;
     } else {
index be39f758fced109321803eb7a7232d4e87ff66e2..b43c4ac0f879da15e15be354848c94db783989f0 100644 (file)
 #include "pci.h"
 #include "hostusb.h"
 #include "files.h"
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_SECURITY
 #define SECURITY_APPARMOR_VOID_DOI      "0"
 #define SECURITY_APPARMOR_NAME          "apparmor"
-#define VIRT_AA_HELPER BINDIR "/virt-aa-helper"
+#define VIRT_AA_HELPER LIBEXECDIR "/virt-aa-helper"
 
 /* Data structure to pass to *FileIterate so we have everything we need */
 struct SDPDOP {
@@ -561,7 +562,7 @@ AppArmorRestoreSecurityAllLabel(virSecurityDriverPtr drv ATTRIBUTE_UNUSED,
 }
 
 /* Called via virExecWithHook. Output goes to
- * LOCAL_STATE_DIR/log/libvirt/qemu/<vm name>.log
+ * LOCALSTATEDIR/log/libvirt/qemu/<vm name>.log
  */
 static int
 AppArmorSetSecurityProcessLabel(virSecurityDriverPtr drv, virDomainObjPtr vm)
index 5708cd82f9bb2df32cdc99813fa0d9c9c4f3b94d..0f94fe4eca3b7068569b131e2c4311c4a320a76c 100644 (file)
@@ -38,6 +38,7 @@
 #include "hostusb.h"
 #include "pci.h"
 #include "files.h"
+#include "configmake.h"
 
 static char *progname;
 
@@ -1179,11 +1180,11 @@ main(int argc, char **argv)
                 goto clean;
         } else {
             virBufferVSprintf(&buf, "  \"%s/log/libvirt/**/%s.log\" w,\n",
-                              LOCAL_STATE_DIR, ctl->def->name);
+                              LOCALSTATEDIR, ctl->def->name);
             virBufferVSprintf(&buf, "  \"%s/lib/libvirt/**/%s.monitor\" rw,\n",
-                              LOCAL_STATE_DIR, ctl->def->name);
+                              LOCALSTATEDIR, ctl->def->name);
             virBufferVSprintf(&buf, "  \"%s/run/libvirt/**/%s.pid\" rwk,\n",
-                              LOCAL_STATE_DIR, ctl->def->name);
+                              LOCALSTATEDIR, ctl->def->name);
             if (ctl->files)
                 virBufferVSprintf(&buf, "%s", ctl->files);
         }
index a8864dd834f7e4623198f5e20f7bb139ef798ebe..c7ade6b79256bbe894509642bdfdf46070976545 100644 (file)
 #include "storage_backend_disk.h"
 #include "util.h"
 #include "memory.h"
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_STORAGE
 
-#define PARTHELPER BINDIR "/libvirt_parthelper"
+#define PARTHELPER LIBEXECDIR "/libvirt_parthelper"
 
 #define SECTOR_SIZE 512
 
index f6672d922995a83edd33bd3edce0aa217e50d1b1..6df706b325f8d3b92e0261c382a20fa9dc485db0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * storage_driver.c: core driver for storage APIs
  *
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2010 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -46,6 +46,7 @@
 #include "storage_backend.h"
 #include "logging.h"
 #include "files.h"
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_STORAGE
 
@@ -125,7 +126,7 @@ storageDriverStartup(int privileged) {
     storageDriverLock(driverState);
 
     if (privileged) {
-        if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
+        if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
             goto out_of_memory;
     } else {
         uid_t uid = geteuid();
index f143dbc420671de4841e1efd09592b54e89c2006..7423956f241f3d181f7d44101afcbc3a04423694 100644 (file)
 #include "domain_nwfilter.h"
 #include "files.h"
 #include "fdstream.h"
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_UML
 
 /* For storing short-lived temporary files. */
-#define TEMPDIR LOCAL_STATE_DIR "/cache/libvirt"
+#define TEMPDIR LOCALSTATEDIR "/cache/libvirt"
 
 typedef struct _umlDomainObjPrivate umlDomainObjPrivate;
 typedef umlDomainObjPrivate *umlDomainObjPrivatePtr;
@@ -371,14 +372,14 @@ umlStartup(int privileged) {
 
     if (privileged) {
         if (virAsprintf(&uml_driver->logDir,
-                        "%s/log/libvirt/uml", LOCAL_STATE_DIR) == -1)
+                        "%s/log/libvirt/uml", LOCALSTATEDIR) == -1)
             goto out_of_memory;
 
-        if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
+        if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
             goto out_of_memory;
 
         if (virAsprintf(&uml_driver->monitorDir,
-                        "%s/run/libvirt/uml-guest", LOCAL_STATE_DIR) == -1)
+                        "%s/run/libvirt/uml-guest", LOCALSTATEDIR) == -1)
             goto out_of_memory;
     } else {
 
index 6e4e2b9b1d7ee2f5a19459062bfe6841aec70221..8e2456467207af154a2906904904990091bb2d6f 100644 (file)
@@ -37,6 +37,7 @@
 #include "logging.h"
 #include "memory.h"
 #include "files.h"
+#include "configmake.h"
 
 #define VIR_FROM_THIS VIR_FROM_HOOK
 
@@ -44,7 +45,7 @@
     virReportErrorHelper(NULL, VIR_FROM_HOOK, code, __FILE__,      \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
-#define LIBVIRT_HOOK_DIR SYSCONF_DIR "/libvirt/hooks"
+#define LIBVIRT_HOOK_DIR SYSCONFDIR "/libvirt/hooks"
 
 VIR_ENUM_DECL(virHookDriver)
 VIR_ENUM_DECL(virHookDaemonOp)
index 20b6805273950fcaecd28a1ede98a34648ad1f47..77b6fb97d756c41673b6acce0498b684280d0555 100644 (file)
@@ -17,7 +17,6 @@ INCLUDES = \
        $(SASL_CFLAGS) \
        $(SELINUX_CFLAGS) \
        $(APPARMOR_CFLAGS) \
-        -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
          $(COVERAGE_CFLAGS) \
          $(WARN_CFLAGS)
 
index 921d6214e4d760e92e694a81181b63d301be8f2c..376ffa81916034a80c9cab0c97ce0ef90cb7bcc0 100644 (file)
@@ -55,8 +55,6 @@ virsh_CFLAGS =                                                        \
                -I$(top_srcdir)/src                             \
                -I$(top_srcdir)/src/util                        \
                -I$(top_srcdir)                                 \
-               -DGETTEXT_PACKAGE=\"$(PACKAGE)\"                \
-               -DLOCALEBASEDIR=\""$(datadir)/locale"\"         \
                $(WARN_CFLAGS)                                  \
                $(COVERAGE_CFLAGS)                              \
                $(LIBXML_CFLAGS)                                \
index 6e523e8d067ac8271e6c6dbda6055c7bfe2c5c73..3f64dd32bd8a319b743fff7e416ccfabe5727ac5 100644 (file)
@@ -53,6 +53,7 @@
 #include "libvirt/libvirt-qemu.h"
 #include "files.h"
 #include "../daemon/event.h"
+#include "configmake.h"
 
 static char *progname;
 
@@ -11786,11 +11787,11 @@ main(int argc, char **argv)
         perror("setlocale");
         /* failure to setup locale is not fatal */
     }
-    if (!bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR)) {
+    if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
         perror("bindtextdomain");
         return -1;
     }
-    if (!textdomain(GETTEXT_PACKAGE)) {
+    if (!textdomain(PACKAGE)) {
         perror("textdomain");
         return -1;
     }