]> git.saurik.com Git - wxWidgets.git/blame - distrib/msw/makesetup.sh
Fix for probably rare but potential refcount leak.
[wxWidgets.git] / distrib / msw / makesetup.sh
CommitLineData
2ce79e48
JS
1#!/bin/sh
2
3# Make a distribution of an application on MSW.
4# Example:
d61c1a6f 5# ../distrib/msw/makesetup.sh --wxmsw --verbose &> | cat > log
2ce79e48
JS
6
7# If your zip accepts Cygwin-style paths, then
8# use cygpath, else substitute echo
9CYGPATHPROG=cygpath
10#CYGPATHPROG=echo
11
12INNO=1
13SPINMSW=0
14SPINMAC=0
15SPINOS2=0
16SPINDOCS=1
17SPINALL=1
0157e579 18SPINWXALL=1
2ce79e48
JS
19VERBOSE=0
20ZIPFLAGS=
21
22PROGNAME=$0
23SCRIPTDIR=$WXWIN/distrib/msw
24WEBFILES=c:/wx2dev/wxWebSite
25# Set this to the required version
c4839ccf 26VERSION=2.5.2
2ce79e48
JS
27
28. $SCRIPTDIR/setup.var
29
30doreplace()
31{
32 thefile=$1
33 theexpr=$2
34
35 if [ -f $thefile ]; then
36 sed -e "$theexpr" < $thefile > $thefile.tmp
37 mv $thefile.tmp $thefile
38 else
39 echo "*** $thefile not found."
40 fi
41}
42
43unix2dosname()
44{
45 echo $1 | sed -e "s/\//\\\\\\\/g" > /tmp/filename.tmp
46 RETVALUE=`cat /tmp/filename.tmp`
47 rm -f /tmp/filename.tmp
48}
49
50unix2dosname2()
51{
52 echo $1 | sed -e "s/\//\\\\/g" > /tmp/filename.tmp
53 RETVALUE=`cat /tmp/filename.tmp`
54 rm -f /tmp/filename.tmp
55}
56
57doinit()
58{
59 if [ "$VERBOSE" != "1" ]; then
60 ZIPFLAGS=-q
61 fi
62}
63
64rearchive()
65{
66 archive=$1
67 dirname=$2
68 changeto=$3
69
70 echo Re-archiving $archive as $dirname
71
72 pushd $changeto
73
74 if [ -d $dirname ]; then
75 rm -f -r $dirname
76 fi
77 mkdir $dirname
78 cd $dirname
79 unzip $ZIPFLAGS ../$archive
80 cd ..
81 rm -f $archive
82 zip $ZIPFLAGS -r $archive $dirname/*
83
84 popd
85}
86
87# Find the version from wx/version.h
88# Not yet used
89findversion()
90{
91 echo "#include <stdio.h>" > /tmp/appver.c
92 echo "#include \"$VERSIONSYMBOLFILE\"" >> /tmp/appver.c
93 echo "int main() { printf(\"%.2f\", $VERSIONSYMBOL); }" >> /tmp/appver.c
94 gcc /tmp/appver.c -I$APPDIR -o /tmp/appver
95 VERSION=`/tmp/appver`
96 rm -f /tmp/appver /tmp/appver.c
97}
98
99dospinos2()
100{
101 cd $APPDIR
102 echo Zipping OS/2
103
104 # Zip up the complete wxOS2-xxx.zip file
105 zip $ZIPFLAGS -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/generic.rsp
106 zip $ZIPFLAGS -@ -u $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/os2.rsp
107 zip $ZIPFLAGS -@ -u $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/jpeg.rsp
108 zip $ZIPFLAGS -@ -u $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/tiff.rsp
109 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/tiff.rsp
110 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/jpeg.rsp
111 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/utils.rsp
112 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/tex2rtf.rsp
113 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/ogl.rsp
114 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/xml.rsp
115 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/contrib.rsp
116 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/deprecated.rsp
117 zip $ZIPFLAGS -u -@ $DESTDIR/wxOS2-$VERSION.zip < $APPDIR/distrib/msw/makefile.rsp
118
77ffb593
JS
119 # Rearchive under wxWidgets-$VERSION
120 if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
121 rm -f -r $DESTDIR/wxWidgets-$VERSION
2ce79e48
JS
122 fi
123
77ffb593
JS
124 mkdir $DESTDIR/wxWidgets-$VERSION
125 cd $DESTDIR/wxWidgets-$VERSION
2ce79e48 126 unzip $ZIPFLAGS ../wxOS2-$VERSION.zip
97c0ea03 127 # No longer do this, configure should be OK
8a82c9ec
JS
128 # echo Overwriting with OS2-specific versions of configure files...
129 # unzip $ZIPFLAGS -o $APPDIR/distrib/os2/os2-specific.zip
2ce79e48
JS
130 rm -f src/gtk/descrip.mms src/motif/descrip.mms docs/pdf/*.pdf
131 rm -f src/tiff/*.mcp src/jpeg/*.mcp src/png/*.mcp src/zlib/*.mcp
1cb14841 132 rm -f -r docs/html/tex2rtf
2ce79e48 133
46c81560
JS
134 # echo Making OS/2 files lower case...
135 # no longer necessary
136 # $SCRIPTDIR/namedown include/wx/os2/*.H
137 # $SCRIPTDIR/namedown src/os2/*.CPP src/os2/*.I
2ce79e48 138
71da8cff
JS
139 echo Copying readme files...
140 cp $APPDIR/docs/os2/install.txt INSTALL-OS2.txt
141 cp $APPDIR/docs/licence.txt LICENCE.txt
142 cp $APPDIR/docs/lgpl.txt COPYING.LIB
143 cp $APPDIR/docs/changes.txt CHANGES.txt
144 cp $APPDIR/docs/readme.txt README.txt
145
2ce79e48
JS
146 cd $DESTDIR
147
148 rm -f wxOS2-$VERSION.zip
77ffb593 149 zip $ZIPFLAGS -r wxOS2-$VERSION.zip wxWidgets-$VERSION/*
2ce79e48
JS
150}
151
152dospinmac()
153{
154 cd $APPDIR
155
156 echo Zipping wxMac distribution
157
158 cp $APPDIR/include/wx/mac/setup0.h $APPDIR/include/wx/setup.h
159
160 zip $ZIPFLAGS -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/generic.rsp
161 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/mac.rsp
c4839ccf 162 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/cocoa.rsp
2ce79e48
JS
163 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/cw_mac.rsp
164 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/tiff.rsp
165 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/jpeg.rsp
166 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/utils.rsp
167 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/tex2rtf.rsp
168 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/ogl.rsp
169 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/xml.rsp
170 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/stc.rsp
171 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/contrib.rsp
172 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/deprecated.rsp
173 zip $ZIPFLAGS -u -@ $DESTDIR/wxMac-$VERSION.zip < $APPDIR/distrib/msw/makefile.rsp
174
77ffb593 175 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-CW-Mac.zip < $APPDIR/distrib/msw/cw_mac.rsp
2ce79e48
JS
176
177 rm -f $APPDIR/include/wx/setup.h
178
77ffb593
JS
179 if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
180 rm -f -r $DESTDIR/wxWidgets-$VERSION
2ce79e48
JS
181 fi
182
77ffb593
JS
183 mkdir $DESTDIR/wxWidgets-$VERSION
184 cd $DESTDIR/wxWidgets-$VERSION
2ce79e48
JS
185 unzip $ZIPFLAGS ../wxMac-$VERSION.zip
186 rm -f src/gtk/descrip.mms src/motif/descrip.mms docs/pdf/*.pdf
1cb14841 187 rm -f -r docs/html/tex2rtf docs/htmlhelp
2ce79e48 188
71da8cff
JS
189 echo Copying readme files...
190 cp $APPDIR/docs/mac/readme.txt README-MAC.txt
191 cp $APPDIR/docs/mac/install.txt INSTALL-MAC.txt
192 cp $APPDIR/docs/licence.txt LICENCE.txt
193 cp $APPDIR/docs/lgpl.txt COPYING.LIB
194 cp $APPDIR/docs/changes.txt CHANGES.txt
195 cp $APPDIR/docs/readme.txt README.txt
196
2ce79e48
JS
197 cd $DESTDIR
198
199 rm -f wxMac-$VERSION.zip
77ffb593 200 zip $ZIPFLAGS -r wxMac-$VERSION.zip wxWidgets-$VERSION/*
2ce79e48
JS
201}
202
203dospinmsw()
204{
205 cd $APPDIR
206
77ffb593 207 # Create wxWidgets-$VERSION-win.zip which is used to create wxMSW
2ce79e48 208 echo Zipping individual components
43adccf8 209 rm -f $DESTDIR/wxWidgets-$VERSION-win.zip
77ffb593
JS
210 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/generic.rsp
211 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/makefile.rsp
212 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/msw.rsp
213 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/ogl.rsp
214 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/mmedia.rsp
215 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/stc.rsp
216 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/tex2rtf.rsp
217 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/jpeg.rsp
218 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/tiff.rsp
219 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/xml.rsp
220 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/contrib.rsp
221 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/deprecated.rsp
222 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/utils.rsp
223 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/utilmake.rsp
224 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/univ.rsp
0157e579 225 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/wince.rsp
43adccf8 226 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/dmc.rsp
77ffb593
JS
227
228# rearchive wxWidgets-$VERSION-win.zip wxWidgets-$VERSION $DESTDIR
229
230 if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
231 rm -f -r $DESTDIR/wxWidgets-$VERSION
71da8cff
JS
232 fi
233
77ffb593
JS
234 mkdir $DESTDIR/wxWidgets-$VERSION
235 cd $DESTDIR/wxWidgets-$VERSION
236 unzip $ZIPFLAGS ../wxWidgets-$VERSION-win.zip
2ce79e48
JS
237
238 echo Removing .mms files
71da8cff
JS
239 rm -f src/gtk/descrip.mms src/motif/descrip.mms
240
241 echo Copying readme files...
242 cp $APPDIR/docs/msw/readme.txt README-MSW.txt
243 cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt
244 cp $APPDIR/docs/licence.txt LICENCE.txt
245 cp $APPDIR/docs/lgpl.txt COPYING.LIB
246 cp $APPDIR/docs/changes.txt CHANGES.txt
247 cp $APPDIR/docs/readme.txt README.txt
248
249 cd $DESTDIR
250
77ffb593
JS
251 rm -f wxWidgets-$VERSION-win.zip
252 zip $ZIPFLAGS -r wxWidgets-$VERSION-win.zip wxWidgets-$VERSION/*
2ce79e48
JS
253}
254
0157e579
JS
255dospinwxall()
256{
257 cd $APPDIR
258
259 # Create wxWidgets-$VERSION-win.zip which is used to create wxMSW
260 echo Zipping individual components
43adccf8 261 rm -f $DESTDIR/wxWidgets-$VERSION-win.zip
0157e579
JS
262 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/generic.rsp
263 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/makefile.rsp
264 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/msw.rsp
265 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/ogl.rsp
266 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/mmedia.rsp
267 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/stc.rsp
268 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/tex2rtf.rsp
269 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/jpeg.rsp
270 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/tiff.rsp
271 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/xml.rsp
272 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/contrib.rsp
273 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/deprecated.rsp
274 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/utils.rsp
275 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/utilmake.rsp
276 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/univ.rsp
277 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/wince.rsp
43adccf8 278 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/dmc.rsp
667d61b8
JS
279 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/cw.rsp
280 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/cw_mac.rsp
0157e579
JS
281
282 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/x11.rsp
667d61b8 283 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/cocoa.rsp
0157e579
JS
284 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/motif.rsp
285 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/mac.rsp
286 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/wince.rsp
287 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/mgl.rsp
288 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-win.zip < $APPDIR/distrib/msw/os2.rsp
289
290# rearchive wxWidgets-$VERSION-win.zip wxWidgets-$VERSION $DESTDIR
291
292 if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
293 rm -f -r $DESTDIR/wxWidgets-$VERSION
294 fi
295
296 mkdir $DESTDIR/wxWidgets-$VERSION
297 cd $DESTDIR/wxWidgets-$VERSION
298 unzip $ZIPFLAGS ../wxWidgets-$VERSION-win.zip
299
300 echo Copying readme files...
301 cp $APPDIR/docs/licence.txt LICENCE.txt
302 cp $APPDIR/docs/lgpl.txt COPYING.LIB
303 cp $APPDIR/docs/changes.txt CHANGES.txt
304 cp $APPDIR/docs/readme.txt README.txt
305
306 cd $DESTDIR
307
43adccf8 308 rm -f $DESTDIR/wxWidgets-$VERSION-win.zip
667d61b8 309 zip $ZIPFLAGS -r wxAll-$VERSION.zip wxWidgets-$VERSION/*
0157e579
JS
310}
311
2ce79e48
JS
312dospindocs()
313{
314 cd $APPDIR
315
77ffb593
JS
316 echo Creating $DESTDIR/wxWidgets-$VERSION-DocSource.zip
317 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-DocSource.zip < $APPDIR/distrib/msw/docsrc.rsp
318 rearchive wxWidgets-$VERSION-DocSource.zip wxWidgets-$VERSION $DESTDIR
2ce79e48 319
77ffb593
JS
320 echo Creating $DESTDIR/wxWidgets-$VERSION-WinHelp.zip
321 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-WinHelp.zip < $APPDIR/distrib/msw/wx_hlp.rsp
322 rearchive wxWidgets-$VERSION-WinHelp.zip wxWidgets-$VERSION $DESTDIR
2ce79e48 323
77ffb593
JS
324 echo Creating $DESTDIR/wxWidgets-$VERSION-HTML.zip
325 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTML.zip < $APPDIR/distrib/msw/wx_html.rsp
326 rearchive wxWidgets-$VERSION-HTML.zip wxWidgets-$VERSION $DESTDIR
2ce79e48 327
77ffb593
JS
328 echo Creating $DESTDIR/wxWidgets-$VERSION-PDF.zip
329 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-PDF.zip < $APPDIR/distrib/msw/wx_pdf.rsp
330 rearchive wxWidgets-$VERSION-PDF.zip wxWidgets-$VERSION $DESTDIR
2ce79e48 331
77ffb593
JS
332 # zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-Word.zip < $APPDIR/distrib/msw/wx_word.rsp
333 # rearchive wxWidgets-$VERSION-Word.zip wxWidgets-$VERSION $DESTDIR
2ce79e48 334
77ffb593
JS
335 echo Creating $DESTDIR/wxWidgets-$VERSION-HTB.zip
336 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTB.zip < $APPDIR/distrib/msw/wx_htb.rsp
337 rearchive wxWidgets-$VERSION-HTB.zip wxWidgets-$VERSION $DESTDIR
2ce79e48 338
77ffb593
JS
339 echo Creating $DESTDIR/wxWidgets-$VERSION-HTMLHelp.zip
340 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTMLHelp.zip < $APPDIR/distrib/msw/wx_chm.rsp
341 rearchive wxWidgets-$VERSION-HTMLHelp.zip wxWidgets-$VERSION $DESTDIR
2ce79e48
JS
342
343 # Add Linuxy docs to a separate archive to be transported to Linux for the
344 # Linux-based releases
77ffb593
JS
345 echo Creating $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip
346 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip < $APPDIR/distrib/msw/wx_html.rsp
347 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip < $APPDIR/distrib/msw/wx_pdf.rsp
348 zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip < $APPDIR/distrib/msw/wx_htb.rsp
2ce79e48
JS
349
350 # PDF/HTML docs that should go into the Windows setup because
351 # there are no WinHelp equivalents
77ffb593
JS
352 echo Creating $DESTDIR/wxWidgets-$VERSION-ExtraDoc.zip
353 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-ExtraDoc.zip < $APPDIR/distrib/msw/extradoc.rsp
354 rearchive wxWidgets-$VERSION-ExtraDoc.zip wxWidgets-$VERSION $DESTDIR
2ce79e48
JS
355}
356
357dospinmisc()
358{
359 cd $APPDIR
360
361 # zip up Univ-specific files
77ffb593
JS
362 echo Creating $DESTDIR/wxWidgets-$VERSION-Univ.zip
363 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-Univ.zip < $APPDIR/distrib/msw/univ.rsp
364 rearchive wxWidgets-$VERSION-Univ.zip wxWidgets-$VERSION $DESTDIR
2ce79e48
JS
365
366 # VC++ project files
77ffb593
JS
367 echo Creating $DESTDIR/wxWidgets-$VERSION-VC.zip
368 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-VC.zip < $APPDIR/distrib/msw/vc.rsp
369 # rearchive wxWidgets-$VERSION-VC.zip wxWidgets-$VERSION $DESTDIR
2ce79e48 370
0157e579
JS
371 # eVC++ project files
372 echo Creating $DESTDIR/wxWidgets-$VERSION-eVC.zip
373 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-eVC.zip < $APPDIR/distrib/msw/wince.rsp
374 # rearchive wxWidgets-$VERSION-eVC.zip wxWidgets-$VERSION $DESTDIR
375
43adccf8
JS
376 # DMC project files
377 echo Creating $DESTDIR/wxWidgets-$VERSION-DMC.zip
378 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-DMC.zip < $APPDIR/distrib/msw/dmc.rsp
379 # rearchive wxWidgets-$VERSION-DMC.zip wxWidgets-$VERSION $DESTDIR
380
2ce79e48 381 # BC++ project files
77ffb593
JS
382 echo Creating $DESTDIR/wxWidgets-$VERSION-BC.zip
383 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-BC.zip < $APPDIR/distrib/msw/bc.rsp
384 # rearchive wxWidgets-$VERSION-BC.zip wxWidgets-$VERSION $DESTDIR
2ce79e48
JS
385
386 # CodeWarrior project files
77ffb593
JS
387 echo Creating $DESTDIR/wxWidgets-$VERSION-CW.zip
388 zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-CW.zip < $APPDIR/distrib/msw/cw.rsp
389 # rearchive wxWidgets-$VERSION-CW.zip wxWidgets-$VERSION $DESTDIR
2ce79e48
JS
390}
391
392dospinsetup()
393{
394 cd $DESTDIR
395
396 # Put all archives for transit to Linux in a zip file
77ffb593
JS
397 echo Creating $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip
398 rm -f $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip
43adccf8 399 zip $ZIPFLAGS $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip wxWidgets-$VERSION-LinuxDocs.zip wxWidgets-$VERSION-VC.zip wxWidgets-$VERSION-DMC.zip wxWidgets-$VERSION-eVC.zip wxWidgets-$VERSION-CW-Mac.zip
2ce79e48 400
77ffb593 401 echo Unzipping the Windows files into wxWidgets-$VERSION
2ce79e48 402
77ffb593
JS
403 unzip $ZIPFLAGS -o wxWidgets-$VERSION-win.zip
404 unzip $ZIPFLAGS -o wxWidgets-$VERSION-VC.zip -d wxWidgets-$VERSION
405 unzip $ZIPFLAGS -o wxWidgets-$VERSION-BC.zip -d wxWidgets-$VERSION
406 unzip $ZIPFLAGS -o wxWidgets-$VERSION-CW.zip -d wxWidgets-$VERSION
407 unzip $ZIPFLAGS -o wxWidgets-$VERSION-HTMLHelp.zip
408 unzip $ZIPFLAGS -o wxWidgets-$VERSION-ExtraDoc.zip
2ce79e48
JS
409
410 # After this change of directory, we're in the
411 # temporary 'wx' directory and not acting on
77ffb593
JS
412 # the source wxWidgets directory.
413 cd $DESTDIR/wxWidgets-$VERSION
2ce79e48
JS
414
415 # Now delete a few files that are unnecessary
416 #attrib -R *
417 rm -f BuildCVS.txt descrip.mms
418 rm -f setup.h_vms
419 rm -f docs/html/wxbook.htm docs/html/roadmap.htm
420 rm -f -r contrib/docs/latex/ogl
421 rm -f src/mingegcs.bat
d61c1a6f 422 rm -f -r distrib
2ce79e48
JS
423 rm -f *.spec
424 rm -f -r contrib/utils/wxrcedit
425
426 # Now cp some binary files to 'bin'
427 if [ ! -d bin ]; then
428 mkdir bin
429 fi
2ce79e48 430 cp $APPDIR/bin/tex2rtf.exe bin
b1c1e25b 431 cp $APPDIR/bin/tex2rtf.chm bin
2ce79e48 432 cp $APPDIR/bin/widgets.exe bin
2ce79e48 433 cp $APPDIR/bin/life.exe bin
2ce79e48 434 cp $APPDIR/demos/life/breeder.lif bin
2ce79e48
JS
435 cp $APPDIR/docs/htmlhelp/tex2rtf.chm bin
436
437 if [ ! -d docs/pdf ]; then
438 mkdir docs/pdf
439 fi
440 #cp $APPDIR/docs/pdf/wxTutorial.pdf docs/pdf
441
442 # Make wxMSW-xxx.zip
443 cd $DESTDIR
77ffb593
JS
444 zip $ZIPFLAGS -r wxMSW-$VERSION.zip wxWidgets-$VERSION/*
445 cd wxWidgets-$VERSION
2ce79e48
JS
446
447 echo Generating $SETUPSCRIPTNAME
448 rm -f $SETUPSCRIPTNAME
449
450 sh $SCRIPTDIR/makeinno.sh $SETUPIMAGEDIR $INNOTOP $INNOBOTTOM $SETUPSCRIPTNAME
451
452 if [ ! -f $SETUPSCRIPTNAME ]; then
453 echo "*** Error - something went wrong with the script file generation."
454 exit 1
455 fi
456
457 # Now replace %VERSION% with the real application version, and other
458 # variables
459 echo Replacing variables in the setup script
460 doreplace $SETUPSCRIPTNAME "s/%VERSION%/$VERSION/g"
461 doreplace $SETUPSCRIPTNAME "s/%COPYRIGHTHOLDER%/$AUTHOR/g"
462 doreplace $SETUPSCRIPTNAME "s/%VENDOR%/$VENDOR/g"
463
464 unix2dosname $READMEFILE
465 doreplace $SETUPSCRIPTNAME "s;%READMEFILE%;$RETVALUE;g"
466
467 unix2dosname $READMEAFTERFILE
468 doreplace $SETUPSCRIPTNAME "s;%READMEAFTERFILE%;$RETVALUE;g"
469
470 unix2dosname $LICENSEFILE
471 doreplace $SETUPSCRIPTNAME "s;%LICENSEFILE%;$RETVALUE;g"
472
473 doreplace $SETUPSCRIPTNAME "s/%APPNAME%/$APPNAME/g"
474 doreplace $SETUPSCRIPTNAME "s/%APPTITLE%/$APPTITLE/g"
475
476 unix2dosname $SETUPIMAGEDIR
477 doreplace $SETUPSCRIPTNAME "s;%SOURCEDIR%;$RETVALUE;g"
478
479 unix2dosname $DESTDIR
480 doreplace $SETUPSCRIPTNAME "s;%OUTPUTDIR%;$RETVALUE;g"
481
482 doreplace $SETUPSCRIPTNAME "s/%APPEXTENSION%/$APPEXTENSION/g"
483
484 # FIXME: how do we get the first name in the list?
485 if [ "$MANUALFILES" != "" ]; then
486 HELPFILE=`basename $MANUALFILES`
487 unix2dosname $HELPFILE
488 doreplace $SETUPSCRIPTNAME "s;%HELPFILE%;$RETVALUE;g"
489 fi
490
491 rm -f $DESTDIR/setup*.*
492
493 # Inno Setup complains if this step is not done
494 unix2dos --unix2dos $SETUPSCRIPTNAME
495
496 # Now invoke INNO compiler on the new ISS file
497 # First, make a DOS filename or Inno Setup will get confused.
498
499 unix2dosname2 $SETUPSCRIPTNAME
500 DOSFILENAME=$RETVALUE
501
502 # Note: the double slash is Mingw32/MSYS convention for
503 # denoting a switch, that must not be converted into
504 # a path (otherwise /c = c:/)
505
506 cd `dirname $SETUPSCRIPTNAME`
507 BASESCRIPTNAME=`basename $SETUPSCRIPTNAME`
508 echo Invoking Inno Setup compiler on $BASESCRIPTNAME
509
510 "$SETUPCOMPILER" //cc $BASESCRIPTNAME
511
512 if [ ! -f $DESTDIR/setup.exe ]; then
513 echo "*** Error - the setup.exe was not generated."
514 exit
515 fi
516
517 cd $DESTDIR
518# mv setup.exe $APPNAME-$VERSION-setup.exe
519
520 echo Putting all the setup files into a single zip archive
521 zip wxMSW-$VERSION-setup.zip readme-$VERSION.txt setup*.*
522
77ffb593
JS
523 rm -f wxWidgets-$VERSION-win.zip
524 rm -f wxWidgets-$VERSION-ExtraDoc.zip
2ce79e48
JS
525
526 echo If you saw no warnings or errors, $APPTITLE was successfully spun.
527 echo
528}
529
530makesetup()
531{
532# if [ -d $SETUPIMAGEDIR ]; then
533# echo Removing contents of existing $SETUPIMAGEDIR
534# rm -f -r $SETUPIMAGEDIR/*
535# fi
536
537 if [ ! -d $SETUPIMAGEDIR ]; then
538 echo Making the $SETUPIMAGEDIR for preparing the setup
539 mkdir -p $SETUPIMAGEDIR
540 fi
541
542 # Copying readmes
543 if [ "$READMEFILE" != "" ] && [ -f $READMEFILE ]; then
544 echo Copying readme.txt
545 cp $READMEFILE $SETUPIMAGEDIR
546# else
547# echo "*** Warning - $READMEFILE not found"
548 fi
549
550 if [ "$LICENSEFILE" != "" ] && [ -f $LICENSEFILE ]; then
551 echo Copying licence.txt
552 cp $LICENSEFILE $SETUPIMAGEDIR
553 # else
554 # echo "*** Warning - $LICENSEFILE not found"
555 fi
556
557 if [ "$MAKEMANUAL" != "0" ]; then
558 if [ -d $MANUALDIR ]; then
559 cd $MANUALDIR
560 make
561 else
562 echo "*** Warning - $MANUALDIR not found"
563 fi
564 fi
565
566 rm -f $DESTDIR/wx*.zip
567 rm -f $DESTDIR/*.htb
568 rm -f $DESTDIR/ogl3*.zip
569 rm -f $DESTDIR/contrib*.zip
570 rm -f $DESTDIR/tex2rtf2*.zip
571 rm -f $DESTDIR/mmedia*.zip
572 rm -f $DESTDIR/jpeg*.zip
573 rm -f $DESTDIR/tiff*.zip
574 rm -f $DESTDIR/utils*.zip
575 rm -f $DESTDIR/extradoc*.zip
576 rm -f $DESTDIR/stc*.zip
577 rm -f $DESTDIR/*-win32*.zip
578 rm -f $DESTDIR/setup*.*
579 rm -f $DESTDIR/*.txt
580 rm -f $DESTDIR/make*
581
582 if [ -d $DESTDIR/wx ]; then
583 rm -f -r $DESTDIR/wx
584 fi
585
586 if [ ! -d $DESTDIR ]; then
587 mkdir $DESTDIR
588 fi
77ffb593
JS
589 if [ -d $DESTDIR/wxWidgets-$VERSION ]; then
590 rm -f -r $DESTDIR/wxWidgets-$VERSION
2ce79e48
JS
591 fi
592
593 # Copy FAQ from wxWebSite CVS
594 if [ ! -d $WEBFILES ]; then
595 echo Error - $WEBFILES does not exist
596 exit
597 fi
598
599 echo Copying FAQ and other files from $WEBFILES
600 cp $WEBFILES/site/faq*.htm $APPDIR/docs/html
601 cp $WEBFILES/site/platform.htm $APPDIR/docs/html
602 cp $WEBFILES/site/i18n.htm $APPDIR/docs/html
603
604 # Copy setup0.h files to setup.h
605 cp $APPDIR/include/wx/os2/setup0.h $APPDIR/include/wx/os2/setup.h
606 cp $APPDIR/include/wx/msw/setup0.h $APPDIR/include/wx/msw/setup.h
607 cp $APPDIR/include/wx/univ/setup0.h $APPDIR/include/wx/univ/setup.h
608
609 # Do OS/2 spin
610 if [ "$SPINOS2" = "1" ] || [ "$SPINALL" = "1" ]; then
611 dospinos2
612 fi
613
614 # Do Mac spin
615 if [ "$SPINMAC" = "1" ] || [ "$SPINALL" = "1" ]; then
616 dospinmac
617 fi
618
619 # Do MSW spin
620 if [ "$SPINMSW" = "1" ] || [ "$SPINALL" = "1" ]; then
621 dospinmsw
622 fi
623
0157e579
JS
624 # Do wxAll spin
625 if [ "$SPINWXALL" = "1" ] || [ "$SPINALL" = "1" ]; then
626 dospinwxall
627 fi
628
2ce79e48
JS
629 # Do docs spin
630 if [ "$SPINDOCS" = "1" ] || [ "$SPINALL" = "1" ]; then
631 dospindocs
632 fi
633
634 # Do misc files spin
635 dospinmisc
636
637 cp $APPDIR/docs/changes.txt $DESTDIR/changes-$VERSION.txt
c4839ccf
JS
638 cp $APPDIR/docs/readme.txt $DESTDIR/readme-$VERSION.txt
639
640 cp $APPDIR/docs/msw/readme.txt $DESTDIR/readme-msw-$VERSION.txt
2ce79e48 641 cp $APPDIR/docs/msw/install.txt $DESTDIR/install-msw-$VERSION.txt
c4839ccf
JS
642
643 cp $APPDIR/docs/mac/readme.txt $DESTDIR/readme-mac-$VERSION.txt
2ce79e48 644 cp $APPDIR/docs/mac/install.txt $DESTDIR/install-mac-$VERSION.txt
c4839ccf
JS
645
646 cp $APPDIR/docs/motif/readme.txt $DESTDIR/readme-motif-$VERSION.txt
2ce79e48 647 cp $APPDIR/docs/motif/install.txt $DESTDIR/install-motif-$VERSION.txt
c4839ccf
JS
648
649 cp $APPDIR/docs/gtk/readme.txt $DESTDIR/readme-gtk-$VERSION.txt
2ce79e48 650 cp $APPDIR/docs/gtk/install.txt $DESTDIR/install-gtk-$VERSION.txt
c4839ccf
JS
651
652 cp $APPDIR/docs/x11/readme.txt $DESTDIR/readme-x11-$VERSION.txt
653# cp $APPDIR/docs/x11/readme-nanox.txt $DESTDIR/readme-nanox-$VERSION.txt
2ce79e48 654 cp $APPDIR/docs/x11/install.txt $DESTDIR/install-x11-$VERSION.txt
c4839ccf 655
52f52ebc
JS
656 cp $APPDIR/docs/mgl/readme.txt $DESTDIR/readme-mgl-$VERSION.txt
657 cp $APPDIR/docs/mgl/install.txt $DESTDIR/install-mgl-$VERSION.txt
658
c4839ccf
JS
659 cp $APPDIR/docs/cocoa/readme.txt $DESTDIR/readme-cocoa-$VERSION.txt
660 cp $APPDIR/docs/cocoa/install.txt $DESTDIR/install-cocoa-$VERSION.txt
661
2ce79e48 662 cp $APPDIR/docs/base/readme.txt $DESTDIR/readme-base-$VERSION.txt
c4839ccf 663
2ce79e48 664 cp $APPDIR/docs/os2/install.txt $DESTDIR/install-os2-$VERSION.txt
c4839ccf 665
2ce79e48 666 cp $APPDIR/docs/univ/readme.txt $DESTDIR/readme-univ-$VERSION.txt
c4839ccf 667
2ce79e48 668 cp $APPDIR/docs/readme_vms.txt $DESTDIR/readme-vms-$VERSION.txt
c4839ccf 669
2ce79e48
JS
670 # cp $APPDIR/docs/motif/makewxmotif $DESTDIR/makewxmotif-$VERSION
671 # cp $APPDIR/docs/gtk/makewxgtk $DESTDIR/makewxgtk-$VERSION
672
673 # Time to regenerate the Inno Install script
674 if [ "$INNO" != "0" ]; then
675 dospinsetup
676 fi
677}
678
679# We can't use e.g. this:
77ffb593 680# ls `cat $SRC/distrib/msw/makefile.rsp` zip -@ -u $DEST/wxWidgets-$VERSION-gen.zip
2ce79e48
JS
681# because there's not enough space on the command line, plus we need to ignore the
682# blank lines.
683# So if we need to (not in this script so far) we do something like this instead:
684# expandlines $SRC/setup/files.rsp temp.txt
685# zip -@ `$CYGPATHPROG -w $DEST/archive.zip` < temp.txt
686
687expandlines()
688{
689 toexpand=$1
690 outputfile=$2
691
692 rm -f $outputfile
693 touch $outputfile
694 for line in `cat $toexpand` ; do
695 if [ $line != "" ]; then
696 ls $line >> $outputfile
697 fi
698 done
699}
700
701usage()
702{
703 echo "Usage: $PROGNAME [ options ]" 1>&2
704 echo Options:
705 echo " --help Display this help message"
706 echo " --upx Compress executable with UPX"
707 echo " --no-upx Do not compress executable with UPX"
708 echo " --inno Build the setup.exe"
709 echo " --no-inno Do not build the setup.exe"
710 echo " --wxmac Build wxMac distribution"
711 echo " --wxmsw Build wxMSW distribution"
712 echo " --wxos2 Build wxOS2 distribution"
0157e579 713 echo " --wxall Build wxAll zip distribution"
2ce79e48
JS
714 echo " --docs Build docs archives"
715 echo " --all Build all distributions (the default)"
b1c1e25b 716 echo " --verbose Verbose zip operation"
2ce79e48
JS
717 echo.
718 echo Note that options only override settings in $SCRIPTDIR/setup.var.
719 exit 1
720}
721
722# Process command line options.
723
724for i in "$@"; do
725 case "$i" in
726 --inno) INNO=1 ;;
727 --no-inno) INNO=0 ;;
728 --upx) UPX=1 ;;
729 --no-upx) UPX=0 ;;
730 --wxmac) SPINMAC=1; SPINALL=0 ;;
731 --wxmsw) SPINMSW=1; SPINALL=0 ;;
732 --wxos2) SPINOS2=1; SPINALL=0 ;;
0157e579 733 --wxall) SPINWXALL=1; SPINALL=0 ;;
2ce79e48
JS
734 --docs) SPINDOCS=1; SPINALL=0 ;;
735 --all) SPINALL=1 ;;
736 --verbose) VERBOSE=1 ;;
737 *)
738 usage
739 exit
740 ;;
741 esac
742done
743
744doinit
745
746# findversion
747makesetup
748