From 0c7b880305305499dd75524bd2a45765029ddf43 Mon Sep 17 00:00:00 2001 From: shadow Date: Fri, 13 Nov 2009 10:05:58 +0000 Subject: [PATCH] build fixes for posix 2008 enviroment Branch HEAD b=19808 i=tappro i=lee@sandia --- libsysio/configure.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ libsysio/include/sysio.h | 10 ++++++++-- libsysio/include/xtio.h | 14 ++++++++++---- libsysio/src/readdir.c | 7 ++++++- libsysio/src/rw.c | 11 ++++++----- 5 files changed, 75 insertions(+), 12 deletions(-) diff --git a/libsysio/configure.in b/libsysio/configure.in index 4fcd3c0..5ce600f 100644 --- a/libsysio/configure.in +++ b/libsysio/configure.in @@ -360,6 +360,51 @@ if test x$have_st_gen = xyes; then AC_DEFINE(HAVE_GENERATION) fi +AC_MSG_CHECKING(for POSIX 2008 preadv) +tmp_flags="$CFLAGS" +CFLAGS="$CFLAGS -Wall -Werror" +AC_TRY_COMPILE([ +#include +ssize_t preadv (int __fd, const struct iovec *__iovec, + int __count, off_t off) +{ + return 0; +} +],[ +],[ +AC_DEFINE(HAVE_POSIX2008_PREADV, 1, [POSIX 2008 preadv]) +AC_MSG_RESULT(yes) +],[ +AC_MSG_RESULT(no) +]) +CFLAGS="$tmp_flags" + +AC_MSG_CHECKING(for POSIX 2008 scandir) +tmp_flags="$CFLAGS" +CFLAGS="$CFLAGS -Wall -Werror" +AC_TRY_COMPILE([ +#define _BSD_SOURCE + +#include +#include + +int scandir(const char *dir, + struct dirent ***namelist, + int(*filter)(const struct dirent *), + int(*compar)(const struct dirent **, + const struct dirent **) + ); + +],[ +], [ +AC_DEFINE(HAVE_POSIX2008_SCANDIR, 1, [POSIX 2008 scandir]) +AC_MSG_RESULT(yes) +],[ +AC_MSG_RESULT(no) +]) +CFLAGS="$tmp_flags" + + AC_MSG_CHECKING(whether .text pseudo-op must be used) AC_CACHE_VAL(am_cv_sysio_asm_dot_text, [dnl cat > conftest.s <