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