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