]>
Commit | Line | Data |
---|---|---|
bdac31ba RD |
1 | #!/bin/bash |
2 | # ---------------------------------------------------------------------- | |
3 | ||
5e66e38e | 4 | if [ "$SWIGDIR" = "" ]; then |
94b2c6e6 | 5 | SWIGDIR=$PROJECTS\\SWIG-1.3.29 |
5e66e38e KO |
6 | fi |
7 | ||
bdac31ba RD |
8 | |
9 | # Use non-default python? | |
f60a22bd | 10 | case $1 in |
e2b154e3 RD |
11 | 21 | 2.1) VER=21; shift ;; |
12 | 22 | 2.2) VER=22; shift ;; | |
13 | 23 | 2.3) VER=23; shift ;; | |
14 | 24 | 2.4) VER=24; shift ;; | |
f60a22bd | 15 | |
e2b154e3 | 16 | *) VER=24 |
f60a22bd RD |
17 | esac |
18 | ||
19 | PYTHON=$TOOLS/python$VER/python.exe | |
bdac31ba RD |
20 | |
21 | SETUP="$PYTHON -u setup.py" | |
22 | $PYTHON -c "import sys;print '\n', sys.version, '\n'" | |
23 | ||
24 | ||
454a21e9 RD |
25 | FLAGS="USE_SWIG=1 SWIG=$SWIGDIR\\swig.exe" |
26 | UNIFLAG="UNICODE=1" | |
27 | ||
28 | for p in $*; do | |
29 | if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then | |
30 | UNIFLAG="" | |
31 | break | |
32 | fi | |
33 | done | |
34 | ||
35 | FLAGS="$FLAGS $UNIFLAG" | |
36 | ||
37 | ||
38 | ||
39 | ||
40 | ||
bdac31ba RD |
41 | |
42 | # "c" --> clean | |
43 | if [ "$1" = "c" ]; then | |
44 | shift | |
45 | CMD="$SETUP $FLAGS clean $@" | |
46 | OTHERCMD="rm wx/*.pyd" | |
47 | ||
48 | # just remove the *.pyd's | |
49 | elif [ "$1" = "d" ]; then | |
50 | shift | |
51 | CMD="rm wx/*.pyd" | |
52 | ||
53 | # touch all the *.i files so swig will regenerate | |
54 | elif [ "$1" = "t" ]; then | |
55 | shift | |
56 | CMD= | |
57 | find . -name "*.i" | xargs -l touch | |
58 | ||
59 | # "i" --> install | |
60 | elif [ "$1" = "i" ]; then | |
61 | shift | |
62 | CMD="$SETUP build install" | |
63 | ||
64 | # "r" --> make installer | |
65 | elif [ "$1" = "r" ]; then | |
66 | shift | |
67 | CMD="$PYTHON -u distrib\make_installer.py $@" | |
68 | ||
69 | # "s" --> source dist | |
70 | elif [ "$1" = "s" ]; then | |
71 | shift | |
72 | CMD="$SETUP sdist" | |
73 | ||
74 | # "f" --> FINAL | |
75 | elif [ "$1" == "f" ]; then | |
76 | shift | |
77 | CMD="$SETUP $FLAGS FINAL=1 build_ext --inplace $@" | |
78 | ||
79 | # "h" --> HYBRID | |
80 | elif [ "$1" = "h" ]; then | |
81 | shift | |
82 | CMD="$SETUP $FLAGS HYBRID=1 build_ext --inplace $@" | |
83 | ||
84 | # "a" --> make all installers | |
85 | elif [ "$1" = "a" ]; then | |
86 | shift | |
87 | CMD= | |
88 | ||
1d84f787 RD |
89 | $0 23 d UNICODE=0 |
90 | $0 23 h UNICODE=0 | |
91 | $0 23 r UNICODE=0 | |
bdac31ba RD |
92 | $0 23 d UNICODE=1 |
93 | $0 23 h UNICODE=1 | |
94 | $0 23 r UNICODE=1 | |
95 | ||
1d84f787 RD |
96 | $0 24 d UNICODE=0 |
97 | $0 24 h UNICODE=0 | |
98 | $0 24 r UNICODE=0 | |
99 | $0 24 d UNICODE=1 | |
100 | $0 24 h UNICODE=1 | |
101 | $0 24 r UNICODE=1 | |
102 | ||
bdac31ba RD |
103 | |
104 | # "b" --> both debug and hybrid builds | |
105 | elif [ "$1" = "b" ]; then | |
106 | shift | |
107 | CMD="echo Finished!" | |
108 | $0 $VER $@ | |
109 | $0 $VER h $@ | |
110 | ||
cb56afc4 | 111 | # (no command arg) --> normal debug build for development |
bdac31ba RD |
112 | else |
113 | CMD="$SETUP $FLAGS HYBRID=0 build_ext --inplace --debug $@" | |
114 | fi | |
115 | ||
116 | ||
117 | ||
118 | if [ "$CMD" != "" ]; then | |
119 | echo $CMD | |
120 | $CMD | |
121 | fi | |
122 | ||
123 | if [ "$OTHERCMD" != "" ]; then | |
124 | echo $OTHERCMD | |
125 | $OTHERCMD | |
126 | fi | |
127 |