Make swig bindings a superset of mlt.
[melted] / src / swig / python / build
1 #!/bin/sh
2
3 path=`which python 2> /dev/null`
4
5 if [ $? = 0 ]
6 then
7         # Change this as needed
8         export PYTHON_INCLUDE=`python -c "import sys;print \"%s/include/python%d.%d\"%(sys.prefix,sys.version_info[0],sys.version_info[1])"`
9
10         [ ! -d "$PYTHON_INCLUDE" ] && echo python development missing && exit 1
11
12         ln -sf ../mlt.i
13
14         # Invoke swig
15         swig -c++ -I../../melted++ `pkg-config mlt++ --cflags` -python mlt.i || exit $?
16
17         # Compile the wrapper
18         g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../../melted++ `pkg-config mlt++ --cflags` -I$PYTHON_INCLUDE mlt_wrap.cxx || exit $?
19
20         # Create the module
21         gcc -shared mlt_wrap.o -L../../melted++ -lmelted++ -o _mlt.so || exit $?
22 else
23         echo Python not installed.
24         exit 1
25 fi