CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
+ # FIXME? Only if __ANDROID_API__ < 24?
+ # FILE32API means "long", which is stuck at 32bits for 32bit ABI (64bits for 64bit ABI).
+ # ABI 24 introduces the "o" for "file offset" variations, which can be widened to 64bits for 32bit ABI (and still 64bits for 64bit).
+ # Android itself uses FILE32API, and mono should use system zlib on Android anyway.
+ ZLIB_CFLAGS="$ZLIB_CFLAGS -DUSE_FILE32API"
+
# to bypass the underscore linker check, can't work when cross-compiling
mono_cv_uscore=yes
mono_cv_clang=no
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h sys/prctl.h copyfile.h)
AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h)
-AC_CHECK_HEADER(unistd.h, [HAVE_UNISTD_H=1], [HAVE_UNISTD_H=0])
+
+# zlib/configure checks for unistd.h existance and defines HAVE_UNISTD_H on the compiler
+# command line (not config.h) if it is present.
+AC_CHECK_HEADER(unistd.h,
+ [HAVE_UNISTD_H=1
+ ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_UNISTD_H"],
+ [HAVE_UNISTD_H=0])
+
AC_SUBST(HAVE_UNISTD_H)
+
AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
[], [], [#include <stddef.h>
#include <sys/socket.h>
AC_DEFINE_UNQUOTED(SIZEOF_REGISTER,${target_sizeof_void_p},[size of target machine integer registers])
fi
+# zlib/configure detects visibility support similarly and defines HAVE_HIDDEN
+# on the compiler command line (not config.h).
if test "x$have_visibility_hidden" = "xyes"; then
AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
+ ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_HIDDEN"
fi
if test "x$have_deprecated" = "xyes"; then
JAY_CFLAGS="-Wno-implicit-function-declaration"
fi
+# zlib/configure checks if this program compiles and if so
+# defines _LARGEFILE64_SOURCE on the compiler command line (not config.h).
+#
+AC_MSG_CHECKING([for large file support])
+AC_COMPILE_IFELSE(
+ [
+ #include <sys/types.h>
+ off64_t dummy = 0;
+ ], [
+ AC_MSG_RESULT(yes)
+ # FIXME The ramifications of _LARGEFILE64_SOURCE are not understood.
+ # ZLIB_CFLAGS="$ZLIB_CFLAGS -D_LARGEFILE64_SOURCE=1"
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
+AC_SUBST(ZLIB_CFLAGS)
# Update all submodules recursively to ensure everything is checked out
if test "x$with_core" != "xonly"; then