File: pdns_with_geo.m4

package info (click to toggle)
pdns 4.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,856 kB
  • sloc: cpp: 78,652; sh: 5,405; makefile: 2,096; sql: 822; ruby: 598; yacc: 228; ansic: 208; lex: 130; perl: 48; python: 4
file content (47 lines) | stat: -rw-r--r-- 1,744 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
AC_DEFUN([PDNS_CHECK_GEOIP], [
  PKG_CHECK_MODULES([GEOIP], [geoip], AC_DEFINE([HAVE_GEOIP], [1], [Define this if you have GeoIP]), [have_geoip=0])
  AC_ARG_WITH([maxminddb_incdir],
    AS_HELP_STRING([--with-maxminddb-includedir],[path to maxminddb include directory @<:@default=auto@:>@]),
    [with_maxminddb_incdir=$withval],
    [with_maxminddb_incdir=auto]
  )
  AC_ARG_WITH([maxminddb_libdir],
    AS_HELP_STRING([--with-maxminddb-libdir],[path to maxminddb library directory @<:@default=auto@:>@]),
    [with_maxminddb_libdir=$withval],
    [with_maxminddb_libdir=auto],
  )

  PKG_CHECK_MODULES([MMDB], [libmaxminddb], [
    AC_DEFINE([HAVE_MMDB], [1], [Define this if you have Maxmind DB])
  ], [
    AS_IF([test "x$with_maxminddb_incdir" = "xauto"], [
      AC_CHECK_HEADER([maxminddb.h], [have_mmdb=1], [have_mmdb=0])
    ], [
      OLD_CFLAGS="$CFLAGS"
      CFLAGS="$CFLAGS -I$with_maxminddb_incdir"
      AC_CHECK_HEADER([maxminddb.h], [have_mmdb=1], [have_mmdb=0])
      CFLAGS="$OLD_CFLAGS"
    ])

    AS_IF([test "$have_mmdb" = "1"], [
      AS_IF([test "x$with_maxminddb_libdir" = "xauto"], [
        AC_CHECK_LIB([maxminddb], [MMDB_open], [
          AC_DEFINE([HAVE_MMDB], [1], [Define this if you have Maxmind DB])
          MMDB_LIBS="-lmaxminddb"
        ])
      ], [
        OLD_LDFLAGS="$LDFLAGS"
        LDFLAGS="$LDFLAGS -L$with_maxminddb_libdir"
        AC_CHECK_LIB([maxminddb], [MMDB_open], [
          AC_DEFINE([HAVE_MMDB], [1], [Define this if you have Maxmind DB])
          MMDB_CFLAGS="-I$with_maxminddb_incdir"
          MMDB_LIBS="-L$with_maxminddb_libdir -lmaxminddb"
        ])
      ])
    ])
  ])

  PKG_CHECK_MODULES([YAML], [yaml-cpp >= 0.5],[],
    AC_MSG_ERROR([Could not find yaml-cpp])
  )
])