Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / adm / unix / config_files / check_expat.m4
1 dnl Copyright (C) 2006-2012  CEA/DEN, EDF R&D
2 dnl
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.
7 dnl
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.
12 dnl
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
16 dnl
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 dnl
19
20 AC_DEFUN([AC_CHECK_EXPAT],[
21
22 AC_CHECKING(for expat)
23
24 CXXFLAGS_old=$CXXFLAGS
25 CPPFLAGS_old=$CPPFLAGS
26
27 # Custom location of expat package can be specified
28 # through EXPAT_DIR variable
29 if test "x$EXPAT_DIR" != "x"
30 then
31   if test "x$EXPAT_DIR" = "x/usr"
32   then
33     AC_MSG_NOTICE(Trying native Expat...)
34     TMPLIBS="-lexpat $LIBS"
35   else
36     AC_MSG_NOTICE(Trying Expat from $EXPAT_DIR ...)
37     TMPLIBS="-L$EXPAT_DIR/lib -lexpat $LIBS"
38     CXXFLAGS="$CXXFLAGS -I$EXPAT_DIR/include"
39     CPPFLAGS="$CPPFLAGS -I$EXPAT_DIR/include"
40     EXPAT_INCLUDES="-I$EXPAT_DIR/include"
41   fi
42 else
43   AC_MSG_NOTICE(Trying native Expat...)
44   TMPLIBS="-lexpat $LIBS"
45 fi
46
47 AC_CHECK_HEADER(expat.h,expat_ok="yes",expat_ok="no")
48
49 if  test "x$expat_ok" = "xyes"
50 then
51   LIBS_old=$LIBS
52   LIBS=$TMPLIBS
53   AC_CHECK_LIB(expat,XML_ExpatVersionInfo,expat_ok="yes",expat_ok="no",)
54   LIBS=$LIBS_old
55 fi
56
57 if test "x$expat_ok" = "xyes"
58 then
59   EXPAT_LIBS=$TMPLIBS
60 fi
61
62 AC_MSG_RESULT(for expat: $expat_ok)
63
64 CXXFLAGS=$CXXFLAGS_old
65 CPPFLAGS=$CPPFLAGS_old
66
67 AC_SUBST(EXPAT_LIBS)
68 AC_SUBST(EXPAT_INCLUDES)
69
70 ])dnl
71 dnl
72