From: Dan Dennedy Date: Sun, 2 May 2010 19:10:06 +0000 (-0700) Subject: Fix missing PIC flags for bindings (2931009) X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e4261938d87642065bd164ed43eac3d675fb2be0;p=mlt Fix missing PIC flags for bindings (2931009) Also, use g++ for linking bindings because some systems (OS X) do not otherwise know to link with libstdc++. --- diff --git a/src/swig/csharp/build b/src/swig/csharp/build index 5769110c..7ca1aa02 100755 --- a/src/swig/csharp/build +++ b/src/swig/csharp/build @@ -17,10 +17,10 @@ then swig -c++ -I../../mlt++ -I../.. -csharp -dllimport libmltsharp -outdir src_swig -namespace Mlt mlt.i || exit $? # Compile the wrapper - g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx -fPIC || exit $? + g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit $? # Create the module - gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmltsharp.so || exit $? + g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmltsharp.so || exit $? # Compile the library assembly mcs -out:mlt-sharp.dll -target:library src_swig/*.cs diff --git a/src/swig/java/build b/src/swig/java/build index 1cc29bb8..09ff1f11 100755 --- a/src/swig/java/build +++ b/src/swig/java/build @@ -24,10 +24,10 @@ then swig -c++ -I../../mlt++ -I../.. -java -outdir src_swig/org/mltframework -package org.mltframework mlt.i || exit $? # Compile the wrapper - g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx $JAVA_INCLUDE || exit $? + g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx $JAVA_INCLUDE || exit $? # Create the module - gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmlt_java.so || exit $? + g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmlt_java.so || exit $? # Compile the test javac `find src_swig -name '*.java'` || exit $? diff --git a/src/swig/lua/build b/src/swig/lua/build index e3749115..2187bf30 100755 --- a/src/swig/lua/build +++ b/src/swig/lua/build @@ -19,7 +19,7 @@ then g++ -fPIC -DPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit $? # Create the module - gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $? + g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $? else echo Lua not installed. exit 1 diff --git a/src/swig/perl/Makefile.PL b/src/swig/perl/Makefile.PL index 2093b941..f8d07d0f 100644 --- a/src/swig/perl/Makefile.PL +++ b/src/swig/perl/Makefile.PL @@ -7,7 +7,7 @@ system( "ln -sf ../mlt.i" ); system( "swig -c++ -I../../mlt++ -I../.. -perl5 mlt.i" ); WriteMakefile( 'NAME' => 'mlt', - 'CC' => '${CXX} -I../..', + 'CC' => '${CXX} -fPIC -I../..', 'OPTIMIZE' => '-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386', 'LIBS' => ['-L../../mlt++ -lmlt++'], 'OBJECT' => 'mlt_wrap.o', diff --git a/src/swig/perl/build b/src/swig/perl/build index 84023863..1a5b6e23 100755 --- a/src/swig/perl/build +++ b/src/swig/perl/build @@ -7,3 +7,4 @@ then fi perl Makefile.PL || exit 1 +make diff --git a/src/swig/php/build b/src/swig/php/build index f88b94cc..1c53e1c3 100755 --- a/src/swig/php/build +++ b/src/swig/php/build @@ -10,4 +10,4 @@ fi ln -sf ../mlt.i swig -c++ -I../../mlt++ -I../.. -php5 -noproxy mlt.i g++ -fPIC -DPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. `php-config --includes` mlt_wrap.cpp -gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $? +g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $? diff --git a/src/swig/python/build b/src/swig/python/build index 6709da4d..0e87d7f0 100755 --- a/src/swig/python/build +++ b/src/swig/python/build @@ -24,7 +24,7 @@ then g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. -I$PYTHON_INCLUDE mlt_wrap.cxx || exit $? # Create the module - gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o _mlt.so || exit $? + g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o _mlt.so || exit $? else echo Python not installed. exit 1 diff --git a/src/swig/ruby/build b/src/swig/ruby/build index 2fcd34f3..5ef45d29 100755 --- a/src/swig/ruby/build +++ b/src/swig/ruby/build @@ -9,3 +9,4 @@ system( "swig -c++ -ruby -I../../mlt++ -I../.. mlt.i" ) $CFLAGS += " -I../.." $LDFLAGS += " -L../../mlt++ -lmlt++" create_makefile('mlt') +system( "make" ) diff --git a/src/swig/tcl/build b/src/swig/tcl/build index 3a541d33..eeb7a8e9 100755 --- a/src/swig/tcl/build +++ b/src/swig/tcl/build @@ -16,12 +16,11 @@ then swig -c++ -I../../mlt++ -I../.. -tcl mlt.i || exit 1 # Compile the wrapper - g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit 1 + g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit 1 # Create the module - gcc -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit 1 + g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit 1 else echo "Unable to locate tclsh." exit 1 fi -