1 dnl Copyright (C) 2007-2019 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_LIBXML],[
22 AC_CHECKING(for libxml library)
27 AC_SUBST(LIBXML_INCLUDES)
33 AC_CHECKING(for libxml location)
35 [ --with-libxml=DIR root directory path to LIBXML library installation ],
36 [LIBXML_DIR="$withval"
37 AC_MSG_RESULT("select $withval as path to LIBXML library")])
39 AC_MSG_RESULT(\$LIBXML_DIR = ${LIBXML_DIR})
46 if test "x$LIBXML_DIR" != "x"
48 LOCAL_INCLUDES="-I$LIBXML_DIR/include/libxml2"
49 if test "x$LIBXML_DIR" = "x/usr"
51 AC_MSG_NOTICE(Trying native Libxml2...)
54 AC_MSG_NOTICE(Trying Libxml2 from $LIBXML_DIR ...)
55 LOCAL_LIBS="-L$LIBXML_DIR/lib -lxml2"
58 AC_MSG_NOTICE(Trying native Libxml2...)
59 LOCAL_INCLUDES="-I/usr/include/libxml2"
65 CPPFLAGS_old="$CPPFLAGS"
66 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
67 AC_CHECK_HEADER(libxml/parser.h,libxml_ok="yes",libxml_ok="no")
68 CPPFLAGS="$CPPFLAGS_old"
70 if test "x$libxml_ok" = "xyes"
76 LIBS="$LIBS $LOCAL_LIBS"
77 AC_CHECK_LIB(xml2,xmlInitParser,libxml_ok="yes",libxml_ok="no",)
81 if test "x$libxml_ok" = "xyes"
83 LIBXML_INCLUDES="$LOCAL_INCLUDES"
84 LIBXML_LIBS="$LOCAL_LIBS"
87 AC_MSG_RESULT(for libxml: $libxml_ok)