File: mtcheck

package info (click to toggle)
regina-normal 4.5-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 16,824 kB
  • ctags: 7,862
  • sloc: cpp: 63,296; ansic: 12,913; sh: 10,556; perl: 3,294; makefile: 947; python: 188
file content (60 lines) | stat: -rw-r--r-- 1,895 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
#
# Boost.Python multi-threading checker for Regina.
#
# Ensures that the compiled python module regina.so links against the
# multi-threaded Boost.Python, not the single-threaded Boost.Python.
#
# For use during the final stage of the debian package build.
#
set -e

tmp=debian/tmp
python_lib=/usr/lib/regina-normal/python/regina.so

echo "Checking Boost.Python multi-threading..."

boost_libname=`ldd $tmp$python_lib | grep 'libboost_python.*\.so' | \
  sed -e 's/^.*\(libboost_python.*\.so\(\.[^ ]\+\)\?\) => .*$/\1/'`

case "$boost_libname" in
  libboost_python*-mt-* )
    # Okay; this looks like the multi-threaded version.
    exit 0
    ;;
  libboost_python*-mt.* )
    # This also looks like the multi-threaded version.
    exit 0
    ;;
  libboost_python*-st-* )
    # Um.  Single-threaded.
    echo "ERROR: You are linking against the single-threaded Boost.Python."
    echo "       You should be using the multi-threaded Boost.Python instead."
    echo "       Your library appears to be $boost_libname."
    exit 1
    ;;
  libboost_python*-st.* )
    # Likewise.
    echo "ERROR: You are linking against the single-threaded Boost.Python."
    echo "       You should be using the multi-threaded Boost.Python instead."
    echo "       Your library appears to be $boost_libname."
    exit 1
    ;;
  libboost_python* )
    # Can't tell.
    echo "ERROR: I cannot tell whether you are linking against the "
    echo "       single-threaded or the multi-threaded Boost.Python."
    echo "       Your library appears to be $boost_libname."
    exit 1
    ;;
  * )
    # Can't even find the library.
    echo "ERROR: I cannot tell which Boost.Python library you are using."
    echo "       The only information I have is: $boost_libname."
    exit 1
    ;;
esac

# Woooh, should never get this far.
echo "ERROR: Control flow error in the Boost.Python checker script."
exit 1