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