Statistics
| Branch: | Revision:

chunker-player / build_ul.sh @ 78068e21

History | View | Annotate | Download (7.46 KB)

1
#!/bin/bash
2
SCRIPT=$(readlink -f $0)
3
BASE_UL_DIR=`dirname $SCRIPT`
4
EXTERN_DIR="external_libs"
5
cd "$BASE_UL_DIR"
6

    
7
LIBTOOLIZE_PATH=`whereis -b libtoolize`
8
if [ "$LIBTOOLIZE_PATH" = "libtoolize:" ]; then
9
	echo "Can't find libtoolize. Try sudo apt-get install libtool"
10
	exit
11
fi
12

    
13
YASM_PATH=`whereis -b yasm`
14
if [ "$YASM_PATH" = "yasm:" ]; then
15
	echo "Can't find yasm assembler. Try sudo apt-get install yasm"
16
	exit
17
fi
18

    
19
#try to find libbz2 in your system
20
LOCAL_BZ2_A=`locate -l 1 libbz2.a`
21
if [ $LOCAL_BZ2_A = "" ]; then
22
    if [ -f "/usr/lib/libbz2.a" ]; then
23
	echo "You have file libbz2.a in default system"
24
	echo "setting path for it to default /usr/lib/libbz2.a"
25
	LOCAL_BZ2="/usr"
26
    else
27
	echo "you seem not to have file libbz2.a. EXITING."
28
	exit
29
    fi
30
else
31
    LOCAL_BZ2=`dirname $LOCAL_BZ2_A`/..
32
fi
33

    
34
#clean all external libraries if CLEAN_EXTERNAL_BUILD=1
35
if [ -n "$CLEAN_EXTERNAL_BUILD" ]; then
36
	#remove previuos versions of external libs builds
37
	rm -r -f $EXTERN_DIR
38
fi
39

    
40
mkdir $EXTERN_DIR
41

    
42
if [ -n "$BUILD_X264" ]; then
43
	cd "$BASE_UL_DIR/$EXTERN_DIR"
44
	rm -r -f x264
45
	#get and compile latest x264 library
46
	git clone git://git.videolan.org/x264.git
47
	cd x264
48
	#make and simulate install in local folder
49
	./configure --prefix="$BASE_UL_DIR/$EXTERN_DIR/x264/temp_x264_install"
50
	make; make install
51
fi
52

    
53
if [ -n "$BUILD_MP3LAME" ]; then
54
	cd "$BASE_UL_DIR/$EXTERN_DIR"
55
	rm -r -f mp3lame
56
	#get and compile latest mp3lame library
57
	rm -f lame-3.98.4.tar.gz
58
	wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz/download; tar xzf lame-3.98.4.tar.gz; mv lame-3.98.4 mp3lame;
59
	cd mp3lame
60
	#make and simulate install in local folder
61
	./configure --disable-gtktest --disable-frontend --prefix="$BASE_UL_DIR/$EXTERN_DIR/mp3lame/temp_mp3lame_install"
62
	make; make install
63
fi
64

    
65
if [ -n "$BUILD_FFMPEG" ]; then
66
	cd "$BASE_UL_DIR/$EXTERN_DIR"
67
	rm -r -f ffmpeg
68
	#get and compile ffmpeg with x264 support
69
	#get latest snapshot
70
	rm -f ffmpeg-checkout-snapshot.tar.bz2
71
	wget http://ffmpeg.org/releases/ffmpeg-checkout-snapshot.tar.bz2; tar xjf ffmpeg-checkout-snapshot.tar.bz2; mv ffmpeg-checkout-20* ffmpeg
72
	#do not get latest snapshot
73
	#get instead a specific one because allows output video rate resampling
74
	#svn -r 21010 checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
75
	cd ffmpeg
76
	./configure --enable-gpl --enable-nonfree --enable-version3 --enable-libmp3lame --enable-libx264 --enable-pthreads --extra-cflags="-I../x264/temp_x264_install/include -I../mp3lame/temp_mp3lame_install/include" --extra-ldflags="-L../x264/temp_x264_install/lib -L../mp3lame/temp_mp3lame_install/lib"
