X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=configure.ng;fp=configure.ng;h=bc30bed8a721a4b05f42d2d1fccd6b7dd85cb8d9;hp=9a4cc992d41796b41317493eda0e963afa35bc21;hb=b8433e9261c516d7b8743b33681050b6666192e5;hpb=5a424f60dad660815d89285da9a7a07e4991461a diff --git a/configure.ng b/configure.ng index 9a4cc992..bc30bed8 100644 --- a/configure.ng +++ b/configure.ng @@ -93,6 +93,35 @@ AC_DEFUN([GCC_STACK_PROTECT_CC],[ fi ]) +AC_DEFUN([WORKING_GETADDRINFO],[ + AC_CHECK_FUNCS([getaddrinfo],[ + AC_MSG_CHECKING([whether getaddrinfo() works]) + AC_TRY_RUN([ +#include +#include +#include +#include +int +main(int argc, char **argv) +{ + struct addrinfo hints, *ai; + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + hints.ai_family = PF_UNSPEC; + if(getaddrinfo(NULL, "0", &hints, &ai) != 0) + return 1; + return 0; +} + ],[ + AC_DEFINE([HAVE_WORKING_GETADDRINFO], 1, [getaddrinfo(0)]) + AC_MSG_RESULT(yes) + ],[ + AC_MSG_RESULT(no) + ]) + ]) +]) + # -- Hard coded system and compiler dependencies/features/options ... -- if test "$GCC" = "yes"; then @@ -189,11 +218,13 @@ AC_CHECK_FUNCS([ \ AC_MSG_ERROR([required function missing!])) # Optional functions -AC_CHECK_FUNCS_ONCE([ \ - arc4random arc4random_stir gai_strerror getaddrinfo getnameinfo inet_aton +AC_CHECK_FUNCS_ONCE([ + arc4random arc4random_stir gai_strerror getnameinfo inet_aton \ sigaction sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat \ strtok_r unsetenv waitpid]) +WORKING_GETADDRINFO + # -- Configuration options -- # use syslog?