-AC_EGREP_HEADER(h_errno, netdb.h, [AC_DEFINE(HAVE_NETDB_H)
- AC_MSG_RESULT(found)
-], [AC_TRY_COMPILE(netdb.h, h_errno foo, [AC_MSG_RESULT(found)
- AC_MSG_RESULT(found)
- ], [ah_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
- AC_TRY_COMPILE([netdb.h], [h_errno foo], [AC_DEFINE(NEED_XOPEN_NETDB_H)
- AC_MSG_RESULT([found, needed -D_XOPEN_SOURCE_EXTENDED])
- ], [CFLAGS="$ah_CFLAGS"
- AC_MSG_ERROR(["not found."])
- ])
- ])
-])
+AC_EGREP_HEADER(h_errno, netdb.h, [AC_MSG_RESULT(normal)],
+ [CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
+ AC_EGREP_HEADER(h_errno, netdb.h,
+ [AC_MSG_RESULT(needs _XOPEN_SOURCE_EXTENDED)],
+ [AC_MSG_ERROR("not found.")])
+ ])