[libvirt-php][PATCH 3/8] configure: Fix build with --prefix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If source was configured with different --prefix than usual,
local state and sysconfig dir might have improper values. Check
that in configure and set the correct ones.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 configure.ac | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/configure.ac b/configure.ac
index 39ec71c..41c8559 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,17 @@ AC_CHECK_TOOL([RM], [rm])
 dnl Need to test if pkg-config exists
 PKG_PROG_PKG_CONFIG
 
+dnl if --prefix is /usr, don't use /usr/var for localstatedir
+dnl or /usr/etc for sysconfdir
+dnl as this makes a lot of things break in testing situations
+
+if test "$prefix" = "/usr" && test "$localstatedir" = '${prefix}/var' ; then
+    localstatedir='/var'
+fi
+if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then
+    sysconfdir='/etc'
+fi
+
 LIBVIRT_REQUIRED=0.6.2
 PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
 
-- 
2.3.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]