1 dnl Copyright (C) 2006-2012 CEA/DEN, EDF R&D
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.
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([AC_CHECK_LIBXML],[
22 AC_CHECKING(for libxml)
24 CPPFLAGS_old=$CPPFLAGS
25 CXXFLAGS_old=$CXXFLAGS
27 # Custom location of libxml2 package can be specified
28 # thorugh LIBXML_DIR variable
29 if test "x$LIBXML_DIR" != "x"
31 CPPFLAGS="$CPPFLAGS -I$LIBXML_DIR/include/libxml2"
32 CXXFLAGS="$CXXFLAGS -I$LIBXML_DIR/include/libxml2"
33 if test "x$LIBXML_DIR" = "x/usr"
35 AC_MSG_NOTICE(Trying native Libxml2...)
36 TMPLIBS="-lxml2 $LIBS"
38 AC_MSG_NOTICE(Trying Libxml2 from $LIBXML_DIR ...)
39 TMPLIBS="-L$LIBXML_DIR/lib -lxml2 $LIBS"
41 LIBXML_INCLUDES="-I$LIBXML_DIR/include/libxml2"
43 CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
44 CXXFLAGS="$CXXFLAGS -I/usr/include/libxml2"
45 TMPLIBS="-lxml2 $LIBS"
46 LIBXML_INCLUDES="-I/usr/include/libxml2"
49 AC_CHECK_HEADER(libxml/parser.h,libxml_ok="yes",libxml_ok="no")
51 if test "x$libxml_ok" = "xyes"
55 AC_CHECK_LIB(xml2,xmlInitParser,libxml_ok="yes",libxml_ok="no",)
59 if test "x$libxml_ok" = "xyes"
64 AC_MSG_RESULT(for libxml: $libxml_ok)
66 CXXFLAGS=$CXXFLAGS_old
67 CPPFLAGS=$CPPFLAGS_old
70 AC_SUBST(LIBXML_INCLUDES)