]> git.sesse.net Git - mlt/commitdiff
Further integrate swig into build system.
authorDan Dennedy <dan@dennedy.org>
Tue, 23 Jun 2009 06:45:56 +0000 (23:45 -0700)
committerDan Dennedy <dan@dennedy.org>
Tue, 23 Jun 2009 06:45:56 +0000 (23:45 -0700)
This is not enabled by default. It adds configure options --enable-swig
and --swig-languages.

Signed-off-by: Dan Dennedy <dan@dennedy.org>
configure
src/framework/Makefile
src/melt/configure
src/swig/Makefile
src/swig/configure
src/swig/java/build
src/swig/perl/build
src/swig/php/build
src/swig/python/build
src/swig/ruby/build
src/swig/tcl/build

index 9eb329bd8732ecc47a8ccd8b389a5c6495fd9226..cf22a630233fa667b092110fe1f6414374adff1f 100755 (executable)
--- a/configure
+++ b/configure
@@ -249,7 +249,7 @@ else
 fi
 
 # Iterate through each of the components
-for i in framework modules melt mlt++
+for i in framework modules melt mlt++ swig
 do
        if [ -x src/$i/configure ]
        then
index fa95884a3c1799d0be864c78c2d3cbc356ce248d..85f554dd4e1c73704fb1fce3a0a1484d0a22f8f6 100644 (file)
@@ -102,7 +102,7 @@ uninstall:
        rm -f "$(DESTDIR)$(libdir)/$(SONAME)"
        rm -f "$(DESTDIR)$(libdir)/$(NAME)"
        rm -rf "$(DESTDIR)$(prefix)/include/mlt/framework"
-       rm "$(DESTDIR)$(datadir)/mlt/metaschema.yaml"
+       rm -f "$(DESTDIR)$(datadir)/mlt/metaschema.yaml"
 
 ifneq ($(wildcard .depend),)
 include .depend
index 82437fa3d7a6970ec9a57133ab8317890e619deb..c109c84be731682f4efedfc666ac400fef33ba33 100755 (executable)
@@ -5,7 +5,7 @@ then
        cat << EOF
 Melt options:
 
-  --rename-melt           - Give melt executable a different name.
+  --rename-melt=name      - Give melt executable a different name.
 
 EOF
 
index 510cce8b95d05607294e5a112c82c92a93d8cbba..5a1d30ba03ebc84be0dc637d2453e9d3ec32159b 100644 (file)
@@ -1,10 +1,22 @@
-SUBDIRS = java perl php python ruby tcl
+include ../../config.mak
+include config.mak
 
-all clean install:
+all clean depend install:
        list='$(SUBDIRS)'; \
        for subdir in $$list; do \
-               if [ -f $$subdir/Makefile -a -f .$$subdir ] ; \
-               then $(MAKE) -C $$subdir $@ || exit 1; \
+               if [ -x $$subdir/build -a ! -f .$$subdir -o $@ = clean ] ; \
+               then echo -n Building $$subdir... ; \
+                       cd $$subdir && output=`./build $@ 2>&1` ; \
+                       if [ $$? -eq 0 ] ; \
+                       then echo OK && touch ../.$$subdir ; \
+                       else echo $$output && exit 1 ; \
+                       fi ; \
+                       cd .. ; \
+                       if [ -f $$subdir/Makefile -a -f .$$subdir ] ; \
+                       then $(MAKE) -C $$subdir $@ || exit 1 ; \
+                       fi ; \
+                       if [ $@ = clean ] ; \
+                       then rm -f .$$subdir ; \
+                       fi ; \
                fi \
        done
-
index 3c21e5f64fbb0f93b845c6d396a2ee2a213f3704..cc23df48e15b4d5a7549dab56c903703848f1a51 100755 (executable)
@@ -1,42 +1,29 @@
-#!/usr/bin/env sh
+#!/bin/sh
 
-which swig > /dev/null 2>&1
-[ $? != 0 ] && echo "Please install swig" && exit 1
+if [ "$help" = "1" ]
+then
+       cat << EOF
+SWIG options:
 
