#!/bin/env sh

which guile > /dev/null 2>& 1

if [ $? == 0 ]
then
	# Create sym link
	ln -sf ../mlt.i .

	# Invoke swig
	swig `mlt-config --cflags` -guile mlt.i || exit $?

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

	# Create the module
	ld -shared mlt_wrap.o -lmlt -o mlt.so || exit $?
else
	echo "Guile not found - no bindings created."
fi