77
	make
78
fi
79

    
80
if [ -n "$BUILD_MHD" ]; then
81
	cd "$BASE_UL_DIR/$EXTERN_DIR"
82
	rm -r -f libmicrohttpd
83
	#get and compile libmicrohttpd lib
84
	svn --trust-server-cert --non-interactive checkout https://ng.gnunet.org/svn/libmicrohttpd
85
	cd libmicrohttpd
86
	autoreconf -fi
87
	./configure --disable-curl --disable-https --enable-messages --disable-client-side --prefix="$BASE_UL_DIR/$EXTERN_DIR/libmicrohttpd/temp_mhd_install"
88
	make; make install
89
fi
90

    
91
if [ -n "$BUILD_SDL" ]; then
92
	cd "$BASE_UL_DIR/$EXTERN_DIR"
93
	rm -r -r sdl
94
	#get and compile SDL lib
95
	rm -f SDL-1.2.14.tar.gz
96
	wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz; tar xzf SDL-1.2.14.tar.gz; mv SDL-1.2.14 sdl
97
	cd sdl
98
	#make and simulate install in local folder
99
	./configure --disable-video-directfb --prefix="$BASE_UL_DIR/$EXTERN_DIR/sdl/temp_sdl_install"
100
	make; make install
101
fi
102

    
103
if [ -n "$BUILD_SDLIMAGE" ]; then
104
	cd "$BASE_UL_DIR/$EXTERN_DIR"
105
	rm -r -r sdlimage
106
	#get and compile SDLIMAGE lib
107
	rm -f SDL_image-1.2.10.tar.gz
108
	wget http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.tar.gz; tar xzf SDL_image-1.2.10.tar.gz; mv SDL_image-1.2.10 sdlimage
109
	cd sdlimage
110
	#make and simulate install in local folder
111
	./configure --prefix="$BASE_UL_DIR/$EXTERN_DIR/sdlimage/temp_sdlimage_install"
112
	make; make install
113
fi
114

    
115
if [ -n "$BUILD_CURL" ]; then
116
	cd "$BASE_UL_DIR/$EXTERN_DIR"
117
	rm -r -r curl
118
	#get and compile CURL lib
119
	rm -f curl-7.21.0.tar.bz2
120
	wget http://curl.haxx.se/download/curl-7.21.0.tar.bz2; tar xjf curl-7.21.0.tar.bz2; mv curl-7.21.0 curl
121
	cd curl
122
	#make and simulate install in local folder
123
	./configure --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --without-libssh2 --without-ssl --without-krb4 --enable-static --disable-shared --without-zlib --without-libidn --prefix="$BASE_UL_DIR/$EXTERN_DIR/curl/temp_curl_install"
124
	make; make install
125
fi
126

    
127
#set needed paths to external libraries
128
echo "-----"
129
LOCAL_X264="$BASE_UL_DIR/$EXTERN_DIR/x264/temp_x264_install"
130
echo "path for X264 dependancy set to $LOCAL_X264"
131
LOCAL_MP3LAME="$BASE_UL_DIR/$EXTERN_DIR/mp3lame/temp_mp3lame_install"
132
echo "path for MP3LAME dependancy set to $LOCAL_MP3LAME"
133
LOCAL_FFMPEG="$BASE_UL_DIR/$EXTERN_DIR/ffmpeg"
134
echo "path for FFMPEG dependancy set to $LOCAL_FFMPEG"
135
LOCAL_MHD="$BASE_UL_DIR/$EXTERN_DIR/libmicrohttpd/temp_mhd_install"
136
echo "path for LIBMICROHTTPD dependancy set to $LOCAL_MHD"
137
LOCAL_ABS_SDL="$BASE_UL_DIR/$EXTERN_DIR/sdl/temp_sdl_install"
138
echo "path for SDL dependancy set to $LOCAL_ABS_SDL"
139
LOCAL_SDLIMAGE="$BASE_UL_DIR/$EXTERN_DIR/sdlimage/temp_sdlimage_install"
140
echo "path for SDLIMAGE dependancy set to $LOCAL_SDLIMAGE"
141
LOCAL_CURL="$BASE_UL_DIR/$EXTERN_DIR/curl/temp_curl_install"
142
echo "path for CURL dependancy set to $LOCAL_CURL"
143

    
144
echo "path for BZ2 dependancy is set to $LOCAL_BZ2"
145
echo "-----"
146

    
147
#compile the UL external applications
148
#CHUNKER_STREAMER
149
echo "----------------COMPILING CHUNKER STREAMER"
150
cd "$BASE_UL_DIR"
151
cd chunker_streamer
152
if [ -d "$BASE_UL_DIR/../../3RDPARTY-LIBS/libconfuse" ]; then
153
    LOCAL_CONFUSE="$BASE_UL_DIR/../../3RDPARTY-LIBS/libconfuse"
