📄 configure.in
字号:
#include <sys/aio.h>],[],have_sys_aio_h=yes,have_sys_aio_h=no) AC_MSG_RESULT($have_sys_aio_h) if test "$have_sys_aio_h" = yes ; then AC_DEFINE(HAVE_SYS_AIO_H,1,[Define if sys/aio.h exists and can be compiled]) fifiif test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then # Check that aio is available (many systems appear to have aio # either installed improperly or turned off). # The test is the following: if not cross compiling, try to run a # program that includes a *reference* to aio_write but does not call it # If the libraries are not set up correctly, then this will fail. save_libs=$LIBS LIBS="$LIBS $ROMIO_LIBLIST" AC_MSG_CHECKING([whether aio routines can be used]) # Include aio.h and the aiocb struct (since we'll need these to # 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([#include <sys/types.h>#ifdef HAVE_SIGNAL_H#include <signal.h>#endif#ifdef HAVE_AIO_H#include <aio.h>#endif#ifdef HAVE_SYS_AIO_H#include <sys/aio.h>#endif int main(int argc, char **argv) { struct aiocb *aiocbp; if (argc > 10) 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) ) 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 # implementations pass the file descriptor as an argument to aio_write and # aio_read. AIO still works on these platforms, but we have to test with # two-argument aio_write to avoid a false negative. no need to worry about # the two-argument vs. one-argument aio_write and aio_read: ROMIO already # uses ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES to call aio_write and # aio_read correctly AC_MSG_CHECKING([for obsolete two-argument aio_write]) AC_TRY_RUN([#include <sys/types.h>#ifdef HAVE_SIGNAL_H#include <signal.h>#endif#ifdef HAVE_AIO_H#include <aio.h>#endif#ifdef HAVE_SYS_AIO_H#include <sys/aio.h>#endif int main(int argc, char **argv) { int fd; struct aiocb *aiocbp; if (argc > 10) 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) ) if test "$aio_two_arg_write" != "no" -a "$aio_runs" != "yes" ; then AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work) AC_DEFINE(ROMIO_HAVE_AIO_CALLS_NEED_FILEDES, 1, Define if AIO calls need file descriptor) fi AC_MSG_CHECKING([for obsolete two-argument aio_suspend]) AC_TRY_RUN([#include <sys/types.h>#ifdef HAVE_SIGNAL_H#include <signal.h>#endif#ifdef HAVE_AIO_H#include <aio.h>#endif#ifdef HAVE_SYS_AIO_H#include <sys/aio.h>#endif int main(int argc, char **argv) { struct aiocb *aiocbp; if (argc > 10) 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) ) if test "$aio_two_arg_suspend" != "no" -a "$aio_runs" != "yes" ; then AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments) fi LIBS=$save_libs AC_MSG_CHECKING([for aio_fildes member of aiocb structure]) AC_TRY_COMPILE([ #ifdef HAVE_SIGNAL_H #include <signal.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_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_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_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_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_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# End of aio-related tests## Check for statfs (many) and specifically f_fstypename field (BSD)#AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h sys/statvfs.h)AC_MSG_CHECKING([whether struct statfs properly defined])AC_TRY_COMPILE([ #ifdef HAVE_SYS_VFS_H #include <sys/vfs.h> #endif #ifdef HAVE_SYS_STATVFS_H #include <sys/statvfs.h> #endif #ifdef HAVE_SYS_PARAM_H #include <sys/param.h> #endif #ifdef HAVE_SYS_MOUNT_H #include <sys/mount.h> #endif ],[ struct statfs f; ], pac_cv_have_statfs=yes,pac_cv_have_statfs=no)AC_MSG_RESULT($pac_cv_have_statfs)# At this point, we could check for whether defining # __SWORD_TYPE as sizet_t or int/long (size of pointer)# would help. FIXMEif test "$pac_cv_have_statfs" = yes ; then AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])fi AC_MSG_CHECKING([for f_fstypename member of statfs structure])AC_TRY_COMPILE([ #include <sys/param.h> #include <sys/mount.h> #include <string.h> ],[ struct statfs f; memset(&f, 0, sizeof(f)); strncmp("nfs", f.f_fstypename, 3); ], pac_cv_have_statfs_f_fstypename=yes, pac_cv_have_statfs_f_fstypename=no)AC_MSG_RESULT($pac_cv_have_statfs_f_fstypename)if test $pac_cv_have_statfs_f_fstypename = yes ; then AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME, 1,[Define if statfs has f_fstypename])fi## Check for stat and st_fstype field (NEC SX4)#AC_CHECK_HEADERS(sys/stat.h sys/types.h unistd.h)AC_CHECK_FUNCS(stat, [AC_DEFINE(HAVE_STAT, 1, Define if stat function is present) AC_MSG_CHECKING([for st_fstype member of stat structure]) AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif ],[ struct stat s; s.st_fstype = NULL; ], AC_MSG_RESULT(yes) AC_DEFINE(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE, 1, Define if struct stat has a st_fstype member), AC_MSG_RESULT(no) )])## Check for statvfs and f_basetype field (Solaris, Irix, AIX, etc.)#AC_CHECK_HEADERS(sys/types.h sys/statvfs.h sys/vfs.h)AC_CHECK_FUNCS(statvfs, [AC_DEFINE(HAVE_STATVFS, 1, Define if statvfs function is present) AC_MSG_CHECKING([for f_basetype member of statvfs structure]) AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_SYS_VFS_H #include <sys/vfs.h> #endif #ifdef HAVE_SYS_STATVFS_H #include <sys/statvfs.h> #endif ], [ struct statvfs foo; foo.f_basetype = NULL; ], AC_MSG_RESULT(yes) AC_DEFINE(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE, 1, defined if struct statvfs has a f_basetype member), AC_MSG_RESULT(no) )])## Check for large file support. Make sure that we can use the off64_t # type (in some cases, it is an array, and the ROMIO code isn't prepared for# that).#AC_CHECK_HEADERS(unistd.h)if test "$ac_cv_header_unistd_h" = "yes" ; then AC_CACHE_CHECK([for large file defines],ac_cv_has_large_file_defines,[ AC_TRY_COMPILE([#include <unistd.h> ], [ #ifndef _LFS64_LARGEFILE #error no largefile defines #endif ],ac_cv_has_large_file_defines=yes,ac_cv_has_large_file_defines=no)]) if test "$ac_cv_has_large_file_defines" = "yes" ; then # See if we can use them AC_CACHE_CHECK([whether off64_t is an scalar type],ac_cv_off64_t_scalar,[ AC_TRY_COMPILE([#define _LARGEFILE64_SOURCE#define _FILE_OFFSET_BITS 64#include <sys/types.h>#include <unistd.h>],[off64_t a = 3;],ac_cv_off64_t_scalar=yes,ac_cv_off64_t_scalar=no)]) if test "$ac_cv_off64_t_scalar" = "yes" ; then CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" fi fifi##################################################################### We're about to mess with CC etc. No more feature tests past here,# because we may set CC to something that does not yet exist!####################################################################if test -n "$mpi_mpich"; then if test -z "$arch_SX4" ; then MPIOF_H_INCLUDED=1 fi if test "$FROM_MPICH2" = no; then AC_DEFINE(NEEDS_MPI_TEST,1,[Define if mpi_test needed]) AC_DEFINE(MPICH,1,[Define if using MPICH]) fifiif test -n "$mpi_sgi"; then AC_DEFINE(MPISGI,1,[Define if SGI MPI])fiif test -n "$mpi_lam"; then AC_DEFINE(MPILAM,1,[Define if using LAM/MPI])fiif test -n "$mpi_hp"; then AC_DEFINE(MPIHP,1,[Define if using HP MPI]) if test "$NOF77" = 0; then PAC_CHECK_MPIOF_H fifi#AC_CHECK_FUNCS(strerror)if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$ROMIO_HOME" ; fiAC_SUBST(srcdir)# The master_top_srcdir is the location of the source for the building# package. This is used only as part of the MPICH2 build, including # the documentation targets mandoc, htmldoc, and latexdocif test -z "$master_top_srcdir" ; then if test "$FROM_MPICH2" = yes ; then AC_MSG_WARN([Could not determine master_top_srcdir]) fifiAC_SUBST(master_top_srcdir)## Get the master builddir (which may be imported from above)if test -z "$master_top_builddir" ; then master_top_builddir=`pwd`fiexport master_top_builddirAC_SUBST(master_top_builddir)# Make sure the alternate spelling is used until we clean up all of the codemaster_topbuild_dir=$master_top_builddirexport master_topbuild_dirAC_SUBST(master_topbuild_dir)# The following definitions are needed within adio/common/status_setb.cif test "$FROM_MPICH" = yes ; then AC_DEFINE(MPICH,1,[Define if compiling within MPICH])elif test "$FROM_MPICH2" = yes ; then AC_DEFINE(ROMIO_INSIDE_MPICH2,1,[Define if compiling within MPICH2])elif test "$FROM_MPILAM" = yes ; then AC_DEFINE(MPILAM,1,[Define if compiling within LAM/MPI])fiif test "$FROM_MPICH2" = no -a "$FROM_MPICH" = no ; then if test -z "$LIBNAME"; then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -