-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcit_cppunit.m4
49 lines (42 loc) · 1.53 KB
/
cit_cppunit.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- Autoconf -*-
# ======================================================================
# Autoconf macros for cppunit.
# ======================================================================
# ----------------------------------------------------------------------
# CIT_CPPUNIT_HEADER
# ----------------------------------------------------------------------
AC_DEFUN([CIT_CPPUNIT_HEADER], [
cit_save_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CPPUNIT_INCLUDES"
AC_LANG(C++)
AC_REQUIRE_CPP
AC_CHECK_HEADER([cppunit/TestRunner.h], [], [
AC_MSG_ERROR([CppUnit header not found; try --with-cppunit-incdir=<CppUnit include dir>])
])dnl
CPPFLAGS=$cit_save_cppflags
])dnl CIT_CPPUNIT_HEADER
# ----------------------------------------------------------------------
# CIT_CPPUNIT_LIB
# ----------------------------------------------------------------------
AC_DEFUN([CIT_CPPUNIT_LIB], [
cit_save_cppflags=$CPPFLAGS
cit_save_ldflags=$LDFLAGS
cit_save_libs=$LIBS
CPPFLAGS="$CPPFLAGS $CPPUNIT_INCLUDES"
LDFLAGS="$LDFLAGS $CPPUNIT_LDFLAGS"
LIBS="-lcppunit"
AC_LANG(C++)
AC_REQUIRE_CPP
AC_MSG_CHECKING([for CppUnit::TestRunner in -lcppunit])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <cppunit/TestRunner.h>]],
[[CppUnit::TestRunner runner;]])],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_ERROR([CppUnit library not found; try --with-cppunit-libdir=<CppUnit lib dir>])
])
CPPFLAGS=$cit_save_cppflags
LDFLAGS=$cit_save_ldflags
LIBS=$cit_save_libs
])dnl CIT_CPPUNIT_LIB
dnl end of file