]> git.sesse.net Git - mlt/commitdiff
Build the SWIG bindings with the CXXFLAGS (3554425)
authorDan Dennedy <dan@dennedy.org>
Wed, 10 Oct 2012 02:47:53 +0000 (19:47 -0700)
committerDan Dennedy <dan@dennedy.org>
Wed, 10 Oct 2012 02:47:53 +0000 (19:47 -0700)
Based on patch by Cristian Morales Vega

src/swig/Makefile
src/swig/csharp/build
src/swig/java/build
src/swig/lua/build
src/swig/perl/Makefile.PL
src/swig/perl/build
src/swig/php/build
src/swig/python/build
src/swig/ruby/build
src/swig/tcl/build

index 77d386c5a51f86d94418082b8326e6e0f82f9371..b263644376cba1ce1d85a4d001493e3538d3c47c 100644 (file)
@@ -6,7 +6,7 @@ all clean:
        for subdir in $$list; do \
                if [ -x $$subdir/build -a ! -f .$$subdir -o $@ = clean ] ; \
                then echo -n Building $$subdir... ; \
-                       cd $$subdir && output=`./build $@ 2>&1` ; \
+                       cd $$subdir && output=`CXXFLAGS="$(CXXFLAGS)" ./build $@ 2>&1` ; \
                        if [ $$? -eq 0 ] ; \
                        then echo OK && touch ../.$$subdir ; \
                        else echo $$output && exit 1 ; \
index 7ca1aa02fd270abf296cea879ce63a5eca041c09..c67142d7a97ad3cbd60f3e7976caa243d1ed18f9 100755 (executable)
@@ -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++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit $?
+       g++ -fPIC -D_GNU_SOURCE ${CXXFLAGS} -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit $?
        
        # Create the module
-       g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmltsharp.so || exit $?
+       g++ ${CXXFLAGS} -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
index 09ff1f112954d0e3702da29612eb4557c9344604..d6d0d558b2aff233d9d3579eacdc681ab625d5e2 100755 (executable)
@@ -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++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx $JAVA_INCLUDE || exit $?
+       g++ -fPIC -D_GNU_SOURCE ${CXXFLAGS} -c -rdynamic -pthread -I../.. mlt_wrap.cxx $JAVA_INCLUDE || exit $?
        
        # Create the module
-       g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmlt_java.so || exit $?
+       g++ ${CXXFLAGS} -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o libmlt_java.so || exit $?
 
        # Compile the test
        javac `find src_swig -name '*.java'` || exit $?
index 2187bf30a447529e9d7f069d6c64f6ee97752a18..434e4d12afcddc8e42774741f123232c31cbd0f0 100755 (executable)
@@ -16,10 +16,10 @@ then
        swig -c++ -I../../mlt++ -I../.. -lua mlt.i || exit $?
 
        # Compile the wrapper
-       g++ -fPIC -DPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit $?
+       g++ -fPIC -DPIC -D_GNU_SOURCE ${CXXFLAGS} -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit $?
 
        # Create the module
-       g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $?
+       g++ ${CXXFLAGS} -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $?
 else
        echo Lua not installed.
        exit 1
index dc58c4c873b34f1bf0741c73407d6aa9d3a09350..1cab0dd437f24dad01fe887749451ba09dd380a4 100644 (file)
@@ -7,7 +7,7 @@ system( "ln -sf ../mlt.i" );
 system( "swig -c++ -I../../mlt++ -I../.. -perl5 mlt.i" ); 
 WriteMakefile(
        'NAME'    => 'mlt',
-       'CC'      => '${CXX} -fPIC -I../..',
+       'CC'      => '${CXX} -fPIC ${CXXFLAGS} -I../..',
        'OPTIMIZE' => '-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions',
        'LIBS'    => ['-L../../mlt++ -lmlt++'],
        'OBJECT'  => 'mlt_wrap.o',
index 1a5b6e236b439f6acb2aeb5532c1fe95e74e6d1f..c57baf597853a1ddd4173e106451f3746c61ab23 100755 (executable)
@@ -6,5 +6,5 @@ then
        exit 0
 fi
 
-perl Makefile.PL || exit 1
+CXXFLAGS="$CXXFLAGS" perl Makefile.PL || exit 1
 make
index 1c53e1c384de2127ad3db20431df03508c9ce612..21be7a80133e88dc5f8124ca394c7819fedbf746 100755 (executable)
@@ -9,5 +9,5 @@ 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
-g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $?
+g++ -fPIC -DPIC -D_GNU_SOURCE ${CXXFLAGS} -c -rdynamic -pthread -I../.. `php-config --includes` mlt_wrap.cpp
+g++ ${CXXFLAGS} -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $?
index bf930da9b3aff1e320ba4946a440388e936aa988..3e9e9a00151cd08b1207aa0b43a1447151b7d267 100755 (executable)
@@ -21,10 +21,10 @@ then
        swig -c++ -I../../mlt++ -I../.. -python mlt.i || exit $?
 
        # Compile the wrapper
-       g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. -I$PYTHON_INCLUDE mlt_wrap.cxx || exit $?
+       g++ -fPIC -D_GNU_SOURCE ${CXXFLAGS} -c -I../.. -I$PYTHON_INCLUDE mlt_wrap.cxx || exit $?
 
        # Create the module
-       g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -L../../framework -lmlt $(python-config --ldflags) -o _mlt.so || exit $?
+       g++ ${CXXFLAGS} -shared mlt_wrap.o -L../../mlt++ -lmlt++ -L../../framework -lmlt $(python-config --ldflags) -o _mlt.so || exit $?
 else
        echo Python not installed.
        exit 1
index 5ef45d29afa2c00d54bf3b18eab3695527d9e253..6c6e9cab49531e397178bf2fcd137ca2b897c776 100755 (executable)
@@ -6,7 +6,7 @@ if ARGV.shift == 'clean'
 end
 system( "ln -sf ../mlt.i" )
 system( "swig -c++ -ruby -I../../mlt++ -I../.. mlt.i" )
-$CFLAGS += " -I../.."
+$CFLAGS += " -I../.. " + ENV['CXXFLAGS']
 $LDFLAGS += " -L../../mlt++ -lmlt++"
 create_makefile('mlt')
 system( "make" )
index eeb7a8e90180982178b67a65bf3aa6c70c7378fc..78c839b8b8357ffffc9a8e1514850ac1157902b2 100755 (executable)
@@ -16,10 +16,10 @@ then
        swig -c++ -I../../mlt++ -I../.. -tcl mlt.i || exit 1
 
        # Compile the wrapper
-       g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit 1
+       g++ -fPIC -D_GNU_SOURCE ${CXXFLAGS} -c -rdynamic -pthread -I../.. mlt_wrap.cxx || exit 1
 
        # Create the module
-       g++ -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit 1
+       g++ ${CXXFLAGS} -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit 1
 else
        echo "Unable to locate tclsh."
        exit 1