#!/bin/sh

path=`which tclsh 2>/dev/null`

if [ "$path" != "" ]
then
	ln -sf ../mlt.i .

	# Invoke swig
	swig `mlt-config --cflags` -tcl mlt.i || exit 1

	# Compile the wrapper
	gcc -D_GNU_SOURCE -c -rdynamic -pthread mlt_wrap.c || exit 1

	# Create the module
	ld -shared mlt_wrap.o -lmlt -o mlt.so || exit 1
else
	echo "Unable to locate tclsh."
	exit 1
fi

