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