]>
Commit | Line | Data |
---|---|---|
e4bb5998 RD |
1 | #!/bin/bash |
2 | # --------------------------------------------------------------------------- | |
3 | # Build wxWidgets and wxPython on a Windows box. This is normally called | |
4 | # from build-all but it should be able to be used standalone too... | |
5 | # | |
6 | # The command line must have the following parameters: | |
7 | # | |
8 | # 1. the path to the base of the wx source tree | |
9 | # 2. the path of where to put the resulting installers | |
10 | # 3. skipclean flag (yes|no) | |
11 | # 4. the VERSION | |
12 | # 5. the remaining args are the versions of Python to build for | |
13 | # | |
14 | # --------------------------------------------------------------------------- | |
15 | ||
16 | set -o errexit | |
17 | #set -o xtrace | |
18 | ||
19 | echo "-=-=-=- Hello from $HOSTNAME -=-=-=-" | |
20 | ||
f5ed42f8 RD |
21 | if [ $# -lt 6 ]; then |
22 | echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER CHARTYPE" | |
e4bb5998 RD |
23 | exit 1 |
24 | fi | |
25 | ||
26 | WXDIR=$1 | |
27 | DESTDIR=$2 | |
28 | SKIPCLEAN=$3 | |
29 | VERSION=$4 | |
3d6c749c | 30 | PYVER=$5 |
f5ed42f8 | 31 | CHARTYPE=$6 |
e4bb5998 RD |
32 | |
33 | # WXDIR is the cygwin path, WXWIN is the DOS path | |
e4bb5998 RD |
34 | WXWIN=`cygpath -w $WXDIR` |
35 | export WXWIN | |
0f475e8a RD |
36 | export WXDIR |
37 | export TOOLS=/cygdrive/c/TOOLS | |
e4bb5998 | 38 | |
e4bb5998 | 39 | |
3d6c749c RD |
40 | # setup the compiler |
41 | if [ $PYVER = 2.3 ]; then | |
42 | echo "Using MSVC ver 6" | |
43 | . msvcset local 6 | |
44 | echo `which cl.exe` | |
45 | else | |
46 | echo "Using MSVC ver 7" | |
47 | . msvcset local 7 | |
48 | echo `which cl.exe` | |
49 | fi | |
50 | ||
e4bb5998 RD |
51 | |
52 | # untar the source | |
bf158fe6 | 53 | echo "Unarchiving wxPython-src-$VERSION.tar.bz2" |
e4bb5998 | 54 | cd $DESTDIR |
bf158fe6 RD |
55 | tar xjf wxPython-src-$VERSION.tar.bz2 |
56 | rm wxPython-src-$VERSION.tar.bz2 | |
e4bb5998 RD |
57 | |
58 | ||
59 | # Fix line endings | |
60 | echo "Converting wxPython line endings to CRLF..." | |
61 | cd $WXDIR | |
62 | names=`find wxPython -name "*.py" -o -name "*.txt" -o -name "*.htm*" -o -name "*.css" -o -name "*.xml" ` | |
63 | unix2dos -D $names | |
64 | ||
65 | ||
66 | # change to the right spot in the source tree and copy our build scripts | |
67 | echo "Setting up for the build..." | |
68 | cd $WXDIR/build/msw | |
69 | cp $WXDIR/wxPython/distrib/msw/.m* . | |
3d6c749c | 70 | chmod +x .m* |
e4bb5998 RD |
71 | |
72 | ||
73 | # replace some settings in setup0.h and write to setup.h | |
74 | cat > .my.sedexpr <<EOF | |
75 | s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g | |
8c87c6b4 | 76 | s/wxUSE_EXCEPTIONS *1/wxUSE_EXCEPTIONS 0/g |
e4bb5998 RD |
77 | s/wxUSE_DEBUG_CONTEXT *0/wxUSE_DEBUG_CONTEXT 1/g |
78 | s/wxUSE_MEMORY_TRACING *0/wxUSE_MEMORY_TRACING 1/g | |
79 | s/wxUSE_DIALUP_MANAGER *1/wxUSE_DIALUP_MANAGER 0/g | |
80 | s/wxUSE_GLCANVAS *0/wxUSE_GLCANVAS 1/g | |
81 | s/wxUSE_POSTSCRIPT *0/wxUSE_POSTSCRIPT 1/g | |
82 | s/wxUSE_AFM_FOR_POSTSCRIPT *1/wxUSE_AFM_FOR_POSTSCRIPT 0/g | |
83 | s/wxUSE_DISPLAY *0/wxUSE_DISPLAY 1/g | |
8c87c6b4 | 84 | s/wxUSE_DIB_FOR_BITMAP *0/wxUSE_DIB_FOR_BITMAP 1/g |
30eb969a | 85 | s/wxUSE_DEBUGREPORT *1/wxUSE_DEBUGREPORT 0/g |
fa5a80d6 | 86 | s/wxUSE_GRAPHICS_CONTEXT *0/wxUSE_GRAPHICS_CONTEXT 1/g |
e4bb5998 RD |
87 | EOF |
88 | cat $WXDIR/include/wx/msw/setup0.h | sed -f .my.sedexpr > $WXDIR/include/wx/msw/setup.h | |
89 | rm .my.sedexpr | |
90 | ||
91 | ||
92 | echo "Building the wx DLLs..." | |
f5ed42f8 | 93 | if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then |
fa5a80d6 | 94 | .make hybrid USE_GDIPLUS=1 |
f5ed42f8 RD |
95 | fi |
96 | if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then | |
fa5a80d6 | 97 | .make hybrid-uni USE_GDIPLUS=1 |
f5ed42f8 RD |
98 | fi |
99 | ||
100 | ||
101 | # echo "Building tex2rtf..." | |
102 | # cd $WXDIR/utils/tex2rtf/src | |
103 | # $WXDIR/build/msw/.mymake hybrid | |
104 | # cp vc_mswhdll/tex2rtf.exe $WXDIR/lib/vc_dll/tex2rtf.exe | |
e4bb5998 | 105 | |
f5ed42f8 RD |
106 | # echo "Translating docs to html..." |
107 | # DOCDIR=$WXDIR/docs | |
108 | # cd $DOCDIR/latex/wx | |
109 | # mkdir -p $DOCDIR/html/wx | |
110 | # cp *.gif $DOCDIR/html/wx | |
111 | # cp *.css $DOCDIR/html/wx | |
112 | # DOCSRC=`cygpath -w $DOCDIR/latex/wx/manual.tex` | |
113 | # DOCDEST=`cygpath -w $DOCDIR/html/wx/wx.htm` | |
114 | # DOCINI=`cygpath -w $DOCDIR/latex/wx/tex2rtf_css.ini` | |
e4bb5998 | 115 | |
f5ed42f8 RD |
116 | # $WXDIR/lib/vc_dll/tex2rtf.exe $DOCSRC $DOCDEST -twice -html -macros $DOCINI |
117 | ||
118 | ||
3ecece7e RD |
119 | # echo "Extracting html docs..." |
120 | # mkdir -p $WXDIR/docs/html/wx | |
121 | # cd $WXDIR/docs/html/wx | |
122 | # rm -rf * | |
123 | # tar xjf $DESTDIR/wxPython-docs-$VERSION.tar.bz2 | |
124 | # rm $DESTDIR/wxPython-docs-$VERSION.tar.bz2 | |
125 | # unzip wxPython-$VERSION/docs/wx.zip | |
126 | ||
0f475e8a RD |
127 | |
128 | echo "Building the HTMLHelp file..." | |
f5ed42f8 RD |
129 | cd $WXDIR/docs/html/wx |
130 | ##cp $DOCDIR/latex/wx/wx.css . | |
0f475e8a RD |
131 | $TOOLS/HTMLHelpWorkshop/hhc.exe wx.hhp || true |
132 | mkdir -p ../../htmlhelp | |
133 | mv wx.chm ../../htmlhelp | |
134 | ||
0f475e8a | 135 | |
e4bb5998 | 136 | |
e4bb5998 RD |
137 | |
138 | ||
139 | echo "Building wxPython and installers..." | |
140 | cd $WXDIR/wxPython | |
141 | mkdir -p dist | |
f5ed42f8 RD |
142 | if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then |
143 | b $PYVER d UNICODE=0 USE_SWIG=0 | |
144 | b $PYVER h UNICODE=0 USE_SWIG=0 EP_ADD_OPTS=1 | |
145 | b $PYVER r UNICODE=0 USE_SWIG=0 | |
146 | fi | |
147 | if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then | |
148 | b $PYVER d UNICODE=1 USE_SWIG=0 | |
149 | b $PYVER h UNICODE=1 USE_SWIG=0 EP_ADD_OPTS=1 | |
150 | b $PYVER r UNICODE=1 USE_SWIG=0 | |
151 | fi | |
e4bb5998 | 152 | |
3ecece7e | 153 | |
e4bb5998 RD |
154 | echo "Building the developer package..." |
155 | WXWIN=`cygpath -w $WXDIR` | |
156 | export WXWIN | |
0f475e8a | 157 | $TOOLS/4dos/4nt /c distrib/makedev.bat $VERSION |
e4bb5998 RD |
158 | |
159 | ||
160 | echo "Copying installers to $DESTDIR..." | |
161 | mv dist/wxPython* $DESTDIR | |
162 | cd $DESTDIR | |
163 | ||
164 | ||
165 | if [ $SKIPCLEAN != yes ]; then | |
166 | echo "Cleaning up..." | |
167 | rm -r $WXDIR || true | |
168 | fi | |
169 | ||
170 | echo "-=-=-=- Goodbye! -=-=-=-" |