summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-06-23 18:52:33 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-06-23 18:52:33 +0000
commit68d81080b3cbf1c53c3a2f2174d813da5629fab7 (patch)
tree60364b6c6f2edca4fe15eb41e7b0ddc20b8a2ff0 /configure
parenta431fcf71728967999e6a249d90f43353fb44c19 (diff)
Check for aligned access requirements explicitly.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure51
1 files changed, 51 insertions, 0 deletions
diff --git a/configure b/configure
index 82eec3b..3c78a5f 100755
--- a/configure
+++ b/configure
@@ -12456,6 +12456,57 @@ $as_echo "#define sa_family_t uint16_t" >>confdefs.h
fi
+# check wether misaligned access is possible or not
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pointers to integers require aligned access" >&5
+$as_echo_n "checking if pointers to integers require aligned access... " >&6; }
+if ${ax_cv_have_aligned_access_required+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ax_cv_have_aligned_access_required=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ char* string = malloc(40);
+ int i;
+ for (i=0; i < 40; i++) string[[i]] = i;
+ {
+ void* s = string;
+ int* p = s+1;
+ int* q = s+2;
+
+ if (*p == *q) { return 1; }
+ }
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ax_cv_have_aligned_access_required=yes
+else
+ ax_cv_have_aligned_access_required=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_aligned_access_required" >&5
+$as_echo "$ax_cv_have_aligned_access_required" >&6; }
+if test "$ax_cv_have_aligned_access_required" = yes ; then
+
+$as_echo "#define HAVE_ALIGNED_ACCESS_REQUIRED 1" >>confdefs.h
+
+fi
+
+
### zlib
#
# Handle user hints