blob: 6f626695c5666c79361e076d9732e357cde4aa0a [file] [log] [blame]
Emeric Vigierc30b71d2012-09-12 14:51:47 -04001#!/bin/bash -
Emeric Vigier9701e032012-09-12 12:38:01 -04002#
Emeric Vigierc30b71d2012-09-12 14:51:47 -04003# Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
Emeric Vigier9701e032012-09-12 12:38:01 -04004#
Emeric Vigierc30b71d2012-09-12 14:51:47 -04005# 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 Vigier9701e032012-09-12 12:38:01 -040039
Emeric Vigiere7ecf332012-09-12 17:27:45 -040040SRCDIR=jni/sflphone/daemon/src
41NATIVE=nativesrc
42NATIVEDIR=$SRCDIR/$NATIVE
43PACKAGE=com.savoirfairelinux.sflphone.client
44PACKAGEDIR=src/com/savoirfairelinux/sflphone/client
Emeric Vigier9701e032012-09-12 12:38:01 -040045ROOT=`pwd`
Emeric Vigiere7ecf332012-09-12 17:27:45 -040046
Emeric Vigier9701e032012-09-12 12:38:01 -040047echo "in $ROOT"
48
Emeric Vigierc30b71d2012-09-12 14:51:47 -040049# FIXME
Emeric Vigier9701e032012-09-12 12:38:01 -040050echo "Generating callmanager_wrap.cpp..."
Emeric Vigiere7ecf332012-09-12 17:27:45 -040051mkdir -p $NATIVEDIR
52swig -v -c++ -java \
53-package $PACKAGE \
54-outdir $PACKAGEDIR \
55-o $SRCDIR/dbus/callmanager_wrap.cpp $SRCDIR/dbus/callmanager.i
Emeric Vigier9701e032012-09-12 12:38:01 -040056
Emeric Vigiere7ecf332012-09-12 17:27:45 -040057pushd $SRCDIR
Emeric Vigier9701e032012-09-12 12:38:01 -040058echo "in $PWD"
59
60echo "Generating sflphoneservice_loader.c..."
61python JavaJNI2CJNI_Load.py \
Emeric Vigiere7ecf332012-09-12 17:27:45 -040062-i $ROOT/$PACKAGEDIR/sflphoneserviceJNI.java \
63-o $NATIVE/sflphoneservice_loader.c \
Emeric Vigier9701e032012-09-12 12:38:01 -040064-t sflphoneservice.c.template \
65-m sflphoneservice \
Emeric Vigiere7ecf332012-09-12 17:27:45 -040066-p $PACKAGE
Emeric Vigier9701e032012-09-12 12:38:01 -040067
68echo "Appending callmanager_wrap.cpp..."
Emeric Vigiere7ecf332012-09-12 17:27:45 -040069cat $NATIVE/sflphoneservice_loader.c >> dbus/callmanager_wrap.cpp
Emeric Vigier9701e032012-09-12 12:38:01 -040070
71echo -n "in " && popd
72echo "Done"