According to the official documentation for autoconf[1], the
correct names for these variables are abs_top_{src,build}dir
rather than abs_top{src,build}dir; in fact, we're already
using the correct names in various places, so let's just make
everything nice and consistent.
[1]
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Pres...
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/Makefile.am | 8 ++++----
src/conf/domain_conf.c | 2 +-
src/cpu/cpu_map.c | 4 ++--
src/driver.c | 2 +-
src/locking/lock_driver_lockd.c | 2 +-
src/locking/lock_manager.c | 2 +-
src/logging/log_manager.c | 2 +-
src/lxc/lxc_conf.c | 2 +-
src/network/bridge_driver.c | 2 +-
src/remote/remote_driver.c | 2 +-
src/storage/storage_backend.c | 2 +-
src/storage/storage_backend_disk.c | 4 ++--
src/util/virfile.c | 4 ++--
src/util/virstoragefilebackend.c | 2 +-
tests/Makefile.am | 8 ++++----
tests/virschematest.c | 2 +-
tests/virshtest.c | 4 ++--
tests/virtestmock.c | 4 ++--
18 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 8c8dfe3dcf..0d3d231889 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,9 +18,9 @@
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
-abs_topbuilddir = $(shell cd .. && pwd)
+abs_top_builddir = $(shell cd .. && pwd)
abs_srcdir = $(shell cd $(srcdir) && pwd)
-abs_topsrcdir = $(shell cd $(top_srcdir) && pwd)
+abs_top_srcdir = $(shell cd $(top_srcdir) && pwd)
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
@@ -33,8 +33,8 @@ AM_CPPFLAGS = -I../gnulib/lib \
-I$(srcdir)/util \
-I./util \
-DIN_LIBVIRT \
- -Dabs_topbuilddir="\"$(abs_topbuilddir)\"" \
- -Dabs_topsrcdir="\"$(abs_topsrcdir)\"" \
+ -Dabs_top_builddir="\"$(abs_top_builddir)\"" \
+ -Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
$(NULL)
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cfd7221538..0eee982989 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19396,7 +19396,7 @@ virDomainDefParseXML(xmlDocPtr xml,
VIR_AUTOFREE(char *) schema = NULL;
schema = virFileFindResource("domain.rng",
- abs_topsrcdir "/docs/schemas",
+ abs_top_srcdir "/docs/schemas",
PKGDATADIR "/schemas");
if (!schema)
return NULL;
diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c
index 83151c1c54..cb9f7c243f 100644
--- a/src/cpu/cpu_map.c
+++ b/src/cpu/cpu_map.c
@@ -96,7 +96,7 @@ cpuMapLoadInclude(const char *filename,
char *mapfile;
if (!(mapfile = virFileFindResource(filename,
- abs_topsrcdir "/src/cpu_map",
+ abs_top_srcdir "/src/cpu_map",
PKGDATADIR "/cpu_map")))
return -1;
@@ -185,7 +185,7 @@ int cpuMapLoad(const char *arch,
char *mapfile;
if (!(mapfile = virFileFindResource("index.xml",
- abs_topsrcdir "/src/cpu_map",
+ abs_top_srcdir "/src/cpu_map",
PKGDATADIR "/cpu_map")))
return -1;
diff --git a/src/driver.c b/src/driver.c
index 8b5ade763f..5e8f68f6df 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -54,7 +54,7 @@ virDriverLoadModule(const char *name,
if (!(modfile = virFileFindResourceFull(name,
"libvirt_driver_",
".so",
- abs_topbuilddir "/src/.libs",
+ abs_top_builddir "/src/.libs",
DEFAULT_DRIVER_DIR,
"LIBVIRT_DRIVER_DIR")))
return -1;
diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c
index 4ffa92fc9b..f6371f3050 100644
--- a/src/locking/lock_driver_lockd.c
+++ b/src/locking/lock_driver_lockd.c
@@ -221,7 +221,7 @@ static virNetClientPtr virLockManagerLockDaemonConnectionNew(bool
privileged,
if (!privileged &&
!(daemonPath = virFileFindResourceFull("virtlockd",
NULL, NULL,
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
SBINDIR,
"VIRTLOCKD_PATH")))
goto error;
diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c
index d421b6acfc..1c8705ab11 100644
--- a/src/locking/lock_manager.c
+++ b/src/locking/lock_manager.c
@@ -141,7 +141,7 @@ virLockManagerPluginPtr virLockManagerPluginNew(const char *name,
if (!(modfile = virFileFindResourceFull(name,
NULL,
".so",
- abs_topbuilddir "/src/.libs",
+ abs_top_builddir "/src/.libs",
LIBDIR "/libvirt/lock-driver",
"LIBVIRT_LOCK_MANAGER_PLUGIN_DIR")))
goto cleanup;
diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c
index cd7935802d..eb0a32b4b6 100644
--- a/src/logging/log_manager.c
+++ b/src/logging/log_manager.c
@@ -80,7 +80,7 @@ virLogManagerConnect(bool privileged,
if (!privileged &&
!(daemonPath = virFileFindResourceFull("virtlogd",
NULL, NULL,
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
SBINDIR,
"VIRTLOGD_PATH")))
goto error;
diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
index 4720c99793..2e4cc4f51a 100644
--- a/src/lxc/lxc_conf.c
+++ b/src/lxc/lxc_conf.c
@@ -94,7 +94,7 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
}
if (!(lxc_path = virFileFindResource("libvirt_lxc",
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
LIBEXECDIR)))
goto error;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index c3e1381124..6789dafd15 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1488,7 +1488,7 @@ networkBuildDhcpDaemonCommandLine(virNetworkDriverStatePtr driver,
/* This helper is used to create custom leases file for libvirt */
if (!(leaseshelper_path = virFileFindResource("libvirt_leaseshelper",
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
LIBEXECDIR)))
goto cleanup;
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index eabe7a3823..5c4dd41227 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1079,7 +1079,7 @@ doRemoteOpen(virConnectPtr conn,
if ((flags & VIR_DRV_OPEN_REMOTE_AUTOSTART) &&
!(daemonPath = virFileFindResourceFull("libvirtd",
NULL, NULL,
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
SBINDIR,
"LIBVIRTD_PATH")))
goto failed;
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 295d8de479..ed5bdd5bad 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -92,7 +92,7 @@ virStorageDriverLoadBackendModule(const char *name,
if (!(modfile = virFileFindResourceFull(name,
"libvirt_storage_backend_",
".so",
- abs_topbuilddir "/src/.libs",
+ abs_top_builddir "/src/.libs",
STORAGE_BACKEND_MODULE_DIR,
"LIBVIRT_STORAGE_BACKEND_DIR")))
return -1;
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index 4c5b784ca7..9b94d26cf9 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -363,7 +363,7 @@ virStorageBackendDiskReadPartitions(virStoragePoolObjPtr pool,
VIR_AUTOPTR(virCommand) cmd = NULL;
if (!(parthelper_path = virFileFindResource("libvirt_parthelper",
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
LIBEXECDIR)))
return -1;
@@ -417,7 +417,7 @@ virStorageBackendDiskReadGeometry(virStoragePoolObjPtr pool)
VIR_AUTOPTR(virCommand) cmd = NULL;
if (!(parthelper_path = virFileFindResource("libvirt_parthelper",
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
LIBEXECDIR)))
return -1;
diff --git a/src/util/virfile.c b/src/util/virfile.c
index a4c6d184af..ec8d85929c 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -260,7 +260,7 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags)
}
if (!(iohelper_path = virFileFindResource("libvirt_iohelper",
- abs_topbuilddir "/src",
+ abs_top_builddir "/src",
LIBEXECDIR)))
goto error;
@@ -1704,7 +1704,7 @@ static bool useDirOverride;
* @prefix: optional string to prepend to filename
* @suffix: optional string to append to filename
* @builddir: location of the filename in the build tree including
- * abs_topsrcdir or abs_topbuilddir prefix
+ * abs_top_srcdir or abs_top_builddir prefix
* @installdir: location of the installed binary
* @envname: environment variable used to override all dirs
*
diff --git a/src/util/virstoragefilebackend.c b/src/util/virstoragefilebackend.c
index 9acaea2f81..f362436d9b 100644
--- a/src/util/virstoragefilebackend.c
+++ b/src/util/virstoragefilebackend.c
@@ -57,7 +57,7 @@ virStorageFileLoadBackendModule(const char *name,
if (!(modfile = virFileFindResourceFull(name,
"libvirt_storage_file_",
".so",
- abs_topbuilddir "/src/.libs",
+ abs_top_builddir "/src/.libs",
STORAGE_FILE_MODULE_DIR,
"LIBVIRT_STORAGE_FILE_DIR")))
return -1;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 237336d648..42ec64755d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -18,9 +18,9 @@
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
-abs_topbuilddir = $(shell cd .. && pwd)
+abs_top_builddir = $(shell cd .. && pwd)
abs_srcdir = $(shell cd $(srcdir) && pwd)
-abs_topsrcdir = $(shell cd $(top_srcdir) && pwd)
+abs_top_srcdir = $(shell cd $(top_srcdir) && pwd)
SHELL = $(PREFERABLY_POSIX_SHELL)
@@ -37,9 +37,9 @@ WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)
AM_CFLAGS = \
-Dabs_builddir="\"$(abs_builddir)\"" \
- -Dabs_topbuilddir="\"$(abs_topbuilddir)\"" \
+ -Dabs_top_builddir="\"$(abs_top_builddir)\"" \
-Dabs_srcdir="\"$(abs_srcdir)\"" \
- -Dabs_topsrcdir="\"$(abs_topsrcdir)\"" \
+ -Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
$(LIBXML_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GNUTLS_CFLAGS) \
diff --git a/tests/virschematest.c b/tests/virschematest.c
index 8dfab5e2a3..56bdcb2f88 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -148,7 +148,7 @@ testSchemaGrammar(const void *opaque)
int ret = -1;
if (virAsprintf(&schema_path, "%s/docs/schemas/%s",
- abs_topsrcdir, data->schema) < 0)
+ abs_top_srcdir, data->schema) < 0)
return -1;
if (!(data->validator = virXMLValidatorInit(schema_path)))
diff --git a/tests/virshtest.c b/tests/virshtest.c
index d77d3d81d4..7e59ad7da6 100644
--- a/tests/virshtest.c
+++ b/tests/virshtest.c
@@ -82,13 +82,13 @@ testCompareOutputLit(const char *expectData,
return result;
}
-# define VIRSH_DEFAULT abs_topbuilddir "/tools/virsh", \
+# define VIRSH_DEFAULT abs_top_builddir "/tools/virsh", \
"--connect", \
"test:///default"
static char *custom_uri;
-# define VIRSH_CUSTOM abs_topbuilddir "/tools/virsh", \
+# define VIRSH_CUSTOM abs_top_builddir "/tools/virsh", \
"--connect", \
custom_uri
diff --git a/tests/virtestmock.c b/tests/virtestmock.c
index 1cafbec0d5..3049c90789 100644
--- a/tests/virtestmock.c
+++ b/tests/virtestmock.c
@@ -161,8 +161,8 @@ checkPath(const char *path,
}
- if (!STRPREFIX(path, abs_topsrcdir) &&
- !STRPREFIX(path, abs_topbuilddir)) {
+ if (!STRPREFIX(path, abs_top_srcdir) &&
+ !STRPREFIX(path, abs_top_builddir)) {
printFile(path, func);
}
--
2.20.1