X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=configure;h=9892dcdfafd68400332f094a9838964fd70d004b;hb=61a1fd80791f7ff2042756814b2868c797426b9a;hp=ef25c065fe94da9cbbbebdb63035fa22adba5812;hpb=3d3ffb147614f6e0b46e56206ebb8c6a67c5e67a;p=melted diff --git a/configure b/configure index ef25c06..9892dcd 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh -export version=0.3.1 +export version=0.3.5 export soversion=1 show_help() @@ -19,6 +19,7 @@ General build options: --enable-gpl - Enable GPL components --disable-debug - Compile without debug support (default: on) --disable-mmx - Compile without MMX support (default: on) + --disable-sse - Compile without SSE support (default: on) --cpu='cpu' - Compile for a specific CPU/architectre (default: none) Module disables options: @@ -49,6 +50,9 @@ build_config() [ "$mmx" = "true" ] && echo "MMX_FLAGS=-DUSE_MMX" + [ "$sse" = "true" ] && + echo "SSE_FLAGS=-DUSE_SSE" + [ "$debug" = "true" ] && echo "DEBUG_FLAGS=-g" @@ -59,15 +63,17 @@ build_config() echo "TARGETCPU=-mcpu=$cpu" echo "OPTIMISATIONS=-O3 -pipe -fomit-frame-pointer" - echo "CFLAGS+=-Wall -fPIC -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)" + echo "CFLAGS+=-Wall -fPIC -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)" case $targetos in Darwin) + sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64" echo "CFLAGS+=-D__DARWIN__ `sdl-config --cflags`" echo "SHFLAGS=-dynamiclib" echo "LDFLAGS+=`sdl-config --libs`" ;; Linux) + [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64" echo "OPTIMISATIONS+=-ffast-math" echo "CFLAGS+=-pthread" echo "SHFLAGS=-shared" @@ -75,6 +81,7 @@ build_config() echo "RDYNAMIC=-rdynamic" ;; FreeBSD) + [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64" echo "OPTIMISATIONS+=-ffast-math" echo "CFLAGS+=-pthread" echo "SHFLAGS=-shared" @@ -126,8 +133,10 @@ export libdir="" export help=0 export debug=true export mmx=true +export sse=true export gpl=false export cpu= +export targetos= # Determine OS targetos=$(uname -s) @@ -135,7 +144,6 @@ targetos=$(uname -s) case $targetos in Darwin) LIBSUF=".dylib" - mmx=false ;; Linux|FreeBSD) LIBSUF=".so" @@ -154,7 +162,8 @@ do --prefix=* ) prefix="${i#--prefix=}" ;; --libdir=* ) libdir="${i#--libdir=}" ;; --disable-debug ) debug=false ;; - --disable-mmx ) mmx=false ;; + --disable-mmx ) mmx=false; sse=false ;; + --disable-sse ) sse=false ;; --enable-gpl ) gpl=true ;; --cpu=* ) cpu="${i#--cpu=}" ;; esac @@ -167,6 +176,9 @@ done if [ "$mmx" = "true" ] then case $targetos in + Darwin) + sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false + ;; Linux) grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false ;; @@ -179,6 +191,25 @@ then esac fi +# Double check SSE (Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly) +if [ "$sse" = "true" ] +then + case $targetos in + Darwin) + sysctl -a hw | grep "sse: 1" > /dev/null || sse=false + ;; + Linux) + grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false + ;; + FreeBSD) + [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false + ;; + *) + grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false + ;; + esac +fi + # Show help if requested if [ $help = 1 ] then