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