Mercurial > hg > anonet-resdb
annotate contrib/splicex/configure @ 706:de6fd9fc14e5 draft
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
author | d3v11 <d3v11@d3v11.ano> |
---|---|
date | Sat, 29 Oct 2011 11:37:41 -0400 |
parents | dc8f88270f6a |
children | 59babc5385d5 |
rev | line source |
---|---|
697 | 1 #!/bin/bash |
2 if [ -z "$1" ]; then | |
705 | 3 echo 'usage: ./configure <python[version]> {optional: <--no-compile>}' |
4 exit 1 | |
5 fi | |
6 | |
7 if [ -n "$2" ] && [[ "$2" != *--no-compile* ]]; then | |
8 echo 'usage: ./configure <python[version]> {optional: <--no-compile>}' | |
697 | 9 exit 1 |
10 fi | |
11 | |
701 | 12 echo -e 'checking dependencies: ' |
705 | 13 echo -ne " checking for python as <$1>..." |
697 | 14 if which `which "$1"` >/dev/null; then |
15 PYPATH=`which "$1"` | |
16 echo -ne ' OK' | |
17 echo | |
18 else | |
19 echo -ne ' FAILED' | |
20 exit 1 | |
21 fi | |
22 | |
701 | 23 echo -ne ' checking for man...' |
697 | 24 if which man >/dev/null; then |
25 echo -ne ' OK' | |
26 echo | |
27 else | |
28 echo -ne ' FAILED' | |
29 exit 1 | |
30 fi | |
31 | |
705 | 32 if [ -z "$2" ]; then |
33 echo -ne ' checking for cython...' | |
34 if which cython >/dev/null; then | |
35 echo -ne ' OK' | |
36 echo | |
37 else | |
38 echo -ne ' FAILED' | |
39 exit 1 | |
40 fi | |
697 | 41 fi |
42 | |
705 | 43 if [ -z "$2" ]; then |
44 echo -ne ' checking for gcc...' | |
45 if which gcc >/dev/null; then | |
46 echo -ne ' OK' | |
47 echo | |
48 else | |
49 echo -ne ' FAILED' | |
50 exit 1 | |
51 fi | |
697 | 52 fi |
53 | |
700 | 54 echo |
55 echo -ne "configuring splicex: " | |
56 echo | |
705 | 57 echo -e " python version == $1" |
58 echo -e " interpreter path == $PYPATH" | |
59 if [ -z "$2" ]; then | |
706
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
60 if [ -e /usr/include/"$1"/Python.h ] && [ -e /usr/include/"$1"/structmember.h ]; then |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
61 PYHEADERS="/usr/include/$1" |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
62 echo -e " compiler flags == gcc -I /usr/include/$1" |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
63 elif [ -e /usr/local/include/"$1"/Python.h ] && [ -e /usr/local/include/"$1"/structmember.h ]; then |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
64 PYHEADERS="/usr/local/include/$1" |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
65 echo -e " compiler flags == gcc -I /usr/local/include/$1" |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
66 else |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
67 echo -e " Python.h and structmember.h could not be found... FAILED" |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
68 fi |
705 | 69 fi |
70 echo | |
71 if [ -z "$2" ]; then | |
72 sed -e s^PYTHON^"$PYPATH"^g src/splicex.py >build/splicex || exit 1 | |
73 sed -e s^PYTHON^"$PYPATH"^g src/splicex-deshadow.py >build/splicex-deshadow || exit 1 | |
74 fi | |
75 sed -e s^PYTHON^"$PYPATH"^g src/splicex.pyx >build/splicex.pyx || exit 1 | |
76 sed -e s^PYTHON^"$PYPATH"^g src/deshadow.pyx >build/deshadow.pyx || exit 1 | |
77 echo -ne " generating Makefile..." | |
78 if [ -z "$2" ]; then | |
79 sed -e s^PYTHON^"$1"^g src/make.in >Makefile || exit 1 | |
706
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
80 sed -i s^HEADERS^"$PYHEADERS"^g Makefile || exit 1 |
705 | 81 echo -ne ' DONE' |
82 echo | |
83 else | |
84 sed -e s^PYTHON^"$1"^g src/pymake.in >Makefile || exit 1 | |
85 echo -ne ' DONE' | |
86 echo | |
87 fi | |
697 | 88 echo |
700 | 89 echo -e 'splicex configured' |