Statistics
| Branch: | Revision:

chunker-player / build_ul.sh @ 78068e21

History | View | Annotate | Download (7.46 KB)

1 1538a3bd GiuseppeTropea
#!/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 870d410a GiuseppeTropea
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 d06e13db GiuseppeTropea
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 9f668f32 GiuseppeTropea
#try to find libbz2 in your system
20 870d410a GiuseppeTropea
LOCAL_BZ2_A=`locate -l 1 libbz2.a`
21 9f668f32 GiuseppeTropea
if [ $LOCAL_BZ2_A = "" ]; then
22
    if [ -f "/usr/lib/libbz2.a" ]; then
23
	echo "You have file libbz2.a in default system"
24 1538a3bd GiuseppeTropea
	echo "setting path for it to default /usr/lib/libbz2.a"
25 9f668f32 GiuseppeTropea
	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 1538a3bd GiuseppeTropea
fi
33
34 ff3fddf2 GiuseppeTropea
#clean all external libraries if CLEAN_EXTERNAL_BUILD=1
35 1538a3bd GiuseppeTropea
if [ -n "$CLEAN_EXTERNAL_BUILD" ]; then
36
	#remove previuos versions of external libs builds
37
	rm -r -f $EXTERN_DIR
38
fi
39
40 a046bebf GiuseppeTropea
mkdir $EXTERN_DIR
41
42 1538a3bd GiuseppeTropea
if [ -n "$BUILD_X264" ]; then
43
	cd "$BASE_UL_DIR/$EXTERN_DIR"
44 ff3fddf2 GiuseppeTropea
	rm -r -f x264
45
	#get and compile latest x264 library
46 1538a3bd GiuseppeTropea
	git clone git://git.videolan.org/x264.git
47
	cd x264
48
	#make and simulate install in local folder
49 9f668f32 GiuseppeTropea
	./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 1538a3bd GiuseppeTropea
	make; make install
63
fi
64
65
if [ -n "$BUILD_FFMPEG" ]; then
66
	cd "$BASE_UL_DIR/$EXTERN_DIR"
67 ff3fddf2 GiuseppeTropea
	rm -r -f ffmpeg
68 1538a3bd GiuseppeTropea
	#get and compile ffmpeg with x264 support
69 ff3fddf2 GiuseppeTropea
	#get latest snapshot
70 e27711c4 GiuseppeTropea
	rm -f ffmpeg-checkout-snapshot.tar.bz2
71 1538a3bd GiuseppeTropea
	wget http://ffmpeg.org/releases/ffmpeg-checkout-snapshot.tar.bz2; tar xjf ffmpeg-checkout-snapshot.tar.bz2; mv ffmpeg-checkout-20* ffmpeg
72 ff3fddf2 GiuseppeTropea
	#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 1538a3bd GiuseppeTropea
	cd ffmpeg
76 9f668f32 GiuseppeTropea
	./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 1538a3bd GiuseppeTropea
	make
78
fi
79
80
if [ -n "$BUILD_MHD" ]; then
81
	cd "$BASE_UL_DIR/$EXTERN_DIR"
82 ff3fddf2 GiuseppeTropea
	rm -r -f libmicrohttpd
83 1538a3bd GiuseppeTropea
	#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 9f668f32 GiuseppeTropea
	./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 1538a3bd GiuseppeTropea
fi
90
91
if [ -n "$BUILD_SDL" ]; then
92
	cd "$BASE_UL_DIR/$EXTERN_DIR"
93 9f668f32 GiuseppeTropea
	rm -r -r sdl
94 1538a3bd GiuseppeTropea
	#get and compile SDL lib
95 e27711c4 GiuseppeTropea
	rm -f SDL-1.2.14.tar.gz
96 9f668f32 GiuseppeTropea
	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 1538a3bd GiuseppeTropea
	#make and simulate install in local folder
99 9f668f32 GiuseppeTropea
	./configure --disable-video-directfb --prefix="$BASE_UL_DIR/$EXTERN_DIR/sdl/temp_sdl_install"
100 1538a3bd GiuseppeTropea
	make; make install
101
fi
102
103 e27711c4 GiuseppeTropea
if [ -n "$BUILD_SDLIMAGE" ]; then
104
	cd "$BASE_UL_DIR/$EXTERN_DIR"
105 9f668f32 GiuseppeTropea
	rm -r -r sdlimage
106 e27711c4 GiuseppeTropea
	#get and compile SDLIMAGE lib
107
	rm -f SDL_image-1.2.10.tar.gz
108 9f668f32 GiuseppeTropea
	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 e27711c4 GiuseppeTropea
	#make and simulate install in local folder
111 9f668f32 GiuseppeTropea
	./configure --prefix="$BASE_UL_DIR/$EXTERN_DIR/sdlimage/temp_sdlimage_install"
112 e27711c4 GiuseppeTropea
	make; make install
113
fi
114
115
if [ -n "$BUILD_CURL" ]; then
116
	cd "$BASE_UL_DIR/$EXTERN_DIR"
