summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2016-09-13 02:23:06 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2016-09-13 02:49:00 -0400
commit5dfe21acc973b81b95f27d76ce7e686205424a96 (patch)
tree1818ac0217286e335944bfe8f4a300ba0b85b157 /configure.ac
parentab935a2b96679944eddc6804805c0f5b70e5cd94 (diff)
downloadlighttpd1.4-5dfe21acc973b81b95f27d76ce7e686205424a96.tar.gz
lighttpd1.4-5dfe21acc973b81b95f27d76ce7e686205424a96.zip
[mod_geoip] add to default build (fixes #2705, fixes #2101, fixes #2092, fixes #2025, fixes #1962, fixes #1938)
(add to default build to reduce distributor package maintenance) x-ref: "broken module API since 1.4.38" https://redmine.lighttpd.net/issues/2705 "lighttpd-1.4.24 fails to compile with mod_geoip.c" https://redmine.lighttpd.net/issues/2101 "unsafe sprintfs mod_geoip" https://redmine.lighttpd.net/issues/2092 "mod_geoip crashes lighttpd 1.5.x on FreeBSD 7.2 AMD64" https://redmine.lighttpd.net/issues/2025 "mod_geoip" https://redmine.lighttpd.net/issues/1962 "lighttpd 1.4 crashes on FreeBSD 7.0 AMD64 when mod_geoip compiled in" https://redmine.lighttpd.net/issues/1938
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 25 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ffccab4d..0c43c796 100644
--- a/configure.ac
+++ b/configure.ac
@@ -590,6 +590,31 @@ if test "$WITH_GDBM" != "no"; then
fi
fi
+dnl Check for GeoIP
+AC_MSG_CHECKING(for GeoIP)
+AC_ARG_WITH(geoip, AC_HELP_STRING([--with-geoip],[IP-based geolocation lookup]),
+[WITH_GEOIP=$withval],[WITH_GEOIP=no])
+AC_MSG_RESULT([$WITH_GEOIP])
+
+if test "$WITH_GEOIP" != "no"; then
+ if test "$WITH_GEOIP" != "yes"; then
+ GEOIP_LIB="-L$WITH_GEOIP -lGeoIP"
+ CPPFLAGS="$CPPFLAGS -I$WITH_GEOIP"
+ else
+ AC_CHECK_LIB(GeoIP, GeoIP_country_name_by_addr, [
+ AC_CHECK_HEADERS([GeoIP.h],[GEOIP_LIB=-lGeoIP])
+ ])
+ fi
+
+ if test x"$GEOIP_LIB" != x; then
+ AC_DEFINE([HAVE_GEOIP], [1], [libGeoIP])
+ AC_DEFINE([HAVE_GEOIP_H], [1])
+ AC_SUBST(GEOIP_LIB)
+ else
+ AC_MSG_ERROR([GeoIP headers and/or libs were not found, install them or build with --without-geoip])
+ fi
+fi
+
dnl Check for memcached
AC_MSG_CHECKING(for memcached)
AC_ARG_WITH(memcached, AC_HELP_STRING([--with-memcached],[memcached storage for mod_trigger_b4_dl]),