Commit 748b86be authored by Ghislain MARY's avatar Ghislain MARY

Fix autotools to search for bctoolbox-tester instead of cunit.

parent 01f90b26
......@@ -18,20 +18,13 @@ AC_ARG_ENABLE(strict,
[wall_werror=$enableval],
[wall_werror=yes]
)
# configure option to disable the tests
PKG_CHECK_MODULES(CUNIT, cunit, [found_cunit=yes],[found_cunit=no])
if test "$found_cunit" = "no" ; then
AC_CHECK_HEADERS(CUnit/CUnit.h,
[
AC_CHECK_LIB(cunit,CU_add_suite,[
found_cunit=yes
CUNIT_LIBS+=" -lcunit"
])
])
PKG_CHECK_MODULES(BCTOOLBOXTESTER, bctoolbox-tester, [found_pkg_config_bctoolboxtester=yes],[found_pkg_config_bctoolboxtester=no])
if test "$found_pkg_config_bctoolboxtester" = "no" ; then
AC_MSG_WARN([Could not find bctoolbox-tester wrapper, tests are not compiled.])
fi
dnl check bctoolbox
PKG_CHECK_MODULES(BCTOOLBOX, [bctoolbox] ,[bctoolbox_found=yes] ,foo=bar)
if test "$bctoolbox_found" != "yes" ; then
......@@ -46,16 +39,6 @@ else
AC_DEFINE(HAVE_LIBXML2,1,[defined when libxml2 is available])
fi
if test "$found_cunit" = "no" ; then
AC_MSG_WARN([Could not find cunit framework, tests are not compiled.])
else
AC_CHECK_LIB(cunit,CU_get_suite,[
AC_DEFINE(HAVE_CU_GET_SUITE,1,[defined when CU_get_suite is available])
],[foo=bar],[$CUNIT_LIBS])
AC_CHECK_LIB(cunit,CU_curses_run_tests,[
AC_DEFINE(HAVE_CU_CURSES,1,[defined when CU_curses_run_tests is available])
],[foo=bar],[$CUNIT_LIBS])
fi
AC_ARG_ENABLE(tests,
[AS_HELP_STRING([--disable-tests], [Disable compilation of tests])],
[case "${enableval}" in
......@@ -65,7 +48,7 @@ AC_ARG_ENABLE(tests,
esac],
[tests_enabled=yes]
)
AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes && test x$found_cunit = xyes)
AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes && test x$found_pkg_config_bctoolboxtester = xyes)
CFLAGS="$CFLAGS -Wall"
......
......@@ -7,8 +7,8 @@ bzrtpTest_SOURCES=bzrtpTest.c \
bzrtpParserTest.c bzrtpParserTest.h
bzrtpTest_CFLAGS=$(CUNIT_CFLAGS) $(LIBXML2_CFLAGS)
bzrtpTest_LDADD=$(top_builddir)/src/libbzrtp.la $(BCTOOLBOX_LIBS) $(CUNIT_LIBS) $(LIBXML2_LIBS) -lm
bzrtpTest_CFLAGS=$(BCTOOLBOXTESTER_CFLAGS) $(LIBXML2_CFLAGS)
bzrtpTest_LDADD=$(top_builddir)/src/libbzrtp.la $(BCTOOLBOX_LIBS) $(BCTOOLBOXTESTER_LIBS) $(LIBXML2_LIBS) -lm
AM_CPPFLAGS=-I$(top_srcdir)/include
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment