only compile geoip.o when requested.
silence compiler warnings
TARGETS = named@EXEEXT@ lwresd@EXEEXT@
+GEOIPLINKOBJS = geoip.@O@
+
OBJS = builtin.@O@ client.@O@ config.@O@ control.@O@ \
- controlconf.@O@ geoip.@O@ interfacemgr.@O@ \
+ controlconf.@O@ @GEOIPLINKOBJS@ interfacemgr.@O@ \
listenlist.@O@ log.@O@ logconf.@O@ main.@O@ notify.@O@ \
query.@O@ server.@O@ sortlist.@O@ statschannel.@O@ \
tkeyconf.@O@ tsigconf.@O@ update.@O@ xfrout.@O@ \
SYMOBJS = symtbl.@O@
+GEOIPLINKSRCS = geoip.c
+
SRCS = builtin.c client.c config.c control.c \
- controlconf.c geoip.c interfacemgr.c \
+ controlconf.c @GEOIPLINKSRCS@ interfacemgr.c \
listenlist.c log.c logconf.c main.c notify.c \
query.c server.c sortlist.c statschannel.c symtbl.c symtbl-empty.c \
tkeyconf.c tsigconf.c update.c xfrout.c \
#include <config.h>
+#include <isc/util.h>
+
#ifdef HAVE_GEOIP
#include <named/log.h>
#include <named/geoip.h>
void
ns_geoip_load(char *dir) {
#ifndef HAVE_GEOIP
+
+ UNUSED(dir);
+
return;
#else
GeoIPOptions method;
ISC_PLATFORM_GSSAPI_KRB5_HEADER
ISC_PLATFORM_GSSAPIHEADER
ISC_PLATFORM_HAVEGSSAPI
+GEOIPLINKOBJS
+GEOIPLINKSRCS
PKCS11_PROVIDER
PKCS11_TOOLS
USE_PKCS11
esac
+GEOIPLINKSRCS=
+GEOIPLINKOBJS=
# Check whether --with-geoip was given.
if test "${with_geoip+set}" = set; then :
$as_echo "#define HAVE_GEOIP 1" >>confdefs.h
+ GEOIPLINKSRCS='${GEOIPLINKSRCS}'
+ GEOIPLINKOBJS='${GEOIPLINKOBJS}'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP support" >&5
$as_echo_n "checking for GeoIP support... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
;;
esac
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSSAPI library" >&5
$as_echo_n "checking for GSSAPI library... " >&6; }
esac
AC_SUBST(PKCS11_PROVIDER)
+GEOIPLINKSRCS=
+GEOIPLINKOBJS=
AC_ARG_WITH(geoip,
[ --with-geoip=PATH Build with GeoIP support (yes|no|path)],
use_geoip="$withval", use_geoip="no")
[AC_MSG_ERROR([Math library not found])]
)
AC_DEFINE(HAVE_GEOIP, 1, Build with GeoIP support)
+ GEOIPLINKSRCS='${GEOIPLINKSRCS}'
+ GEOIPLINKOBJS='${GEOIPLINKOBJS}'
AC_MSG_CHECKING([for GeoIP support])
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for GeoIP Country IPv6 support])
AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([[
+ [AC_LANG_PROGRAM([
#include <GeoIP.h>
#include <netinet/in.h>
- ]], [[
+ ], [
struct in6_addr in6;
GeoIP_country_name_by_ipnum_v6(NULL, in6);
- ]]),
+ ])],
[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_GEOIP_V6, 1, Build with GeoIP Country IPv6 support)
AC_MSG_CHECKING([for GeoIP City IPv6 support])
AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([[
+ [AC_LANG_PROGRAM([
#include <GeoIP.h>
#include <GeoIPCity.h>
#include <netinet/in.h>
- ]], [[
+ ], [
struct in6_addr in6;
int i = GEOIP_CITY_EDITION_REV0_V6;
GeoIP_record_by_ipnum_v6(NULL, in6);
- ]]),
+ ])],
[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_GEOIP_CITY_V6, 1, Build with GeoIP City IPv6 support)
)
;;
esac
+AC_SUBST(GEOIPLINKSRCS)
+AC_SUBST(GEOIPLINKOBJS)
AC_MSG_CHECKING(for GSSAPI library)
AC_ARG_WITH(gssapi,
dst_api.@O@ dst_lib.@O@ dst_parse.@O@ dst_result.@O@ \
gssapi_link.@O@ gssapictx.@O@ hmac_link.@O@ key.@O@
+GEOIPLINKOBJS = geoip.@O@
+
# Alphabetically
DNSOBJS = acache.@O@ acl.@O@ adb.@O@ byaddr.@O@ \
cache.@O@ callbacks.@O@ clientinfo.@O@ compress.@O@ \
db.@O@ dbiterator.@O@ dbtable.@O@ diff.@O@ dispatch.@O@ \
- dlz.@O@ dns64.@O@ dnssec.@O@ ds.@O@ forward.@O@ geoip.@O@\
+ dlz.@O@ dns64.@O@ dnssec.@O@ ds.@O@ forward.@O@ \
iptable.@O@ journal.@O@ keydata.@O@ keytable.@O@ \
lib.@O@ log.@O@ lookup.@O@ \
master.@O@ masterdump.@O@ message.@O@ \
tsec.@O@ tsig.@O@ ttl.@O@ update.@O@ validator.@O@ \
version.@O@ view.@O@ xfrin.@O@ zone.@O@ zonekey.@O@ zt.@O@
-OBJS= ${DNSOBJS} ${OTHEROBJS} ${DSTOBJS}
+OBJS= ${DNSOBJS} ${OTHEROBJS} ${DSTOBJS} @GEOIPLINKOBJS@
+
# Alphabetically
OPENSSLGOSTLINKSRCS = opensslgost_link.c
dst_result.c gssapi_link.c gssapictx.c \
hmac_link.c key.c
+GEOIOLINKSRCS = geoip.c
+
DNSSRCS = acache.c acl.c adb.c byaddr.c \
cache.c callbacks.c clientinfo.c compress.c \
db.c dbiterator.c dbtable.c diff.c dispatch.c \
tsec.c tsig.c ttl.c update.c validator.c \
version.c view.c xfrin.c zone.c zonekey.c zt.c ${OTHERSRCS}
-SRCS = ${DSTSRCS} ${DNSSRCS}
+SRCS = ${DSTSRCS} ${DNSSRCS} @GEOIPLINKSRCS@
SUBDIRS = include
TARGETS = include/dns/enumtype.h include/dns/enumclass.h \
#define DB46(addr, geoip, name) \
((addr->family == AF_INET) ? (geoip->name##_v4) : (geoip->name##_v6))
+#ifdef HAVE_GEOIP
/*
* Find the best database to answer a generic subtype
*/
return (ret);
}
+#endif /* HAVE_GEOIP */
isc_boolean_t
dns_geoip_match(const isc_netaddr_t *reqaddr,
tcpmsg.@O@ time.@O@ tsec.@O@ tsig.@O@ ttl.@O@ \
validator.@O@ version.@O@ view.@O@
PORTDNSOBJS = ecdb.@O@
+GEOIPLINKOBJS = geoip.@O@
-OBJS= ${DNSOBJS} ${OTHEROBJS} ${DSTOBJS} ${PORTDNSOBJS}
+OBJS= ${DNSOBJS} ${OTHEROBJS} ${DSTOBJS} ${PORTDNSOBJS} @GEOIPLINKOBJS@
# Alphabetically
tcpmsg.c time.c tsec.c tsig.c ttl.c \
validator.c version.c view.c
PORTDNSSRCS = ecdb.c
+GEOIPLINKSRCS = geoip.c
-SRCS = ${DSTSRCS} ${DNSSRCS} ${PORTDNSSRCS}
+SRCS = ${DSTSRCS} ${DNSSRCS} ${PORTDNSSRCS} @GEOIPLINKSRCS@
SUBDIRS = include
TARGETS = include/dns/enumtype.h include/dns/enumclass.h \