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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
|
dnl Project: ipv6calc
dnl File : configure.in
dnl Version: $Id: configure.in,v 1.54 2012/02/05 09:40:35 peter Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(ipv6calc, 0.93.1, ipv6calc@deepspace6.net, ipv6calc, http://www.deepspace6.net/projects/ipv6calc.html)
AC_DEFINE(COPYRIGHT_YEAR, "2012", [Copyright year])
COPYRIGHT_YEAR=2012
AC_SUBST(COPYRIGHT_YEAR)
dnl Define version header
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
dnl AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MAKE_SET
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_C_BIGENDIAN
dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_CHECK_FUNCS(strspn strstr)
dnl Check for getopt
AC_CHECK_FUNC(getopt_long, [],
[
AC_LIBOBJ(../getopt/getopt)
AC_LIBOBJ(../getopt/getopt1)
GETOPT_INCLUDE=-I../getopt
ENABLE_BUNDLED_GETOPT=1
])
AC_SUBST(GETOPT_INCLUDE)
AC_SUBST(ENABLE_BUNDLED_GETOPT)
dnl disable databases
AC_ARG_ENABLE([db-ieee],
AS_HELP_STRING([--disable-db-ieee],
[Disable IEEE database (default: enabled)]),
[
DB_IEEE="$enableval"
],
[DB_IEEE="yes"])
if test "$DB_IEEE" = "yes"; then
AC_DEFINE(SUPPORT_DB_IEEE, 1, Define if you want IEEE database included.)
fi
AC_ARG_ENABLE([db-ipv4],
AS_HELP_STRING([--disable-db-ipv4],
[Disable IPv4 database (default: enabled)]),
[
DB_IPV4="$enableval"
],
[DB_IPV4="yes"])
if test "$DB_IPV4" = "yes"; then
AC_DEFINE(SUPPORT_DB_IPV4, 1, Define if you want IPv4 database included.)
fi
AC_ARG_ENABLE([db-ipv6],
AS_HELP_STRING([--disable-db-ipv6],
[Disable IPv6 database (default: enabled)]),
[
DB_IPV6="$enableval"
],
[DB_IPV6="yes"])
if test "$DB_IPV6" = "yes"; then
AC_DEFINE(SUPPORT_DB_IPV6, 1, Define if you want IPv6 database included.)
fi
dnl IP2Location support
AC_ARG_ENABLE([ip2location],
AS_HELP_STRING([--enable-ip2location],
[Enable IP2Location support (default: disabled)]),
[
IP2LOCATION="$enableval"
IP2LOCATION_LIB="-lIP2Location"
],
[IP2LOCATION="no"])
AC_ARG_WITH([ip2location-headers],
AS_HELP_STRING([--with-ip2location-headers=DIR],
[IP2Location include files location]),
[IP2LOCATION_INCLUDE="-I$withval"])
AC_ARG_WITH([ip2location-lib],
AS_HELP_STRING([--with-ip2location-lib=DIR],
[IP2Location library location]),
[IP2LOCATION_LIB="-L$withval $IP2LOCATION_LIB"])
AC_ARG_WITH([ip2location-static],
AS_HELP_STRING([--with-ip2location-static],
[Explicitly link IP2Location statically (default=no)]),
[if test "$withval" != "no"; then
IP2LOCATION_LIB="-Wl,-Bstatic $IP2LOCATION_LIB -Wl,-Bdynamic"
fi])
AC_ARG_WITH([ip2location-ipv4-default-file],
AS_HELP_STRING([--with-ip2location-ipv4-default-file=file],
[Use a default IP2Location IPv4 database file when ipv6calc is invoked with '--db-ip2location-ipv4-default|-L']),
[AC_DEFINE_UNQUOTED(IP2LOCATION_DEFAULT_FILE_IPV4, "$withval", Define for a default IP2Location IPv4 database file.)])
AC_ARG_WITH([ip2location-ipv6-default-file],
AS_HELP_STRING([--with-ip2location-ipv6-default-file=file],
[Use a default IP2Location IPv6 database file when ipv6calc is invoked with '--db-ip2location-ipv6-default|-L']),
[AC_DEFINE_UNQUOTED(IP2LOCATION_DEFAULT_FILE_IPV6, "$withval", Define for a default IP2Location IPv6 database file.)])
if test "$IP2LOCATION" = "yes"; then
CPPFLAGS="$CPPFLAGS $IP2LOCATION_INCLUDE"
LDFLAGS="$LDFLAGS $IP2LOCATION_LIB"
AC_CHECK_HEADER(IP2Location.h,,
[AC_MSG_ERROR([IP2Location library header files not found])]
)
AC_CHECK_LIB(IP2Location,IP2Location_open,
[
AC_DEFINE(SUPPORT_IP2LOCATION, 1, Define if you want IP2Location support.)
],
[
AC_MSG_ERROR([IP2Location library header files were found but the library was not found])
])
fi
AC_SUBST(IP2LOCATION_INCLUDE)
AC_SUBST(IP2LOCATION_LIB)
dnl GeoIP support
AC_ARG_ENABLE([geoip],
AS_HELP_STRING([--enable-geoip],
[Enable GeoIP support (default: disabled)]),
[
if test "$enableval" != "no"; then
GEOIP="$enableval"
GEOIP_LIB="-lGeoIP"
fi
],
[GEOIP="no"])
AC_ARG_WITH([geoip-headers],
AS_HELP_STRING([--with-geoip-headers=DIR],
[GeoIP include files location]),
[GEOIP_INCLUDE="-I$withval"])
AC_ARG_WITH([geoip-lib],
AS_HELP_STRING([--with-geoip-lib=DIR],
[GeoIP library location]),
[GEOIP_LIB="-L$withval $GEOIP_LIB"])
AC_ARG_WITH([geoip-static],
AS_HELP_STRING([--with-geoip-static],
[Explicitly link GeoIP statically (default=no)]),
[if test "$withval" != "no"; then
GEOIP_LIB="-Wl,-Bstatic $GEOIP_LIB -Wl,-Bdynamic"
fi])
AC_ARG_WITH([geoip-ipv4-default-file],
AS_HELP_STRING([--with-geoip-ipv4-default-file=file],
[Use a default GeoIP IPv4 database file when ipv6calc is invoked with '--db-geoip-ipv4-default|-G']),
[AC_DEFINE_UNQUOTED(GEOIP_DEFAULT_FILE_IPV4, "$withval", Define for a default GeoIP IPv4 database file.)])
AC_ARG_WITH([geoip-ipv6-default-file],
AS_HELP_STRING([--with-geoip-ipv6-default-file=file],
[Use a default GeoIP IPv6 database file when ipv6calc is invoked with '--db-geoip-ipv6-default|-G']),
[AC_DEFINE_UNQUOTED(GEOIP_DEFAULT_FILE_IPV6, "$withval", Define for a default GeoIP IPv6 database file.)])
AC_ARG_WITH([geoip-ipv6-compat],
AS_HELP_STRING([--with-geoip-ipv6-compat],
[Use IPv6 interface of GeoIP in compatibility mode (supporting 1.4.5)]),
[if test "$withval" != "no"; then
GEOIP_COMPAT="yes",
fi], [ GEOIP_COMPAT="no" ])
if test "$GEOIP" = "yes"; then
CPPFLAGS="$CFLAGS $GEOIP_INCLUDE"
LDFLAGS="$LDFLAGS $GEOIP_LIB"
AC_CHECK_HEADER(GeoIP.h,,
[AC_MSG_ERROR([GeoIP library header files not found])]
)
AC_CHECK_LIB(GeoIP, GeoIP_open,
[
AC_DEFINE(SUPPORT_GEOIP, 1, Define if you want GeoIP support.)
],
[
AC_MSG_ERROR([GeoIP library header files were found but the library was not found])
])
AC_CHECK_LIB(GeoIP, GeoIP_country_code_by_ipnum_v6,
[
AC_DEFINE(SUPPORT_GEOIP_V6, 1, Define if you want GeoIP IPv6 support.)
],
[
AC_MSG_WARN([GeoIP library header files were found but not supporting IPv6 (upgrade to GeoIP 1.4.5 or newer for enabling IPv6 support)])
])
if test "$GEOIP_COMPAT" = "no"; then
AC_CHECK_LIB(GeoIP, GeoIP_lib_version,
[
AC_DEFINE(SUPPORT_GEOIP_LIB_VERSION, 1, Define if your GeoIP version supports GeoIP_lib_version.)
],
[
AC_MSG_WARN([GeoIP library header files were found but not supporting GeoIP_lib_version (upgrade to newer version for support).])
])
AC_CHECK_LIB(GeoIP, GeoIP_country_code_by_addr_v6,
[
AC_DEFINE(SUPPORT_GEOIP_COUNTRY_CODE_BY_ADDR_V6, 1, Define if your GeoIP version supports GeoIP_country_code_by_addr_v6.)
],
[
AC_MSG_WARN([GeoIP library header files were found but not supporting GeoIP_country_code_by_addr_v6 (will use workaround).])
])
AC_CHECK_LIB(GeoIP, GeoIP_country_name_by_addr_v6,
[
AC_DEFINE(SUPPORT_GEOIP_COUNTRY_NAME_BY_ADDR_V6, 1, Define if your GeoIP version supports GeoIP_country_name_by_addr_v6.)
],
[
AC_MSG_WARN([GeoIP library header files were found but not supporting GeoIP_country_name_by_addr_v6 (will use workaround).])
])
else
AC_MSG_WARN([GeoIP IPv6 support compatibility mode enabled (supporting 1.4.5).])
fi
fi
AC_SUBST(GEOIP_INCLUDE)
AC_SUBST(GEOIP_LIB)
dnl Files to create
AC_OUTPUT([Makefile
md5/Makefile
tools/Makefile
getopt/Makefile
ipv6calc/Makefile
lib/Makefile
man/Makefile
ipv6logconv/Makefile
ipv6loganon/Makefile
ipv6logstats/Makefile
contrib/ipv6calc.spec
VERSION
ipv6calcweb/ipv6calcweb.cgi ])
|