Update gitignore
[www-quvi.git] / swigity.sh
blob7fd306f3ad1bd22d4fe722de63186a7f91c7f0d3
1 #!/bin/sh
3 # WWW::Quvi
4 # Copyright (C) 2010, 2011 Toni Gundogdu <legatvs@gmail.com>
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301 USA
21 swigity_flag=off
22 build_flag=off
23 clean_flag=off
25 while [ $# -gt 0 ]
27 case "$1" in
28 -s) swigity_flag=on;;
29 -b) build_flag=on;;
30 -c) clean_flag=on;;
31 esac
32 shift
33 done
35 swigity()
37 swig -c++ -const -outdir lib/WWW -perl5 \
38 -I/usr/include $quvi_CFLAGS Quvi.i
39 exit $?
42 build_so()
44 quvi_CFLAGS=`pkg-config --cflags libquvi`
45 quvi_LDFLAGS=`pkg-config --libs libquvi`
47 perl_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
48 perl_LDFLAGS=`perl -MExtUtils::Embed -e ldopts`
50 g++ -g Quvi_wrap.cxx \
51 -I . \
52 Options.cxx \
53 Link.cxx \
54 Video.cxx \
55 Query.cxx \
56 -fpic -shared -o Quvi.so \
57 $quvi_CFLAGS $quvi_LDFLAGS \
58 $perl_CFLAGS $perl_LDFLAGS
60 exit $?
63 clean()
65 rm Quvi.so
66 exit $?
69 if [ x"$swigity_flag" = "xon" ]; then
70 swigity
73 if [ x"$build_flag" = "xon" ]; then
74 build_so
77 if [ x"$clean_flag" = "xon" ]; then
78 clean
81 echo "
82 usage: $0 [-s | -b | -c]
84 -s .. run swig against Quvi.i
85 -b .. build, compile a shared library from swig wrapper code
86 -c .. cleanup, remove the shared library created with -b
88 Most users will want to use the Makefile.PL instead.
89 This script was written to aid the development work."
90 exit 0