]> git.saurik.com Git - wxWidgets.git/blob - distrib/scripts/unix/maketarballs
Stop building on a platform as soon as a tarball build error is encountered.
[wxWidgets.git] / distrib / scripts / unix / maketarballs
1 #!/bin/sh
2 # Makes the wxWidgets tarballs with 'make dist'
3
4 set -o errexit
5
6 PROGNAME=$0
7 WXSRC=$1
8 WXDEST=$2
9 WXVER=$3
10
11 # for docopyreadmefiles and docopysetup_h
12 SCRIPTDIR=$WXSRC/distrib/scripts
13 . $SCRIPTDIR/utils.inc
14
15 doupdatecvs()
16 {
17 cd $WXSRC
18 echo Updating from CVS...
19 cvswx update -d -P
20 }
21
22 dospinwxgtk()
23 {
24 echo Making wxGTK tarballs...
25
26 if [ ! -d $WXDEST ]; then
27 mkdir $WXDEST
28 fi
29
30 rm -f -r $WXDEST/wxgtk
31 mkdir $WXDEST/wxgtk
32 mkdir $WXDEST/wxgtk/release
33
34 cd $WXSRC
35 cd locale
36 make allmo
37 cd $WXDEST/wxgtk/release
38 echo Configuring...
39 $WXSRC/configure --no-recursion
40 echo Making...
41 make -j1 dist bzip-dist-only
42 mv $WXDEST/wxgtk/release/*.gz $WXDEST/wxgtk/release/*.bz2 $WXDEST
43 }
44
45 dospinwxmgl()
46 {
47 echo Making wxMGL tarballs...
48
49 if [ ! -d $WXDEST ]; then
50 mkdir $WXDEST
51 fi
52
53 rm -f -r $WXDEST/wxmgl
54 mkdir $WXDEST/wxmgl
55 mkdir $WXDEST/wxmgl/release
56
57 cd $WXSRC
58 cd locale
59 make allmo
60 cd $WXDEST/wxmgl/release
61 echo Configuring...
62 $WXSRC/configure --no-recursion --with-mgl
63 echo Making...
64 make -j1 dist bzip-dist-only
65 mv $WXDEST/wxmgl/release/*.gz $WXDEST/wxmgl/release/*.bz2 $WXDEST
66 }
67
68 dospinwxbase()
69 {
70 echo Making wxBase tarballs...
71
72 if [ ! -d $WXDEST ]; then
73 mkdir $WXDEST
74 fi
75
76 rm -f -r $WXDEST/wxbase
77 mkdir $WXDEST/wxbase
78 mkdir $WXDEST/wxbase/release
79
80 cd $WXSRC
81 cd locale
82 make allmo
83 cd $WXDEST/wxbase/release
84 echo Configuring...
85 $WXSRC/configure --no-recursion --disable-gui
86 echo Making...
87 make -j1 dist bzip-dist-only
88 mv $WXDEST/wxbase/release/*.gz $WXDEST/wxbase/release/*.bz2 $WXDEST
89 }
90
91 dospinwxx11()
92 {
93 echo Making wxX11 tarballs...
94
95 if [ ! -d $WXDEST ]; then
96 mkdir $WXDEST
97 fi
98
99 rm -f -r $WXDEST/wxx11
100 mkdir $WXDEST/wxx11
101 mkdir $WXDEST/wxx11/release
102
103 cd $WXSRC
104 cd locale
105 make allmo
106 cd $WXDEST/wxx11/release
107 echo Configuring...
108 $WXSRC/configure --with-x11 --no-recursion
109 echo Making...
110 make -j1 dist bzip-dist-only
111
112 cp $WXDEST/wxx11/release/*.tar.gz $WXDEST
113 cp $WXDEST/wxx11/release/*.tar.bz2 $WXDEST
114 }
115
116 dospinwxmotif()
117 {
118 echo Making wxMotif tarballs...
119
120 if [ ! -d $WXDEST ]; then
121 mkdir $WXDEST
122 fi
123
124 rm -f -r $WXDEST/wxmotif
125 mkdir $WXDEST/wxmotif
126 mkdir $WXDEST/wxmotif/release
127
128 cd $WXSRC
129 cd locale
130 make allmo
131 cd $WXDEST/wxmotif/release
132 echo Configuring...
133 $WXSRC/configure --with-motif --no-recursion
134 echo Making...
135 make -j1 dist bzip-dist-only
136
137 cp $WXDEST/wxmotif/release/*.tar.gz $WXDEST
138 cp $WXDEST/wxmotif/release/*.tar.bz2 $WXDEST
139
140 echo Rearchiving wxMotif tarballs to change wxMOTIF to wxMotif...
141 cd $WXDEST
142 mkdir wxMotif.tmp
143 cd wxMotif.tmp
144 rm -f -r *
145 tar xfz ../wxMOTIF-$WXVER.tar.gz
146 mv wxMOTIF-$WXVER wxMotif-$WXVER
147 rm -f ../wxMOTIF-$WXVER.tar.gz
148 rm -f ../wxMOTIF-$WXVER.tar.bz2
149 tar cf ../wxMotif-$WXVER.tar *
150 gzip -c ../wxMotif-$WXVER.tar > ../wxMotif-$WXVER.tar.gz
151 bzip2 -f9 ../wxMotif-$WXVER.tar
152 cd ..
153 rm -f -r wxMotif.tmp
154 # rm -f -r $WXDEST/wxmotif
155 }
156
157 dospindocs()
158 {
159 mkdir -p $WXSRC/docs/html/wx
160 mkdir -p $WXSRC/docs/html/tex2rtf
161 mkdir -p $WXSRC/docs/html/fl
162 mkdir -p $WXSRC/docs/html/ogl
163 mkdir -p $WXSRC/docs/htb
164
165 rm -f -r $WXSRC/docs/html/wx/*.htm*
166 rm -f -r $WXSRC/docs/htb/wx.htb
167
168 echo Making HTML wxWidgets manual...
169 cd $WXSRC/docs/latex/wx
170 cp *.gif $WXSRC/docs/html/wx
171 tex2rtf manual.tex $WXSRC/docs/html/wx/wx.htm -twice -html
172
173 echo Making HTB wxWidgets manual...
174 cd $WXSRC/docs/html/wx
175 zip -q $WXSRC/docs/htb/wx.htb *.html *.gif *.hhp *.hhc *.hhk
176
177 echo Archiving manuals...
178 # TODO
179
180 echo Done making manuals.
181 }
182
183 SPINWXX11=0
184 SPINWXGTK=0
185 SPINWXMOTIF=0
186 SPINWXMAC=0
187 SPINWXBASE=0
188 SPINWXMGL=0
189 SPINDOCS=0
190 SPINEVERYTHING=0
191 UPDATECVS=0
192 SILENT=0
193
194 usage()
195 {
196 echo Usage: $PROGNAME "src-dir dest-dir version-number [ options ]"
197 echo Options:
198 echo " --help Display this help message"
199 echo " --wxgtk Spin wxGTK"
200 echo " --wxbase Spin wxBase"
201 echo " --wxx11 Spin wxX11"
202 echo " --wxmotif Spin wxMotif"
203 echo " --wxmgl Spin wxMGL"
204 echo " --docs Spin docs"
205 echo " --all Spin EVERYTHING"
206 echo " --updatecvs Update from CVS"
207
208 exit 1
209 }
210
211 init=""
212 if [ "$1" = "" ]
213 then
214 usage
215 exit
216 fi
217
218 if [ "$2" = "" ]
219 then
220 usage
221 exit
222 fi
223
224 if [ "$3" = "" ]
225 then
226 usage
227 exit
228 fi
229
230 # Process command line options.
231 shift 3
232 for i in "$@"; do
233 case "$i" in
234 --wxx11) SPINWXX11=1 ;;
235 --wxgtk) SPINWXGTK=1 ;;
236 --wxmac) SPINWXMAC=1 ;;
237 --wxbase) SPINWXBASE=1 ;;
238 --wxmgl) SPINWXMGL=1 ;;
239 --wxmotif) SPINWXMOTIF=1 ;;
240 --all) SPINEVERYTHING=1 ;;
241 --updatecvs) UPDATECVS=1 ;;
242 --silent) SILENT=1 ;;
243 *)
244 usage
245 exit
246 ;;
247 esac
248 done
249
250 # we don't want this when batch building tarballs.
251 if [ "$SILENT" = "0" ]; then
252 echo CTRL-C if this is not correct.
253 read dummy
254 fi
255
256 if [ "$UPDATECVS" = "1" ]; then
257 doupdatecvs
258 fi
259
260 if [ "$SPINWXX11" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
261 dospinwxx11
262 fi
263
264 if [ "$SPINWXGTK" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
265 dospinwxgtk
266 fi
267
268 if [ "$SPINWXMOTIF" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
269 dospinwxmotif
270 fi
271
272 if [ "$SPINWXMAC" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
273 dospinwxmac
274 fi
275
276 if [ "$SPINWXMGL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
277 dospinwxmgl
278 fi
279
280 if [ "$SPINWXBASE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
281 dospinwxbase
282 fi
283
284 if [ "$SPINDOCS" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
285 dospindocs
286 fi