aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-11-01 10:40:29 +0100
committerLukas Larsson <[email protected]>2013-11-01 10:40:29 +0100
commitf7659aeadf2b50acc6140c62a1d1587bf0a8795c (patch)
treedd5e240b61781a95536f48bc59018ba4af7c023e /erts/configure.in
parent492b8682fdb46f93c0da16e44051787fc064f530 (diff)
parent70ebf76f1cef4a6de6be3ea96b36fb81fe245921 (diff)
downloadotp-f7659aeadf2b50acc6140c62a1d1587bf0a8795c.tar.gz
otp-f7659aeadf2b50acc6140c62a1d1587bf0a8795c.tar.bz2
otp-f7659aeadf2b50acc6140c62a1d1587bf0a8795c.zip
Merge branch 'lukas/erts/openbsd-posix-memalign-fix/OTP-11371' into maint
* lukas/erts/openbsd-posix-memalign-fix/OTP-11371: 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 f17f4cb5c8..8288a1aab1 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1974,11 +1974,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)