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