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