[Devel] [PATCH 4/8] configure.ac: add checks for libvzevent

Kir Kolyshkin kir at openvz.org
Tue Jun 2 15:50:22 PDT 2015


This commit adds checks for vzevent header and library. In case they are
not present, a helpful error message is displayed.

If library is there, -lvzvent is added to LIBS by AC_CHECK_LIB, so we
don't have to specify it explicitly.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 configure.ac    | 6 +++++-
 lib/Makefile.am | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index efc1a11..b02f611 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,7 +69,11 @@ AC_CHECK_LIB(util, openpty,
 
 AC_SUBST(UTIL_LIBS)
 
-# Checks for header files.
+# Checks for libvzevent
+AC_CHECK_HEADER([vz/vzevent.h], ,
+	AC_MSG_ERROR([Please install libvzevent devel package]))
+AC_CHECK_LIB([vzevent], [vzevt_register], ,
+	AC_MSG_ERROR([Please install libvzevent devel package]))
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 23f5215..6ae06c7 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -71,5 +71,5 @@ libvzctl2_la_SOURCES =  bitmap.c \
 # 5. If any interfaces have been added since the last public release, then increment age.
 # 6. If any interfaces have been removed since the last public release, then set age to 0. 
 libvzctl2_la_LDFLAGS = -version-info 2:1:0 -Wl,--version-script=version.map
-libvzctl2_la_LIBADD = $(XML_LIBS) -lvzevent -lutil -lploop -lcrypt $(UUID_LIBS)
+libvzctl2_la_LIBADD = $(XML_LIBS) -lutil -lploop -lcrypt $(UUID_LIBS)
 
-- 
1.9.3




More information about the Devel mailing list