aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMax Horn2003-06-02 11:20:07 +0000
committerMax Horn2003-06-02 11:20:07 +0000
commit2b1128acb5b1e681fa367a987759fddadccf4895 (patch)
tree4a982c71e4d058d7bdbb5f5877e1c386b594c60a /configure
parentf8ab6ad8da72af5197a29684791a84543dc5bf67 (diff)
downloadscummvm-rg350-2b1128acb5b1e681fa367a987759fddadccf4895.tar.gz
scummvm-rg350-2b1128acb5b1e681fa367a987759fddadccf4895.tar.bz2
scummvm-rg350-2b1128acb5b1e681fa367a987759fddadccf4895.zip
working alignment check (but if alignment is needed it'll print out a 'Bus error' message which isn't nice...)
svn-id: r8270
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure19
1 files changed, 15 insertions, 4 deletions
diff --git a/configure b/configure
index 2a604a6222..1972cdb38f 100755
--- a/configure
+++ b/configure
@@ -307,13 +307,24 @@ case $endianess in
esac
rm -f tmp_endianess_check tmp_endianess_check.cpp
-echo -n "Alignment required... "
+#
+# Check whether memory alignment is required
+#
+echo -n "Alignment required (don't worry if this shows a 'Bus error')... "
cat > $TMPC << EOF
-#include <malloc.h>
-int main (void) { (void) memalign(64, sizeof(char)); return 0; }
+int main(int argc, char **argv)
+{
+ int i;
+ unsigned char buf[20];
+ for (i = 0; i < 16; i++)
+ *(int *)(&buf[i]) = 0;
+ return 0;
+}
EOF
_need_memalign=yes
-cc_check && _need_memalign=no
+# TODO: Hide the "Bus error" message, if possible...
+trap true BUS
+cc_check && ./$TMPO && _need_memalign=no
if test "$_need_memalign" = yes ; then
_def_align='#define SCUMM_NEED_ALIGNMENT'
else