~ubuntu-branches/ubuntu/trusty/subversion/trusty-proposed

« back to all changes in this revision

Viewing changes to build/run_ctypesgen.sh

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft
  • Date: 2012-06-21 15:36:36 UTC
  • mfrom: (0.4.13 sid)
  • Revision ID: package-import@ubuntu.com-20120621153636-amqqmuidgwgxz1ly
Tags: 1.7.5-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Create pot file on build.
  - Build a python-subversion-dbg package.
  - Build-depend on python-dbg.
  - Build-depend on default-jre-headless/-jdk.
  - Do not apply java-build patch.
  - debian/rules: Manually create the doxygen output directory, otherwise
    we get weird build failures when running parallel builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
#
 
4
# Licensed to the Apache Software Foundation (ASF) under one
 
5
# or more contributor license agreements.  See the NOTICE file
 
6
# distributed with this work for additional information
 
7
# regarding copyright ownership.  The ASF licenses this file
 
8
# to you under the Apache License, Version 2.0 (the
 
9
# "License"); you may not use this file except in compliance
 
10
# with the License.  You may obtain a copy of the License at
 
11
#
 
12
#   http://www.apache.org/licenses/LICENSE-2.0
 
13
#
 
14
# Unless required by applicable law or agreed to in writing,
 
15
# software distributed under the License is distributed on an
 
16
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
17
# KIND, either express or implied.  See the License for the
 
18
# specific language governing permissions and limitations
 
19
# under the License.
 
20
#
 
21
#
 
22
#
 
23
# Helper script to generate the ctypesgen wrappers
 
24
#
 
25
 
 
26
LT_EXECUTE="$1"
 
27
 
 
28
CPPFLAGS="$2"
 
29
EXTRA_CTYPES_LDFLAGS="$3"
 
30
PYTHON="$4"
 
31
CTYPESGEN="$5"
 
32
 
 
33
abs_srcdir="$6"
 
34
abs_builddir="$7"
 
35
 
 
36
svn_libdir="$8"
 
37
apr_config="$9"
 
38
apu_config="${10}"
 
39
 
 
40
cp_relpath="subversion/bindings/ctypes-python"
 
41
output="$cp_relpath/svn_all.py"
 
42
 
 
43
# Avoid build path in csvn/core/functions.py
 
44
if test "$abs_builddir" = "$abs_srcdir"; then
 
45
  svn_includes="subversion/include"
 
46
else
 
47
  mkdir -p "$cp_relpath/csvn/core"
 
48
  svn_includes="$abs_srcdir/subversion/include"
 
49
fi
 
50
 
 
51
### most of this should be done at configure time and passed in
 
52
apr_cppflags="`$apr_config --includes --cppflags`"
 
53
apr_include_dir="`$apr_config --includedir`"
 
54
apr_ldflags="`$apr_config --ldflags --link-ld`"
 
55
 
 
56
apu_cppflags="`$apu_config --includes`"  # no --cppflags
 
57
apu_include_dir="`$apu_config --includedir`"
 
58
apu_ldflags="`$apu_config --ldflags --link-ld`"
 
59
 
 
60
cpp="`$apr_config --cpp`"
 
61
### end
 
62
 
 
63
cppflags="$apr_cppflags $apu_cppflags -I$svn_includes"
 
64
ldflags="-L$svn_libdir $apr_ldflags $apu_ldflags $EXTRA_CTYPES_LDFLAGS"
 
65
 
 
66
 
 
67
# This order is important. The resulting stubs will load libraries in
 
68
# this particular order.
 
69
### maybe have gen-make do this for us
 
70
for lib in subr diff delta fs repos wc ra client ; do
 
71
  ldflags="$ldflags -lsvn_$lib-1"
 
72
done
 
73
 
 
74
includes="$svn_includes/svn_*.h $apr_include_dir/ap[ru]_*.h"
 
75
if test "$apr_include_dir" != "$apu_include_dir" ; then
 
76
  includes="$includes $apu_include_dir/ap[ru]_*.h"
 
77
fi
 
78
 
 
79
# Remove some whitespace in csvn/core/functions.py
 
80
CPPFLAGS="`echo $CPPFLAGS`"
 
81
cppflags="`echo $cppflags`"
 
82
 
 
83
echo $LT_EXECUTE $PYTHON $CTYPESGEN --cpp "$cpp $CPPFLAGS $cppflags" $ldflags $includes -o $output --no-macro-warnings --strip-build-path=$abs_srcdir
 
84
$LT_EXECUTE $PYTHON $CTYPESGEN --cpp "$cpp $CPPFLAGS $cppflags" $ldflags $includes -o $output --no-macro-warnings --strip-build-path=$abs_srcdir
 
85
 
 
86
(cat $abs_srcdir/$cp_relpath/csvn/core/functions.py.in; \
 
87
 sed -e '/^FILE =/d' $output | \
 
88
 perl -pe 's{(\s+\w+)\.restype = POINTER\(svn_error_t\)}{\1.restype = POINTER(svn_error_t)\n\1.errcheck = _svn_errcheck}' \
 
89
 ) > $abs_srcdir/$cp_relpath/csvn/core/functions.py