File: ax_lib_mapnik.m4

package info (click to toggle)
libapache2-mod-tile 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,872 kB
  • sloc: cpp: 18,151; ansic: 7,574; sh: 980; makefile: 163; xml: 27
file content (95 lines) | stat: -rw-r--r-- 2,408 bytes parent folder | download | duplicates (4)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# SYNOPSIS
#
#   AX_LIB_MAPNIK()
#
# DESCRIPTION
#
#   This macro provides tests of availability of mapnik 'libmapnik' library
#   of particular version or newer.
#
#   
#
#   The --with-mapnik option takes one of three possible values:
#
#   no - do not check for mapnik library
#
#   yes - do check for mapnik library in standard locations (xml2-config
#   should be in the PATH)
#
#   path - complete path to mapnik-config utility, use this option if mapnik-config
#   can't be found in the PATH
#
#   This macro calls:
#
#     AC_SUBST(MAPNIK_CFLAGS)
#     AC_SUBST(MAPNIK_LDFLAGS)
#
#   And sets:
#
#     HAVE_MAPNIK
#
# LICENSE
#
#   Copyright (c) 2012
#   Copyright (c) 2009 Hartmut Holzgraefe <hartmut@php.net>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.

AC_DEFUN([AX_LIB_MAPNIK],
[
    AC_ARG_WITH([libmapnik],
        AC_HELP_STRING([--with-libmapnik=@<:@ARG@:>@],
            [use mapnik library @<:@default=yes@:>@, optionally specify path to mapnik-config]
        ),
        [
        if test "$withval" = "no"; then
            want_libmapnik="no"
        elif test "$withval" = "yes"; then
            want_libmapnik="yes"
        else
            want_libmapnik="yes"
            MAPNIK_CONFIG="$withval"
        fi
        ],
        [want_libmapnik="yes"]
    )

    MAPNIK_CFLAGS=""
    MAPNIK_LDFLAGS=""
    MAPNIK_VERSION=""

    dnl
    dnl Check mapnik libraries (libmapnik)
    dnl

    if test "$want_libmapnik" = "yes"; then

        if test -z "$MAPNIK_CONFIG" -o test; then
            AC_PATH_PROG([MAPNIK_CONFIG], [mapnik-config], [])
        fi

        if test "$MAPNIK_CONFIG" != "no"; then
            AC_MSG_CHECKING([for mapnik libraries])

            MAPNIK_CFLAGS="`$MAPNIK_CONFIG --cflags`"
            MAPNIK_LDFLAGS="`$MAPNIK_CONFIG --libs` `$MAPNIK_CONFIG --ldflags` `$MAPNIK_CONFIG --dep-libs`"
            MAPNIK_VERSION=`$MAPNIK_CONFIG --version`

            AC_DEFINE([HAVE_MAPNIK], [1],
                [Define to 1 if mapnik libraries are available])

            found_libmapnik="yes"
            AC_MSG_RESULT([yes])
        else
            found_libmapnik="no"
            AC_MSG_RESULT([no])
        fi
    fi

    AC_SUBST([MAPNIK_VERSION])
    AC_SUBST([MAPNIK_CFLAGS])
    AC_SUBST([MAPNIK_LDFLAGS])
])