Emeric Vigier | c30b71d | 2012-09-12 14:51:47 -0400 | [diff] [blame] | 1 | #!/bin/bash - |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 2 | # |
Emeric Vigier | c30b71d | 2012-09-12 14:51:47 -0400 | [diff] [blame] | 3 | # Copyright (C) 2004-2012 Savoir-Faire Linux Inc. |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 4 | # |
Emeric Vigier | c30b71d | 2012-09-12 14:51:47 -0400 | [diff] [blame] | 5 | # Author: Emeric Vigier <emeric.vigier@savoirfairelinux.com> |
| 6 | # |
| 7 | # This program is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 3 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | # This program is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with this program; if not, write to the Free Software |
| 19 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | # |
| 21 | # Additional permission under GNU GPL version 3 section 7: |
| 22 | # |
| 23 | # If you modify this program, or any covered work, by linking or |
| 24 | # combining it with the OpenSSL project's OpenSSL library (or a |
| 25 | # modified version of that library), containing parts covered by the |
| 26 | # terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc. |
| 27 | # grants you additional permission to convey the resulting work. |
| 28 | # Corresponding Source for a non-source form of such a combination |
| 29 | # shall include the source code for the parts of OpenSSL used as well |
| 30 | # as that of the covered work. |
| 31 | # |
| 32 | |
| 33 | # input: jni/sflphone/daemon/src/dbus/callmanager.i |
| 34 | # output: sflphoneservice_loader.c |
| 35 | # callmanager_wrap.cpp |
| 36 | # sflphoneservice.java |
| 37 | # sflphoneserviceJNI.java |
| 38 | # ManagerImpl.java |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 39 | |
Emeric Vigier | e7ecf33 | 2012-09-12 17:27:45 -0400 | [diff] [blame] | 40 | SRCDIR=jni/sflphone/daemon/src |
| 41 | NATIVE=nativesrc |
| 42 | NATIVEDIR=$SRCDIR/$NATIVE |
| 43 | PACKAGE=com.savoirfairelinux.sflphone.client |
| 44 | PACKAGEDIR=src/com/savoirfairelinux/sflphone/client |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 45 | ROOT=`pwd` |
Emeric Vigier | e7ecf33 | 2012-09-12 17:27:45 -0400 | [diff] [blame] | 46 | |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 47 | echo "in $ROOT" |
| 48 | |
Emeric Vigier | c30b71d | 2012-09-12 14:51:47 -0400 | [diff] [blame] | 49 | # FIXME |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 50 | echo "Generating callmanager_wrap.cpp..." |
Emeric Vigier | e7ecf33 | 2012-09-12 17:27:45 -0400 | [diff] [blame] | 51 | mkdir -p $NATIVEDIR |
| 52 | swig -v -c++ -java \ |
| 53 | -package $PACKAGE \ |
| 54 | -outdir $PACKAGEDIR \ |
| 55 | -o $SRCDIR/dbus/callmanager_wrap.cpp $SRCDIR/dbus/callmanager.i |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 56 | |
Emeric Vigier | e7ecf33 | 2012-09-12 17:27:45 -0400 | [diff] [blame] | 57 | pushd $SRCDIR |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 58 | echo "in $PWD" |
| 59 | |
| 60 | echo "Generating sflphoneservice_loader.c..." |
| 61 | python JavaJNI2CJNI_Load.py \ |
Emeric Vigier | e7ecf33 | 2012-09-12 17:27:45 -0400 | [diff] [blame] | 62 | -i $ROOT/$PACKAGEDIR/sflphoneserviceJNI.java \ |
| 63 | -o $NATIVE/sflphoneservice_loader.c \ |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 64 | -t sflphoneservice.c.template \ |
| 65 | -m sflphoneservice \ |
Emeric Vigier | e7ecf33 | 2012-09-12 17:27:45 -0400 | [diff] [blame] | 66 | -p $PACKAGE |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 67 | |
| 68 | echo "Appending callmanager_wrap.cpp..." |
Emeric Vigier | e7ecf33 | 2012-09-12 17:27:45 -0400 | [diff] [blame] | 69 | cat $NATIVE/sflphoneservice_loader.c >> dbus/callmanager_wrap.cpp |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 70 | |
| 71 | echo -n "in " && popd |
| 72 | echo "Done" |