occtl: use maxminddb when available

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2019-10-14 14:54:40 +02:00
parent b9ff297c7d
commit 960032e065
4 changed files with 199 additions and 4 deletions

View File

@@ -163,13 +163,28 @@ if test "$test_for_libnl" = yes;then
fi
fi
AC_ARG_WITH(maxmind,
AS_HELP_STRING([--without-maxmind], [do not try to use the maxmind library]),
test_for_maxmind=$withval,
test_for_maxmind=yes)
have_maxmind=no
if test "$test_for_maxmind" = yes;then
PKG_CHECK_MODULES(MAXMIND, libmaxminddb >= 1.0.0, [have_maxmind=yes], [have_maxmind=no])
if test "$have_maxmind" = yes;then
AC_DEFINE(HAVE_MAXMIND, 1, [have libmaxminddb])
fi
fi
AM_CONDITIONAL(HAVE_MAXMIND, test "x$have_maxmind" != xno)
AC_ARG_WITH(geoip,
AS_HELP_STRING([--without-geoip], [do not try to use the geoip library]),
test_for_geoip=$withval,
test_for_geoip=yes)
have_geoip=no
if test "$test_for_geoip" = yes;then
if test "$test_for_geoip" = yes && test "$have_maxmind" != yes;then
PKG_CHECK_MODULES(GEOIP, geoip >= 1.6.0, [have_geoip=yes], [have_geoip=no])
if test "$have_geoip" = yes;then
AC_DEFINE(HAVE_GEOIP, 1, [have libgeoip])
@@ -601,6 +616,7 @@ Summary of build options:
libnl3: ${have_libnl3}
liboath: ${have_liboath}
libgeoip: ${have_geoip}
libmaxminddb: ${have_maxmind}
glibc (sha2crypt): ${have_glibc}
local talloc: ${with_local_talloc}
local protobuf-c: ${with_local_protobuf_c}