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