📄 configure.in
字号:
# TODO: REMOVE BAD ONES FROM THE LIST SOMEHOW?#AC_MSG_CHECKING([configured file systems])AC_MSG_RESULT([$FILE_SYSTEM])if test -n "$file_system_nfs" ; then AC_DEFINE(ROMIO_NFS,1,[Define for ROMIO with NFS]) AC_MSG_WARN([File locks may not work with NFS. See the Installation andusers manual for instructions on testing and if necessary fixing this])fiif test -n "$file_system_panfs"; then AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS])fiif test -n "$file_system_ufs"; then AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS])fiif test -n "$file_system_hfs"; then AC_DEFINE(ROMIO_HFS,1,[Define for ROMIO with HFS])fiif test -n "$file_system_sfs"; then AC_DEFINE(ROMIO_SFS,1,[Define for ROMIO with SFS])fiif test -n "$file_system_pfs"; then AC_DEFINE(ROMIO_PFS,1,[Define for ROMIO with PFS])fiif test -n "$file_system_testfs"; then AC_DEFINE(ROMIO_TESTFS,1,[Define for ROMIO with TESTFS])fiif test -n "$file_system_xfs"; then AC_DEFINE(ROMIO_XFS,1,[Define for ROMIO with XFS]) # Check for memalign value AC_CACHE_CHECK([for memory alignment needed for direct I/O], pac_cv_memalignval, [ /bin/rm -f confmemalignval /bin/rm -f /tmp/romio_tmp.bin AC_TRY_RUN([ #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <stdio.h> main() { struct dioattr st; int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644); FILE *f=fopen("confmemalignval","w"); if (fd == -1) exit(1); if (!f) exit(1); fcntl(fd, F_DIOINFO, &st); fprintf( f, "%u\n", st.d_mem); exit(0); } ], pac_cv_memalignval=`cat confmemalignval`, pac_cv_memalignval="unknown",pac_cv_memalignval="unknown" ) /bin/rm -f confmemalignval /bin/rm -f /tmp/romio_tmp.bin ]) if test -n "$pac_cv_memalignval" -a "$pac_cv_memalignval" != 0 -a \ "$pac_cv_memalignval" != "unknown" ; then CFLAGS="$CFLAGS -DXFS_MEMALIGN=$pac_cv_memalignval" else AC_MSG_RESULT(assuming 128 for memory alignment) CFLAGS="$CFLAGS -DXFS_MEMALIGN=128" fifi## Verify presence of pvfs.h, issue with int64#if test -n "$file_system_pvfs"; then CPPFLAGS="$CPPFLAGS $CFLAGS" AC_CHECK_HEADERS(pvfs.h, AC_DEFINE(ROMIO_PVFS2,1,[Define for ROMIO with PVFS]), AC_MSG_ERROR([PVFS support requested but cannot find pvfs.h header file]) ) # Check for missing int64_t (intel version 8 compiler and -no-gcc # selected) AC_MSG_CHECKING([that pvfs.h can be compiled]) AC_TRY_COMPILE([ #include <pvfs.h> ],[ ],pvfs_header_ok=yes,pvfs_header_ok=no ) AC_MSG_RESULT($pvfs_header_ok) if test "$pvfs_header_ok" = no -a "$ac_cv_sizeof_long_long" = 8 ; then AC_MSG_CHECKING([if pvfs.h can be compiled if we define int64_t]) # Try again, but with int64_t AC_TRY_COMPILE([ typedef long long int int64_t; #include <pvfs.h> ],[ ], pvfs_header_ok="yes with int64 definition" ) AC_MSG_RESULT($pvfs_header_ok) fi if test "$pvfs_header_ok" = "yes with int64 definition" ; then AC_DEFINE(ROMIO_PVFS_NEEDS_INT64_DEFINITION,1,[Define if int64_t must be defined for PVFS]) fi if test "$pvfs_header_ok" != "no" ; then AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS]) AC_DEFINE(HAVE_PVFS_SUPER_MAGIC, 1, [Define if PVFS_SUPER_MAGIC defined.]) else AC_MSG_WARN(missing or broken pvfs.h header file; disabling ROMIO PVFS support) fifi## Verify presence of pvfs2.h#if test -n "$file_system_pvfs2"; then CPPFLAGS="$CPPFLAGS $CFLAGS" AC_CHECK_HEADERS(pvfs2.h, AC_DEFINE(ROMIO_PVFS2,1,[Define for ROMIO with PVFS2]) AC_DEFINE(HAVE_PVFS2_SUPER_MAGIC, 1, [Define if PVFS2_SUPER_MAGIC defined.]), AC_MSG_ERROR([PVFS2 support requested but cannot find pvfs2.h header file]) )fiif test -n "$file_system_gridftp"; then AC_DEFINE(ROMIO_GRIDFTP, 1, [Define for ROMIO with gridftp])fi## Check for presence and characteristics of async. I/O calls if# not disabled.## Q: Do we need to list some "other libs" to get things to link?#save_libs=$LIBSLIBS=## Some systems need pthreads to get AIO to work#if test "x$disable_aio" = "xno" ; then AC_SEARCH_LIBS(pthread_create,pthread, ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS" MPI_LIB="$MPI_LIB $LIBS" ) LIBS= AC_SEARCH_LIBS(aio_write,aio rt, ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS" MPI_LIB="$MPI_LIB $LIBS" aio_write_found=yes )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 <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/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.)#
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -