1 dnl Copyright (C) 2006-2014 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, 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([AC_CHECK_EXPAT],[
22 AC_CHECKING(for expat)
24 CXXFLAGS_old=$CXXFLAGS
25 CPPFLAGS_old=$CPPFLAGS
27 # Custom location of expat package can be specified
28 # through EXPAT_DIR variable
30 if test "x$EXPAT_DIR" != "x"
33 elif test "x$EXPAT_ROOT" != "x"
38 if test "x$EXPATDIR" != "x"
40 if test "x$EXPATDIR" = "x/usr"
42 AC_MSG_NOTICE(Trying native Expat...)
43 TMPLIBS="-lexpat $LIBS"
45 AC_MSG_NOTICE(Trying Expat from $EXPATDIR ...)
46 TMPLIBS="-L$EXPATDIR/lib -lexpat $LIBS"
47 CXXFLAGS="$CXXFLAGS -I$EXPATDIR/include"
48 CPPFLAGS="$CPPFLAGS -I$EXPATDIR/include"
49 EXPAT_INCLUDES="-I$EXPATDIR/include"
52 AC_MSG_NOTICE(Trying native Expat...)
53 TMPLIBS="-lexpat $LIBS"
56 AC_CHECK_HEADER(expat.h,expat_ok="yes",expat_ok="no")
58 if test "x$expat_ok" = "xyes"
62 AC_CHECK_LIB(expat,XML_ExpatVersionInfo,expat_ok="yes",expat_ok="no",)
66 if test "x$expat_ok" = "xyes"
71 AC_MSG_RESULT(for expat: $expat_ok)
73 CXXFLAGS=$CXXFLAGS_old
74 CPPFLAGS=$CPPFLAGS_old
77 AC_SUBST(EXPAT_INCLUDES)