]> git.sesse.net Git - mlt/blob - src/swig/python/build
a4ad605a111401c743fa3ce75c7d01b60e22d1f3
[mlt] / 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../../mlt++ -I../.. -python mlt.i || exit $?
16
17         # Compile the wrapper
18         g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. -I$PYTHON_INCLUDE mlt_wrap.cxx || exit $?
19
20         # Create the module
21         gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o _mlt.so || exit $?
22 else
23         echo Python not installed.
24         exit 1
25 fi