From b71b2b4b0d7d290eb7c029ee6895239f056afffb Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Wed, 13 Jun 2007 03:16:32 +0000 Subject: [PATCH] Make the aio detection work with cross compiling. The tests no longer even look at the status code and basically guarantee that the aio function was never called, so there's really no point in AC_TRY_RUN over AC_COMPILE_IFELSE... This commit was SVN r15033. --- ompi/mca/io/romio/romio/configure.in | 62 +++++++++++----------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/ompi/mca/io/romio/romio/configure.in b/ompi/mca/io/romio/romio/configure.in index 0576419402..2f5c0df6ca 100644 --- a/ompi/mca/io/romio/romio/configure.in +++ b/ompi/mca/io/romio/romio/configure.in @@ -1325,7 +1325,7 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then # actually use the aio_write interface). Note that this will # fail for some pre-POSIX implementations of the aio interface # (an old IBM interface needs an fd argument as well) - AC_TRY_RUN([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #ifdef HAVE_SIGNAL_H #include @@ -1336,24 +1336,20 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then #ifdef HAVE_SYS_AIO_H #include #endif - int main(int argc, char **argv) - { +],[ struct aiocb *aiocbp; - if (argc > 10) aio_write(aiocbp); + aio_write(aiocbp); return 0; - } - ], - aio_runs=yes - AC_MSG_RESULT(yes), - aio_runs=no - AC_MSG_RESULT(no), - aio_runs=unknown - AC_MSG_RESULT(unknown) +])], + [aio_runs=yes + AC_MSG_RESULT(yes)], + [aio_runs=no + AC_MSG_RESULT(no)] ) if test "$aio_runs" != "no" ; then AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work) fi - + # now about that old IBM interface... # modern AIO interfaces have the file descriptor in the aiocb structure, # and will set ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES. Old IBM @@ -1365,7 +1361,7 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then # aio_read correctly AC_MSG_CHECKING([for obsolete two-argument aio_write]) - AC_TRY_RUN([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #ifdef HAVE_SIGNAL_H #include @@ -1376,20 +1372,16 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then #ifdef HAVE_SYS_AIO_H #include #endif - int main(int argc, char **argv) - { +],[ int fd; struct aiocb *aiocbp; - if (argc > 10) aio_write(fd, aiocbp); + aio_write(fd, aiocbp); return 0; - } - ], - aio_two_arg_write=yes - AC_MSG_RESULT(yes), - aio_two_arg_write=no - AC_MSG_RESULT(no), - aio_two_arg_write=unknown - AC_MSG_RESULT(unknown) +])], + [aio_two_arg_write=yes + AC_MSG_RESULT(yes)], + [aio_two_arg_write=no + AC_MSG_RESULT(no)] ) if test "$aio_two_arg_write" != "no" -a "$aio_runs" != "yes" ; then @@ -1398,7 +1390,7 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then fi AC_MSG_CHECKING([for obsolete two-argument aio_suspend]) - AC_TRY_RUN([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #ifdef HAVE_SIGNAL_H #include @@ -1409,19 +1401,15 @@ if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then #ifdef HAVE_SYS_AIO_H #include #endif - int main(int argc, char **argv) - { +],[ struct aiocb *aiocbp; - if (argc > 10) aio_suspend(1, &aiocbp); + aio_suspend(1, &aiocbp); return 0; - } - ], - aio_two_arg_suspend=yes - AC_MSG_RESULT(yes), - aio_two_arg_suspend=no - AC_MSG_RESULT(no), - aio_two_arg_suspend=unknown - AC_MSG_RESULT(unknown) +])], + [aio_two_arg_suspend=yes + AC_MSG_RESULT(yes)], + [aio_two_arg_suspend=no + AC_MSG_RESULT(no)] ) if test "$aio_two_arg_suspend" != "no" -a "$aio_runs" != "yes" ; then