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