154
    echo "found LIBCONFUSE in $LOCAL_CONFUSE"
155
else
156
    LOCAL_CONFUSE_A=`locate -l 1 libconfuse.a`
157
    if [ "$LOCAL_CONFUSE_A" = "" ]; then
158
        if [ -f "/usr/lib/libconfuse.a" ]; then
159
	    echo "You have file libconfuse.a in default system"
160
	    echo "setting path for it to default /usr/lib/libconfuse.a"
161
	    LOCAL_CONFUSE="/usr"
162
	else
163
	    echo "you seem not to have file libconfuse.a. EXITING."
164
	    exit
165
	fi
166
    else
167
	LOCAL_CONFUSE=`dirname $LOCAL_CONFUSE_A`/..
168
    fi
169
fi
170
make clean
171
LOCAL_X264=$LOCAL_X264 LOCAL_MP3LAME=$LOCAL_MP3LAME LOCAL_FFMPEG=$LOCAL_FFMPEG LOCAL_BZ2=$LOCAL_BZ2 LOCAL_CURL=$LOCAL_CURL LOCAL_CONFUSE=$LOCAL_CONFUSE make
172
echo "----------------FINISHED COMPILING CHUNKER STREAMER"
173
#CHUNKER_PLAYER
174
echo "----------------COMPILING CHUNKER PLAYER"
175
cd "$BASE_UL_DIR"
176
cd chunker_player
177
make clean
178
LOCAL_X264=$LOCAL_X264 LOCAL_MP3LAME=$LOCAL_MP3LAME LOCAL_FFMPEG=$LOCAL_FFMPEG LOCAL_BZ2=$LOCAL_BZ2 LOCAL_MHD=$LOCAL_MHD LOCAL_ABS_SDL=$LOCAL_ABS_SDL LOCAL_SDLIMAGE=$LOCAL_SDLIMAGE LOCAL_CONFUSE=$LOCAL_CONFUSE make
179
echo "----------------FINISHED COMPILING CHUNKER PLAYER"
180

    
181
#compile a version of offerstreamer with UL enabled
182
#static needs fix??
183
cd "$BASE_UL_DIR/../OfferStreamer"
184
make clean
185
if [ -d "$BASE_UL_DIR/../../3RDPARTY-LIBS/libevent" ]; then
186
    LOCAL_EVENT="$BASE_UL_DIR/../../3RDPARTY-LIBS/libevent"
187
    echo "found LIBEVENT in $LOCAL_EVENT"
188
else
189
    LOCAL_EVENT_A=`locate -l 1 libevent.a`
190
    if [ "$LOCAL_EVENT_A" = "" ]; then
191
        if [ -f "/usr/lib/libevent.a" ]; then
192
	    echo "You have file libevent.a in default system"
193
	    echo "setting path for it to default /usr/lib/libevent.a"
194
	    LOCAL_EVENT="/usr"
195
	else
196
	    echo "you seem not to have file libevent.a. EXITING."
197
	    exit
198
	fi
199
    else
200
	LOCAL_EVENT=`dirname $LOCAL_EVENT_A`/..
201
    fi
202
fi
203
ULPLAYER=$BASE_UL_DIR ULPLAYER_EXTERNAL_LIBS=$EXTERN_DIR LIBEVENT_DIR=$LOCAL_EVENT ML=1 STATIC= MONL=1 HTTPIO=1 DEBUG=1 make