summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorstwo <stwo>2010-09-06 12:57:31 (GMT)
committerstwo <stwo>2010-09-06 12:57:31 (GMT)
commit3c5c0386e0a63f34a79ce78f5d35c48599949508 (patch)
treeda0b07ffe6eb9d201b76d0c12b6568095681ce58 /unix
parenta3ca2c33322a3f277d3affa55344c20ea64c1605 (diff)
downloadtcl-3c5c0386e0a63f34a79ce78f5d35c48599949508.zip
tcl-3c5c0386e0a63f34a79ce78f5d35c48599949508.tar.gz
tcl-3c5c0386e0a63f34a79ce78f5d35c48599949508.tar.bz2
Backport blkcnt_t detection/usage.
Diffstat (limited to 'unix')
-rwxr-xr-xunix/configure68
-rw-r--r--unix/configure.in6
2 files changed, 71 insertions, 3 deletions
diff --git a/unix/configure b/unix/configure
index 2965f76..7eaf6ed 100755
--- a/unix/configure
+++ b/unix/configure
@@ -13696,7 +13696,8 @@ _ACEOF
#--------------------------------------------------------------------
# Some systems (e.g., IRIX 4.0.5) lack some fields in struct stat. But
-# we might be able to use fstatfs instead.
+# we might be able to use fstatfs instead. Some systems (OpenBSD?) also
+# lack blkcnt_t.
#--------------------------------------------------------------------
echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5
@@ -13918,6 +13919,71 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking for blkcnt_t" >&5
+echo $ECHO_N "checking for blkcnt_t... $ECHO_C" >&6
+if test "${ac_cv_type_blkcnt_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((blkcnt_t *) 0)
+ return 0;
+if (sizeof (blkcnt_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_blkcnt_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_blkcnt_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_blkcnt_t" >&5
+echo "${ECHO_T}$ac_cv_type_blkcnt_t" >&6
+if test $ac_cv_type_blkcnt_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_BLKCNT_T 1
+_ACEOF
+
+
+fi
+
echo "$as_me:$LINENO: checking for fstatfs" >&5
echo $ECHO_N "checking for fstatfs... $ECHO_C" >&6
if test "${ac_cv_func_fstatfs+set}" = set; then
diff --git a/unix/configure.in b/unix/configure.in
index c3d65b8..0953d51 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.180.2.17 2010/08/12 00:11:22 hobbs Exp $
+# RCS: @(#) $Id: configure.in,v 1.180.2.18 2010/09/06 12:57:34 stwo Exp $
AC_INIT([tcl],[8.5])
AC_PREREQ(2.59)
@@ -245,10 +245,12 @@ SC_TIME_HANDLER
#--------------------------------------------------------------------
# Some systems (e.g., IRIX 4.0.5) lack some fields in struct stat. But
-# we might be able to use fstatfs instead.
+# we might be able to use fstatfs instead. Some systems (OpenBSD?) also
+# lack blkcnt_t.
#--------------------------------------------------------------------
AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
+AC_CHECK_TYPES([blkcnt_t])
AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS, 1, [Do we have fstatfs()?])])
#--------------------------------------------------------------------