2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-23 10:27:36 +00:00
Update configure for lcov and gtest detection.
Be more verbose.
Use gtest-config if available.


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@516 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Jeremy C. Reed 2010-01-26 19:41:22 +00:00
parent f389d00070
commit b8b4032ff3

View File

@ -44,21 +44,19 @@ USE_LCOV="no"
if test "$lcov" != "no"; then if test "$lcov" != "no"; then
# force gtest if not set # force gtest if not set
if test "$gtest_path" = "no"; then if test "$gtest_path" = "no"; then
# AC_MSG_ERROR("lcov needs gtest for test coverage report")
AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
gtest_path="yes" gtest_path="yes"
fi fi
if test "$lcov" != "yes"; then if test "$lcov" != "yes"; then
LCOV_PATHS=$lcov LCOV=$lcov
else else
LCOV_PATHS="/usr/bin/lcov /usr/local/bin/lcov" AC_PATH_PROG([LCOV], [lcov])
fi fi
for f in $LCOV_PATHS; do if test -x "${LCOV}"; then
if test -x "$f"; then
USE_LCOV="yes" USE_LCOV="yes"
LCOV=$f else
fi AC_MSG_ERROR([Cannot find lcov.])
done
if test $USE_LCOV != "yes"; then
AC_MSG_ERROR([Cannot find lcov in: $LCOV_PATHS])
fi fi
# is genhtml always in the same directory? # is genhtml always in the same directory?
GENHTML=`echo "$LCOV" | sed s/lcov$/genhtml/` GENHTML=`echo "$LCOV" | sed s/lcov$/genhtml/`
@ -66,7 +64,7 @@ if test "$lcov" != "no"; then
AC_MSG_ERROR([genhtml not found, needed for lcov]) AC_MSG_ERROR([genhtml not found, needed for lcov])
fi fi
# GCC specific? # GCC specific?
CPPFLAGS="$CPPFLAGS -fprofile-arcs -ftest-coverage" CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
LIBS=" $LIBS -lgcov" LIBS=" $LIBS -lgcov"
AC_SUBST(CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(LIBS) AC_SUBST(LIBS)
@ -76,16 +74,32 @@ fi
AC_SUBST(USE_LCOV) AC_SUBST(USE_LCOV)
# #
# Check availablity of gtest, which will be used for unit tests. # Check availability of gtest, which will be used for unit tests.
# #
if test "$gtest_path" != "no" if test "$gtest_path" != "no"
then then
if test "$gtest_path" != "yes"; then if test "$gtest_path" != "yes"; then
GTEST_PATHS=$gtest_path GTEST_PATHS=$gtest_path
if test -x "${gtest_path}/bin/gtest-config" ; then
GTEST_CONFIG="${gtest_path}/bin/gtest-config"
fi
else else
AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
fi
if test -x "${GTEST_CONFIG}" ; then :
# using cppflags instead of cxxflags
GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
GTEST_LDADD=`${GTEST_CONFIG} --libs`
GTEST_FOUND="true"
else
AC_MSG_WARN([Unable to locate Google Test gtest-config.])
if test -z "${GTEST_PATHS}" ; then
GTEST_PATHS="/usr /usr/local" GTEST_PATHS="/usr /usr/local"
fi fi
GTEST_FOUND="false"
fi
if test "${GTEST_FOUND}" != "true"; then
GTEST_FOUND="false" GTEST_FOUND="false"
for dir in $GTEST_PATHS; do for dir in $GTEST_PATHS; do
if test -f "$dir/include/gtest/gtest.h"; then if test -f "$dir/include/gtest/gtest.h"; then
@ -93,9 +107,11 @@ then
GTEST_LDFLAGS="-L$dir/lib" GTEST_LDFLAGS="-L$dir/lib"
GTEST_LDADD="-lgtest" GTEST_LDADD="-lgtest"
GTEST_FOUND="true" GTEST_FOUND="true"
break
fi fi
done done
if test $GTEST_FOUND != "true"; then fi
if test "${GTEST_FOUND}" != "true"; then
AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS]) AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
fi fi
else else