It seems that adding AC_USE_SYSTEM_EXTENSIONS to configure.ac
will always cause _POSIX_PTHREAD_SEMANTICS and _TANDEM_SOURCE to
be defined (at least that is the case for autoconf version 2.61 on my
linux FC6 host). From /usr/share/autoconf/autoconf/specific.m4:
[snip]
As you can see, this defines _POSIX_PTHREAD_SEMANTICS and _TANDEM_SOURCE
unconditionally.
As a result, this logic in io.c to decide whether to include
missing_d/getaddrinfo.h is not working as intended:
#ifdef _TANDEM_SOURCE
#include <arpa/inet.h>
#include <netdb.h>
#else
#ifdef HAVE_GETADDRINFO
#include <netdb.h>
#else
#include "missing_d/getaddrinfo.h"
#endif
#endif
Because _TANDEM_SOURCE is defined, there is never any chance
of including missing_d/getaddrinfo.h.
This causes compilation errors on systems that do not supply getaddrinfo.
I'm not certain of the best fix. Why is it necessary to test
for _TANDEM_SOURCE at all in this spot? It seems that the only
difference is whether to include <arpa/inet.h>. Couldn't configure.ac
just test whether this header file exists (and similarly for netdb.h),
and just include them unconditionally if they exist (without caring
about _TANDEM_SOURCE)?