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 " ;
91 else if $(OS) = MACOSX
93 FFMPEG_PATCH += " && $(PATCH) -p1 < ../patch-ffmpeg-h264dsp-crash.diff " ;
99 # Not all of ffmpeg works on Solaris - disable the bits that
100 # don't. When we get new versions of FFMPEG we can try enabling
103 FFMPEG_EXTRA_OPTIONS = "--disable-vis --disable-demuxer=mpc8 --disable-vhook --disable-network" ;
106 Depends $(<) : $(>) ;
111 cd `dirname $(>)` && CONTRIB=`pwd` &&
112 rm -rf ffmpeg && (gzip -dc ffmpeg.tar.gz | tar xf -) &&
113 cd ffmpeg && $(FFMPEG_PATCH) &&
114 ./configure --prefix=$CONTRIB --enable-gpl --enable-pthreads --enable-swscale \
115 --disable-shared --enable-static --disable-encoders \
116 --enable-encoder=mpeg4 --enable-encoder=ac3 --enable-encoder=snow \
117 --enable-libfaad --disable-ffmpeg --disable-ffserver \
118 --disable-muxers --enable-muxer=ipod --disable-bsfs --disable-vhook \
119 --extra-cflags="-I$CONTRIB/include" \
120 --extra-ldflags="-L$CONTRIB/lib" $(FFMPEG_EXTRA_OPTIONS) &&
121 $(MAKE) && $(MAKE) install &&
122 $(STRIP) $CONTRIB/lib/libavcodec.a
124 Wget $(SUBDIR)/ffmpeg.tar.gz : $(SUBDIR)/version_ffmpeg.txt ;
125 LibAvCodec $(SUBDIR)/lib/libavcodec.a : $(SUBDIR)/ffmpeg.tar.gz ;
129 Depends $(<) : $(>) ;
136 LibAvUtil $(SUBDIR)/lib/libavutil.a : $(SUBDIR)/lib/libavcodec.a ;
137 LibAvUtil $(SUBDIR)/lib/libavformat.a : $(SUBDIR)/lib/libavcodec.a ;
138 LibAvUtil $(SUBDIR)/lib/libswscale.a : $(SUBDIR)/lib/libavcodec.a ;
140 # HandBrake does not include a DVD decrypting library,
141 # so if a user requests it, let them download and compile it from a 3rd party
145 # We need libdvdcss.so for libdvdread's configure to work...
148 Depends $(<) : $(>) ;
153 cd `dirname $(>)` && CONTRIB=`pwd` &&
154 rm -rf libdvdcss-1.2.9 && (gzip -dc libdvdcss.tar.gz | tar xf - ) &&
155 cd libdvdcss-1.2.9 &&
156 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install &&
157 $(STRIP) $CONTRIB/lib/libdvdcss.a
159 Wget $(SUBDIR)/libdvdcss.tar.gz : $(SUBDIR)/version_libdvdcss.txt ;
160 LibDvdCss $(SUBDIR)/lib/libdvdcss.a : $(SUBDIR)/libdvdcss.tar.gz ;
166 Depends $(<) : $(>) ;
171 cd `dirname $(>)` && CONTRIB=`pwd` &&
172 rm -rf libdca && (gzip -dc libdca.tar.gz | tar xf - ) &&
173 cd libdca && $(PATCH) -p1 < ../patch-libdca.patch &&
174 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install &&
175 $(STRIP) $CONTRIB/lib/libdca.a
177 Wget $(SUBDIR)/libdca.tar.gz : $(SUBDIR)/version_libdca.txt ;
178 LibDCA $(SUBDIR)/lib/libdca.a : $(SUBDIR)/libdca.tar.gz ;
183 Depends $(<) : $(>) ;
188 DVDREAD_PATCH = "$(PATCH) -p0 < ../patch-libdvdread-css-vlc-dylib.patch &&" ;
193 DVDREAD_PATCH = "$(PATCH) -p1 < ../patch-libdvdread-cygwin.patch &&" ;
197 if $(CSS) = 1 # Include CSS support in libdvdread if requested
201 cd `dirname $(>)` && CONTRIB=`pwd` &&
202 rm -rf libdvdread && (gzip -dc libdvdread.tar.gz | tar xf - ) &&
204 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --with-libdvdcss=$CONTRIB &&
205 $(MAKE) && $(MAKE) install &&
206 $(STRIP) $CONTRIB/lib/libdvdread.a
210 # Cygwin/Windows doesn't use CSS as of now, so don't include it on the
212 # MacOSX uses a dylib for CSS, so it doesn't need including there either.
215 cd `dirname $(>)` && CONTRIB=`pwd` &&
216 rm -rf libdvdread && (gzip -dc libdvdread.tar.gz | tar xf - ) &&
217 cd libdvdread && $(DVDREAD_PATCH)
218 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
219 $(MAKE) && $(MAKE) install &&
220 $(STRIP) $CONTRIB/lib/libdvdread.a
223 Wget $(SUBDIR)/libdvdread.tar.gz : $(SUBDIR)/version_libdvdread.txt ;
224 LibDvdRead $(SUBDIR)/lib/libdvdread.a : $(SUBDIR)/libdvdread.tar.gz ;
229 Depends $(<) : $(>) ;
233 CYGWIN_PATCH = "$(PATCH) -p1 < ../patch-faac-cygwin.patch &&" ;
238 cd `dirname $(>)` && CONTRIB=`pwd` &&
239 rm -rf faac && (gzip -dc faac.tar.gz | tar xf - ) && cd faac && $(CYGWIN_PATCH) ./bootstrap &&
240 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --enable-static --without-mp4v2 &&
241 $(MAKE) && $(MAKE) install &&
242 $(STRIP) $CONTRIB/lib/libfaac.a
244 Wget $(SUBDIR)/faac.tar.gz : $(SUBDIR)/version_faac.txt ;
245 LibFaac $(SUBDIR)/lib/libfaac.a : $(SUBDIR)/faac.tar.gz ;
250 Depends $(<) : $(>) ;
255 cd `dirname $(>)` && CONTRIB=`pwd` &&
256 rm -rf lame && (gzip -dc lame.tar.gz | tar xf - ) && cd lame &&
257 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
258 $(MAKE) && $(MAKE) install &&
259 $(STRIP) $CONTRIB/lib/libmp3lame.a
261 Wget $(SUBDIR)/lame.tar.gz : $(SUBDIR)/version_lame.txt ;
262 LibMp3Lame $(SUBDIR)/lib/libmp3lame.a : $(SUBDIR)/lame.tar.gz ;
267 LIBMP4V2_PATCH = "" ;
268 Depends $(<) : $(>) ;
273 cd `dirname $(>)` && CONTRIB=`pwd` &&
274 rm -rf libmp4v2 && (gzip -dc libmp4v2.tar.gz | tar xf - ) &&
275 cd libmp4v2 && $(LIBMP4V2_PATCH) rm -rf build && mkdir build && cd build &&
276 ../configure --disable-shared --disable-debug --prefix=$CONTRIB && $(MAKE) && $(MAKE) install &&
277 $(STRIP) $CONTRIB/lib/libmp4v2.a
279 Wget $(SUBDIR)/libmp4v2.tar.gz : $(SUBDIR)/version_libmp4v2.txt ;
280 LibMp4v2 $(SUBDIR)/lib/libmp4v2.a : $(SUBDIR)/libmp4v2.tar.gz ;
284 Depends $(<) : $(>) ;
289 cd `dirname $(>)` && CONTRIB=`pwd` &&
290 rm -rf libmkv && (gzip -dc libmkv.tar.gz | tar xf - ) &&
292 ./configure --disable-shared --enable-static --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache &&
293 $(MAKE) && $(MAKE) install &&
294 $(STRIP) $CONTRIB/lib/libmkv.a
296 Wget $(SUBDIR)/libmkv.tar.gz : $(SUBDIR)/version_libmkv.txt ;
297 LibMkv $(SUBDIR)/lib/libmkv.a : $(SUBDIR)/libmkv.tar.gz ;
302 Depends $(<) : $(>) ;
307 cd `dirname $(>)` && CONTRIB=`pwd` &&
308 rm -rf mpeg2dec && (gzip -dc mpeg2dec.tar.gz | tar xf - ) &&
310 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --disable-sdl --without-x &&
311 $(MAKE) && $(MAKE) install &&
312 $(STRIP) $CONTRIB/lib/libmpeg2.a
314 Wget $(SUBDIR)/mpeg2dec.tar.gz : $(SUBDIR)/version_mpeg2dec.txt ;
315 LibMpeg2 $(SUBDIR)/lib/libmpeg2.a : $(SUBDIR)/mpeg2dec.tar.gz ;
320 Depends $(<) : $(>) ;
325 cd `dirname $(>)` && CONTRIB=`pwd` &&
326 rm -rf libogg && (gzip -dc libogg.tar.gz | tar xf - ) &&
328 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
329 $(MAKE) && $(MAKE) install &&
330 $(STRIP) $CONTRIB/lib/libogg.a
332 Wget $(SUBDIR)/libogg.tar.gz : $(SUBDIR)/version_libogg.txt ;
333 LibOgg $(SUBDIR)/lib/libogg.a : $(SUBDIR)/libogg.tar.gz ;
338 Depends $(<) : $(>) ;
341 actions LibSampleRate
343 cd `dirname $(>)` && CONTRIB=`pwd` &&
344 rm -rf libsamplerate && (gzip -dc libsamplerate.tar.gz | tar xf - ) &&
346 ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
347 $(MAKE) && $(MAKE) install &&
348 $(STRIP) $CONTRIB/lib/libsamplerate.a
350 Wget $(SUBDIR)/libsamplerate.tar.gz : $(SUBDIR)/version_libsamplerate.txt ;
351 LibSampleRate $(SUBDIR)/lib/libsamplerate.a : $(SUBDIR)/libsamplerate.tar.gz ;
356 Depends $(<) : $(>) ;
361 cd `dirname $(>)` && CONTRIB=`pwd` &&
362 rm -rf libvorbis && (gzip -dc libvorbis.tar.gz | tar xf - ) &&
364 ./configure --prefix=$CONTRIB --with-ogg=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared &&
365 $(MAKE) && $(MAKE) install &&
366 $(STRIP) $CONTRIB/lib/libvorbis.a
368 Wget $(SUBDIR)/libvorbis.tar.gz : $(SUBDIR)/version_libvorbis.txt ;
369 LibVorbis $(SUBDIR)/lib/libvorbis.a : $(SUBDIR)/libvorbis.tar.gz ;
373 Depends $(<) : $(>) ;
380 LibVorbisEnc $(SUBDIR)/lib/libvorbisenc.a : $(SUBDIR)/lib/libvorbis.a ;
385 Depends $(<) : $(>) ;
390 cd `dirname $(>)` && CONTRIB=`pwd` && rm -rf libtheora &&
391 (gzip -dc libtheora.tar.gz | tar xf - ) && cd libtheora &&
392 HAVE_PKG_CONFIG="no" && export HAVE_PKG_CONFIG &&
393 ./configure --prefix=$CONTRIB --with-ogg=$CONTRIB --with-vorbis=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared \
394 --disable-oggtest --disable-vorbistest --disable-sdltest --disable-examples &&
395 $(MAKE) && $(MAKE) install &&
396 $(STRIP) $CONTRIB/lib/libtheora.a
398 Wget $(SUBDIR)/libtheora.tar.gz : $(SUBDIR)/version_libtheora.txt ;
399 LibTheora $(SUBDIR)/lib/libtheora.a : $(SUBDIR)/libtheora.tar.gz ;
407 LIBX264_PATCH += "$(PATCH) -p1 < ../patch-x264-cygwin.patch && " ;
409 else if $(OS) = SOLARIS
411 LIBX264_PATCH += " $(PATCH) -p1 < ../patch-x264-solaris.patch && " ;
413 LIBX264_PATCH += "$(PATCH) -p0 < ../patch-x264-idr.patch && " ;
414 Depends $(<) : $(>) ;
419 cd `dirname $(>)` && CONTRIB=`pwd` &&
420 rm -rf x264 && (gzip -dc x264.tar.gz | tar xf - ) &&
421 cd x264 && $(LIBX264_PATCH)
422 bash ./configure --prefix=$CONTRIB --enable-pthread &&
423 $(MAKE) libx264.a && cp libx264.a $CONTRIB/lib/ && cp x264.h $CONTRIB/include/ && $(STRIP) $CONTRIB/lib/libx264.a
425 Wget $(SUBDIR)/x264.tar.gz : $(SUBDIR)/version_x264.txt ;
426 LibX264 $(SUBDIR)/lib/libx264.a : $(SUBDIR)/x264.tar.gz ;
431 LIBXVIDCORE_PATCH = "" ;
434 LIBXVIDCORE_PATCH = "$(PATCH) -p1 < ../patch-xvidcore-macosx.patch && " ;
436 else if $(OS) = CYGWIN
438 LIBXVIDCORE_PATCH = "$(PATCH) -p1 < ../patch-xvidcore-cygwin.patch && " ;
440 LIBXVIDCORE_PATCH += "$(PATCH) -p1 < ../patch-xvidcore-nasm-2.00-configure.patch && " ;
441 LIBXVIDCORE_PATCH += "$(PATCH) -p1 < ../patch-xvidcore-fdct.patch && " ;
442 Depends $(<) : $(>) ;
447 cd `dirname $(>)` && CONTRIB=`pwd` &&
448 rm -rf xvidcore && (gzip -dc xvidcore.tar.gz | tar xf - ) &&
449 cd xvidcore && $(LIBXVIDCORE_PATCH)
450 cd build/generic/ && ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) libxvidcore.a &&
451 cp ./=build/libxvidcore.a $CONTRIB/lib/ &&
452 cp ../../src/xvid.h $CONTRIB/include/ &&
453 $(STRIP) $CONTRIB/lib/libxvidcore.a
455 Wget $(SUBDIR)/xvidcore.tar.gz : $(SUBDIR)/version_xvidcore.txt ;
456 LibXvidCore $(SUBDIR)/lib/libxvidcore.a : $(SUBDIR)/xvidcore.tar.gz ;
463 Depends $(<) : $(>) ;
468 cd `dirname $(>)` && CONTRIB=`pwd` &&
469 rm -rf zlib && (gzip -dc zlib.tar.gz | tar xf - ) &&
470 cd zlib && ./configure --prefix=$CONTRIB &&
471 $(MAKE) && $(MAKE) install && touch $CONTRIB/.contrib &&
472 $(STRIP) $CONTRIB/lib/libz.a
474 Wget $(SUBDIR)/zlib.tar.gz : $(SUBDIR)/version_zlib.txt ;
475 Zlib $(SUBDIR)/lib/libz.a : $(SUBDIR)/zlib.tar.gz ;
483 Depends $(<) : $(>) ;
488 cd `dirname $(>)` && CONTRIB=`pwd` &&
489 rm -rf bzip2 && (gzip -dc bzip2.tar.gz | tar xf - ) &&
490 cd bzip2 && $(MAKE) && $(MAKE) install && cp libbz2.a $CONTRIB/lib/ &&
491 $(STRIP) $CONTRIB/lib/libbz2.a
493 Wget $(SUBDIR)/bzip2.tar.gz : $(SUBDIR)/version_bzip2.txt ;
494 BZip2 $(SUBDIR)/lib/libbz2.a : $(SUBDIR)/bzip2.tar.gz ;