-pkg-config mlt-framework --cflags > /dev/null 2>&1
-[ $? != 0 ] && echo "Please install mlt" && exit 1
+  --enable-swig           - Build the high level language bindings.
+  --swig-languages=[all | [java | perl | php | python | ruby | tcl]*]
+                          - Languages to build (default: all)
 
-if [ "$1" = "all" ]
-then languages="java perl php python ruby tcl"
-elif [ "$1" != "" ]
-then languages=$*
-else echo "Usage: ./configure [ all | language * ]"
-        exit 0
-fi
+EOF
 
-for i in java perl php python ruby tcl
-do
-       rm -f .$i
-done
+else
+       
+       which swig > /dev/null 2>&1
+       [ $? != 0 ] && echo "Please install swig" && exit 1
+       
+       languages="java perl php python ruby tcl"
+       touch config.mak
 
-for i in $languages
-do
-       echo -n "Configuring $i ... "
-       if [ -d "$i" ] 
-       then
-               cd $i &&
-               output=`./build`
-               if [ $? == 0 ]
-               then echo "OK"
-                       touch ../.$i
-               elif [ "$output" == "" ]
-               then
-                       echo "Failed"
-               else
-                       echo $output
-               fi
-               cd ..
-       else
-               echo "Unknown"
-       fi
-done
+       # Iterate through arguments
+       for i in "$@"
+       do
+               case $i in
+                       --swig-languages=* ) echo SUBDIRS = ${i#--swig-languages=} > config.mak ;;
+               esac
+       done
+fi
index 5d1ffb8ef27bcc4122c9bdc6e07657d37dd37a89..e16127b90fad21d8948955e1b94b3c3765e0a042 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+if [ "$1" = "clean" ]
+then
+       ( cd `dirname $0`; rm -rf *.cxx *.so mlt.i ../.java *.class src_swig )
+       exit 0
+fi
+
 path=`which java 2> /dev/null`
 
 if [ $? = 0 ]
index 93e532cad490136d170cfc09dc97bdfc667f83d2..a376899dac0ca3207a4bdaa6cbb6e9dcc1a76df3 100755 (executable)
@@ -1,3 +1,9 @@
 #!/bin/sh
+
+if [ "$1" = "clean" ]
+then
+       ( cd `dirname $0`; rm -f *.cxx *.so mlt.i ../.perl mlt.pm )
+       exit 0
+fi
+
 perl Makefile.PL || exit 1
-make
index 4074b8778b960a6c559c1ca15ff6b6869d3760f9..b966b328cd228316cbc2ebd4282fbc2df22dea9c 100755 (executable)
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+if [ "$1" = "clean" ]
+then
+       ( cd `dirname $0`; rm -f *.cpp *.so mlt.i ../.php mlt.php *.h )
+       exit 0
+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
index a4ad605a111401c743fa3ce75c7d01b60e22d1f3..871c90ea27cbbf3c15aaaa5ca78c120c7db48f67 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+if [ "$1" = "clean" ]
+then
+       ( cd `dirname $0`; rm -f *.cxx *.so mlt.i ../.python mlt.py? )
+       exit 0
+fi
+
 path=`which python 2> /dev/null`
 
 if [ $? = 0 ]
index 4f4f1f198be00ad4c4438542625236b543e793f8..b878735b4dcc4e695cf7b748f2e422735c751685 100755 (executable)
@@ -1,8 +1,11 @@
 #!/usr/bin/env ruby
 require 'mkmf'
+if ARGV.shift == 'clean'
+  system( "rm -f *.cxx *.so mlt.i ../.ruby Makefile" )
+  exit 0
+end
 system( "ln -sf ../mlt.i" )
 system( "swig -c++ -ruby -I../../mlt++ -I../.. mlt.i" )
 $CFLAGS += "-I../.."
 $LDFLAGS += " -L../../mlt++ -lmlt++"
 create_makefile('mlt')
-system( 'make' )
index 53e44962f63410a3c29ff835b455a9d8d3412cc7..d321904910e05cfd21521cde40c802c43543e0c4 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+if [ "$1" = "clean" ]
+then
+       ( cd `dirname $0`; rm -f *.cxx *.so mlt.i ../.tcl )
+       exit 0
+fi
+
 path=`which tclsh 2>/dev/null`
 
 if [ "$path" != "" ]