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 |
|
60 echo -e " compiler flags == gcc -I/usr/include/$1" |
|
61 fi |
|
62 echo |
|
63 if [ -z "$2" ]; then |
|
64 sed -e s^PYTHON^"$PYPATH"^g src/splicex.py >build/splicex || exit 1 |
|
65 sed -e s^PYTHON^"$PYPATH"^g src/splicex-deshadow.py >build/splicex-deshadow || exit 1 |
|
66 fi |
|
67 sed -e s^PYTHON^"$PYPATH"^g src/splicex.pyx >build/splicex.pyx || exit 1 |
|
68 sed -e s^PYTHON^"$PYPATH"^g src/deshadow.pyx >build/deshadow.pyx || exit 1 |
|
69 echo -ne " generating Makefile..." |
|
70 if [ -z "$2" ]; then |
|
71 sed -e s^PYTHON^"$1"^g src/make.in >Makefile || exit 1 |
|
72 echo -ne ' DONE' |
|
73 echo |
|
74 else |
|
75 sed -e s^PYTHON^"$1"^g src/pymake.in >Makefile || exit 1 |
|
76 echo -ne ' DONE' |
|
77 echo |
|
78 fi |
697
|
79 echo |
700
|
80 echo -e 'splicex configured' |