swig/configure, swig/php/*: add php bindings
[melted] / mlt++ / swig / configure
index 5a9fa52..794113a 100755 (executable)
@@ -1,31 +1,42 @@
-#!/bin/env sh
+#!/usr/bin/env sh
 
 which swig > /dev/null 2>&1
-[ $? != 0 ] && echo Please install swig
+[ $? != 0 ] && echo "Please install swig" && exit 1
 
-which mlt-config > /dev/null 2>&1
-[ $? != 0 ] && echo Please install mlt
+pkg-config mlt-framework --cflags > /dev/null 2>&1
+[ $? != 0 ] && echo "Please install mlt" && exit 1
 
 if [ "$1" = "all" ]
-then languages="java perl python ruby tcl"
+then languages="perl php python ruby tcl"
 elif [ "$1" != "" ]
 then languages=$*
 else echo "Usage: ./configure [ all | language * ]"
         exit 0
 fi
 
+for i in perl php python ruby tcl
+do
+       rm -f .$i
+done
+
 for i in $languages
 do
        echo -n "Configuring $i ... "
-       cd $i
-       output=`./build 2>/dev/null`
-       if [ $? == 0 ]
-       then echo "OK"
-       elif [ "$output" == "" ]
+       if [ -d "$i" ] 
        then
-               echo "Failed"
+               cd $i &&
+               output=`./build 2>/dev/null`
+               if [ $? == 0 ]
+               then echo "OK"
+                       touch ../.$i
+               elif [ "$output" == "" ]
+               then
+                       echo "Failed"
+               else
+                       echo $output
+               fi
+               cd ..
        else
-               echo $output
+               echo "Unknown"
        fi
-       cd ..
 done