Skip to content

Commit

Permalink
Merge pull request networkupstools#1002 from jimklimov/configure-cppunit
Browse files Browse the repository at this point in the history
configure.ac: add --enable-cppunit to allow disabling it even if deemed…
  • Loading branch information
jimklimov authored Mar 30, 2021
2 parents 80842dd + 4c028f9 commit 03c3bbe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,7 @@ AC_LANG_POP([C++])
unset CPLUSPLUS_MAIN
unset CPLUSPLUS_DECL

AC_MSG_CHECKING(for have_cppunit)
have_cppunit="no"
CPPUNIT_NUT_CXXFLAGS=""
AS_IF([test x"$have_PKG_CONFIG" = xyes],
Expand All @@ -1541,6 +1542,18 @@ AS_IF([test x"$have_PKG_CONFIG" = xyes],
], [AC_MSG_WARN([pkg-config not found, can not look properly for libcppunit - those C++ tests will not be built.])
have_cppunit=no]
)
AC_MSG_RESULT(${have_cppunit})

dnl # By default keep the originally detected have_cppunit value
AC_MSG_CHECKING(for impact from --enable-cppunit option - should we build cppunit tests?)
AC_ARG_ENABLE(cppunit,
[AS_HELP_STRING([--enable-cppunit], [enable CPPUNIT tests for C++ bindings])],
[AS_CASE(["${enableval}"],
["yes"], [AS_IF([test x"${have_cppunit}" = xyes], [], [AC_MSG_ERROR([--with-cppunit=yes can not be satisfied])])],
["no"], [have_cppunit=no]
)])
AC_MSG_RESULT(${have_cppunit})

AM_CONDITIONAL(HAVE_CPPUNIT, test "${have_cppunit}" = "yes")
AC_DEFINE_UNQUOTED(CPPUNIT_NUT_CXXFLAGS, $CPPUNIT_NUT_CXXFLAGS, [Compiler flags for cppunit tests])

Expand Down

0 comments on commit 03c3bbe

Please sign in to comment.