summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-06-05 17:33:54 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-06-06 00:46:13 -0700
commit079652ee6b5d3987525ce225518a15253fc9d319 (patch)
treec2a88e9eb7e42aa802dd9312cb80c70872a9fbfc /configure.ac
parent95413f7dff7ccc0595c93c30850446b8ea4d2f49 (diff)
downloadcoreutils-079652ee6b5d3987525ce225518a15253fc9d319.tar.xz
build: port to AIX
Problems reported by Michael Felt, and and part of this fix taken from code suggested by Pádraig Brady in: http://bugs.gnu.org/20733#112 * configure.ac (stdbuf_supported): Check for warnings, and for -fPIC and -shared, for AIX. * src/stat.c (STRUCT_STATVFS): Define to struct statvfs64 if STATFS is statvfs64. * src/sync.c (sync_arg) [_AIX]: Open in write mode, since AIX fsync doesn't work on read-only file descriptors. * tests/misc/wc-parallel.sh: Skip test if xargs -P does not work.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 14 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index c1599831c..a50992d04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -454,8 +454,17 @@ if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
gl_ADD_PROG([optional_bin_progs], [df])
fi
-AC_MSG_CHECKING([whether this is system supports stdbuf])
-AC_COMPILE_IFELSE(
+ac_save_CFLAGS=$CFLAGS
+ac_save_LDFLAGS=$LDFLAGS
+# Detect warnings about ignored "constructor" attributes.
+gl_WARN_ADD([-Werror], [CFLAGS])
+gl_WARN_ADD([-errwarn], [CFLAGS])
+# Put this message here, after gl_WARN_ADD's chatter.
+AC_MSG_CHECKING([whether this system supports stdbuf])
+CFLAGS="-fPIC $CFLAGS"
+LDFLAGS="-shared $LDFLAGS"
+stdbuf_supported=no
+AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
static int stdbuf = 0;
@@ -470,12 +479,13 @@ AC_COMPILE_IFELSE(
}]],[[
return !(stdbuf == 1);]])
],
- [stdbuf_supported=yes],
- [stdbuf_supported=no])
+ [stdbuf_supported=yes])
AC_MSG_RESULT([$stdbuf_supported])
if test "$stdbuf_supported" = "yes" && test -z "$EXEEXT"; then
gl_ADD_PROG([optional_bin_progs], [stdbuf])
fi
+CFLAGS=$ac_save_CFLAGS
+LDFLAGS=$ac_save_LDFLAGS
############################################################################