summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-24 14:49:05 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-24 14:49:05 +0000
commitcc3b911d90946a6d781bdb33915694849c3a4b64 (patch)
tree255a0754241f35d1e4950367bfc9f96ffc9b7d07 /configure
parent5a91214b593361aac7160fee4217c932e3fd5ad5 (diff)
downloadmpv-cc3b911d90946a6d781bdb33915694849c3a4b64.tar.bz2
mpv-cc3b911d90946a6d781bdb33915694849c3a4b64.tar.xz
added memalign detection, maps to malloc if fails.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1679 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure19
1 files changed, 18 insertions, 1 deletions
diff --git a/configure b/configure
index 44dd216776..399bf3ba08 100755
--- a/configure
+++ b/configure
@@ -908,8 +908,22 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+_memalign_def=
_malloc_h=no
-$_cc -o $TMPO $TMPC 2> /dev/null && _malloc_h=yes
+if $_cc -o $TMPO $TMPC 2> /dev/null ; then
+_malloc_h=yes
+# check for memalign - atmos
+# should this be restricted to x86, or customized for cpu types (opt for cacheline sizes)?
+cat > $TMPC << EOF
+#include <malloc.h>
+int main ( void ) {
+char *string = NULL;
+string = memalign(64, sizeof(char));
+return 0;
+}
+EOF
+$_cc -o $TMPO $TMPC 2> /dev/null || _memalign_def='#define memalign(a,b) malloc(b)'
+fi
cat > $TMPC << EOF
@@ -1994,6 +2008,9 @@ $_have_soundcard_h
/* Define this if your system has the "malloc.h" header file */
$_have_malloc_h
+/* memalign is mapped to malloc here, if unsupported */
+$_memalign_def
+
/* Define this if your system has the "alloca.h" header file */
$_have_alloca_h