2 AC_DEFUN([CHECK_CPPUNIT],[
4 AC_CHECKING(for cppunit)
11 [ --with-cppunit=DIR directory path to CPPUNIT installation ],
12 [CPPUNITHOME="$withval"
13 AC_MSG_RESULT("select $withval as path to CPPUNIT")
16 AC_ARG_WITH(cppunit_inc,
17 [ --with-cppunit_inc=DIR directory path to CPPUNIT includes ],
18 [CPPUNIT_INCLUDES="$withval"
19 AC_MSG_RESULT("select $withval as path to CPPUNIT includes")
22 if test -z $CPPUNITHOME; then
23 AC_MSG_RESULT(CPPUNITHOME not defined)
25 if test "x$exits_ok" = "xno"; then
26 for d in /usr/local /usr ; do
27 AC_CHECK_FILE(${d}/lib/libcppunit.so,exits_ok=yes,exits_ok=no)
28 if test "x$exits_ok" = "xyes"; then
30 AC_MSG_RESULT(libcppunit.so detected in $d/lib)
34 if test "x$exits_ok" = "xno"; then
35 for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
36 if test -f $d/libcppunit.so ; then
37 AC_MSG_RESULT(libcppunit.so detected in $d)
39 CPPUNITHOME=`echo ${CPPUNITHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
45 if test "x$exits_ok" = "xyes"; then
46 if test -z $CPPUNIT_INCLUDES; then
47 CPPUNIT_INCLUDES=$CPPUNITHOME"/include"
51 if test -z $CPPUNIT_INCLUDES; then
52 CPPUNIT_INCLUDES="$CPPUNITHOME/include"
56 if test "x$cppunit_ok" = xno -o ! -d "$CPPUNITHOME" ; then
58 AC_MSG_WARN(cppunit not found)
63 CPPFLAGS_old=$CPPFLAGS
64 CPPFLAGS="$CPPFLAGS -I$CPPUNIT_INCLUDES"
65 CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
67 AC_CHECK_HEADER(cppunit/extensions/HelperMacros.h,cppunit_ok=yes,cppunit_ok=no)
69 CPPFLAGS=$CPPFLAGS_old
71 if test "x$cppunit_ok" = xno ; then
73 AC_MSG_WARN(cppunit not found)
78 if test "x$cppunit_ok" = "xno"
80 AC_MSG_RESULT(unable to found cppunit headers and library)
81 AC_MSG_RESULT(CPPUNITHOME environment variable may be wrong)
83 if test "x$CPPUNIT_INCLUDES" = "x/usr/include"
87 CPPUNIT_INCLUDES="-I$CPPUNIT_INCLUDES"
89 if test "x$CPPUNITHOME" = "x/usr"
91 CPPUNIT_LIBS=" -lcppunit"
93 CPPUNIT_LIBS="-L$CPPUNITHOME/lib -lcppunit"
96 AC_SUBST(CPPUNIT_INCLUDES)
97 AC_SUBST(CPPUNIT_LIBS)