3 # Use curl on Mac OS X since it's always installed, and assume wget
4 # is installed for all other systems
30 # Wget rule: downloads $(<) from the link in $(>)
38 $(WGET) $(<) `cat $(>)` &&
39 ( touch $(<) || true )
51 cd `dirname $(>)` && CONTRIB=`pwd` &&
52 rm -rf a52dec && (gzip -dc a52dec.tar.gz | tar xf -) &&
53 cd a52dec && $(PATCH) -p1 < ../patch-a52dec.patch &&
54 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install &&
55 $(STRIP) $CONTRIB/lib/liba52.a
57 Wget $(SUBDIR)/a52dec.tar.gz : $(SUBDIR)/version_a52dec.txt ;
58 LibA52 $(SUBDIR)/lib/liba52.a : $(SUBDIR)/a52dec.tar.gz ;
69 cd `dirname $(>)` && CONTRIB=`pwd` &&
70 rm -rf faad2 && (gzip -dc faad2.tar.gz | tar xf -) &&
71 cd faad2 && $(PATCH) -p1 < ../patch-faad2-libtool22.patch &&
72 ./bootstrap && ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared && $(MAKE) && $(MAKE) install
74 Wget $(SUBDIR)/faad2.tar.gz : $(SUBDIR)/version_faad2.txt ;
75 LibFaad2 $(SUBDIR)/lib/libfaad.a : $(SUBDIR)/faad2.tar.gz ;
80 FFMPEG_PATCH = "$(PATCH) -p0 < ../patch-ffmpeg.patch" ;
81 FFMPEG_PATCH += " && $(PATCH) -p0 < ../patch-ffmpeg-latm.patch " ;
82 FFMPEG_PATCH += " && $(PATCH) -p0 < ../patch-ffmpeg-mpegleak.patch " ;
85 FFMPEG_PATCH += " && $(PATCH) -p1 < ../patch-ffmpeg-cygwin.patch " ;
87 else if $(OS) = SOLARIS
89 FFMPEG_PATCH += " && $(PATCH) -p1 < ../patch-ffmpeg-solaris.patch " ;
95 # Not all of ffmpeg works on Solaris - disable the bits that
96 # don't. When we get new versions of FFMPEG we can try enabling
99 FFMPEG_EXTRA_OPTIONS = "--disable-vis --disable-demuxer=mpc8 --disable-vhook" ;
102 Depends $(<) : $(>) ;
107 cd `dirname $(>)` && CONTRIB=`pwd` &&
108 rm -rf ffmpeg && (gzip -dc ffmpeg.tar.gz | tar xf -) &&
109 cd ffmpeg && $(FFMPEG_PATCH) &&
110 ./configure --prefix=$CONTRIB --enable-gpl --enable-pthreads --enable-swscale \
111 --disable-shared --enable-static --disable-encoders \
112 --enable-encoder=mpeg4 --enable-encoder=ac3 --enable-encoder=snow \
113 --enable-libfaad --disable-ffmpeg --disable-ffserver \
114 --disable-muxers --enable-muxer=ipod --disable-bsfs \
115 --extra-cflags="-I$CONTRIB/include" \
116 --extra-ldflags="-L$CONTRIB/lib" $(FFMPEG_EXTRA_OPTIONS) &&
117 $(MAKE) && $(MAKE) install &&
118 $(STRIP) $CONTRIB/lib/libavcodec.a
120 Wget $(SUBDIR)/ffmpeg.tar.gz : $(SUBDIR)/version_ffmpeg.txt ;
121 LibAvCodec $(SUBDIR)/lib/libavcodec.a : $(SUBDIR)/ffmpeg.tar.gz ;
125 Depends $(<) : $(>) ;
132 LibAvUtil $(SUBDIR)/lib/libavutil.a : $(SUBDIR)/lib/libavcodec.a ;
133 LibAvUtil $(SUBDIR)/lib/libavformat.a : $(SUBDIR)/lib/libavcodec.a ;
134 LibAvUtil $(SUBDIR)/lib/libswscale.a : $(SUBDIR)/lib/libavcodec.a ;
136 # HandBrake does not include a DVD decrypting library,
137 # so if a user requests it, let them download and compile it from a 3rd party
141 # We need libdvdcss.so for libdvdread's configure to work...
144 Depends $(<) : $(>) ;
149 cd `dirname $(>)` && CONTRIB=`pwd` &&
150 rm -rf libdvdcss-1.2.9 && (gzip -dc libdvdcss.tar.gz | tar xf - ) &&
151 cd libdvdcss-1.2.9 &&
152 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install &&
153 $(STRIP) $CONTRIB/lib/libdvdcss.a
155 Wget $(SUBDIR)/libdvdcss.tar.gz : $(SUBDIR)/version_libdvdcss.txt ;
156 LibDvdCss $(SUBDIR)/lib/libdvdcss.a : $(SUBDIR)/libdvdcss.tar.gz ;
162 Depends $(<) : $(>) ;
167 cd `dirname $(>)` && CONTRIB=`pwd` &&
168 rm -rf libdca && (gzip -dc libdca.tar.gz | tar xf - ) &&
169 cd libdca && $(PATCH) -p1 < ../patch-libdca.patch &&
170 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install &&
171 $(STRIP) $CONTRIB/lib/libdca.a
173 Wget $(SUBDIR)/libdca.tar.gz : $(SUBDIR)/version_libdca.txt ;
174 LibDCA $(SUBDIR)/lib/libdca.a : $(SUBDIR)/libdca.tar.gz ;
179 Depends $(<) : $(>) ;
184 DVDREAD_PATCH = "$(PATCH) -p0 < ../patch-libdvdread-css-vlc-dylib.patch &&" ;
188 if $(CSS) = 1 # Include CSS support in libdvdread if requested
192 cd `dirname $(>)` && CONTRIB=`pwd` &&
193 rm -rf libdvdread && (gzip -dc libdvdread.tar.gz | tar xf - ) &&
195 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --with-libdvdcss=$CONTRIB &&
196 $(MAKE) && $(MAKE) install &&
197 $(STRIP) $CONTRIB/lib/libdvdread.a
201 # Cygwin/Windows doesn't use CSS as of now, so don't include it on the
203 # MacOSX uses a dylib for CSS, so it doesn't need including there either.
206 cd `dirname $(>)` && CONTRIB=`pwd` &&
207 rm -rf libdvdread && (gzip -dc libdvdread.tar.gz | tar xf - ) &&
208 cd libdvdread && $(DVDREAD_PATCH)
209 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
210 $(MAKE) && $(MAKE) install &&
211 $(STRIP) $CONTRIB/lib/libdvdread.a
214 Wget $(SUBDIR)/libdvdread.tar.gz : $(SUBDIR)/version_libdvdread.txt ;
215 LibDvdRead $(SUBDIR)/lib/libdvdread.a : $(SUBDIR)/libdvdread.tar.gz ;
220 Depends $(<) : $(>) ;
224 CYGWIN_PATCH = "$(PATCH) -p1 < ../patch-faac-cygwin.patch &&" ;
229 cd `dirname $(>)` && CONTRIB=`pwd` &&
230 rm -rf faac && (gzip -dc faac.tar.gz | tar xf - ) && cd faac && $(CYGWIN_PATCH) ./bootstrap &&
231 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --enable-static --without-mp4v2 &&
232 $(MAKE) && $(MAKE) install &&
233 $(STRIP) $CONTRIB/lib/libfaac.a
235 Wget $(SUBDIR)/faac.tar.gz : $(SUBDIR)/version_faac.txt ;
236 LibFaac $(SUBDIR)/lib/libfaac.a : $(SUBDIR)/faac.tar.gz ;
241 Depends $(<) : $(>) ;
246 cd `dirname $(>)` && CONTRIB=`pwd` &&
247 rm -rf lame && (gzip -dc lame.tar.gz | tar xf - ) && cd lame &&
248 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
249 $(MAKE) && $(MAKE) install &&
250 $(STRIP) $CONTRIB/lib/libmp3lame.a
252 Wget $(SUBDIR)/lame.tar.gz : $(SUBDIR)/version_lame.txt ;
253 LibMp3Lame $(SUBDIR)/lib/libmp3lame.a : $(SUBDIR)/lame.tar.gz ;
258 LIBMP4V2_PATCH = "" ;
261 LIBMP4V2_PATCH += "$(PATCH) -p1 < ../patch_mpeg4ip_cygwin.patch && " ;
263 LIBMP4V2_PATCH += "$(PATCH) -p1 < ../patch-mpeg4ip.patch && " ;
264 LIBMP4V2_PATCH += "$(PATCH) -p1 < ../patch-mpeg4ip-nasm-2.00-configure.patch && " ;
265 LIBMP4V2_PATCH += "$(PATCH) -p1 < ../patch-mpeg4ip-ac3.patch && " ;
266 LIBMP4V2_PATCH += "$(PATCH) -p1 < ../patch-mpeg4ip-colr.patch && " ;
267 Depends $(<) : $(>) ;
272 cd `dirname $(>)` && CONTRIB=`pwd` &&
273 rm -rf mpeg4ip && (gzip -dc mpeg4ip.tar.gz | tar xf - ) &&
274 cd mpeg4ip && $(LIBMP4V2_PATCH)
275 ./bootstrap --cache-file=$CONTRIB/config.cache --disable-mp3lame --disable-faac --disable-x264 --disable-server --disable-player &&
276 $(MAKE) -C lib/mp4v2 libmp4v2.la && cp lib/mp4v2/.libs/libmp4v2.a $CONTRIB/lib &&
277 cp mpeg4ip_config.h include/mpeg4ip.h include/mpeg4ip_version.h \
278 include/mpeg4ip_win32.h lib/mp4v2/*.h $CONTRIB/include &&
279 $(STRIP) $CONTRIB/lib/libmp4v2.a
281 Wget $(SUBDIR)/mpeg4ip.tar.gz : $(SUBDIR)/version_mpeg4ip.txt ;
282 LibMp4v2 $(SUBDIR)/lib/libmp4v2.a : $(SUBDIR)/mpeg4ip.tar.gz ;
286 Depends $(<) : $(>) ;
291 cd `dirname $(>)` && CONTRIB=`pwd` &&
292 rm -rf libmkv && (gzip -dc libmkv.tar.gz | tar xf - ) &&
294 ./configure --disable-shared --enable-static --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache &&
295 $(MAKE) && $(MAKE) install &&
296 $(STRIP) $CONTRIB/lib/libmkv.a
298 Wget $(SUBDIR)/libmkv.tar.gz : $(SUBDIR)/version_libmkv.txt ;
299 LibMkv $(SUBDIR)/lib/libmkv.a : $(SUBDIR)/libmkv.tar.gz ;
304 Depends $(<) : $(>) ;
309 cd `dirname $(>)` && CONTRIB=`pwd` &&
310 rm -rf mpeg2dec && (gzip -dc mpeg2dec.tar.gz | tar xf - ) &&
312 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --disable-sdl --without-x &&
313 $(MAKE) && $(MAKE) install &&
314 $(STRIP) $CONTRIB/lib/libmpeg2.a
316 Wget $(SUBDIR)/mpeg2dec.tar.gz : $(SUBDIR)/version_mpeg2dec.txt ;
317 LibMpeg2 $(SUBDIR)/lib/libmpeg2.a : $(SUBDIR)/mpeg2dec.tar.gz ;
322 Depends $(<) : $(>) ;
327 cd `dirname $(>)` && CONTRIB=`pwd` &&
328 rm -rf libogg && (gzip -dc libogg.tar.gz | tar xf - ) &&
330 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
331 $(MAKE) && $(MAKE) install &&
332 $(STRIP) $CONTRIB/lib/libogg.a
334 Wget $(SUBDIR)/libogg.tar.gz : $(SUBDIR)/version_libogg.txt ;
335 LibOgg $(SUBDIR)/lib/libogg.a : $(SUBDIR)/libogg.tar.gz ;
340 Depends $(<) : $(>) ;
343 actions LibSampleRate
345 cd `dirname $(>)` && CONTRIB=`pwd` &&
346 rm -rf libsamplerate && (gzip -dc libsamplerate.tar.gz | tar xf - ) &&
348 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
349 $(MAKE) && $(MAKE) install &&
350 $(STRIP) $CONTRIB/lib/libsamplerate.a
352 Wget $(SUBDIR)/libsamplerate.tar.gz : $(SUBDIR)/version_libsamplerate.txt ;
353 LibSampleRate $(SUBDIR)/lib/libsamplerate.a : $(SUBDIR)/libsamplerate.tar.gz ;
358 Depends $(<) : $(>) ;
363 cd `dirname $(>)` && CONTRIB=`pwd` &&
364 rm -rf libvorbis && (gzip -dc libvorbis.tar.gz | tar xf - ) &&
366 ./configure --prefix=$CONTRIB --with-ogg=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
367 $(MAKE) && $(MAKE) install &&
368 $(STRIP) $CONTRIB/lib/libvorbis.a
370 Wget $(SUBDIR)/libvorbis.tar.gz : $(SUBDIR)/version_libvorbis.txt ;
371 LibVorbis $(SUBDIR)/lib/libvorbis.a : $(SUBDIR)/libvorbis.tar.gz ;
375 Depends $(<) : $(>) ;
382 LibVorbisEnc $(SUBDIR)/lib/libvorbisenc.a : $(SUBDIR)/lib/libvorbis.a ;
387 Depends $(<) : $(>) ;
392 cd `dirname $(>)` && CONTRIB=`pwd` && rm -rf libtheora &&
393 (gzip -dc libtheora.tar.gz | tar xf - ) && cd libtheora &&
394 HAVE_PKG_CONFIG="no" && export HAVE_PKG_CONFIG &&
395 ./configure --prefix=$CONTRIB --with-ogg=$CONTRIB --with-vorbis=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared \
396 --disable-oggtest --disable-vorbistest --disable-sdltest --disable-examples &&
397 $(MAKE) && $(MAKE) install &&
398 $(STRIP) $CONTRIB/lib/libtheora.a
400 Wget $(SUBDIR)/libtheora.tar.gz : $(SUBDIR)/version_libtheora.txt ;
401 LibTheora $(SUBDIR)/lib/libtheora.a : $(SUBDIR)/libtheora.tar.gz ;
409 LIBX264_PATCH += "$(PATCH) -p1 < ../patch-x264-cygwin.patch && " ;
411 else if $(OS) = SOLARIS
413 LIBX264_PATCH += " $(PATCH) -p1 < ../patch-x264-solaris.patch && " ;
415 LIBX264_PATCH += "$(PATCH) -p0 < ../patch-x264-idr.patch && " ;
416 Depends $(<) : $(>) ;
421 cd `dirname $(>)` && CONTRIB=`pwd` &&
422 rm -rf x264 && (gzip -dc x264.tar.gz | tar xf - ) &&
423 cd x264 && $(LIBX264_PATCH)
424 bash ./configure --prefix=$CONTRIB --enable-pthread &&
425 $(MAKE) libx264.a && cp libx264.a $CONTRIB/lib/ && cp x264.h $CONTRIB/include/ && $(STRIP) $CONTRIB/lib/libx264.a
427 Wget $(SUBDIR)/x264.tar.gz : $(SUBDIR)/version_x264.txt ;
428 LibX264 $(SUBDIR)/lib/libx264.a : $(SUBDIR)/x264.tar.gz ;
433 LIBXVIDCORE_PATCH = "" ;
436 LIBXVIDCORE_PATCH = "$(PATCH) -p1 < ../patch-xvidcore-macosx.patch && " ;
438 else if $(OS) = CYGWIN
440 LIBXVIDCORE_PATCH = "$(PATCH) -p1 < ../patch-xvidcore-cygwin.patch && " ;
442 LIBXVIDCORE_PATCH += "$(PATCH) -p1 < ../patch-xvidcore-nasm-2.00-configure.patch && " ;
443 LIBXVIDCORE_PATCH += "$(PATCH) -p1 < ../patch-xvidcore-fdct.patch && " ;
444 Depends $(<) : $(>) ;
449 cd `dirname $(>)` && CONTRIB=`pwd` &&
450 rm -rf xvidcore && (gzip -dc xvidcore.tar.gz | tar xf - ) &&
451 cd xvidcore && $(LIBXVIDCORE_PATCH)
452 cd build/generic/ && ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) libxvidcore.a &&
453 cp ./=build/libxvidcore.a $CONTRIB/lib/ &&
454 cp ../../src/xvid.h $CONTRIB/include/ &&
455 $(STRIP) $CONTRIB/lib/libxvidcore.a
457 Wget $(SUBDIR)/xvidcore.tar.gz : $(SUBDIR)/version_xvidcore.txt ;
458 LibXvidCore $(SUBDIR)/lib/libxvidcore.a : $(SUBDIR)/xvidcore.tar.gz ;
465 Depends $(<) : $(>) ;
470 cd `dirname $(>)` && CONTRIB=`pwd` &&
471 rm -rf zlib && (gzip -dc zlib.tar.gz | tar xf - ) &&
472 cd zlib && ./configure --prefix=$CONTRIB &&
473 $(MAKE) && $(MAKE) install && touch $CONTRIB/.contrib &&
474 $(STRIP) $CONTRIB/lib/libz.a
476 Wget $(SUBDIR)/zlib.tar.gz : $(SUBDIR)/version_zlib.txt ;
477 Zlib $(SUBDIR)/lib/libz.a : $(SUBDIR)/zlib.tar.gz ;