From adc69f31080e8ab1dc2c9126ecef104ce1f2494b Mon Sep 17 00:00:00 2001 From: ddennedy Date: Fri, 12 Dec 2008 07:41:40 +0000 Subject: [PATCH] configure: add --disable-sse and add mmx/sse detection for OS X git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1256 d19143bc-622f-0410-bfdd-b5b2a6649095 --- configure | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 2f7be0af..dce184f6 100755 --- a/configure +++ b/configure @@ -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,7 +63,7 @@ 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) @@ -126,8 +130,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 +141,6 @@ targetos=$(uname -s) case $targetos in Darwin) LIBSUF=".dylib" - mmx=false ;; Linux|FreeBSD) LIBSUF=".so" @@ -155,6 +160,7 @@ do --libdir=* ) libdir="${i#--libdir=}" ;; --disable-debug ) debug=false ;; --disable-mmx ) mmx=false ;; + --disable-sse ) sse=false ;; --enable-gpl ) gpl=true ;; --cpu=* ) cpu="${i#--cpu=}" ;; esac @@ -167,6 +173,9 @@ done if [ "$mmx" = "true" ] then case $targetos in + Darwin) + sysctl -a hw | grep mmx: > /dev/null | mmx=false + ;; Linux) grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false ;; @@ -179,6 +188,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: > /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 -- 2.39.2