File: install_shared_python.sh

package info (click to toggle)
gaby 2.0.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,148 kB
  • ctags: 3,101
  • sloc: ansic: 48,660; sh: 8,710; python: 1,161; makefile: 951; perl: 265; sed: 93; xml: 89; sql: 25
file content (18 lines) | stat: -rwxr-xr-x 440 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /bin/sh

PY_PREFIX=`python -c 'import sys ; print sys.prefix'`
PY_VERSION=`python -c 'import sys ; print sys.version[0:3]'`

if [ -e $PY_PREFIX/lib/libpython$PY_VERSION.so ]
then
	echo "shared version already there"
	exit
fi

mkdir .extract
(cd .extract; ar xv $PY_PREFIX/lib/python$PY_VERSION/config/libpython$PY_VERSION.a)
gcc -shared -o libpython$PY_VERSION.so .extract/*.o
rm -rf .extract

cp libpython$PY_VERSION.so $PY_PREFIX/lib