+ Fix for Darwin and soname logic
[melted] / src / modules / avformat / configure
index ce10ddf..d74c811 100755 (executable)
@@ -15,7 +15,7 @@ FFMPEG/avformat options:
 EOF
 
 else
-        targetos=$(uname -s)
+       targetos=$(uname -s)
        case $targetos in
        Darwin)
                export LIBSUF=.dylib
@@ -27,6 +27,16 @@ else
                ;;
        esac
                
+       bits=$(uname -m)
+       case $bits in
+       x86_64)
+               export LIBDIR=lib64
+               ;;
+       *)
+               export LIBDIR=lib
+               ;;
+       esac
+
        echo > config.mak
 
        export static_ffmpeg=
@@ -35,7 +45,7 @@ else
        export cvs_ffmpeg=
        export avformat_suffix=
 
-       if [ "$shared_ffmpeg" != "" ]
+       if [ "$shared_ffmpeg" != "" -a -f "$shared_ffmpeg" ]
        then
                # Chop ffmpeg 
                shared_ffmpeg=`dirname $shared_ffmpeg`
@@ -82,10 +92,10 @@ else
                        echo 0
                fi
        else 
-               if [ -d "$shared_ffmpeg/include/ffmpeg" -a -f "$shared_ffmpeg/lib/libavformat$LIBSUF" ]
+               if [ -d "$shared_ffmpeg/include/ffmpeg" -a -f "$shared_ffmpeg/$LIBDIR/libavformat$avformat_suffix$LIBSUF" ]
                then
                        echo "CFLAGS+=-I$shared_ffmpeg/include/ffmpeg " >> config.mak
-                       echo "LDFLAGS+=-L$shared_ffmpeg/lib" >> config.mak
+                       echo "LDFLAGS+=-L$shared_ffmpeg/$LIBDIR" >> config.mak
                else
                        echo "avformat: No build environment found. "
                        echo "          Try configuring mlt with --avformat-cvs."