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