mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Use pkg-config to look for CUnit (needed for systems where it's not on the
standard include path).
This commit is contained in:
parent
8d21033e52
commit
5da88e5ba4
@ -759,10 +759,7 @@ AC_ARG_ENABLE(testing,
|
||||
AC_MSG_RESULT($TESTING)
|
||||
|
||||
if test "$TESTING" = yes; then
|
||||
AC_CHECK_HEADER([CUnit/Basic.h], have_cunit=yes, have_cunit=no)
|
||||
if test "$have_cunit" = "no"; then
|
||||
AC_MSG_ERROR([CUnit is required for unit testing])
|
||||
fi
|
||||
PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
@ -1391,6 +1388,8 @@ AC_SUBST(UDEV_LIBS)
|
||||
AC_SUBST(UDEV_PC)
|
||||
AC_SUBST(UDEV_RULES)
|
||||
AC_SUBST(UDEV_SYNC)
|
||||
AC_SUBST(CUNIT_LIBS)
|
||||
AC_SUBST(CUNIT_CFLAGS)
|
||||
AC_SUBST(WRITE_INSTALL)
|
||||
AC_SUBST(DMEVENTD_PIDFILE)
|
||||
AC_SUBST(interface)
|
||||
|
@ -19,12 +19,13 @@ SOURCES = bitset_t.c matcher_t.c run.c
|
||||
TARGETS = run
|
||||
|
||||
include $(top_builddir)/make.tmpl
|
||||
LDFLAGS += -ldevmapper -lcunit
|
||||
|
||||
ifeq ("$(TESTING)", "yes")
|
||||
LDFLAGS += -ldevmapper @CUNIT_LIBS@
|
||||
CFLAGS += @CUNIT_CFLAGS@
|
||||
|
||||
all: unit
|
||||
endif
|
||||
|
||||
unit: $(TARGETS)
|
||||
@echo Running unit tests
|
||||
LD_LIBRARY_PATH=$(top_builddir)/libdm ./$(TARGETS)
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user