117 9f668f32 GiuseppeTropea
	rm -r -r curl
118 e27711c4 GiuseppeTropea
	#get and compile CURL lib
119
	rm -f curl-7.21.0.tar.bz2
120 9f668f32 GiuseppeTropea
	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 e27711c4 GiuseppeTropea
	#make and simulate install in local folder
123 d06e13db GiuseppeTropea
	./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 e27711c4 GiuseppeTropea
	make; make install
125
fi
126
127 1538a3bd GiuseppeTropea
#set needed paths to external libraries
128
echo "-----"
129 9f668f32 GiuseppeTropea
LOCAL_X264="$BASE_UL_DIR/$EXTERN_DIR/x264/temp_x264_install"
130 1538a3bd GiuseppeTropea
echo "path for X264 dependancy set to $LOCAL_X264"
131 9f668f32 GiuseppeTropea
LOCAL_MP3LAME="$BASE_UL_DIR/$EXTERN_DIR/mp3lame/temp_mp3lame_install"
132
echo "path for MP3LAME dependancy set to $LOCAL_MP3LAME"
133 1538a3bd GiuseppeTropea
LOCAL_FFMPEG="$BASE_UL_DIR/$EXTERN_DIR/ffmpeg"
134
echo "path for FFMPEG dependancy set to $LOCAL_FFMPEG"
135 9f668f32 GiuseppeTropea
LOCAL_MHD="$BASE_UL_DIR/$EXTERN_DIR/libmicrohttpd/temp_mhd_install"
136 1538a3bd GiuseppeTropea
echo "path for LIBMICROHTTPD dependancy set to $LOCAL_MHD"
137 9f668f32 GiuseppeTropea
LOCAL_ABS_SDL="$BASE_UL_DIR/$EXTERN_DIR/sdl/temp_sdl_install"
138 1538a3bd GiuseppeTropea
echo "path for SDL dependancy set to $LOCAL_ABS_SDL"
139 9f668f32 GiuseppeTropea
LOCAL_SDLIMAGE="$BASE_UL_DIR/$EXTERN_DIR/sdlimage/temp_sdlimage_install"
140 e27711c4 GiuseppeTropea
echo "path for SDLIMAGE dependancy set to $LOCAL_SDLIMAGE"
141 9f668f32 GiuseppeTropea
LOCAL_CURL="$BASE_UL_DIR/$EXTERN_DIR/curl/temp_curl_install"
142 e27711c4 GiuseppeTropea
echo "path for CURL dependancy set to $LOCAL_CURL"
143 1538a3bd GiuseppeTropea
144
echo "path for BZ2 dependancy is set to $LOCAL_BZ2"
145
echo "-----"
146
147
#compile the UL external applications
148 e27711c4 GiuseppeTropea
#CHUNKER_STREAMER
149
echo "----------------COMPILING CHUNKER STREAMER"
150 1538a3bd GiuseppeTropea
cd "$BASE_UL_DIR"
151
cd chunker_streamer
152 e27711c4 GiuseppeTropea
if [ -d "$BASE_UL_DIR/../../3RDPARTY-LIBS/libconfuse" ]; then
153 9f668f32 GiuseppeTropea
    LOCAL_CONFUSE="$BASE_UL_DIR/../../3RDPARTY-LIBS/libconfuse"
154
    echo "found LIBCONFUSE in $LOCAL_CONFUSE"
155 e27711c4 GiuseppeTropea
else
156 870d410a GiuseppeTropea
    LOCAL_CONFUSE_A=`locate -l 1 libconfuse.a`
157 9f668f32 GiuseppeTropea
    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 e27711c4 GiuseppeTropea
	fi
166 9f668f32 GiuseppeTropea
    else
167
	LOCAL_CONFUSE=`dirname $LOCAL_CONFUSE_A`/..
168
    fi
169 e27711c4 GiuseppeTropea
fi
170 1538a3bd GiuseppeTropea
make clean
171 870d410a GiuseppeTropea
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 e27711c4 GiuseppeTropea
echo "----------------FINISHED COMPILING CHUNKER STREAMER"
173
#CHUNKER_PLAYER
174
echo "----------------COMPILING CHUNKER PLAYER"
175 1538a3bd GiuseppeTropea
cd "$BASE_UL_DIR"
176
cd chunker_player
177
make clean
178 78068e21 GiuseppeTropea
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 e27711c4 GiuseppeTropea
echo "----------------FINISHED COMPILING CHUNKER PLAYER"
180 1538a3bd GiuseppeTropea
181
#compile a version of offerstreamer with UL enabled
182 ff3fddf2 GiuseppeTropea
#static needs fix??
183 1538a3bd GiuseppeTropea
cd "$BASE_UL_DIR/../OfferStreamer"
184
make clean
185 9f668f32 GiuseppeTropea
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 870d410a GiuseppeTropea
    LOCAL_EVENT_A=`locate -l 1 libevent.a`
190 9f668f32 GiuseppeTropea
    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