diff options
Diffstat (limited to 'configure.in')
| -rw-r--r-- | configure.in | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 08996c9a..ef0d06b6 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -231,6 +231,121 @@ elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then | |||
| 231 | fi | 231 | fi |
| 232 | AC_ARG_WITH(openssl,--with-openssl=<dir> sets path to openssl installation,[OPENSSL=$withval]) | 232 | AC_ARG_WITH(openssl,--with-openssl=<dir> sets path to openssl installation,[OPENSSL=$withval]) |
| 233 | 233 | ||
| 234 | dnl ######################################################################### | ||
| 235 | dnl Check if Posix getaddrinfo() is available. It is also possible to use | ||
| 236 | dnl the version from the lwres library distributed with BIND. | ||
| 237 | dnl ######################################################################### | ||
| 238 | AC_ARG_ENABLE([emulate-getaddrinfo], | ||
| 239 | ACX_HELP_STRING([--enable-emulate-getaddrinfo], | ||
| 240 | [enable getaddrinfo emulation (default=no)]), | ||
| 241 | , | ||
| 242 | enable_emulate_getaddrinfo=no) | ||
| 243 | AC_ARG_WITH(lwres, | ||
| 244 | ACX_HELP_STRING([--with-lwres=DIR], | ||
| 245 | [use lwres library for getaddrinfo (default=no)]), | ||
| 246 | , | ||
| 247 | with_lwres=no) | ||
| 248 | |||
| 249 | dnl ## enable force to test getaddrinfo.c | ||
| 250 | if test x$enable_emulate_getaddrinfo = xforce ; then | ||
| 251 | enable_emulate_getaddrinfo=yes | ||
| 252 | have_getaddrinfo=no | ||
| 253 | else | ||
| 254 | |||
| 255 | have_getaddrinfo=no | ||
| 256 | if test x$with_lwres != xno ; then | ||
| 257 | if test "$with_lwres" != yes ; then | ||
| 258 | CPPFLAGS="-I${with_lwres}/include $CPPFLAGS" | ||
| 259 | LDFLAGS="-L${with_lwres}/lib $LDFLAGS" | ||
| 260 | fi | ||
| 261 | AC_CHECK_HEADERS(lwres/netdb.h, , | ||
| 262 | [AC_MSG_ERROR([cannot find <lwres/netdb.h>])]) | ||
| 263 | AC_CHECK_LIB(lwres, lwres_getaddrinfo, , | ||
| 264 | [AC_MSG_ERROR([cannot find the lwres library])], | ||
| 265 | -lnsl -lpthread) | ||
| 266 | have_getaddrinfo=yes | ||
| 267 | fi | ||
| 268 | |||
| 269 | if test x$have_getaddrinfo != xyes ; then | ||
| 270 | AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes) | ||
| 271 | fi | ||
| 272 | |||
| 273 | dnl # Special nonsense for systems that actually have getaddrinfo but | ||
| 274 | dnl # redefine the name to something else, e.g. OSF | ||
| 275 | if test x$have_getaddrinfo != xyes ; then | ||
| 276 | AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h) | ||
| 277 | AC_TRY_LINK([ | ||
| 278 | # include <netdb.h> | ||
| 279 | ], [ | ||
| 280 | struct addrinfo hints, *res; | ||
| 281 | int err; | ||
| 282 | |||
| 283 | err = getaddrinfo ("host", "service", &hints, &res); | ||
| 284 | ], [ | ||
| 285 | have_getaddrinfo=yes | ||
| 286 | AC_MSG_RESULT(yes) | ||
| 287 | ], [AC_MSG_RESULT(no)]) | ||
| 288 | fi | ||
| 289 | |||
| 290 | fi | ||
| 291 | |||
| 292 | if test x$have_getaddrinfo != xno ; then | ||
| 293 | if test x$enable_emulate_getaddrinfo != xno ; then | ||
| 294 | AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled]) | ||
| 295 | fi | ||
| 296 | AC_DEFINE(HAVE_GETADDRINFO, 1, | ||
| 297 | [Does system provide RFC 2553/Posix getaddrinfo?]) | ||
| 298 | else | ||
| 299 | if test x$enable_emulate_getaddrinfo != xyes ; then | ||
| 300 | AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo]) | ||
| 301 | fi | ||
| 302 | LIBOBJS="$LIBOBJS getaddrinfo.o" | ||
| 303 | fi | ||
| 304 | |||
| 305 | if test x"$enable_emulate_getaddrinfo" != xno ; then | ||
| 306 | have_resolver=no | ||
| 307 | |||
| 308 | dnl Try for getipnodebyname | ||
| 309 | AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes) | ||
| 310 | if test x"$have_resolver" != xno ; then | ||
| 311 | AC_DEFINE(HAVE_GETIPNODEBYNAME, 1, | ||
| 312 | [Set when getipnodebyname is available]) | ||
| 313 | fi | ||
| 314 | |||
| 315 | dnl Try for gethostbyname_r | ||
| 316 | if test x"$have_resolver" = xno ; then | ||
| 317 | AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr, | ||
| 318 | [have_resolver=yes | ||
| 319 | ACX_WHICH_GETHOSTBYNAME_R]) | ||
| 320 | fi | ||
| 321 | |||
| 322 | dnl Try for gethostbyname | ||
| 323 | if test x"$have_resolver" = xno ; then | ||
| 324 | if test x"$enable_pthreads" != xno ; then | ||
| 325 | AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname]) | ||
| 326 | fi | ||
| 327 | AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, , | ||
| 328 | [AC_MSG_ERROR([cannot find gethostbyname])]) | ||
| 329 | fi | ||
| 330 | LIBOBJS="$LIBOBJS gethostbyname.o" | ||
| 331 | |||
| 332 | AC_CACHE_CHECK([for IPv6 support], acx_cv_sys_use_ipv6, [ | ||
| 333 | AC_TRY_COMPILE([ | ||
| 334 | # include <netinet/in.h> | ||
| 335 | ], [ | ||
| 336 | struct sockaddr_in6 sin6; | ||
| 337 | void *p; | ||
| 338 | |||
| 339 | sin6.sin6_family = AF_INET6; | ||
| 340 | sin6.sin6_port = 587; | ||
| 341 | p = &sin6.sin6_addr; | ||
| 342 | ], [acx_cv_sys_use_ipv6=yes], [acx_cv_sys_use_ipv6=no]) | ||
| 343 | ]) | ||
| 344 | if test x"$acx_cv_sys_use_ipv6" != xno ; then | ||
| 345 | AC_DEFINE(USE_IPV6,1,[Enable IPv6 support]) | ||
| 346 | fi | ||
| 347 | fi | ||
| 348 | |||
| 234 | AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) | 349 | AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) |
| 235 | if test "$FOUNDINCLUDE" = "no"; then | 350 | if test "$FOUNDINCLUDE" = "no"; then |
| 236 | _SAVEDCPPFLAGS="$CPPFLAGS" | 351 | _SAVEDCPPFLAGS="$CPPFLAGS" |
