[stunnel-users] stunnel 4.16 /mis-checking getaddrinfo() on FreeBSD

Tomoyuki Murakami tomoyuki at pobox.com
Fri Sep 1 07:55:46 CEST 2006


  Stunnel 4.16 on my FreeBSD 6.1, configure has mis-checking about
getaddrinfo(),

config.log says,

configure:23030: checking for getaddrinfo
configure:23050: gcc -o conftest -g -O2 -Wall -Wshadow -Wcast-align -Wpointer-arith   conftest.c -lz -lutil  -pthread -lpthread >&5
conftest.c: In function `main':
conftest.c:74: error: `NULL' undeclared (first use in this function)
conftest.c:74: error: (Each undeclared identifier is reported only once
conftest.c:74: error: for each function it appears in.)
configure:23056: $? = 1
configure: failed program was:

...
| #define HAVE_GETNAMEINFO 1
| /* end confdefs.h.  */
| #include <sys/types.h>
| #include <sys/socket.h>
| #include <netdb.h>
| int
| main ()
| {
| getaddrinfo(NULL, NULL, NULL, NULL);
|   ;
|   return 0;
| }
configure:23079: result: no

Yep, NULL was undefined.
A trivial patch for workaround.


diff -ru stunnel-4.16.orig/configure stunnel-4.16/configure
--- stunnel-4.16.orig/configure Sun Aug 20 05:28:40 2006
+++ stunnel-4.16/configure      Fri Sep  1 14:44:51 2006
@@ -23035,6 +23035,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <stdio.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
diff -ru stunnel-4.16.orig/configure.ac stunnel-4.16/configure.ac
--- stunnel-4.16.orig/configure.ac      Sun Aug 20 05:28:14 2006
+++ stunnel-4.16/configure.ac   Fri Sep  1 14:43:32 2006
@@ -194,7 +194,8 @@
 AC_MSG_CHECKING([for getaddrinfo])
 AC_LINK_IFELSE(
     [AC_LANG_PROGRAM(
-        [[#include <sys/types.h>
+        [[#include <stdio.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>]],
         [[getaddrinfo(NULL, NULL, NULL, NULL);]],)],




More information about the stunnel-users mailing list