File: gst-libxml2.m4

package info (click to toggle)
gst-plugins-bad1.0 1.0.8-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 36,832 kB
  • sloc: ansic: 297,908; cpp: 22,677; sh: 13,303; xml: 6,362; makefile: 4,867; perl: 1,435; objc: 1,273; python: 362; sed: 16
file content (52 lines) | stat: -rw-r--r-- 1,659 bytes parent folder | download | duplicates (75)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
dnl call this macro with the minimum required version as an argument
dnl this macro sets and AC_SUBSTs XML_CFLAGS and XML_LIBS
dnl it also sets LIBXML_PKG, used for the pkg-config file

AC_DEFUN([AG_GST_LIBXML2_CHECK],
[
  dnl Minimum required version of libxml2
  dnl default to 2.4.9 if not specified
  LIBXML2_REQ=ifelse([$1],,2.4.9,[$1])
  AC_SUBST(LIBXML2_REQ)

  dnl check for libxml2
  PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ,
                    HAVE_LIBXML2=yes, [
                      AC_MSG_RESULT(no)
                      HAVE_LIBXML2=no
                    ])
  if test "x$HAVE_LIBXML2" = "xyes"; then
    AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
  else
    AC_MSG_ERROR([
        Need libxml2 and development headers/files to build GStreamer.

        You can do without libxml2 if you pass --disable-loadsave to
        configure, but that breaks ABI, so don't do that unless you
        are building for an embedded setup and know what you are doing.
    ])
  fi
  dnl this is for the .pc file
  LIBXML_PKG=', libxml-2.0'
  AC_SUBST(LIBXML_PKG)
  AC_SUBST(XML_LIBS)
  AC_SUBST(XML_CFLAGS)

  dnl XML_LIBS might pull in -lz without zlib actually being on the system, so
  dnl try linking with these LIBS and CFLAGS
  ac_save_CFLAGS=$CFLAGS
  ac_save_LIBS=$LIBS
  CFLAGS="$CFLAGS $XML_CFLAGS"
  LIBS="$LIBS $XML_LIBS"
  AC_TRY_LINK([
#include <libxml/tree.h>
#include <stdio.h>
],[
/* function body */
],
    AC_MSG_NOTICE([Test xml2 program linked]),
    AC_MSG_ERROR([Could not link libxml2 test program.  Check if you have the necessary dependencies.])
  )
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
])