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