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