On Tue, Feb 03, 2004 at 04:40:38PM +0000, Joe Orton wrote:
> Thanks - can you make a patch relative to the APR_0_9_BRANCH branch?
Sure, here you go.
--
Ben Reser <[EMAIL PROTECTED]>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
? random/unix/Makefile
Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.535.2.5
diff -u -r1.535.2.5 configure.in
--- configure.in 29 Jan 2004 14:11:45 -0000 1.535.2.5
+++ configure.in 4 Feb 2004 08:31:14 -0000
@@ -1175,24 +1175,20 @@
size_t_fmt='#error Can not determine the proper size for size_t'
fi
-if test "$ac_cv_type_off_t" = "yes"; then
- APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
- if test "$ac_cv_sizeof_off_t" = "2"; then
- off_t_value='apr_int16_t'
- off_t_fmt='#define APR_OFF_T_FMT APR_INT16_T_FMT'
- elif test "$ac_cv_sizeof_off_t" = "4"; then
- off_t_value='apr_int32_t'
- off_t_fmt='#define APR_OFF_T_FMT "d"'
- elif test "$ac_cv_sizeof_off_t" = "8"; then
- off_t_value='apr_int64_t'
- off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
- else
- off_t_value='apr_int64_t'
- off_t_fmt='#error Can not determine the proper size for off_t'
- fi
-else
- off_t_value='apr_int32_t'
+APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
+
+if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then
+ off_t_value='int'
off_t_fmt='#define APR_OFF_T_FMT "d"'
+elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then
+ off_t_value='long'
+ off_t_fmt='#define APR_OFF_T_FMT "ld"'
+elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then
+ off_t_value='apr_int64_t'
+ off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
+else
+ off_t_value='apr_int64_t'
+ off_t_fmt='#error Can not determine the proper size for off_t'
fi
APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8)
@@ -1222,6 +1218,8 @@
esac
;;
*os2_emx)
+ off_t_value='long'
+ off_t_fmt='#define APR_OFF_T_FMT "ld"'
size_t_fmt='#define APR_SIZE_T_FMT "lu"'
;;
*-solaris*)
@@ -1240,6 +1238,17 @@
size_t_fmt='#define APR_SIZE_T_FMT "lu"'
;;
esac
+
+# Override format string for off_t more carefully: only use hard-coded
+# choice if using a 32-bit off_t on platforms which support LFS.
+if test "$ac_cv_sizeof_off_t" = "4"; then
+ case $host in
+ *linux*|*-solaris*|*aix[[45]]*)
+ off_t_value='long'
+ off_t_fmt='#define APR_OFF_T_FMT "ld"'
+ ;;
+ esac
+fi
AC_SUBST(voidp_size)
AC_SUBST(short_value)