1 dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License, or (at your option) any later version.
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl Lesser General Public License for more details.
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 AC_DEFUN([CHECK_CPPUNIT],[
22 AC_CHECKING(for cppunit)
29 [AC_HELP_STRING([--with-cppunit=DIR],[directory path to CPPUNIT installation])],
30 [CPPUNITHOME="$withval"
31 AC_MSG_RESULT("select $withval as path to CPPUNIT")
34 AC_ARG_WITH(cppunit_inc,
35 [AC_HELP_STRING([--with-cppunit_inc=DIR],[directory path to CPPUNIT includes])],
36 [CPPUNIT_INCLUDES="$withval"
37 AC_MSG_RESULT("select $withval as path to CPPUNIT includes")
40 if test -z "$CPPUNITHOME"; then
41 AC_MSG_RESULT(CPPUNITHOME not defined)
43 if test "x$exits_ok" = "xno"; then
44 for d in /usr/local /usr ; do
45 AC_CHECK_FILE(${d}/lib64/libcppunit.so,exits_ok=yes,exits_ok=no)
46 if test "x$exits_ok" = "xyes"; then
48 AC_MSG_RESULT(libcppunit.so detected in $d/lib64)
51 AC_CHECK_FILE(${d}/lib/libcppunit.so,exits_ok=yes,exits_ok=no)
52 if test "x$exits_ok" = "xyes"; then
54 AC_MSG_RESULT(libcppunit.so detected in $d/lib)
59 if test "x$exits_ok" = "xno"; then
60 for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
61 if test -f $d/libcppunit.so ; then
62 AC_MSG_RESULT(libcppunit.so detected in $d)
64 CPPUNITHOME=`echo ${CPPUNITHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
70 if test "x$exits_ok" = "xyes"; then
71 if test -z "$CPPUNIT_INCLUDES"; then
72 CPPUNIT_INCLUDES=$CPPUNITHOME"/include"
76 if test -z "$CPPUNIT_INCLUDES"; then
77 CPPUNIT_INCLUDES="$CPPUNITHOME/include"
81 if test "x$cppunit_ok" = xno -o ! -d "$CPPUNITHOME" ; then
83 AC_MSG_WARN(cppunit not found)
88 CPPFLAGS_old=$CPPFLAGS
89 CPPFLAGS="$CPPFLAGS -I$CPPUNIT_INCLUDES"
91 AC_CHECK_HEADER(cppunit/extensions/HelperMacros.h,cppunit_ok=yes,cppunit_ok=no)
93 CPPFLAGS=$CPPFLAGS_old
95 if test "x$cppunit_ok" = xno ; then
97 AC_MSG_WARN(cppunit not found)
102 if test "x$cppunit_ok" = "xno"
104 AC_MSG_RESULT(unable to found cppunit headers and library)
105 AC_MSG_RESULT(CPPUNITHOME environment variable may be wrong)
107 if test "x$CPPUNIT_INCLUDES" = "x/usr/include"
111 CPPUNIT_INCLUDES="-I$CPPUNIT_INCLUDES"
113 if test "x$CPPUNITHOME" = "x/usr"
115 CPPUNIT_LIBS=" -lcppunit"
117 CPPUNIT_LIBS="-L$CPPUNITHOME/lib -lcppunit"
120 AC_SUBST(CPPUNIT_INCLUDES)
121 AC_SUBST(CPPUNIT_LIBS)
127 AM_CONDITIONAL(CPPUNIT_IS_OK, [test x"$cppunit_ok" = xyes])