📄 configure.in
字号:
fi dnl AC_SEARCH_LIBS(pthread_create,pthread,dnl ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"dnl MPI_LIB="$MPI_LIB $LIBS"dnl )dnl LIBS=dnl AC_SEARCH_LIBS(aio_write,aio rt,dnl ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"dnl MPI_LIB="$MPI_LIB $LIBS"dnl aio_write_found=yesdnl )fiLIBS=$save_libsif test "x$disable_aio" = "xno" -a -n "$aio_write_found" ; then AC_CHECK_HEADERS(signal.h) # Just because aio.h is found by CPP doesn't mean that we can use it # We try to compile it, not just read it. AC_MSG_CHECKING([if aio.h exists and can be compiled]) AC_TRY_COMPILE([#include <sys/types.h>#include <aio.h>],[],have_aio_h=yes,have_aio_h=no) AC_MSG_RESULT($have_aio_h) if test "$have_aio_h" = yes ; then AC_DEFINE(HAVE_AIO_H,1,[Define if aio.h exists and can be compiled]) fi AC_MSG_CHECKING([if sys/aio.h exists and can be compiled]) AC_TRY_COMPILE([#include <sys/types.h>#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]) fi if test "$have_aio_h" = "no" -a "$have_sys_aio_h" = "no" ; then disable_aio=yes fifiif test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = "xno"; 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=no AC_MSG_RESULT(no: aio routines disabled when cross compiling) ) 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=no AC_MSG_RESULT(no: cannot test when cross-compiling) ) 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=no AC_MSG_RESULT(no: cannot test when cross compiling) ) 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_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_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) ) fifi# 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[0] = 'a'; ]], 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]) fifi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -