Salome HOME
Issue 0019980: EDF 818 OTHER : Get rid of the RPATH issues in packaging
[modules/kernel.git] / salome_adm / unix / config_files / check_libxml.m4
1 dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 dnl
3 dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 dnl
6 dnl  This library is free software; you can redistribute it and/or
7 dnl  modify it under the terms of the GNU Lesser General Public
8 dnl  License as published by the Free Software Foundation; either
9 dnl  version 2.1 of the License.
10 dnl
11 dnl  This library is distributed in the hope that it will be useful,
12 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 dnl  Lesser General Public License for more details.
15 dnl
16 dnl  You should have received a copy of the GNU Lesser General Public
17 dnl  License along with this library; if not, write to the Free Software
18 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 dnl
20 dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 dnl
22 AC_DEFUN([CHECK_LIBXML],[
23
24 AC_CHECKING(for libxml library)
25
26 AC_SUBST(LIBXML_INCLUDES)
27 AC_SUBST(LIBXML_LIBS)
28
29 LIBXML_INCLUDES=""
30 LIBXML_LIBS=""
31
32 libxml_ok=no
33
34 LOCAL_INCLUDES=""
35 LOCAL_LIBS=""
36
37 if test "x$LIBXML_DIR" != "x"
38 then
39   LOCAL_INCLUDES="-I$LIBXML_DIR/include/libxml2"
40   if test "x$LIBXML_DIR" = "x/usr"
41   then
42     LOCAL_LIBS="-lxml2"
43   else
44     LOCAL_LIBS="-L$LIBXML_DIR/lib -lxml2"
45   fi
46 else
47   LOCAL_INCLUDES="-I/usr/include/libxml2"
48   LOCAL_LIBS="-lxml2"
49 fi
50
51 dnl libxml2 headers
52
53 CPPFLAGS_old="$CPPFLAGS"
54 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
55 AC_CHECK_HEADER(libxml/parser.h,libxml_ok="yes",libxml_ok="no")
56 CPPFLAGS="$CPPFLAGS_old"
57
58 if  test "x$libxml_ok" = "xyes"
59 then
60
61 dnl libxml2 library
62
63   LIBS_old=$LIBS
64   LIBS="$LIBS $LOCAL_LIBS"
65   AC_CHECK_LIB(xml2,xmlInitParser,libxml_ok="yes",libxml_ok="no",)
66   LIBS=$LIBS_old
67 fi
68
69 if test "x$libxml_ok" = "xyes"
70 then
71   LIBXML_INCLUDES="$LOCAL_INCLUDES"
72   LIBXML_LIBS="$LOCAL_LIBS"
73 fi
74
75 AC_MSG_RESULT(for libxml: $libxml_ok)
76
77 ])dnl
78 dnl
79