]> git.sesse.net Git - mlt/blob - src/swig/csharp/build
5769110c63cf6504da46bfb9473a3e248f9602df
[mlt] / src / swig / csharp / build
1 #!/bin/sh
2
3 if [ "$1" = "clean" ]
4 then
5         ( cd `dirname $0`; rm -rf *.cxx *.snk *.so *.o *.exe *.dll mlt.i ../.cs src_swig )
6         exit 0
7 fi
8
9 path=`which mcs 2> /dev/null`
10
11 if [ $? = 0 ]
12 then
13         ln -sf ../mlt.i
14
15         # Invoke swig
16         mkdir src_swig
17         swig -c++ -I../../mlt++ -I../.. -csharp -dllimport libmltsharp -outdir src_swig -namespace Mlt mlt.i || exit $?
18
19         # Compile the wrapper
20         g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx -fPIC || exit $?
21         
22         # Create the module
23         gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmltsharp.so || exit $?
24
25         # Compile the library assembly
26         mcs -out:mlt-sharp.dll -target:library src_swig/*.cs
27         # uncomment the below if you want to sign the assembly
28         # sn -k mlt-sharp.snk
29         # mcs -out:mlt-sharp.dll -target:library -keyfile:mlt-sharp.snk src_swig/*.cs
30
31         # Compile the example
32         mcs -r:mlt-sharp.dll play.cs
33         
34 else
35         echo Mono C# compiler not installed.
36         exit 1
37 fi