Example: Portable OpenSSH cvs-20051008

configure.ac
2831| AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2832|         AC_TRY_COMPILE(
2833|                 [
2834| #include <sys/types.h>
2835| #include <sys/socket.h>
2836| #include <netdb.h>
2837|                 ],
2838|                 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2839|                 [ ac_cv_have_struct_addrinfo="yes" ],
2840|                 [ ac_cv_have_struct_addrinfo="no" ]
2841|         )
2842| ])
2843| if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2844|         AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1,
2845|                 [define if you have struct addrinfo data type])
2846| fi
2847|
2848| AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2849|         AC_TRY_COMPILE(
2850|                 [ #include <sys/time.h> ],
2851|                 [ struct timeval tv; tv.tv_sec = 1;],
2852|                 [ ac_cv_have_struct_timeval="yes" ],
2853|                 [ ac_cv_have_struct_timeval="no" ]
2854|         )
2855| ])

