Commit b3684399 authored by Rob Latham's avatar Rob Latham
Browse files

use autoconf routines for AIO struct checks



Autoconf provides nice routines for "does this struct have this member",
so use that instead of our home-grown nonstandrd checks
Signed-off-by: Sangmin Seo's avatarSangmin Seo <sseo@anl.gov>
parent a07ac551
...@@ -69,19 +69,19 @@ int ADIOI_NFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, ...@@ -69,19 +69,19 @@ int ADIOI_NFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
aiocbp->aio_buf = buf; aiocbp->aio_buf = buf;
aiocbp->aio_nbytes = len; aiocbp->aio_nbytes = len;
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE #ifdef HAVE_STRUCT_AIOCB_AIO_WHENCE
aiocbp->aio_whence = SEEK_SET; aiocbp->aio_whence = SEEK_SET;
#endif #endif
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES #ifdef HAVE_STRUCT_AIOCB_AIO_FILDES
aiocbp->aio_fildes = fd_sys; aiocbp->aio_fildes = fd_sys;
#endif #endif
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT #ifdef HAVE_STRUCT_AIOCB_AIO_SIGEVENT
# ifdef AIO_SIGNOTIFY_NONE # ifdef AIO_SIGNOTIFY_NONE
aiocbp->aio_sigevent.sigev_notify = SIGEV_NONE; aiocbp->aio_sigevent.sigev_notify = SIGEV_NONE;
# endif # endif
aiocbp->aio_sigevent.sigev_signo = 0; aiocbp->aio_sigevent.sigev_signo = 0;
#endif #endif
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO #ifdef HAVE_STRUCT_AIOCB_AIO_REQPRIO
# ifdef AIO_PRIO_DFL # ifdef AIO_PRIO_DFL
aiocbp->aio_reqprio = AIO_PRIO_DFL; /* not needed in DEC Unix 4.0 */ aiocbp->aio_reqprio = AIO_PRIO_DFL; /* not needed in DEC Unix 4.0 */
# else # else
......
...@@ -113,19 +113,19 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, ...@@ -113,19 +113,19 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
aiocbp->aio_buf = buf; aiocbp->aio_buf = buf;
aiocbp->aio_nbytes = len; aiocbp->aio_nbytes = len;
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE #ifdef HAVE_STRUCT_AIOCB_AIO_WHENCE
aiocbp->aio_whence = SEEK_SET; aiocbp->aio_whence = SEEK_SET;
#endif #endif
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES #ifdef HAVE_STRUCT_AIOCB_AIO_FILDES
aiocbp->aio_fildes = fd_sys; aiocbp->aio_fildes = fd_sys;
#endif #endif
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT #ifdef HAVE_STRUCT_AIOCB_AIO_SIGEVENT
# ifdef AIO_SIGNOTIFY_NONE # ifdef AIO_SIGNOTIFY_NONE
aiocbp->aio_sigevent.sigev_notify = SIGEV_NONE; aiocbp->aio_sigevent.sigev_notify = SIGEV_NONE;
# endif # endif
aiocbp->aio_sigevent.sigev_signo = 0; aiocbp->aio_sigevent.sigev_signo = 0;
#endif #endif
#ifdef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO #ifdef HAVE_STRUCT_AIOCB_AIO_REQPRIO
# ifdef AIO_PRIO_DFL # ifdef AIO_PRIO_DFL
aiocbp->aio_reqprio = AIO_PRIO_DFL; /* not needed in DEC Unix 4.0 */ aiocbp->aio_reqprio = AIO_PRIO_DFL; /* not needed in DEC Unix 4.0 */
# else # else
...@@ -134,7 +134,7 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset, ...@@ -134,7 +134,7 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
#endif #endif
#ifndef ROMIO_HAVE_AIO_CALLS_NEED_FILEDES #ifndef ROMIO_HAVE_AIO_CALLS_NEED_FILEDES
#ifndef ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES #ifndef HAVE_STRUCT_AIOCB_AIO_FILDES
#error 'No fildes set for aio structure' #error 'No fildes set for aio structure'
#endif #endif
if (wr) err = aio_write(aiocbp); if (wr) err = aio_write(aiocbp);
......
...@@ -133,8 +133,6 @@ MPI_OFFSET_KIND2="!" ...@@ -133,8 +133,6 @@ MPI_OFFSET_KIND2="!"
TEST_CC="" TEST_CC=""
TEST_F77="" TEST_F77=""
# #
have_aio=no
#
known_mpi_impls="mpich_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi open_mpi_mpi" known_mpi_impls="mpich_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi open_mpi_mpi"
dnl An m4 macro for use with m4_foreach_w and friends. You should modify this dnl An m4 macro for use with m4_foreach_w and friends. You should modify this
...@@ -1123,123 +1121,20 @@ if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" -o "x ...@@ -1123,123 +1121,20 @@ if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" -o "x
AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments) AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments)
fi fi
AC_MSG_CHECKING([for aio_fildes member of aiocb structure]) AC_CHECK_MEMBERS(
AC_TRY_COMPILE([ [struct aiocb.aio_fildes,
#ifdef HAVE_SIGNAL_H struct aiocb.aio_whence,
#include <signal.h> struct aiocb.aio_handle,
#endif struct aiocb.aio_reqprio,
#ifdef HAVE_SYS_TYPES_H struct aiocb.aio_sigevent],
#include <sys/types.h> [],
#endif [],
#ifdef HAVE_AIO_H [[#ifdef HAVE_AIO_H
#include <aio.h> #include <aio.h>
#endif #endif
#ifdef HAVE_SYS_AIO_H #ifdef HAVE_SYS_AIO_H
#include <sys/aio.h> #include <sys/aio.h>
#endif #endif] ] )
],[
struct aiocb a;
a.aio_fildes = 0;
],
AC_MSG_RESULT(yes)
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES, 1, [Define if aiocb has aio_fildes member]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for aio_whence member of aiocb structure)
AC_TRY_COMPILE([
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#endif
#include <sys/types.h>
#include <unistd.h>
],[
struct aiocb a;
a.aio_whence = SEEK_SET;
],
AC_MSG_RESULT(yes)
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE, 1, [Define if aiocb has aio_whence member]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for aio_handle member of aiocb structure)
AC_TRY_COMPILE([
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#endif
],[
struct aiocb a;
aio_handle_t h;
a.aio_handle = h;
],
AC_MSG_RESULT(yes)
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_HANDLE, 1, [Define if aiocb has aio_handle member]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for aio_reqprio member of aiocb structure)
AC_TRY_COMPILE([
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#endif
],[
struct aiocb a;
a.aio_reqprio = 0;
],
AC_MSG_RESULT(yes)
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO, 1, [Define if aiocb has aio_reqprio member]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for aio_sigevent member of aiocb structure)
AC_TRY_COMPILE([
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_AIO_H
#include <aio.h>
#endif
#ifdef HAVE_SYS_AIO_H
#include <sys/aio.h>
#endif
],[
struct aiocb a;
a.aio_sigevent.sigev_signo = 0;
],
AC_MSG_RESULT(yes)
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT, 1, [Define if aiocb has aio_sigevent member]),
AC_MSG_RESULT(no)
)
fi fi
# End of aio-related tests # End of aio-related tests
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment