Mercurial > hg > anonet-resdb
annotate contrib/splicex/configure @ 991:8827368f49f0 draft
Merge branch 'master' of git://git1.srn.ano
author | icann <icann@icann.ano> |
---|---|
date | Sat, 25 Aug 2012 16:05:55 +0000 |
parents | 1dcc647991ca |
children |
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' | |
712
59babc5385d5
SpliceX fixed, old coding trim down with patch for --time option
d3v11 <d3v11@d3v11.ano>
parents:
706
diff
changeset
|
20 echo |
697 | 21 exit 1 |
22 fi | |
23 | |
701 | 24 echo -ne ' checking for man...' |
697 | 25 if which man >/dev/null; then |
26 echo -ne ' OK' | |
27 echo | |
28 else | |
29 echo -ne ' FAILED' | |
712
59babc5385d5
SpliceX fixed, old coding trim down with patch for --time option
d3v11 <d3v11@d3v11.ano>
parents:
706
diff
changeset
|
30 echo |
697 | 31 exit 1 |
32 fi | |
33 | |
705 | 34 if [ -z "$2" ]; then |
35 echo -ne ' checking for cython...' | |
36 if which cython >/dev/null; then | |
37 echo -ne ' OK' | |
38 echo | |
39 else | |
40 echo -ne ' FAILED' | |
712
59babc5385d5
SpliceX fixed, old coding trim down with patch for --time option
d3v11 <d3v11@d3v11.ano>
parents:
706
diff
changeset
|
41 echo |
705 | 42 exit 1 |
43 fi | |
697 | 44 fi |
45 | |
705 | 46 if [ -z "$2" ]; then |
47 echo -ne ' checking for gcc...' | |
48 if which gcc >/dev/null; then | |
49 echo -ne ' OK' | |
50 echo | |
51 else | |
52 echo -ne ' FAILED' | |
712
59babc5385d5
SpliceX fixed, old coding trim down with patch for --time option
d3v11 <d3v11@d3v11.ano>
parents:
706
diff
changeset
|
53 echo |
705 | 54 exit 1 |
55 fi | |
697 | 56 fi |
57 | |
700 | 58 echo |
59 echo -ne "configuring splicex: " | |
60 echo | |
705 | 61 echo -e " python version == $1" |
62 echo -e " interpreter path == $PYPATH" | |
63 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
|
64 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
|
65 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
|
66 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
|
67 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
|
68 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
|
69 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
|
70 else |
de6fd9fc14e5
SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
d3v11 <d3v11@d3v11.ano>
parents:
705
diff
changeset
|
71 echo -e " Python.h and structmember.h could not be found... FAILED" |
712
59babc5385d5
SpliceX fixed, old coding trim down with patch for --time option
d3v11 <d3v11@d3v11.ano>
parents:
706
diff
changeset
|
72 echo |
59babc5385d5
SpliceX fixed, old coding trim down with patch for --time option
d3v11 <d3v11@d3v11.ano>
parents:
706
diff
changeset
|
73 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
|
74 fi |
705 | 75 fi |
76 echo | |
831 | 77 mkdir -p build || exit 1 |
705 | 78 if [ -z "$2" ]; then |
79 sed -e s^PYTHON^"$PYPATH"^g src/splicex.py >build/splicex || exit 1 | |
80 sed -e s^PYTHON^"$PYPATH"^g src/splicex-deshadow.py >build/splicex-deshadow || exit 1 | |
81 fi | |
82 sed -e s^PYTHON^"$PYPATH"^g src/splicex.pyx >build/splicex.pyx || exit 1 | |
83 sed -e s^PYTHON^"$PYPATH"^g src/deshadow.pyx >build/deshadow.pyx || exit 1 | |
84 echo -ne " generating Makefile..." | |
85 if [ -z "$2" ]; then | |
86 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
|
87 sed -i s^HEADERS^"$PYHEADERS"^g Makefile || exit 1 |
705 | 88 echo -ne ' DONE' |
89 echo | |
90 else | |
91 sed -e s^PYTHON^"$1"^g src/pymake.in >Makefile || exit 1 | |
92 echo -ne ' DONE' | |
93 echo | |
94 fi | |
697 | 95 echo |
700 | 96 echo -e 'splicex configured' |