X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libsysio%2Fconfigure.in;h=510ce2107e01536289cc98fbd6563036fcc6f0c7;hb=325e98e632853a65f60918dad09eb1f4e97e8634;hp=a0e77f34e52e20154ad38f29ef376874d611ab45;hpb=20d0187e95be6ec8c131a9bb8691e7d939875e68;p=fs%2Flustre-release.git diff --git a/libsysio/configure.in b/libsysio/configure.in index a0e77f3..510ce21 100644 --- a/libsysio/configure.in +++ b/libsysio/configure.in @@ -1,6 +1,6 @@ AC_INIT(libsysio, 1.2) -AC_CANONICAL_HOST +AC_CANONICAL_SYSTEM case "$host_os" in aix*) @@ -22,6 +22,11 @@ AC_HEADER_STDC AC_HEADER_STAT AC_HEADER_TIME +if test ${target_cpu} == "powerpc64"; then + AC_MSG_WARN([set compiler with -m64]) + CC="$CC -m64" +fi + have_lib_dir=yes; AC_ARG_WITH(lib-dir, AC_HELP_STRING([--with-lib-dir=], @@ -355,50 +360,140 @@ 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(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(sysio_asm_dot_text, [dnl +AC_CACHE_VAL(am_cv_sysio_asm_dot_text, [dnl cat > conftest.s </dev/null; then - sysio_asm_dot_text=.text + am_cv_sysio_asm_dot_text=.text fi rm -f conftest*]) -if test -z "$sysio_dot_text"; then +if test -z "$am_cv_sysio_asm_dot_text"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi AC_CACHE_CHECK(for assembler global-symbol directive, - sysio_asm_global_directive, [dnl -sysio_asm_global_directive=UNKNOWN + am_cv_sysio_asm_global_directive, [dnl +am_cv_sysio_asm_global_directive=UNKNOWN for ac_globl in .globl .global .EXPORT; do cat > conftest.s </dev/null; then - sysio_asm_global_directive=${ac_globl} + am_cv_sysio_asm_global_directive=${ac_globl} fi rm -f conftest* - test $sysio_asm_global_directive != UNKNOWN && break + test $am_cv_sysio_asm_global_directive != UNKNOWN && break done]) -if test $sysio_asm_global_directive = UNKNOWN; then +if test $am_cv_sysio_asm_global_directive = UNKNOWN; then AC_MSG_ERROR(cannot determine asm global directive) #else -# AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${sysio_asm_global_directive}) +# AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${am_cv_sysio_asm_global_directive}) fi AC_CACHE_CHECK(for .set assembler directive, - sysio_asm_set_directive, [dnl + am_cv_sysio_asm_set_directive, [dnl cat > conftest.s<&AC_FD_CC 2>&AC_FD_CC; then - sysio_asm_set_directive=yes + am_cv_sysio_asm_set_directive=yes else - sysio_asm_set_directive=no + am_cv_sysio_asm_set_directive=no fi rm -f conftest*]) -#if test $sysio_asm_set_directive = yes; then +#if test $am_cv_sysio_asm_set_directive = yes; then # AC_DEFINE(HAVE_ASM_SET_DIRECTIVE) #fi -AC_CACHE_CHECK(for assembler .weak directive, sysio_asm_weak_directive, +AC_CACHE_CHECK(for assembler .weak directive, am_cv_sysio_asm_weak_directive, [dnl cat > conftest.s </dev/null; then - sysio_asm_weak_directive=yes + am_cv_sysio_asm_weak_directive=yes else - sysio_asm_weak_directive=no + am_cv_sysio_asm_weak_directive=no fi rm -f conftest*]) -if test $sysio_asm_weak_directive = no; then +if test $am_cv_sysio_asm_weak_directive = no; then AC_CACHE_CHECK(for assembler .weakext directive, - sysio_asm_weakext_directive, [dnl + am_cv_sysio_asm_weakext_directive, [dnl cat > conftest.s </dev/null; then - sysio_asm_weakext_directive=yes + am_cv_sysio_asm_weakext_directive=yes else - sysio_asm_weakext_directive=no + am_cv_sysio_asm_weakext_directive=no fi rm -f conftest*]) fi # no .weak -if test x$sysio_asm_weak_directive = xyes; then +if test x$am_cv_sysio_asm_weak_directive = xyes; then AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE) fi -if test x$sysio_asm_weakext_directive = xyes; then +if test x$am_cv_sysio_asm_weakext_directive = xyes; then AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE) fi