--- configure.in.orig Tue Jul 12 18:42:55 2005 +++ configure.in Wed Jul 27 04:13:03 2005 @@ -909,6 +909,21 @@ AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type]) fi +AC_CACHE_CHECK([for struct sigevent type],samba_cv_struct_sigevent, [ + AC_TRY_COMPILE([ +#include +#if STDC_HEADERS +#include +#include +#endif +#include ],[struct sigevent s;], + samba_cv_struct_sigevent=yes,samba_cv_struct_sigevent=no)]) +if test x"$samba_cv_struct_sigevent" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_SIGEVENT,1,[Whether we have the struct sigevent]) + AC_CHECK_MEMBERS([struct sigevent.sigev_value.sival_ptr,struct sigevent.sigev_value.sigval_ptr],,, + [#include ]) +fi + AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [ AC_TRY_COMPILE([ #include @@ -917,7 +932,9 @@ #include #endif #include -#include ],[struct timespec ts;], +#if HAVE_AIO_H +#include +#endif],[struct timespec ts;], samba_cv_struct_timespec=yes,samba_cv_struct_timespec=no)]) if test x"$samba_cv_struct_timespec" = x"yes"; then AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec]) @@ -4104,30 +4121,28 @@ case "$host_os" in *) - AC_CHECK_LIB(rt,aio_read,[AIO_LIBS="$ACL_LIBS -lrt"]) + ac_cv_save_LIBS=$LIBS + AC_SEARCH_LIBS(aio_read, [rt], [ + if test "$ac_cv_search_aio_read" != "none required"; then + LIBS="$LIBS $ac_cv_search_aio_read" + fi + ]) AC_CACHE_CHECK([for asynchronous io support],samba_cv_HAVE_AIO,[ - aio_LIBS=$LIBS - LIBS="$LIBS -lrt" AC_TRY_LINK([#include #include ], [ struct aiocb a; return aio_read(&a);], -samba_cv_HAVE_AIO=yes,samba_cv_HAVE_AIO=no) - LIBS=$aio_LIBS]) +samba_cv_HAVE_AIO=yes,samba_cv_HAVE_AIO=no)]) AC_CACHE_CHECK([for 64-bit asynchronous io support],samba_cv_HAVE_AIO64,[ - aio_LIBS=$LIBS - LIBS="$LIBS -lrt" AC_TRY_LINK([#include #include ], [ struct aiocb64 a; return aio_read64(&a);], -samba_cv_HAVE_AIO64=yes,samba_cv_HAVE_AIO64=no) - LIBS=$aio_LIBS]) +samba_cv_HAVE_AIO64=yes,samba_cv_HAVE_AIO64=no)]) + if test x"$samba_cv_HAVE_AIO64" = x"yes"; then AC_DEFINE(HAVE_AIOCB64,1,[Whether 64 bit aio is available]) - AC_DEFINE(WITH_AIO, 1, [Using asynchronous io]) - LIBS="$LIBS -lrt" + AC_DEFINE(WITH_AIO,1,[Using asynchronous io]) elif test x"$samba_cv_HAVE_AIO" = x"yes"; then - AC_DEFINE(WITH_AIO, 1, [Using asynchronous io]) - LIBS="$LIBS -lrt" + AC_DEFINE(WITH_AIO,1,[Using asynchronous io]) fi ;; esac