-
Notifications
You must be signed in to change notification settings - Fork 1
/
Buildit
436 lines (346 loc) · 11.1 KB
/
Buildit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
#!/bin/sh
VERSION=`grep kVersion revision.h | grep -o [:0123456789:].*[:0123456789:]`
##Build script for Darwin Streaming Server
if [ `uname` = "Darwin" ] ; then
PLATFORM=dss
else
PLATFORM=$VERSION
fi
SHOW_HELP=0
if [ "$1" = "-v" ] ; then
SHOW_HELP=1
fi
if [ "$1" = "-h" ] ; then
SHOW_HELP=1
fi
if [ "$1" = "?" ] ; then
SHOW_HELP=1
fi
if [ "$1" = "help" ] ; then
SHOW_HELP=1
fi
if [ $SHOW_HELP = 1 ] ; then
if [ $PLATFORM = dss ] ; then
echo ""
echo "OS X Darwin Streaming Server ($PLATFORM v$VERSION)"
echo ""
echo "buildit (builds target dss, symbols, build os, and cpu)"
echo "buildit dss arg2 (builds target dss, symbols, build os, and cpu, passes to xcode optional arg2)"
echo "buildit dssfat arg2 (builds target dss, symbols, build os, FAT i386+ppc, passes to xcode optional arg2)"
echo "buildit dssfullfat arg2 (builds target dss, symbols, build os, FAT i386+x86_64+ppc+ppc64, passes to xcode optional arg2)"
echo "buildit qtss arg2 (builds target qtss, stripped, build os, and cpu, passes to xcode optional arg2)"
echo "buildit qtssfat arg2 (builds target qtss, stripped, build os, FAT i386+ppc, passes to xcode optional arg2)"
echo "buildit qtssfullfat arg2 (builds target qtss, stripped, build os, FAT i386+x86_64+ppc+ppc64, passes to xcode optional arg2)"
fi
exit 0
fi
if [ "$1" = "install" ] ; then
if [ $PLATFORM = dss ] ; then
echo "OS X Darwin Streaming Server"
./BuildOSXInstallerPkg $2 $3
exit 0
fi
./buildtarball $PLATFORM
exit 0
fi
OSNAME=`uname`
HARDWARENAME=`uname -m`
PLAT=$OSNAME.$HARDWARENAME
echo "Darwin Streaming Server"
echo "-----------------------"
case $PLAT in
Linux.ppc)
echo "Configuring for the "$OSNAME" "$HARDWARENAME" platform"
CPLUS=gcc
CCOMP=gcc
LINKER='gcc'
MAKE=make
COMPILER_FLAGS="-D_REENTRANT -D__USE_POSIX -D__linuxppc__ -pipe"
INCLUDE_FLAG="-include"
CORE_LINK_LIBS="-lpthread -ldl -lstdc++ -lm -lcrypt"
SHARED=-shared
MODULE_LIBS=
if [ -f /usr/include/socketbits.h ]; then
NEED_SOCKETBITS=1
export NEED_SOCKETBITS
fi
;;
Linux.i586 | \
Linux.i686 | \
Linux.x86_64 )
echo "Configuring for the "$OSNAME" "$HARDWARENAME" platform"
CPLUS=gcc
CCOMP=gcc
LINKER='gcc'
MAKE=make
if [ "$PLAT" = "Linux.x86_64" ]; then
COMPILER_FLAGS="-D_REENTRANT -D__USE_POSIX -D__linux__ -pipe -fPIC -g"
else
COMPILER_FLAGS="-D_REENTRANT -D__USE_POSIX -D__linux__ -pipe"
fi
INCLUDE_FLAG="-include"
CORE_LINK_LIBS="-lpthread -ldl -luv -lstdc++ -lm -lcrypt"
SHARED=-shared
MODULE_LIBS=
if [ -f /usr/include/socketbits.h ]; then
NEED_SOCKETBITS=1
export NEED_SOCKETBITS
fi
;;
Linux.mips)
echo "Configuring for the "$OSNAME" "$HARDWARENAME" platform"
CPLUS=gcc
CCOMP=gcc
LINKER='egcs'
MAKE=make
COMPILER_FLAGS="-D_REENTRANT -D__linux__ -Wno-multichar -pipe"
INCLUDE_FLAG="-include"
CORE_LINK_LIBS="-lpthread -ldl -lm -lcrypt"
SHARED=-shared
MODULE_LIBS=
if [ -f /usr/include/socketbits.h ]; then
NEED_SOCKETBITS=1
export NEED_SOCKETBITS
fi
;;
FreeBSD.i386)
echo "Configuring for the "$OSNAME" "$HARDWARENAME" platform"
CPLUS=gcc
CCOMP=gcc
LINKER="gcc"
MAKE=make
COMPILER_FLAGS=
INCLUDE_FLAG="-include"
CORE_LINK_LIBS="-pthread -lm -lcrypt"
SHARED=-shared
MODULE_LIBS="-lgcc -lstdc++"
;;
# SunOS.sun4m | \
# SunOS.sun4u)
SunOS.*)
echo "Configuring for the "$OSNAME" "$HARDWARENAME" platform"
CPLUS=g++
CCOMP=gcc
LINKER="g++"
MAKE=make
COMPILER_FLAGS="-D__solaris__ -D_REENTRANT -DFD_SETSIZE=65536 -L/usr/local/lib -R/usr/local/lib"
INCLUDE_FLAG="-include"
CORE_LINK_LIBS="-lpthread -ldl -lsocket -lnsl -lresolv -lm -lcrypt -lstdc++"
SHARED=-G
MODULE_LIBS=
;;
IRIX*.*)
# IRIX with MipsPro compiler
# Change all references of Makefile.POSIX below to Makefile.IRIX
echo "Configuring for the "$OSNAME" "$HARDWARENAME" SGI platform"
CPLUS=CC
CCOMP=cc
LINKER="CC"
# GNU make is required. Obtain from freeware.sgi.com
MAKE=/usr/freeware/bin/gmake
# defines from PlatformHeader.h defined here as MipsPro does not support -include pre-processor directive
COMPILER_FLAGS="-D__sgi__ -DirixMipsPro -D_SGI_REENTRANT_FUNCTIONS -DASSERT -D__PTHREADS__ -D__PTHREADS_MUTEXES__ -DBIGENDIAN -DUSE_THREAD -DEXPORT -D_REENTRANT"
INCLUDE_FLAG=
CORE_LINK_LIBS="-ldl -lm -lcrypt -lpthread"
SHARED=-shared
MODULE_LIBS=
;;
HP-UX.*)
echo "Configuring for the "$OSNAME" "$HARDWARENAME" platform"
CPLUS=gcc
CCOMP=gcc
LINKER=gcc
MAKE=make
COMPILER_FLAGS="-D__hpux__ -g -fPIC"
INCLUDE_FLAG="-include"
CORE_LINK_LIBS="-lpthread -lnsl -lm -lcrypt -lstdc++"
SHARED=-shared
MODULE_LIBS="-lgcc -lstdc++"
;;
OSF1.alpha)
echo "Configuring for the "$OSNAME" "$HARDWARENAME" Tru64 UNIX platform"
CPLUS=`pwd`/my_tru64_cxx
CCOMP=`pwd`/my_tru64_cc
LINKER="cxx"
MAKE=/usr/local/bin/make
COMPILER_FLAGS="-D__osf__ -DTRUCLUSTER -pthread"
INCLUDE_FLAG="-FI"
CORE_LINK_LIBS="-lpthread -lclu -lm"
SHARED=-shared
MODULE_LIBS=
;;
"Darwin.i386" | \
"Darwin.Power Macintosh")
echo "Configuring for "$OSNAME" on "$HARDWARENAME". This is an OS X build of the QuickTimeStreamingServer."
;;
*)
echo "I don't know your platform. I'll assume this is a Linux x86 platform."
echo "Please edit the BuildServer script & PlatformHeader.h to add your platform."
CPLUS=gcc
CCOMP=gcc
LINKER='egcs'
MAKE=make
COMPILER_FLAGS=-D__linux__
INCLUDE_FLAG="-include"
CORE_LINK_LIBS="-lpthread -ldl -lm -lcrypt"
SHARED=-shared
MODULE_LIBS=
if [ -f /usr/include/socketbits.h ]; then
NEED_SOCKETBITS=1
export NEED_SOCKETBITS
fi
;;
esac
if [ "$*" = "install" ] ; then
if [ `uname` != "SunOS" ]; then
USERID=`id -u`
else
USERID=`/usr/xpg4/bin/id -u`
fi
if [ $USERID != 0 ]; then
echo "You must be root to perform an \"install\" build"
exit 1
fi
fi
echo Building for $PLAT with $CPLUS
if [ "${OSNAME}" = "Darwin" ]; then
BUILDTOOL=""
##xcodebuild should be the default for tiger
if [ -e /usr/bin/xcodebuild ] ; then
BUILDTOOL="xcodebuild"
if [ -e StreamingServer.xcodeproj ] ; then
PROJECT="-project StreamingServer.xcodeproj"
else
PROJECT="-project StreamingServer.xcode"
fi
fi
if [ BUILDTOOL = "" ] ; then
echo "XCode Development Tools are not installed"
exit 1
fi
if [ "$1" = "" ] ; then
echo "$BUILDTOOL DarwinStreamingServer"
$BUILDTOOL $PROJECT -target DSS -configuration Development
else
if [ "$1" = "dss" ] ; then
echo "$BUILDTOOL DarwinStreamingServer $1"
$BUILDTOOL $PROJECT -target DSS -configuration Development $2
else
if [ "$1" = "qtss" ] ; then
echo "$BUILDTOOL QuickTimeStreamingServer $*"
$BUILDTOOL $PROJECT -target QTSS -configuration Development $2
else
if [ "$1" = "qtssfat" ] ; then
echo "$BUILDTOOL QuickTimeStreamingServer FAT i386 ppc"
$BUILDTOOL $PROJECT -target QTSS -configuration Deployment RC_i386=YES RC_ppc=YES RC_CFLAGS='-arch i386 -arch ppc' $2
else
if [ "$1" = "qtssfullfat" ] ; then
echo "$BUILDTOOL QuickTimeStreamingServer FAT i386 ppc x86_64 ppc64"
$BUILDTOOL $PROJECT -target QTSS -configuration Deployment RC_RELEASE=YES RC_i386=YES RC_ppc=YES RC_x86_64=YES RC_ppc64=YES RC_CFLAGS='-arch i386 -arch ppc -arch x86_64 -arch ppc64' $2
else
if [ "$1" = "dssfat" ] ; then
echo "$BUILDTOOL DarwinStreamingServer FAT i386 ppc"
$BUILDTOOL $PROJECT -target DSS -configuration Development RC_i386=YES RC_ppc=YES RC_CFLAGS='-arch i386 -arch ppc' $2
else
if [ "$1" = "dssfullfat" ] ; then
echo "$BUILDTOOL DarwinStreamingServer FAT i386 ppc x86_64 ppc64"
$BUILDTOOL $PROJECT -target DSS -configuration Development RC_RELEASE=YES RC_i386=YES RC_ppc=YES RC_x86_64=YES RC_ppc64=YES RC_CFLAGS='-arch i386 -arch ppc -arch x86_64 -arch ppc64' $2
else
echo "build $BUILDTOOL $*"
$BUILDTOOL $*
fi
fi
fi
fi
fi
fi
fi
else
export CPLUS
export CCOMP
export LINKER
export COMPILER_FLAGS
export INCLUDE_FLAG
export CORE_LINK_LIBS
export SHARED
export MODULE_LIBS
echo Building CommonUtilitiesLib for $PLAT with $CPLUS
cd CommonUtilitiesLib/
$MAKE -f Makefile.POSIX $*
echo Building QTFileLib internal for $PLAT with $CPLUS
cd ../QTFileLib/
if [ "$*" = "clean" ] ; then
$MAKE -f Makefile.POSIX $*
else
$MAKE -f Makefile.POSIX all $*
fi
echo Building StreamingServer for $PLAT with $CPLUS
cd ..
$MAKE -f Makefile.POSIX $*
echo Building RefMovieModule for $PLAT with $CPLUS
cd APIModules/QTSSRefMovieModule/
$MAKE -f Makefile.POSIX $*
echo Building DemoAuthorizationModule for $PLAT with $CPLUS
cd ../QTSSDemoAuthorizationModule.bproj/
$MAKE -f Makefile.POSIX $*
echo Building RawFileModule for $PLAT with $CPLUS
cd ../QTSSRawFileModule.bproj/
$MAKE -f Makefile.POSIX $*
echo Building SpamDefenseModule for $PLAT with $CPLUS
cd ../QTSSSpamDefenseModule.bproj/
$MAKE -f Makefile.POSIX $*
echo Building HomeDirectoryModule for $PLAT with $CPLUS
cd ../QTSSHomeDirectoryModule/
$MAKE -f Makefile.POSIX $*
cd ..
echo Building StreamingProxy for $PLAT with $CPLUS
cd ../StreamingProxy.tproj/
$MAKE -f Makefile.POSIX $*
echo Building qtpasswd for $PLAT with $CPLUS
cd ../qtpasswd.tproj/
$MAKE -f Makefile.POSIX $*
echo Building PlaylistBroadcaster for $PLAT with $CPLUS
cd ../PlaylistBroadcaster.tproj/
$MAKE -f Makefile.POSIX $*
echo Building MP3Broadcaster for $PLAT with $CPLUS
cd ../MP3Broadcaster/
$MAKE -f Makefile.POSIX $*
echo Building QTFileTools for $PLAT with $CPLUS
cd ../QTFileTools/
echo Building QTBroadcaster for $PLAT with $CPLUS
cd QTBroadcaster.tproj/
$MAKE -f Makefile.POSIX $*
echo Building QTFileInfo for $PLAT with $CPLUS
cd ../QTFileInfo.tproj/
$MAKE -f Makefile.POSIX $*
echo Building QTFileTest for $PLAT with $CPLUS
cd ../QTFileTest.tproj/
$MAKE -f Makefile.POSIX $*
echo Building QTRTPFileTest for $PLAT with $CPLUS
cd ../QTRTPFileTest.tproj/
$MAKE -f Makefile.POSIX $*
echo Building QTRTPGen for $PLAT with $CPLUS
cd ../QTRTPGen.tproj/
$MAKE -f Makefile.POSIX $*
echo Building QTSDPGen for $PLAT with $CPLUS
cd ../QTSDPGen.tproj/
$MAKE -f Makefile.POSIX $*
echo Building QTSampleLister for $PLAT with $CPLUS
cd ../QTSampleLister.tproj/
$MAKE -f Makefile.POSIX $*
echo Building QTTrackInfo for $PLAT with $CPLUS
cd ../QTTrackInfo.tproj/
$MAKE -f Makefile.POSIX $*
cd ..
if [ -d ../StreamingLoadTool ]; then
echo Building StreamingLoadTool for $PLAT with $CPLUS
cd ../StreamingLoadTool/
$MAKE -f Makefile.POSIX $*
fi
if [ "$*" = "install" ] ; then
cd ..
pwdi
echo
./DSS_MakeRoot /
fi
fi