~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to config/cs_libxml2.m4

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl----------------------------------------------------------------------------
2
 
dnl   This file is part of the Code_Saturne Kernel, element of the
3
 
dnl   Code_Saturne CFD tool.
4
 
dnl
5
 
dnl   Copyright (C) 2009 EDF S.A., France
6
 
dnl
7
 
dnl   The Code_Saturne Kernel is free software; you can redistribute it
8
 
dnl   and/or modify it under the terms of the GNU General Public License
9
 
dnl   as published by the Free Software Foundation; either version 2 of
10
 
dnl   the License, or (at your option) any later version.
11
 
dnl
12
 
dnl   The Code_Saturne Kernel is distributed in the hope that it will be
13
 
dnl   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14
 
dnl   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
dnl   GNU General Public License for more details.
16
 
dnl
17
 
dnl   You should have received a copy of the GNU General Public Licence
18
 
dnl   along with the Code_Saturne Preprocessor; if not, write to the
19
 
dnl   Free Software Foundation, Inc.,
20
 
dnl   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21
 
dnl-----------------------------------------------------------------------------
22
 
 
23
 
# CS_AC_TEST_LIBXML2
24
 
#-------------------
25
 
# modifies or sets have_libxml2, LIBXML2_CPPFLAGS, LIBXML2_LDFLAGS, and LIBXML2_LIBS
26
 
# depending on libraries found
27
 
 
28
 
AC_DEFUN([CS_AC_TEST_LIBXML2], [
29
 
 
30
 
have_libxml2=no
31
 
 
32
 
AC_ARG_WITH(libxml2,
33
 
            [AS_HELP_STRING([--with-libxml2=PATH],
34
 
                            [specify prefix directory for LIBXML2])],
35
 
            [if test "x$withval" = "x"; then
36
 
               with_libxml2=yes
37
 
             fi],
38
 
            [with_libxml2=check])
39
 
 
40
 
AC_ARG_WITH(libxml2-include,
41
 
            [AS_HELP_STRING([--with-libxml2-include=PATH],
42
 
                            [specify directory for LIBXML2 include files])],
43
 
            [if test "x$with_libxml2" = "xcheck"; then
44
 
               with_libxml2=yes
45
 
             fi
46
 
             LIBXML2_CPPFLAGS="-I$with_libxml2_include"],
47
 
            [if test "x$with_libxml2" != "xno" ; then
48
 
               if test "x$with_libxml2" != "xyes" \
49
 
                       -a "x$with_libxml2" != "xcheck"; then
50
 
                 LIBXML2_CPPFLAGS="-I$with_libxml2/include/libxml2"
51
 
               else
52
 
                 LIBXML2_CPPFLAGS="-I/usr/include/libxml2"
53
 
               fi
54
 
             fi])
55
 
 
56
 
AC_ARG_WITH(libxml2-lib,
57
 
            [AS_HELP_STRING([--with-libxml2-lib=PATH],
58
 
                            [specify directory for LIBXML2 library])],
59
 
            [if test "x$with_libxml2" = "xcheck"; then
60
 
               with_libxml2=yes
61
 
             fi
62
 
             LIBXML2_LDFLAGS="-L$with_libxml2_lib"],
63
 
            [if test "x$with_libxml2" != "xno" -a "x$with_libxml2" != "xyes" \
64
 
                  -a "x$with_libxml2" != "xcheck"; then
65
 
               LIBXML2_LDFLAGS="-L$with_libxml2/lib"
66
 
             fi])
67
 
 
68
 
 
69
 
if test "x$with_libxml2" != "xno" ; then
70
 
 
71
 
  saved_CPPFLAGS="$CPPFLAGS"
72
 
  saved_LDFLAGS="$LDFLAGS"
73
 
  saved_LIBS="$LIBS"
74
 
 
75
 
  LIBXML2_LIBS="-lxml2"
76
 
 
77
 
  CPPFLAGS="${CPPFLAGS} ${LIBXML2_CPPFLAGS}"
78
 
  LDFLAGS="${LDFLAGS} ${LIBXML2_LDFLAGS}"
79
 
  LIBS="${LIBS} ${LIBXML2_LIBS}"
80
 
 
81
 
  AC_CHECK_HEADER([libxml/parser.h])
82
 
 
83
 
  AC_CHECK_LIB(xml2, xmlInitParser, 
84
 
               [ AC_DEFINE([HAVE_LIBXML2], 1, [LIBXML2 support])
85
 
                 have_libxml2=yes
86
 
               ], 
87
 
               [if test "x$with_libxml2" != "xcheck" ; then
88
 
                  AC_MSG_FAILURE([LIBXML2 support is requested, but test for LIBXML2 failed!])
89
 
                else
90
 
                  AC_MSG_WARN([no LIBXML2 support])
91
 
                fi
92
 
               ],
93
 
              )
94
 
 
95
 
  if test "x$have_libxml2" != "xyes"; then
96
 
    LIBXML2_LIBS=""
97
 
  fi
98
 
 
99
 
  CPPFLAGS="$saved_CPPFLAGS"
100
 
  LDFLAGS="$saved_LDFLAGS"
101
 
  LIBS="$saved_LIBS"
102
 
 
103
 
  unset saved_CPPFLAGS
104
 
  unset saved_LDFLAGS
105
 
  unset saved_LIBS
106
 
 
107
 
fi
108
 
 
109
 
AM_CONDITIONAL(HAVE_LIBXML2, test x$have_libxml2 = xyes)
110
 
 
111
 
AC_SUBST(LIBXML2_CPPFLAGS)
112
 
AC_SUBST(LIBXML2_LDFLAGS)
113
 
AC_SUBST(LIBXML2_LIBS)
114
 
 
115
 
])dnl
116