]> git.sesse.net Git - mlt/commitdiff
configure, kino/enadian_types.h, kino/riff.c, sox/configure: apply patch from Alberto...
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 25 Oct 2008 03:08:56 +0000 (03:08 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 25 Oct 2008 03:08:56 +0000 (03:08 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1202 d19143bc-622f-0410-bfdd-b5b2a6649095

configure
src/modules/kino/endian_types.h
src/modules/kino/riff.cc
src/modules/sox/configure

index 02afe84ec744e981392619215071de1460f6a90a..ef25c065fe94da9cbbbebdb63035fa22adba5812 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 export version=0.3.1
 export soversion=1
@@ -74,6 +74,12 @@ build_config()
                echo "LIBDL=-ldl"
                echo "RDYNAMIC=-rdynamic"
                ;;
+               FreeBSD)
+               echo "OPTIMISATIONS+=-ffast-math"
+               echo "CFLAGS+=-pthread"
+               echo "SHFLAGS=-shared"
+               echo "RDYNAMIC=-rdynamic"
+               ;;
                *)
                ;;
                esac
@@ -131,7 +137,7 @@ case $targetos in
        LIBSUF=".dylib"
        mmx=false
        ;;
-       Linux)
+       Linux|FreeBSD)
        LIBSUF=".so"
        ;;
        *)
@@ -157,10 +163,20 @@ done
 # Determine the libdir if it's not specified in the args
 [ "$libdir" = "" ] && libdir=$prefix/lib
 
-# Double check mmx (may end up disabling mmx on non-linux platforms incorrectly)
+# Double check mmx (Linux and FreeBSD supported, may end up disabling mmx on other platforms incorrectly)
 if [ "$mmx" = "true" ]
 then
-       grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
+       case $targetos in
+               Linux)
+               grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
+               ;;
+               FreeBSD)
+               [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
+               ;;
+               *)
+               grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
+               ;;
+       esac
 fi
 
 # Show help if requested
index 709ccfacfd79a12600ce690ca86b6a184500b829..d66cdb65caa28a1229e7598dcee79c8762b71cb7 100644 (file)
 /* Needed for BYTE_ORDER and BIG/LITTLE_ENDIAN macros. */
 #ifndef _BSD_SOURCE
 # define _BSD_SOURCE
+#ifndef __FreeBSD__
 # include <endian.h>
+#else
+# include <sys/endian.h>
+#endif /* __FreeBSD__ */
 # undef  _BSD_SOURCE
 #else
+#ifndef __FreeBSD__
 # include <endian.h>
+#else
+# include <sys/endian.h>
+#endif /* __FreeBSD__ */
 #endif
 
 #include <sys/types.h>
+#ifndef __FreeBSD__
 #include <byteswap.h>
+#else
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
+#endif /* __FreeBSD__ */
 
 static inline int8_t bswap(const int8_t& x)
 {
index 2eef892c0cdccd2f92d12f17e7cc575795bff1b7..a03f069bd8e6efa7fc2e4c2b49f6d06b959775fb 100644 (file)
@@ -82,7 +82,9 @@
 //#include <stdio.h>
 #include <iostream>
 #include <iomanip>
+#ifndef __FreeBSD__
 #include <byteswap.h>
+#endif /* __FreeBSD__ */
 
 using std::cout;
 using std::hex;
index d6a34500c9e722986015f3a0ab144953b8b55d6d..df57eeed25ed004ac9a0dfecd6605c2d6f8cf46d 100755 (executable)
@@ -8,7 +8,7 @@ then
        Darwin)
                LDD="otool -L"
                ;;
-       Linux)
+       Linux|FreeBSD)
                LDD="ldd"
                ;;
        *)
@@ -37,7 +37,7 @@ then
                        disable_sox=0
                        echo "CFLAGS += $(pkg-config --cflags sox) -I$(pkg-config --variable=prefix sox)" > config.mak
                        echo "LDFLAGS += $(pkg-config --libs sox)" >> config.mak
-                       [ "$(pkg-config --modversion sox)" > "13" ] && echo "CFLAGS += -DSOX14" >> config.mak
+                       [ $(pkg-config --modversion sox | cut -d. -f1) -gt 13 ] && echo "CFLAGS += -DSOX14" >> config.mak
                else
                        sox --version 2> /dev/null | grep 'v14.' > /dev/null
                        disable_sox=$?