Bourne shell compliance
[melted] / configure
index 59508f7..2e2f2be 100755 (executable)
--- a/configure
+++ b/configure
@@ -38,6 +38,7 @@ function build_config
                echo "version=$version"
                echo "prefix=$prefix"
                echo "bindir=$prefix/bin"
+               echo "targetos=$targetos"
 
                [ "$mmx" = "true" ] && 
                echo "MMX_FLAGS=-DUSE_MMX"
@@ -56,7 +57,7 @@ function build_config
 
                case $targetos in
                Darwin)
-               echo "CFLAGS+=-DDARWIN"
+               echo "CFLAGS+=-D__DARWIN__"
                echo "SHFLAGS=-dynamiclib"
                ;;
                Linux)
@@ -117,6 +118,7 @@ targetos=$(uname -s)
 case $targetos in
        Darwin)
        LIBSUF=".dylib"
+       mmx=false
        ;;
        Linux)
        LIBSUF=".so"
@@ -140,6 +142,12 @@ do
        esac
 done
 
+# Double check mmx (may end up disabling mmx on non-linux platforms incorrectly)
+if [ "$mmx" = "true" ]
+then
+       grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
+fi
+
 # Show help if requested
 [ $help = 1 ] && show_help || build_config