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