aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-11-01 10:40:44 +0100
committerLukas Larsson <[email protected]>2013-11-01 10:40:44 +0100
commit38051e02fdfd50ed90439fac50d2ce3b18860d7a (patch)
tree9272a0612f8a2520daf2200f90566bbaf1d94ec6 /erts/configure.in
parent3fe6080b8c277c9c6952d9bc4a306387a9324bea (diff)
parentf7659aeadf2b50acc6140c62a1d1587bf0a8795c (diff)
downloadotp-38051e02fdfd50ed90439fac50d2ce3b18860d7a.tar.gz
otp-38051e02fdfd50ed90439fac50d2ce3b18860d7a.tar.bz2
otp-38051e02fdfd50ed90439fac50d2ce3b18860d7a.zip
Merge branch 'maint'
* maint: erts: Add max alignment posix_memalign configure check
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in30
1 files changed, 29 insertions, 1 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 886d82b109..14eae10841 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1985,11 +1985,39 @@ AC_CHECK_FUNCS([getipnodebyname getipnodebyaddr gethostbyname2])
AC_CHECK_FUNCS([ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \
pread pwrite memmove strerror strerror_r strncasecmp \
- gethrtime localtime_r gmtime_r inet_pton posix_memalign \
+ gethrtime localtime_r gmtime_r inet_pton \
mmap mremap memcpy mallopt sbrk _sbrk __sbrk brk _brk __brk \
flockfile fstat strlcpy strlcat setsid posix2time time2posix \
setlocale nl_langinfo poll])
+
+case X$erl_xcomp_posix_memalign in
+ Xno) ;;
+ Xyes) AC_DEFINE(HAVE_POSIX_MEMALIGN,[1],
+ [Define to 1 if you have the `posix_memalign' function.]) ;;
+ *)
+ AC_CHECK_FUNC(
+ [posix_memalign],
+ [if test "$cross_compiling" != yes; then
+AC_TRY_RUN([
+#include <stdlib.h>
+int main(void) {
+ void *ptr = NULL;
+ int error;
+ size_t alignment = 0x40000, size = 0x20028;
+ if ((error = posix_memalign(&ptr, alignment, size)) != 0 || ptr == NULL)
+ return error;
+ return 0;
+}
+],AC_DEFINE(HAVE_POSIX_MEMALIGN,[1],
+ [Define to 1 if you have the `posix_memalign' function.])
+)
+ else
+ AC_DEFINE(HAVE_POSIX_MEMALIGN,[1],
+ [Define to 1 if you have the `posix_memalign' function.])
+ fi]);;
+esac
+
dnl writev on OS X snow leopard is broken for files > 4GB
case $host_os in
darwin10.8.0)