Contribs: syncrhonise with master
[vlc/solaris.git] / extras / contrib / src / Makefile
blob81cf0c7d84390d969a5883741989410dd440bcca
1 #***************************************************************************
2 # src/Makefile : Dearchive and compile all files necessary
3 # ***************************************************************************
4 # Copyright (C) 2003 - 2009 the VideoLAN team
5 # $Id$
7 # Authors: Christophe Massiot <massiot@via.ecp.fr>
8 # Derk-Jan Hartman <hartman at videolan dot org>
9 # Eric Petit <titer@m0k.org>
10 # Felix Paul Kühne <fkuehne at videolan dot org>
11 # Christophe Mutricy <xtophe AT xtelevision.com>
12 # Gildas Bazin <gbazin at videolan dot org>
13 # Damien Fouilleul <damienf at videolan dot org>
14 # Jean-Baptiste Kempf <jb at videolan dot org>
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
29 # ***************************************************************************
31 include ../config.mak
32 include ./packages.mak
34 # ***************************************************************************
35 # Set a clean environment
36 # ***************************************************************************
38 export PATH := $(PREFIX)/bin:$(EXTRA_PATH):$(PATH)
39 export PKG_CONFIG_PATH
40 export PKG_CONFIG_LIBDIR = $(PREFIX)/lib/pkgconfig
41 export MACOSX_DEPLOYMENT_TARGET = $(SDK_TARGET)
42 export LIBRARY_PATH := $(PREFIX)/lib:$(LIBRARY_PATH)
43 export CFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
44 export CPPFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
45 export CXXFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
46 export LDFLAGS = -L$(PREFIX)/lib $(EXTRA_LDFLAGS)
47 ifdef HAVE_DARWIN_OS
48 export CC
49 export CXX
50 export LD
51 endif
53 # ***************************************************************************
54 # Cross compilation variables
55 # We'll usually use --host=<platform>, except for a few libraries which
56 # don't handle it (gotta set CC/CXX/etc), and obviously FFmpeg has its own
57 # way of doing it... ;)
58 # ***************************************************************************
60 ifneq ($(CC),)
61 HOSTCC+= CC="$(CC)"
62 endif
63 ifneq ($(CXX),)
64 HOSTCC+= CXX="$(CXX)"
65 endif
66 ifneq ($(LD),)
67 HOSTCC+= LD="$(LD)"
68 endif
69 ifneq ($(RANLIB),)
70 HOSTCC+= RANLIB="$(RANLIB)"
71 endif
72 ifneq ($(AR),)
73 HOSTCC+= AR="$(AR)"
74 endif
75 ifneq ($(STRIP),)
76 HOSTCC+= STRIP="$(STRIP)"
77 endif
80 # Define ranlib on non-cross compilation setups
81 ifeq ($(RANLIB),)
82 RANLIB=ranlib
83 endif
85 # For libebml/libmatroska. Grrr.
86 ifneq ($(AR),)
87 HOSTCC2=$(HOSTCC) AR="$(AR) rcvu"
88 else
89 HOSTCC2=$(HOSTCC)
90 endif
92 FFMPEGCONF=
94 # cross compiling
95 #This should be inside the if block but some config scripts are buggy
96 HOSTCONF=--target=$(HOST) --host=$(HOST) --build=$(BUILD) --program-prefix=""
97 ifneq ($(BUILD),$(HOST))
99 # Compiling for MinGW under Cygwin could be deemed as cross compiling
100 # unfortunately there isn't a complete separate GCC toolchain for MinGW under Cygwin
102 ifndef HAVE_CYGWIN
103 # We are REALLY cross compiling
104 FFMPEGCONF+=--cross-prefix=$(HOST)- --enable-cross-compile
105 X264CONF=--host=$(HOST)
106 PTHREADSCONF="CROSS=$(HOST)-"
107 else
108 # We are compiling for MinGW on Cygwin
109 PTHREADSCONF=$(HOSTCC)
110 endif
111 endif
114 # Special target-dependant options
116 ifdef HAVE_WIN32
117 HOSTCONF+= --without-pic --disable-shared --enable-msw --disable-dependency-tracking
118 FFMPEGCONF+= --target-os=mingw32 --arch=x86 --enable-memalign-hack
119 ifdef HAVE_WIN64
120 FFMPEGCONF+= --cpu=athlon64 --arch=x86_64
121 else
122 FFMPEGCONF+= --cpu=i686
123 endif
124 endif
126 ifdef HAVE_WINCE
127 HOSTCONF+= --without-pic --disable-shared
128 FFMPEGCONF+= --target-os=mingw32ce --arch=armv4l --cpu=armv4t --disable-encoders --disable-muxers --disable-mpegaudio-hp --disable-decoder=snow --disable-decoder=vc9 --disable-decoder=wmv3 --disable-decoder=vorbis --disable-decoder=dvdsub --disable-decoder=dvbsub --disable-protocols
129 endif
131 ifdef HAVE_UCLIBC
132 ifdef HAVE_BIGENDIAN
133 FFMPEGCONF+= --arch=armeb --enable-armv5te --enable-iwmmxt
134 else
135 FFMPEGCONF+= --arch=armv4l
136 endif
137 FFMPEGCONF+= --enable-small --disable-mpegaudio-hp
138 FFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99
139 else
140 ifndef HAVE_WINCE
141 FFMPEGCONF+= --enable-libmp3lame --enable-libgsm
142 endif
143 endif
145 ifdef HAVE_DARWIN_OS_ON_INTEL
146 FFMPEGCONF += --enable-memalign-hack
147 endif
149 ifdef HAVE_DARWIN_OS
150 X264CONF=--host=$(HOST)
151 X264CONF += --enable-pic
152 ifdef HAVE_DARWIN_32
153 FFMPEGCONF += --cc=gcc-4.0
154 else
155 FFMPEGCONF += --cc=$(CC)
156 endif
157 FFMPEGCONF += --arch=$(ARCH)
158 ifdef HAVE_DARWIN_64
159 FFMPEGCONF += --cpu=core2
160 X264CONF+=--host=x86_64-apple-darwin10
161 endif
162 ifdef HAVE_DARWIN_OS_ON_INTEL
163 FFMPEG_CFLAGS += -DHAVE_LRINTF
164 endif
165 endif
167 ifdef HAVE_AMR
168 FFMPEGCONF+= --enable-libamr-nb --enable-libamr-wb --enable-nonfree
169 endif
171 ifdef HAVE_LINUX
172 ifdef HAVE_MAEMO
173 ifneq ($(filter -m%=cortex-a8, $(EXTRA_CFLAGS)),)
174 FFMPEGCONF += --disable-runtime-cpudetect --enable-neon --cpu=cortex-a8
175 endif
176 # Really, this could be done on all Linux platforms, not just Maemo.
177 # Installing statically-linked VLC plugins is so much simpler.
178 HOSTCONF += --with-pic --disable-shared
179 endif
180 FFMPEGCONF += --enable-pic
181 X264CONF += --enable-pic
182 endif
184 ifdef HAVE_ISA_THUMB
185 NOTHUMB ?= -mno-thumb
186 endif
188 X264CONF+= --disable-avs-input --disable-lavf-input --disable-ffms-input --disable-mp4-output
190 DATE=`date +%Y-%m-%d`
192 # ***************************************************************************
193 # Standard rules
194 # ***************************************************************************
195 # Generated by ./bootstrap from default configuration in src/Distributions
197 include ../distro.mak
199 FORCE:
201 # ***************************************************************************
202 # Useful macros
203 # ***************************************************************************
205 define EXTRACT_GZ
206 rm -rf $@ || true
207 gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
208 mv $(patsubst %.tar.gz,%,$(patsubst %.tgz,%,$(notdir $<))) $@ || true
209 touch $@
210 endef
212 define EXTRACT_BZ2
213 rm -rf $@ || true
214 bunzip2 -c $< | tar xf - --exclude='[*?:<>\|]'
215 mv $(patsubst %.tar.bz2,%,$(notdir $<)) $@ || true
216 touch $@
217 endef
219 define EXTRACT_ZIP
220 rm -rf $@ || true
221 unzip $<
222 mv $(patsubst %.zip,%,$(notdir $<)) $@ || true
223 touch $@
224 endef
226 ### Darwin-specific ###
227 # These macros prepare the dynamic libraries for inclusion in the Mac OS X
228 # bundle. For instance if you're building a library named libtoto.dylib,
229 # which depends on the contrib library libtata.dylib, you should have the
230 # following entry :
231 # .toto: toto_directory .tata
232 # cd $< ; ./configure --prefix=$(PREFIX)
233 # $(MAKE) -C $<
234 # $(MAKE) -C $< install
235 # $(INSTALL_NAME)
236 # touch $@
238 # ***************************************************************************
239 # errno
240 # ***************************************************************************
242 errno:
243 mkdir -p $@
244 $(WGET) $(ERRNO_URL)/errno.h -O $@/errno.h
246 .errno: errno
247 mkdir -p $(PREFIX)/include
248 cp $</errno.h $(PREFIX)/include
249 touch $@
251 CLEAN_FILE += .errno
252 CLEAN_PKG += errno
254 # ***************************************************************************
255 # autoconf
256 # ***************************************************************************
258 autoconf-$(AUTOCONF_VERSION).tar.bz2:
259 $(WGET) $(AUTOCONF_URL)
261 autoconf: autoconf-$(AUTOCONF_VERSION).tar.bz2
262 $(EXTRACT_BZ2)
264 .autoconf: autoconf
265 (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
266 touch $@
268 CLEAN_FILE += .autoconf
269 CLEAN_PKG += autoconf
270 DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.bz2
272 # ***************************************************************************
273 # gnumake
274 # ***************************************************************************
276 make-$(GNUMAKE_VERSION).tar.bz2:
277 $(WGET) $(GNUMAKE_URL)
279 gnumake: make-$(GNUMAKE_VERSION).tar.bz2
280 $(EXTRACT_BZ2)
282 .gnumake: gnumake
283 ifdef HAVE_DARWIN_OS
284 ifndef HAVE_DARWIN_9
285 (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
286 endif
287 endif
288 touch $@
290 CLEAN_FILE += .gnumake
291 CLEAN_PKG += gnumake
292 DISTCLEAN_PKG += make-$(GNUMAKE_VERSION).tar.bz2
294 # ***************************************************************************
295 # CMake
296 # ***************************************************************************
297 cmake-$(CMAKE_VERSION).tar.gz:
298 $(WGET) $(CMAKE_URL)
300 cmake: cmake-$(CMAKE_VERSION).tar.gz
301 $(EXTRACT_GZ)
303 .cmake: cmake
304 (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
305 touch $@
307 CLEAN_FILE += .cmake
308 CLEAN_PKG += cmake
310 # ***************************************************************************
311 # libtool
312 # ***************************************************************************
314 ifdef HAVE_DARWIN_OS
315 libtool-$(LIBTOOL_VERSION).tar.gz:
316 $(WGET) $(LIBTOOL_URL)
318 libtool: libtool-$(LIBTOOL_VERSION).tar.gz
319 $(EXTRACT_GZ)
321 .libtool: libtool
322 (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
323 ln -sf libtool $(PREFIX)/bin/glibtool
324 ln -sf libtoolize $(PREFIX)/bin/glibtoolize
325 touch $@
327 CLEAN_PKG += libtool
328 DISTCLEAN_PKG += libtool-$(LIBTOOL_VERSION).tar.gz
329 CLEAN_FILE += .libtool
331 endif
333 # ***************************************************************************
334 # automake
335 # ***************************************************************************
337 automake-$(AUTOMAKE_VERSION).tar.gz:
338 $(WGET) $(AUTOMAKE_URL)
340 automake: automake-$(AUTOMAKE_VERSION).tar.gz
341 $(EXTRACT_GZ)
343 .automake: automake
344 (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
345 touch $@
347 CLEAN_FILE += .automake
348 CLEAN_PKG += automake
349 DISTCLEAN_PKG += automake-$(AUTOMAKE_VERSION).tar.gz
351 # ***************************************************************************
352 # pkgconfig
353 # ***************************************************************************
355 pkg-config-$(PKGCFG_VERSION).tar.gz:
356 $(WGET) $(PKGCFG_URL)
358 pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz
359 $(EXTRACT_GZ)
360 (cd $@; autoconf)
362 .pkgcfg: pkgconfig
363 (cd pkgconfig; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
364 touch $@
366 CLEAN_FILE += .pkgcfg
367 CLEAN_PKG += pkgconfig
368 DISTCLEAN_PKG += pkg-config-$(PKGCFG_VERSION).tar.gz
370 # ***************************************************************************
371 # gettext
372 # ***************************************************************************
374 gettext-$(GETTEXT_VERSION).tar.gz:
375 $(WGET) $(GETTEXT_URL)
377 gettext: gettext-$(GETTEXT_VERSION).tar.gz
378 $(EXTRACT_GZ)
379 ifdef HAVE_WIN32
380 patch -p0 < Patches/gettext-win32.patch
381 endif
382 ifdef HAVE_DARWIN_OS
383 patch -p0 < Patches/gettext-macosx.patch
384 endif
386 .intl: gettext .iconv
387 ifdef HAVE_WIN32
388 ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-relocatable --with-iconv-prefix=$(PREFIX) --disable-java --disable-native-java)
389 else
390 ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-java --disable-native-java --without-emacs)
391 endif
392 ifneq ($(HOST),$(BUILD))
393 ifndef HAVE_CYGWIN
394 # We'll use the installed gettext and only need to cross-compile libintl, also build autopoint and gettextsize tools need for VLC bootstrap
395 ( cd $< && make -C gettext-runtime/intl && patch -p1 < ../Patches/libintl.patch && make -C gettext-runtime/intl install && make -C gettext-tools/misc install )
396 else
397 # We are compiling for MinGW on Cygwin -- build the full current gettext
398 ( cd $< && make && patch -p1 < ../Patches/libintl.patch && make install )
399 endif
400 else
401 # Build and install the whole gettext
402 ( cd $< && make && patch -p1 < ../Patches/libintl.patch && make install )
403 endif
404 # Work around another non-sense of autoconf.
405 ifdef HAVE_WIN32
406 (cd $(PREFIX)/include; sed -i.orig '311 c #if 0' libintl.h)
407 endif
408 $(INSTALL_NAME)
409 touch $@
411 CLEAN_FILE += .intl
412 CLEAN_PKG += gettext
413 DISTCLEAN_PKG += gettext-$(GETTEXT_VERSION).tar.gz
415 # ***************************************************************************
416 # libiconv
417 # ***************************************************************************
419 libiconv-$(LIBICONV_VERSION).tar.gz:
420 $(WGET) $(LIBICONV_URL)
422 libiconv: libiconv-$(LIBICONV_VERSION).tar.gz
423 $(EXTRACT_GZ)
424 ifdef HAVE_WIN64
425 patch -p0 < Patches/libiconv-win64.patch
426 endif
427 ifdef HAVE_WINCE
428 patch -p0 < Patches/libiconv-wince.patch
429 patch -p0 < Patches/libiconv-wince-hack.patch
430 endif
432 libiconv-snowleopard.tar.bz2:
433 $(WGET) $(LIBICONVMAC_URL)
435 libiconv-snowleopard: libiconv-snowleopard.tar.bz2
436 $(EXTRACT_BZ2)
438 ifdef HAVE_DARWIN_OS
439 ifdef HAVE_DARWIN_10
440 .iconv: libiconv-snowleopard
441 (cd libiconv-snowleopard && cp libiconv.* $(PREFIX)/lib/)
442 touch $@
443 else
444 .iconv:
445 touch $@
446 endif
447 else
448 .iconv: libiconv
449 (cd libiconv; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls && make && make install)
450 $(INSTALL_NAME)
451 touch $@
452 endif
454 CLEAN_FILE += .iconv
455 CLEAN_PKG += libiconv
456 DISTCLEAN_PKG += libiconv-$(LIBICONV_VERSION).tar.gz
458 # ***************************************************************************
459 # fontconfig
460 # ***************************************************************************
462 fontconfig-$(FONTCONFIG_VERSION).tar.gz:
463 $(WGET) $(FONTCONFIG_URL)
465 fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz Patches/fontconfig.patch
466 $(EXTRACT_GZ)
467 patch -p0 < Patches/fontconfig-march.patch
468 patch -p0 < Patches/fontconfig-nodocs.patch
469 ifdef HAVE_WIN32
470 patch -p0 < Patches/fontconfig.patch
471 patch -p0 < Patches/fontconfig-noxml2.patch
472 (cd $@; autoreconf -ivf)
473 endif
475 .fontconfig: fontconfig .xml .freetype
476 ifdef HAVE_WIN32
477 ifdef HAVE_CYGWIN
478 (cd $<; ./configure --target=$(HOST) --disable-pic --disable-shared --disable-docs --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 && make && make install)
479 else
480 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --disable-libxml2 --disable-docs && make && make install)
481 endif
482 else
483 ifdef HAVE_DARWIN_OS
484 (cd $<; $(HOSTCC) LIBXML2_CFLAGS=`xml2-config --cflags` LIBXML2_LIBS=`xml2-config --libs` ./configure $(HOSTCONF) --with-cache-dir=/usr/X11/var/cache/fontconfig --with-confdir=/usr/X11/lib/X11/fonts --with-default-fonts=/System/Library/Fonts --with-add-fonts=/Library/Fonts,~/Library/Fonts --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --with-arch=$(ARCH) --enable-libxml2 --disable-docs && make && make install-exec && (cd fontconfig ; make install-data) && cp fontconfig.pc $(PKG_CONFIG_LIBDIR))
485 else
486 (cd $<; $(HOSTCC) LIBXML2_CFLAGS=`$(PREFIX)/bin/xml2-config --cflags` ./configure $(HOSTCONF) --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 --disable-docs && make && make install)
487 endif
488 endif
489 $(INSTALL_NAME)
490 touch $@
492 CLEAN_FILE += .fontconfig
493 CLEAN_PKG += fontconfig
494 DISTCLEAN_PKG += fontconfig-$(FONTCONFIG_VERSION).tar.gz
496 # ***************************************************************************
497 # freetype2
498 # ***************************************************************************
500 freetype-$(FREETYPE2_VERSION).tar.gz:
501 $(WGET) $(FREETYPE2_URL)
503 freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
504 $(EXTRACT_GZ)
506 .freetype: freetype2
507 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
508 $(INSTALL_NAME)
509 touch $@
511 CLEAN_FILE += .freetype
512 CLEAN_PKG += freetype2
513 DISTCLEAN_PKG += freetype-$(FREETYPE2_VERSION).tar.gz
515 # ***************************************************************************
516 # fribidi
517 # ***************************************************************************
519 fribidi-$(FRIBIDI_VERSION).tar.gz:
520 $(WGET) $(FRIBIDI_URL)
522 fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz
523 $(EXTRACT_GZ)
524 patch -p0 < Patches/fribidi.patch
525 ( cd $@; rm -f configure; ./bootstrap)
527 .fribidi: fribidi .iconv
528 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
529 $(INSTALL_NAME)
530 touch $@
532 CLEAN_FILE += .fribidi
533 CLEAN_PKG += fribidi
534 DISTCLEAN_PKG += fribidi-$(FRIBIDI_VERSION).tar.gz
536 # ***************************************************************************
537 # liba52
538 # ***************************************************************************
540 a52dec-$(A52DEC_VERSION).tar.gz:
541 $(WGET) $(A52DEC_URL)
543 a52dec: a52dec-$(A52DEC_VERSION).tar.gz
544 $(EXTRACT_GZ)
545 ifeq ($(ARCH),armel)
546 (cd $@ ; patch -p0 < ../Patches/liba52-fixed.diff)
547 endif
549 .a52: a52dec
550 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd liba52 && make && make install && cd ../include && make && make install)
551 touch $@
553 CLEAN_FILE += .a52
554 CLEAN_PKG += a52dec
555 DISTCLEAN_PKG += a52dec-$(A52DEC_VERSION).tar.gz
557 # ***************************************************************************
558 # mpeg2dec
559 # ***************************************************************************
561 libmpeg2-$(LIBMPEG2_VERSION).tar.gz:
562 $(WGET) $(LIBMPEG2_URL)
564 libmpeg2: libmpeg2-$(LIBMPEG2_VERSION).tar.gz
565 $(EXTRACT_GZ)
566 patch -p0 < Patches/libmpeg2-arm-pld.patch
567 cd libmpeg2 && patch -p0 < ../Patches/libmpeg2-mc-neon.patch
568 cd libmpeg2 && ./bootstrap
570 .mpeg2: libmpeg2
571 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --without-x --disable-sdl && cd libmpeg2 && make && make install && cd ../include && make && make install)
572 touch $@
574 CLEAN_FILE += .mpeg2
575 CLEAN_PKG += libmpeg2
576 DISTCLEAN_PKG += libmpeg2-$(LIBMPEG2_VERSION).tar.gz
578 # ***************************************************************************
579 # libid3tag
580 # ***************************************************************************
582 libid3tag-$(LIBID3TAG_VERSION).tar.gz:
583 $(WGET) $(LIBID3TAG_URL)
585 libid3tag: libid3tag-$(LIBID3TAG_VERSION).tar.gz
586 $(EXTRACT_GZ)
587 patch -d libid3tag -p0 < Patches/libid3tag-0.15.1b-fix-CVE-2008-2109.patch
588 ifdef HAVE_DARWIN_OS
589 ( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig configure )
590 endif
592 .id3tag: libid3tag
593 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
594 $(INSTALL_NAME)
595 touch $@
597 CLEAN_FILE += .id3tag
598 CLEAN_PKG += libid3tag
599 DISTCLEAN_PKG += libid3tag-$(LIBID3TAG_VERSION).tar.gz
601 # ***************************************************************************
602 # pcre
603 # ***************************************************************************
605 pcre-$(PCRE_VERSION).tar.bz2:
606 $(WGET) $(PCRE_URL)
608 pcre: pcre-$(PCRE_VERSION).tar.bz2
609 $(EXTRACT_BZ2)
611 .pcre: pcre
612 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared && make && make install )
613 touch $@
615 CLEAN_FILE += .pcre
616 CLEAN_PKG += pcre
617 DISTCLEAN_PKG += pcre-$(PCRE_VERSION).tar.bz2
619 # ***************************************************************************
620 # lua
621 # ***************************************************************************
623 ifdef HAVE_WIN32
624 LUA_MAKEPLATEFORM=mingw
625 else
626 ifdef HAVE_DARWIN_OS
627 LUA_MAKEPLATEFORM=macosx
628 else
629 ifdef HAVE_LINUX
630 LUA_MAKEPLATEFORM=linux
631 else
632 ifdef HAVE_BSD
633 LUA_MAKEPLATEFORM=bsd
634 else
635 LUA_MAKEPLATEFORM=generic
636 endif
637 endif
638 endif
639 endif
641 lua-$(LUA_VERSION).tar.gz:
642 $(WGET) $(LUA_URL)
644 lua: lua-$(LUA_VERSION).tar.gz
645 $(EXTRACT_GZ)
646 ifdef HAVE_DARWIN_OS
647 (cd $@; sed -e 's%gcc%$(CC)%' -e 's%LDFLAGS=%LDFLAGS=$(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)%' -i.orig src/Makefile)
648 endif
650 .lua: lua
651 ifdef HAVE_WIN32
652 ( cd $< && sed -i.orig 's/lua luac/lua.exe/' Makefile && cd src && sed -i.orig 's/CC=/#CC=/' Makefile && sed -i 's/strip/$(STRIP)/' Makefile && cd ../..)
653 (cd $<&& $(HOSTCC) make $(LUA_MAKEPLATEFORM)&& cd src&& $(HOSTCC) make liblua.a&& cd ..&&$(HOSTCC) make install INSTALL_TOP=$(PREFIX)&& $(RANLIB) $(PREFIX)/lib/liblua.a)
654 (cd $<&& sed -i.orig 's@prefix= /usr/local@prefix= $(PREFIX)@' etc/lua.pc&& mkdir -p $(PREFIX)/lib/pkgconfig&& cp etc/lua.pc $(PREFIX)/lib/pkgconfig)
655 else
656 (cd $<&& patch -p1) < Patches/lua-noreadline.patch
657 (cd $<&& $(HOSTCC) make $(LUA_MAKEPLATEFORM) && make install INSTALL_TOP=$(PREFIX))
658 endif
659 touch $@
661 CLEAN_FILE += .lua
662 CLEAN_PKG += lua
663 DISTCLEAN_PKG += lua-$(LUA_VERSION).tar.gz
665 # ***************************************************************************
666 # libmad
667 # ***************************************************************************
669 libmad-$(LIBMAD_VERSION).tar.gz:
670 $(WGET) $(LIBMAD_URL)
672 libmad: libmad-$(LIBMAD_VERSION).tar.gz
673 $(EXTRACT_GZ)
674 ifdef HAVE_DARWIN_OS
675 ( cd $@; sed -e 's%-march=i486%$(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)%' -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig configure )
676 endif
678 .mad: libmad
679 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="-O3 $(NOTHUMB)" && make && make install)
680 $(INSTALL_NAME)
681 touch $@
683 CLEAN_FILE += .mad
684 CLEAN_PKG += libmad
685 DISTCLEAN_PKG += libmad-$(LIBMAD_VERSION).tar.gz
687 # ***************************************************************************
688 # ogg
689 # ***************************************************************************
691 libogg-$(OGG_VERSION).tar.gz:
692 $(WGET) $(OGG_URL)
694 libogg: libogg-$(OGG_VERSION).tar.gz
695 $(EXTRACT_GZ)
696 patch -p0 < Patches/ogg.patch
697 patch -p0 < Patches/libogg-1.1.patch
698 ifdef HAVE_WINCE
699 patch -p0 < Patches/libogg-wince.patch
700 endif
701 (cd $@; autoconf)
703 .ogg: libogg
704 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make install)
705 $(INSTALL_NAME)
706 touch $@
708 CLEAN_FILE += .ogg
709 CLEAN_PKG += libogg
710 DISTCLEAN_PKG += libogg-$(OGG_VERSION).tar.gz
712 # ***************************************************************************
713 # vorbis
714 # ***************************************************************************
716 libvorbis-$(VORBIS_VERSION).tar.gz:
717 $(WGET) $(VORBIS_URL)
719 libvorbis: libvorbis-$(VORBIS_VERSION).tar.gz
720 $(EXTRACT_GZ)
721 patch -p0 < Patches/vorbis-noapps.patch
723 .vorbis: libvorbis .ogg
724 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
725 # $(INSTALL_NAME)
726 touch $@
728 .vorbisenc: .vorbis .ogg
729 # $(INSTALL_NAME)
730 touch $@
732 CLEAN_FILE += .vorbis .vorbisenc
733 CLEAN_PKG += libvorbis
734 DISTCLEAN_PKG += libvorbis-$(VORBIS_VERSION).tar.gz
736 # ***************************************************************************
737 # tremor
738 # ***************************************************************************
740 ifdef SVN
741 tremor:
742 $(SVN) co http://svn.xiph.org/trunk/Tremor tremor
743 (cd $@ && patch -p0 < ../Patches/tremor.patch)
744 (cd $@; rm -f ogg.h && echo "#include <ogg/ogg.h>" > ogg.h && rm -f os_types.h && echo "#include <ogg/os_types.h>" > os_types.h)
745 else
746 tremor-$(TREMOR_VERSION).tar.bz2:
747 echo "tremor snapshot does not exist, you MUST use subversion !"
748 exit -1
749 $(WGET) $(TREMOR_URL)
751 tremor: tremor-$(TREMOR_VERSION).tar.bz2
752 $(EXTRACT_BZ2)
753 endif
755 .tremor: tremor .ogg
756 (cd $<; $(HOSTCC) ./autogen.sh $(HOSTCONF) --prefix=$(PREFIX) --disable-shared CFLAGS="$(NOTHUMB)" && make && make install)
757 $(INSTALL_NAME)
758 touch $@
760 ifdef SVN
761 tremor-source: tremor
762 tar cv --exclude=.svn tremor | bzip2 > tremor-$(DATE).tar.bz2
764 SOURCE += tremor-source
765 endif
767 CLEAN_FILE += .tremor
768 CLEAN_PKG += tremor
769 #DISTCLEAN_PKG += tremor-$(TREMOR_VERSION).tar.bz2 #no tremor snapshot
771 # ***************************************************************************
772 # theora
773 # ***************************************************************************
775 libtheora-$(THEORA_VERSION).tar.bz2:
776 $(WGET) $(THEORA_URL)
778 libtheora: libtheora-$(THEORA_VERSION).tar.bz2
779 $(EXTRACT_BZ2)
780 patch -p0 < Patches/libtheora-includes.patch
782 THEORACONF = --disable-sdltest --disable-oggtest --disable-vorbistest --disable-examples
784 ifdef HAVE_DARWIN_64
785 THEORACONF += --disable-asm
786 endif
787 ifdef HAVE_WIN64
788 THEORACONF += --disable-asm
789 endif
791 .theora: libtheora .ogg
792 ifdef HAVE_DARWIN_OS
793 cd $<; ($(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(THEORACONF) && make && make install)
794 else
795 ifdef HAVE_WIN32
796 cd $<; $(HOSTCC) ./autogen.sh $(HOSTCONF) --prefix=$(PREFIX) $(THEORACONF)
797 endif
798 if test ! -f $</config.status; then \
799 cd $< ; \
800 $(HOSTCC) ./configure $(HOSTCONF) \
801 --prefix=$(PREFIX) $(THEORACONF) ; \
803 cd $< && make && make install
804 endif
805 $(INSTALL_NAME)
806 touch $@
808 CLEAN_FILE += .theora
809 CLEAN_PKG += libtheora
810 DISTCLEAN_PKG += libtheora-$(THEORA_VERSION).tar.bz2
812 # ***************************************************************************
813 # shout
814 # ***************************************************************************
816 libshout-$(SHOUT_VERSION).tar.gz:
817 $(WGET) $(SHOUT_URL)
819 libshout: libshout-$(SHOUT_VERSION).tar.gz
820 $(EXTRACT_GZ)
821 ifdef HAVE_WIN32
822 patch -p0 < Patches/libshout-win32.patch
823 endif
825 .shout: libshout .theora .ogg .speex .vorbis
826 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install )
827 $(INSTALL_NAME)
828 touch $@
830 CLEAN_FILE += .shout
831 CLEAN_PKG += libshout
832 DISTCLEAN_PKG += libshout-$(SHOUT_VERSION).tar.gz
834 # ***************************************************************************
835 # flac
836 # ***************************************************************************
838 flac-$(FLAC_VERSION).tar.gz:
839 $(WGET) $(FLAC_URL)
841 flac: flac-$(FLAC_VERSION).tar.gz
842 $(EXTRACT_GZ)
843 ifdef HAVE_WIN32
844 patch -p0 < Patches/flac-win32.patch
845 endif
846 ifdef HAVE_DARWIN_OS
847 ( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig configure )
848 endif
850 FLAC_DISABLE_FLAGS = --disable-oggtest --disable-xmms-plugin --disable-cpplibs
852 .flac: flac .ogg
853 ifdef HAVE_DARWIN_OS_ON_INTEL
854 cd $< && \
855 $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-asm-optimizations $(FLAC_DISABLE_FLAGS)
856 else
857 cd $< && \
858 $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS)
859 endif
860 cd $</src && \
861 make -C libFLAC && \
862 echo 'Requires.private: ogg' >> libFLAC/flac.pc && \
863 make -C libFLAC install
864 cd $< && make -C include install
865 $(INSTALL_NAME)
866 touch $@
868 CLEAN_FILE += .flac
869 CLEAN_PKG += flac
870 DISTCLEAN_PKG += flac-$(FLAC_VERSION).tar.gz
872 # ***************************************************************************
873 # speex
874 # ***************************************************************************
876 speex-$(SPEEX_VERSION).tar.gz:
877 $(WGET) $(SPEEX_URL)
879 speex: speex-$(SPEEX_VERSION).tar.gz
880 $(EXTRACT_GZ)
881 patch -p0 < Patches/speex.patch
883 .speex: speex
884 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-ogg=no && make && make install)
885 $(INSTALL_NAME)
886 touch $@
888 CLEAN_FILE += .speex
889 CLEAN_PKG += speex
890 DISTCLEAN_PKG += speex-$(SPEEX_VERSION).tar.gz
892 # ***************************************************************************
893 # faad2
894 # ***************************************************************************
896 faad2-$(FAAD2_VERSION).tar.gz:
897 $(WGET) $(FAAD2_URL)
899 faad2: faad2-$(FAAD2_VERSION).tar.gz
900 $(EXTRACT_GZ)
901 (cd $@; echo|$(CC) -iquote . -E - || sed -i 's/-iquote /-I/' libfaad/Makefile.am; sh ./bootstrap)
902 patch -p0 < Patches/faad-arm-fixed.patch
904 .faad: faad2
905 (cd $< && $(HOSTCC) ./configure $(HOSTCONF) --disable-shared --prefix=$(PREFIX) CFLAGS="-O3 $(NOTHUMB)" && sed -i.orig "s/shrext_cmds/shrext/g" libtool && make -C libfaad && make -C libfaad install)
906 touch $@
908 CLEAN_FILE += .faad
909 CLEAN_PKG += faad2
910 DISTCLEAN_PKG += faad2-$(FAAD2_VERSION).tar.gz
912 # ***************************************************************************
913 # lame
914 # ***************************************************************************
916 lame-$(LAME_VERSION).tar.gz:
917 $(WGET) $(LAME_URL)
919 lame: lame-$(LAME_VERSION).tar.gz
920 $(EXTRACT_GZ)
922 .lame: lame
923 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-analyser-hooks --disable-decoder --disable-shared --disable-gtktest --disable-frontend && make && make install)
924 touch $@
926 CLEAN_FILE += .lame
927 CLEAN_PKG += lame
928 DISTCLEAN_PKG += lame-$(LAME_VERSION).tar.gz
930 # ***************************************************************************
931 # libebml
932 # ***************************************************************************
934 libebml-$(LIBEBML_VERSION).tar.bz2:
935 $(WGET) $(LIBEBML_URL)
937 libebml: libebml-$(LIBEBML_VERSION).tar.bz2
938 $(EXTRACT_BZ2)
939 ifdef HAVE_WIN32
940 (cd $@; patch -p0 < ../Patches/libebml-svn-win32.patch)
941 endif
942 ifdef HAVE_WIN64
943 patch -p0 < Patches/libebml-win64.patch
944 endif
946 .ebml: libebml
947 ifdef HAVE_WIN32
948 (cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC2) CFLAGS="$(CFLAGS) -DWIN32" SHARED=no && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC2))
949 else
950 (cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
951 $(RANLIB) $(PREFIX)/lib/libebml.a
952 endif
953 touch $@
955 CLEAN_FILE += .ebml
956 CLEAN_PKG += libebml
957 DISTCLEAN_PKG += libebml-$(LIBEBML_VERSION).tar.bz2
959 # ***************************************************************************
960 # libmatroska
961 # ***************************************************************************
963 libmatroska-$(LIBMATROSKA_VERSION).tar.bz2:
964 $(WGET) $(LIBMATROSKA_URL)
966 libmatroska: libmatroska-$(LIBMATROSKA_VERSION).tar.bz2
967 $(EXTRACT_BZ2)
968 patch -p0 < ./Patches/libmatroska-kaxblock.patch
969 ifdef HAVE_WIN32
970 (cd $@; patch -p0 < ../Patches/libmatroska-win32.patch)
971 endif
973 .matroska: libmatroska .ebml
974 ifdef HAVE_WIN32
975 (cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC2) SHARED=no EBML_DLL=no libmatroska.a && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC2))
976 else
977 (cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
978 $(RANLIB) $(PREFIX)/lib/libmatroska.a
979 endif
980 touch $@
983 CLEAN_FILE += .matroska
984 CLEAN_PKG += libmatroska
985 DISTCLEAN_PKG += libmatroska-$(LIBMATROSKA_VERSION).tar.bz2
987 # ***************************************************************************
988 # libamrnb
989 # ***************************************************************************
991 amrnb-$(LIBAMR_NB_VERSION).tar.bz2:
992 $(WGET) $(LIBAMR_NB)
994 libamrnb: amrnb-$(LIBAMR_NB_VERSION).tar.bz2
995 $(EXTRACT_BZ2)
997 .libamrnb: libamrnb
998 (cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --enable-shared && make && make install)
999 touch $@
1001 CLEAN_FILE += .libamrnb
1002 CLEAN_PKG += libamrnb
1003 DISTCLEAN_PKG += amrnb-$(LIBAMR_NB_VERSION).tar.bz2
1005 # ***************************************************************************
1006 # libamrwb
1007 # ***************************************************************************
1009 amrwb-$(LIBAMR_WB_VERSION).tar.bz2:
1010 $(WGET) $(LIBAMR_WB)
1012 libamrwb: amrwb-$(LIBAMR_WB_VERSION).tar.bz2
1013 $(EXTRACT_BZ2)
1015 .libamrwb: libamrwb
1016 (cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --enable-shared && make && make install)
1017 touch $@
1020 CLEAN_FILE += .libamrwb
1021 CLEAN_PKG += libamrwb
1022 DISTCLEAN_PKG += amrwb-$(LIBAMR_WB_VERSION).tar.bz2
1024 # ***************************************************************************
1026 # ffmpeg
1027 # ***************************************************************************
1029 ifdef SVN
1030 ifdef HAVE_WIN32
1031 ffmpeg: .dshow_headers
1032 else
1033 ffmpeg:
1034 endif
1035 $(SVN) co $(FFMPEG_SVN) ffmpeg
1036 ifdef HAVE_ISA_THUMB
1037 patch -p0 < Patches/ffmpeg-avcodec-no-thumb.patch
1038 endif
1039 ifdef HAVE_WIN64
1040 (cd ffmpeg/libswscale; patch -p0 < ../../Patches/ffmpeg-win64.patch;)
1041 endif
1042 ifdef HAVE_UCLIBC
1043 patch -p0 < Patches/ffmpeg-svn-uclibc.patch
1044 patch -p0 < Patches/ffmpeg-svn-internal-define.patch
1045 patch -p0 < Patches/ffmpeg-svn-libavformat.patch
1046 endif
1047 else
1048 ffmpeg-$(FFMPEG_VERSION).tar.gz:
1049 echo "ffmpeg snapshot is too old, you MUST use subversion !"
1050 exit -1
1051 $(WGET) $(FFMPEG_URL)
1053 ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz
1054 $(EXTRACT_GZ)
1055 endif
1057 FFMPEGCONF += \
1058 --disable-debug \
1059 --enable-gpl \
1060 --enable-postproc \
1061 --disable-ffserver \
1062 --disable-ffmpeg \
1063 --disable-ffplay \
1064 --disable-devices \
1065 --disable-protocols \
1066 --disable-filters \
1067 --disable-network
1068 ifdef HAVE_WIN64
1069 FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --enable-libmp3lame --enable-w32threads --disable-dxva2 --disable-bsfs
1070 else
1071 ifdef HAVE_WIN32
1072 FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --enable-libmp3lame --enable-w32threads --enable-dxva2 --disable-bsfs
1073 else
1074 FFMPEGCONFG += --enable-pthreads
1075 endif
1076 endif
1078 ifdef HAVE_WINCE
1079 .ffmpeg: ffmpeg .zlib
1080 else
1081 ifdef HAVE_UCLIBC
1082 .ffmpeg: ffmpeg
1083 else
1084 .ffmpeg: ffmpeg .lame .gsm
1085 endif
1086 endif
1087 (cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --extra-cflags="$(CFLAGS) $(FFMPEG_CFLAGS)" --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) --disable-shared --enable-static && make && make install-libs install-headers)
1088 touch $@
1090 ifdef SVN
1091 ffmpeg-source: ffmpeg
1092 tar cv --exclude=.svn ffmpeg | bzip2 > ffmpeg-$(DATE).tar.bz2
1094 SOURCE += ffmpeg-source
1095 endif
1097 CLEAN_FILE += .ffmpeg
1098 CLEAN_PKG += ffmpeg
1099 DISTCLEAN_PKG += ffmpeg-$(FFMPEG_VERSION).tar.gz
1101 # ***************************************************************************
1102 # libdvdcss
1103 # ***************************************************************************
1105 libdvdcss-$(LIBDVDCSS_VERSION).tar.bz2:
1106 $(WGET) $(LIBDVDCSS_URL)
1108 # ifdef SVN
1109 # libdvdcss:
1110 # $(SVN) co svn://svn.videolan.org/libdvdcss/trunk libdvdcss
1111 # cd $@ && sh bootstrap
1112 # else
1113 libdvdcss: libdvdcss-$(LIBDVDCSS_VERSION).tar.bz2
1114 $(EXTRACT_BZ2)
1115 # endif
1117 .dvdcss: libdvdcss
1118 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --disable-doc --prefix=$(PREFIX) && make && make install)
1119 $(INSTALL_NAME)
1120 touch $@
1122 # ifdef SVN
1123 # libdvdcss-source: libdvdcss
1124 # tar cv --exclude=.svn libdvdcss | bzip2 > libdvdcss-$(DATE).tar.bz2
1126 # SOURCE += libdvdcss-source
1127 # endif
1129 CLEAN_FILE += .dvdcss
1130 CLEAN_PKG += libdvdcss
1131 DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.bz2
1133 # ***************************************************************************
1134 # dummy dvdread to trigger the INSTALL_NAME script
1135 # ***************************************************************************
1136 # .dvdread: .dvdnav
1137 # $(INSTALL_NAME)
1138 # touch $@
1140 # CLEAN_FILE += .dvdread
1142 # ***************************************************************************
1143 # libdvdread: We use dvdnav's dvdread
1144 # ***************************************************************************
1145 libdvdread:
1146 $(SVN) co $(LIBDVDREAD_SVN) libdvdread
1147 (cd $@; patch -p 0 < ../Patches/libdvdread-dvdcss-static.patch)
1148 ifdef HAVE_WIN32
1149 (cd $@; patch -p 0 < ../Patches/libdvdread-win32.patch)
1150 endif
1151 (cd $@; sh autogen.sh noconfig)
1153 .libdvdread: libdvdread .dvdcss
1154 (cd libdvdread; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --with-libdvdcss=$(PREFIX) && make && make install)
1155 $(INSTALL_NAME)
1156 touch $@
1158 CLEAN_FILE += .libdvdread
1159 CLEAN_PKG += libdvdread
1160 #DISTCLEAN_PKG += libdvdread-$(LIBDVDREAD_VERSION).tar.gz
1162 # ***************************************************************************
1163 # libdvdnav
1164 # ***************************************************************************
1166 ifdef SVN
1167 libdvdnav:
1168 $(SVN) co $(LIBDVDNAV_SVN) libdvdnav
1169 patch -d libdvdnav -p0 < Patches/libdvdnav.patch
1170 (cd $@; ./autogen.sh noconfig)
1171 else
1172 libdvdnav-$(LIBDVDNAV_VERSION).tar.gz:
1173 $(WGET) $(LIBDVDNAV_URL)
1175 libdvdnav: libdvdnav-$(LIBDVDNAV_VERSION).tar.gz
1176 $(EXTRACT_GZ)
1177 patch -p0 < Patches/libdvdnav.patch
1178 ifdef HAVE_WIN32
1179 patch -p0 < Patches/libdvdnav-win32.patch
1180 endif
1181 (cd $@; ./autogen.sh noconfig)
1182 endif
1184 .dvdnav: libdvdnav .libdvdread
1185 ifdef HAVE_WIN32
1186 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) && make && make install)
1187 else
1188 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make && make install)
1189 endif
1190 $(INSTALL_NAME)
1191 touch $@
1193 CLEAN_FILE += .dvdnav
1194 CLEAN_PKG += libdvdnav
1195 DISTCLEAN_PKG += libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2
1197 # ***************************************************************************
1198 # libdvbpsi
1199 # ***************************************************************************
1201 libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz:
1202 $(WGET) $(LIBDVBPSI_URL)
1204 libdvbpsi: libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1205 $(EXTRACT_GZ)
1207 .dvbpsi: libdvbpsi
1208 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd src && make && make install)
1209 $(INSTALL_NAME)
1210 touch $@
1212 CLEAN_FILE += .dvbpsi
1213 CLEAN_PKG += libdvbpsi
1214 DISTCLEAN_PKG += libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1216 # ***************************************************************************
1217 # live
1218 # ***************************************************************************
1220 live555-$(LIVEDOTCOM_VERSION).tar.gz:
1221 $(WGET) $(LIVEDOTCOM_URL)
1223 live: live555-$(LIVEDOTCOM_VERSION).tar.gz
1224 $(EXTRACT_GZ)
1225 patch -p0 < Patches/live-uselocale.patch
1226 patch -p0 < Patches/live-inet_ntop.patch
1227 ifdef HAVE_WIN64
1228 patch -p0 < Patches/live-win64.patch
1229 endif
1230 ifndef HAVE_WIN32
1231 ifndef HAVE_WINCE
1232 patch -p0 < Patches/live-getaddrinfo.patch
1233 endif
1234 endif
1236 .live: live
1237 ifdef HAVE_WIN32
1238 (cd $<;./genMakefiles mingw && make $(HOSTCC))
1239 else
1240 ifdef HAVE_WINCE
1241 (cd $<; sed -e 's/-lws2_32/-lws2/g' -i.orig config.mingw)
1242 (cd $<;./genMakefiles mingw && make $(HOSTCC))
1243 else
1244 ifdef HAVE_DARWIN_OS
1245 (cd $<; sed -e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' -e 's%cc%$(CC)%' -e 's%c++%$(CXX)\ $(EXTRA_LDFLAGS)%' -i.orig config.macosx)
1246 (cd $<; ./genMakefiles macosx && make)
1247 else
1248 (cd $<; sed -e 's/=/= EXTRA_CPPFLAGS/' -e 's%EXTRA_CPPFLAGS%-I/include%' -i.orig groupsock/Makefile.head)
1249 ifdef HAVE_UCLIBC
1250 ifdef HAVE_BIGENDIAN
1251 (cd $<; ./genMakefiles armeb-uclibc && make $(HOSTCC))
1252 endif
1253 else
1254 ifeq ($(ARCH)$(HAVE_MAEMO),armel)
1255 (cd $<; ./genMakefiles armlinux && make $(HOSTCC))
1256 else
1257 (cd $<; sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig config.linux)
1258 (cd $<; ./genMakefiles linux && make $(HOSTCC))
1259 endif
1260 endif
1261 endif
1262 endif
1263 endif
1264 mkdir -p $(PREFIX)/lib $(PREFIX)/include
1265 cp $</groupsock/libgroupsock.a $(PREFIX)/lib
1266 cp $</liveMedia/libliveMedia.a $(PREFIX)/lib
1267 cp $</UsageEnvironment/libUsageEnvironment.a $(PREFIX)/lib
1268 cp $</BasicUsageEnvironment/libBasicUsageEnvironment.a $(PREFIX)/lib
1269 cp $</groupsock/include/*.hh $</groupsock/include/*.h $(PREFIX)/include
1270 cp $</liveMedia/include/*.hh $(PREFIX)/include
1271 cp $</UsageEnvironment/include/*.hh $(PREFIX)/include
1272 cp $</BasicUsageEnvironment/include/*.hh $(PREFIX)/include
1273 touch $@
1275 CLEAN_FILE += .live
1276 CLEAN_PKG += live
1277 DISTCLEAN_PKG += live555-$(LIVEDOTCOM_VERSION).tar.gz
1279 # ***************************************************************************
1280 # goom2k4
1281 # ***************************************************************************
1283 goom$(GOOM2k4_VERSION).tar.gz:
1284 $(WGET) $(GOOM2k4_URL)
1285 mv goom-$(GOOM2k4_VERSION)-src.tar.gz goom$(GOOM2k4_VERSION).tar.gz
1287 goom: goom$(GOOM2k4_VERSION).tar.gz
1288 $(EXTRACT_GZ)
1289 ifdef HAVE_WIN32
1290 (cd $@; dos2unix configure.in)
1291 patch -p0 < Patches/goom2k4-0-win32.patch
1292 else
1293 patch -p0 < Patches/goom2k4-0-mmx.patch
1294 endif
1295 patch -p0 < Patches/goom2k4-0-memleaks.patch
1296 patch -p0 < Patches/goom2k4-autotools.patch
1297 (cd $@; rm -f configure; ACLOCAL="aclocal -I m4/" autoreconf -ivf)
1299 .goom2k4: goom
1300 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --disable-glibtest --disable-gtktest && make && make install)
1301 touch $@
1303 CLEAN_FILE += .goom2k4
1304 CLEAN_PKG += goom
1305 DISTCLEAN_PKG += goom$(GOOM2k4_VERSION).tar.gz
1307 # ***************************************************************************
1308 # libcaca
1309 # ***************************************************************************
1311 libcaca-$(LIBCACA_VERSION).tar.gz:
1312 $(WGET) $(LIBCACA_URL)
1314 libcaca: libcaca-$(LIBCACA_VERSION).tar.gz
1315 $(EXTRACT_GZ)
1316 patch -p0 < Patches/libcaca-static.patch
1317 ifdef HAVE_DARWIN_OS
1318 patch -p0 < Patches/libcaca-osx-sdkofourchoice.patch
1319 (cd $@; sed -e 's%/Developer/SDKs/MacOSX10.4u.sdk%$(MACOSX_SDK)%' -i.orig configure)
1320 endif
1322 .caca: libcaca
1323 ifdef HAVE_WIN32
1324 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-win32 --disable-x11 --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx && make && make install)
1325 else
1326 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx && make && make install)
1327 endif
1328 touch $@
1330 CLEAN_FILE += .caca
1331 CLEAN_PKG += libcaca
1332 DISTCLEAN_PKG += libcaca-$(LIBCACA_VERSION).tar.gz
1334 # ***************************************************************************
1335 # libdca
1336 # ***************************************************************************
1338 libdca-$(LIBDCA_VERSION).tar.bz2:
1339 $(WGET) $(LIBDCA_URL)
1341 libdca: libdca-$(LIBDCA_VERSION).tar.bz2
1342 $(EXTRACT_BZ2)
1343 ifdef HAVE_DARWIN_9
1344 ( cd $@; patch -p0 < ../Patches/libdca-llvm-gcc.patch )
1345 endif
1347 .dca: libdca
1348 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1349 $(INSTALL_NAME)
1350 touch $@
1352 CLEAN_FILE += .dca
1353 CLEAN_PKG += libdca
1354 DISTCLEAN_PKG += libdca-$(LIBDCA_VERSION).tar.bz2
1356 # ***************************************************************************
1357 # libx264
1358 # ***************************************************************************
1360 x264-$(X264_VERSION).tar.gz:
1361 $(WGET) $(X264_URL)
1363 ifdef GIT
1364 x264:
1365 $(GIT) clone git://git.videolan.org/x264.git
1366 ifdef HAVE_WIN32
1367 (cd x264; patch -p0 < ../Patches/x264-svn-win32.patch )
1368 endif
1370 else
1372 x264: x264-$(X264_VERSION).tar.gz
1373 $(EXTRACT_GZ)
1374 ifdef HAVE_WIN32
1375 ifndef HAVE_CYGWIN
1376 (cd x264;patch -p0 <../Patches/x264-20050624-win32.patch)
1377 endif
1378 else
1379 patch -p0 < Patches/x264.patch
1380 rm x264/x264.c
1381 endif
1382 endif
1384 ifdef HAVE_WIN32
1385 .x264: x264 .pthreads
1386 ifdef HAVE_CYGWIN
1387 (cd $<; $(HOSTCC) RANLIB="ranlib" AR="ar" STRIP="strip" ./configure $(X264CONF) --prefix="$(PREFIX)" --extra-cflags="-I$(PREFIX)/include" --extra-ldflags="-L$(PREFIX)/lib" && make && make install)
1388 else
1389 (cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" --enable-pthread && make && make install)
1390 endif
1391 else
1392 ifdef HAVE_DARWIN_OS_ON_INTEL
1393 .x264: x264 .yasm
1394 (cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1395 else
1396 .x264: x264
1397 (cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1398 endif
1399 endif
1400 touch $@
1402 ifdef GIT
1403 x264-source: x264
1404 cd x264 && \
1405 git archive --format=tar HEAD | bzip2 > ../x264-$(DATE).tar.bz2
1407 SOURCE += x264-source
1408 endif
1410 CLEAN_FILE += .x264
1411 CLEAN_PKG += x264
1412 DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz
1414 # ***************************************************************************
1415 # libmodplug
1416 # ***************************************************************************
1418 libmodplug-$(MODPLUG_VERSION).tar.gz:
1419 $(WGET) $(MODPLUG_URL)
1421 libmodplug: libmodplug-$(MODPLUG_VERSION).tar.gz
1422 $(EXTRACT_GZ)
1423 ifdef HAVE_WIN32
1424 patch -p0 < Patches/libmodplug-win32.patch
1425 (cd $@; autoreconf -ivf )
1426 endif
1428 .mod: libmodplug
1429 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
1430 touch $@
1432 CLEAN_FILE += .mod
1433 CLEAN_PKG += libmodplug
1434 DISTCLEAN_PKG += libmodplug-$(MODPLUG_VERSION).tar.gz
1436 # ***************************************************************************
1437 # libcddb
1438 # ***************************************************************************
1440 libcddb-$(CDDB_VERSION).tar.bz2:
1441 $(WGET) $(CDDB_URL)
1443 libcddb: libcddb-$(CDDB_VERSION).tar.bz2
1444 $(EXTRACT_BZ2)
1445 (cd $@; patch -p0 < ../Patches/libcddb-cross.patch )
1446 ifdef HAVE_WIN32
1447 (cd $@; patch -p0 < ../Patches/libcddb-win32.patch )
1448 endif
1449 (cd $@; autoreconf -fisv)
1451 ifdef HAVE_WIN32
1452 .cddb: libcddb .regex
1453 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --without-iconv CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make && make install)
1454 else
1455 .cddb: libcddb
1456 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" LDFLAGS="$(LDFLAGS) -liconv" && make && make install)
1457 endif
1458 touch $@
1460 CLEAN_FILE += .cddb
1461 CLEAN_PKG += libcddb
1462 DISTCLEAN_PKG += libcddb-$(CDDB_VERSION).tar.bz2
1464 # ***************************************************************************
1465 # vcdimager
1466 # ***************************************************************************
1468 vcdimager-$(VCDIMAGER_VERSION).tar.gz:
1469 $(WGET) $(VCDIMAGER_URL)
1471 vcdimager: vcdimager-$(VCDIMAGER_VERSION).tar.gz
1472 $(EXTRACT_GZ)
1474 ifdef HAVE_DARWIN_OS
1475 .vcdimager: vcdimager
1476 (cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static LDFLAGS="$(LDFLAGS) -framework CoreFoundation -framework IOKit" && make && make install)
1477 touch $@
1478 else
1479 .vcdimager: vcdimager
1480 (cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
1481 touch $@
1482 endif
1484 CLEAN_FILE += .vcdimager
1485 CLEAN_PKG += vcdimager
1486 DISTCLEAN_PKG += vcdimager-$(VCDIMAGER_VERSION).tar.gz
1488 # ***************************************************************************
1489 # libcdio
1490 # ***************************************************************************
1492 libcdio-$(CDIO_VERSION).tar.gz:
1493 $(WGET) $(CDIO_URL)
1495 libcdio: libcdio-$(CDIO_VERSION).tar.gz
1496 $(EXTRACT_GZ)
1497 patch -p0 < Patches/libcdio-install-cdparanoia-pc.patch
1498 ifdef HAVE_DARWIN_OS
1499 patch -p0 < Patches/libcdio-modernOSX.patch
1500 endif
1502 .cdio: libcdio
1503 (cd $<; sed -e 's%@ENABLE_CPP_TRUE@SUBDIRS = C++%@ENABLE_CPP_TRUE@SUBDIRS = %' -i.orig example/Makefile.in && autoreconf -fisv && ./configure --prefix=$(PREFIX) --without-vcdinfo --disable-shared && make && make install)
1504 touch $@
1506 CLEAN_FILE += .cdio
1507 CLEAN_PKG += libcdio
1508 DISTCLEAN_PKG += libcdio-$(CDIO_VERSION).tar.gz
1510 # ***************************************************************************
1511 # qt4 (win32 binary)
1512 # ***************************************************************************
1514 qt4-$(QT4_VERSION)-win32-bin.tar.bz2:
1515 $(WGET) $(QT4_URL)
1517 qt4_win32: qt4-$(QT4_VERSION)-win32-bin.tar.bz2
1518 $(EXTRACT_BZ2)
1519 chmod -R 755 qt4_win32
1521 .qt4_win32: qt4_win32
1522 (cd qt4_win32;mkdir -p $(PREFIX)/bin; mkdir -p $(PREFIX)/include;mkdir -p $(PREFIX)/lib/pkgconfig;rm -f $(PREFIX)/lib/pkgconfig/Qt*; sed 's,@@PREFIX@@,$(PREFIX),' lib/pkgconfig/QtCore.pc.in > $(PREFIX)/lib/pkgconfig/QtCore.pc;sed 's,@@PREFIX@@,$(PREFIX),' lib/pkgconfig/QtGui.pc.in > $(PREFIX)/lib/pkgconfig/QtGui.pc;cp -r include/* $(PREFIX)/include;cp lib/*a $(PREFIX)/lib)
1523 ifeq ($(BUILD),i686-pc-cygwin)
1524 (cd qt4_win32;cp bin/*.exe $(PREFIX)/bin)
1525 else
1526 (cd qt4_win32;cp bin/* $(PREFIX)/bin)
1527 endif
1528 touch $@
1530 CLEAN_FILE += .qt4_win32
1531 CLEAN_PKG += qt4_win32
1532 DISTCLEAN_PKG += qt4-$(QT4_VERSION)-win32-bin.tar.bz2
1534 # ***************************************************************************
1535 # qt4 (trolltech binaries)
1536 # ***************************************************************************
1538 qt-win-opensource-$(QT4T_VERSION)-mingw.exe:
1539 wget $(QT4T_URL)
1541 Qt_win32: qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1542 mkdir Qt
1543 7z -oQt x qt-win-opensource-$(QT4T_VERSION)-mingw.exe \$$OUTDIR/bin\ /bin \$$OUTDIR/bin\ /lib \$$OUTDIR/bin\ /include/QtCore \$$OUTDIR/bin\ /include/QtGui \$$OUTDIR/bin\ /src/gui \$$OUTDIR/bin\ /src/corelib \$$OUTDIR/bin\ /translations
1544 mv Qt/\$$OUTDIR/bin\ /* Qt/ && rmdir Qt/\$$OUTDIR/bin\ Qt/\$$OUTDIR
1545 find Qt -name '* ' -exec sh -c "mv \"{}\" `echo {}`" \;
1546 find Qt/src -name '*.cpp' -exec rm {} \;
1547 find Qt/translations -type f -a ! -name 'qt_*.qm' -exec rm {} \;
1548 find Qt/include -name '*.h' -exec sh -c "mv {} {}.tmp; sed 's,..\/..\/src,..\/src,' {}.tmp > {}; rm -f {}.tmp" \;
1549 mkdir Qt/lib/pkgconfig
1550 sed -e s,@@VERSION@@,$(QT4T_VERSION), -e s,@@PREFIX@@,$(PREFIX), Patches/QtCore.pc.in > Qt/lib/pkgconfig/QtCore.pc
1551 sed -e s,@@VERSION@@,$(QT4T_VERSION), -e s,@@PREFIX@@,$(PREFIX), Patches/QtGui.pc.in > Qt/lib/pkgconfig/QtGui.pc
1553 .Qt_win32: Qt_win32
1554 mkdir -p $(PREFIX)/bin $(PREFIX)/include/qt4/src $(PREFIX)/lib/pkgconfig $(PREFIX)/share/qt4/translations
1555 cp Qt/bin/moc.exe Qt/bin/rcc.exe Qt/bin/uic.exe $(PREFIX)/bin
1556 cp -r Qt/include/QtCore Qt/include/QtGui $(PREFIX)/include/qt4
1557 cp -r Qt/src/corelib Qt/src/gui $(PREFIX)/include/qt4/src
1558 cp Qt/lib/libQtCore4.a Qt/lib/libQtGui4.a $(PREFIX)/lib
1559 cp Qt/lib/pkgconfig/* $(PREFIX)/lib/pkgconfig
1560 cp Qt/translations/* $(PREFIX)/share/qt4/translations
1561 touch $@
1563 CLEAN_FILE += .Qt_win32
1564 CLEAN_PKG += Qt_win32
1565 DISTCLEAN_PKG += qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1567 # ***************************************************************************
1568 # qt4 (source-code compilation for Mac)
1569 # ***************************************************************************
1571 qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz:
1572 $(WGET) $(QT4_MAC_URL)
1574 qt4_mac: qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz
1575 $(EXTRACT_GZ)
1577 .qt4_mac: qt4_mac
1578 (cd qt4_mac; ./configure -prefix $(PREFIX) -release -fast -no-qt3support -nomake "examples demos" -sdk $(MACOSX_SDK) -no-framework -arch $(ARCH) && make && make install)
1579 touch $@
1581 CLEAN_FILE += .qt4_mac
1582 CLEAN_PKG += qt4_mac
1583 DISTCLEAN_PKG += qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz
1585 # ***************************************************************************
1586 # zlib
1587 # ***************************************************************************
1589 zlib-$(ZLIB_VERSION).tar.gz:
1590 $(WGET) $(ZLIB_URL)
1592 zlib: zlib-$(ZLIB_VERSION).tar.gz
1593 $(EXTRACT_GZ)
1594 patch -p0 < Patches/zlib.patch
1596 .zlib: zlib
1597 (cd zlib; $(HOSTCC2) ./configure --prefix=$(PREFIX) && make install)
1598 $(INSTALL_NAME)
1599 touch $@
1601 CLEAN_FILE += .zlib
1602 CLEAN_PKG += zlib
1603 DISTCLEAN_PKG += zlib-$(ZLIB_VERSION).tar.gz
1605 # ***************************************************************************
1606 # PortAudio
1607 # ***************************************************************************
1609 pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz:
1610 $(WGET) $(PORTAUDIO_URL)
1612 portaudio: pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1613 $(EXTRACT_GZ)
1614 ifneq ($(HOST),$(BUILD))
1615 (patch -p0 < Patches/portaudio-cross.patch;cd $@; autoconf)
1616 endif
1618 .portaudio: portaudio
1619 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1620 $(INSTALL_NAME)
1621 touch $@
1623 CLEAN_FILE += .portaudio
1624 CLEAN_PKG += portaudio
1625 DISTCLEAN_PKG += pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1627 # ***************************************************************************
1628 # xml
1629 # ***************************************************************************
1631 libxml2-$(XML_VERSION).tar.gz:
1632 $(WGET) $(XML_URL)
1634 xml: libxml2-$(XML_VERSION).tar.gz
1635 $(EXTRACT_GZ)
1636 ifdef HAVE_UCLIBC
1637 patch -p0 < Patches/xml2-uclibc.patch
1638 endif
1640 XMLCONF = --with-minimal --with-catalog --with-reader --with-tree --with-push --with-xptr --with-valid --with-xpath --with-xinclude --with-sax1 --without-zlib --without-iconv --without-http --without-ftp --without-debug --without-docbook --without-regexps --without-python
1642 .xml: xml
1643 ifdef HAVE_CYGWIN
1644 (cd xml; ac_cv_header_pthread_h="no" CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1645 else
1646 (cd xml; CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1647 endif
1648 ifndef HAVE_DARWIN_OS
1649 $(INSTALL_NAME)
1650 endif
1651 touch $@
1653 CLEAN_FILE += .xml
1654 CLEAN_PKG += xml
1655 DISTCLEAN_PKG += libxml2-$(XML_VERSION).tar.gz
1657 # ***************************************************************************
1658 # twolame
1659 # ***************************************************************************
1661 twolame-$(TWOLAME_VERSION).tar.gz:
1662 $(WGET) $(TWOLAME_URL)
1664 twolame: twolame-$(TWOLAME_VERSION).tar.gz
1665 $(EXTRACT_GZ)
1666 ifdef HAVE_WIN32
1667 (cd twolame/win32; $(WGET) "http://twolame.svn.sourceforge.net/viewvc/*checkout*/twolame/trunk/win32/winutil.h")
1668 endif
1670 .twolame: twolame
1671 (cd twolame; $(HOSTCC) CFLAGS="${CFLAGS} -DLIBTWOLAME_STATIC" ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd libtwolame && make && make install && cd .. && make install-data)
1672 $(INSTALL_NAME)
1673 touch $@
1675 CLEAN_FILE += .twolame
1676 CLEAN_PKG += twolame
1677 DISTCLEAN_PKG += twolame-$(TWOLAME_VERSION).tar.gz
1679 # ***************************************************************************
1680 # libpng
1681 # ***************************************************************************
1683 libpng-$(PNG_VERSION).tar.bz2:
1684 $(WGET) $(PNG_URL)
1686 libpng: libpng-$(PNG_VERSION).tar.bz2
1687 $(EXTRACT_BZ2)
1688 ifdef HAVE_WIN32
1689 (cd $@; cat ../Patches/libpng-win32.patch | sed s,??PREFIX??,$(PREFIX), | patch -p0)
1690 else
1691 (cat Patches/libpng-osx.patch | sed -e 's%??PREFIX??%$(PREFIX)%' -e 's%??EXTRA_CFLAGS??%$(EXTRA_CFLAGS)%' -e 's%??EXTRA_LDFLAGS??%$(EXTRA_LDFLAGS)%' | patch -p0)
1692 endif
1693 (patch -p0 < Patches/libpng-makefile.patch)
1694 ifdef HAVE_DARWIN_OS_ON_INTEL
1695 (patch -p0 < Patches/libpng-darwin-mactel.patch)
1696 endif
1698 .png: libpng .zlib
1699 ifdef HAVE_DARWIN_OS
1700 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1701 else
1702 ifdef HAVE_WIN32
1703 (cd $<; rm -f INSTALL; cp scripts/makefile.cygwin Makefile && make $(HOSTCC) && make install-static)
1704 else
1705 ifeq ($(PNG_VERSION),1.2.8)
1706 (cd $<; PREFIX=$(PREFIX) DESTDIR=$(PREFIX) cp scripts/makefile.linux Makefile && make && make install)
1707 else
1708 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1709 endif
1710 endif
1711 endif
1712 $(INSTALL_NAME)
1713 touch $@
1715 CLEAN_FILE += .png
1716 CLEAN_PKG += libpng
1717 DISTCLEAN_PKG += libpng-$(PNG_VERSION).tar.bz2
1719 # ***************************************************************************
1720 # libzvbi
1721 # ***************************************************************************
1723 zvbi-$(ZVBI_VERSION).tar.bz2:
1724 $(WGET) $(ZVBI_URL)
1726 zvbi: zvbi-$(ZVBI_VERSION).tar.bz2
1727 $(EXTRACT_BZ2)
1728 ifdef HAVE_WIN32
1729 (cd $@; patch -p1 < ../Patches/zvbi-win32.patch; patch -p1 < ../Patches/zvbi-makefile.patch; autoreconf -ivf)
1730 endif
1732 ifdef HAVE_WIN32
1733 .zvbi: zvbi .pthreads
1734 else
1735 .zvbi: zvbi
1736 endif
1737 ifdef HAVE_DARWIN_OS
1738 (cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -fnested-functions" && make && make install)
1739 else
1740 ifdef HAVE_WIN32
1741 (cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -DPTW32_STATIC_LIB --std=gnu99" && make && make install)
1742 else
1743 (cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make -C src && make -C src install)
1744 endif
1745 endif
1746 $(INSTALL_NAME)
1747 touch $@
1749 CLEAN_FILE += .zvbi
1750 CLEAN_PKG += zvbi
1751 DISTCLEAN_PKG += zvbi-$(ZVBI_VERSION).tar.bz2
1753 # ***************************************************************************
1754 # libraw1394
1755 # ***************************************************************************
1757 libraw1394-$(LIBRAW1394_VERSION).tar.gz:
1758 $(WGET) $(LIBRAW1394_URL)
1760 libraw1394: libraw1394-$(LIBRAW1394_VERSION).tar.gz
1761 $(EXTRACT_GZ)
1763 .raw1394: libraw1394
1764 (cd $<; ./configure --prefix=$(PREFIX) && make && make DESTDIR=$(PREFIX) install)
1765 # sed 's/^typedef u_int8_t byte_t;/\/* typedef u_int8_t byte_t;\*\//'
1766 touch $@
1768 CLEAN_FILE += .raw1394
1769 CLEAN_PKG += libraw1394
1770 DISTCLEAN_PKG += libraw1394-$(LIBRAW1394_VERSION).tar.gz
1772 # ***************************************************************************
1773 # libdc1394
1774 # ***************************************************************************
1776 libdc1394-$(LIBDC1394_VERSION).tar.gz:
1777 $(WGET) $(LIBDC1394_URL)
1779 libdc1394: libdc1394-$(LIBDC1394_VERSION).tar.gz
1780 $(EXTRACT_GZ)
1782 .dc1394: libdc1394
1783 (cd $<; ./configure --prefix=$(PREFIX) && \
1784 patch -p1 < ../Patches/libdc1394-noexamples.patch && \
1785 make && make DESTDIR=$(PREFIX) install)
1786 touch $@
1788 CLEAN_FILE += .dc1394
1789 CLEAN_PKG += libdc1394
1790 DISTCLEAN_PKG += libdc1394-$(LIBDC1394_VERSION).tar.gz
1792 # ***************************************************************************
1793 # gpg-error
1794 # ***************************************************************************
1796 libgpg-error-$(GPGERROR_VERSION).tar.bz2:
1797 $(WGET) $(GPGERROR_URL)
1799 libgpg-error: libgpg-error-$(GPGERROR_VERSION).tar.bz2
1800 $(EXTRACT_BZ2)
1802 .gpg-error: libgpg-error
1803 ifdef HAVE_DARWIN_OS_ON_INTEL
1804 (cd $<; ./autogen.sh)
1805 endif
1806 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls --disable-shared --disable-languages && make && make install)
1807 # $(INSTALL_NAME)
1808 touch $@
1810 CLEAN_FILE += .gpg-error
1811 CLEAN_PKG += libgpg-error
1812 DISTCLEAN_PKG += libgpg-error-$(GPGERROR_VERSION).tar.bz2
1814 # ***************************************************************************
1815 # libgcrypt
1816 # ***************************************************************************
1818 libgcrypt-$(GCRYPT_VERSION).tar.bz2:
1819 $(WGET) $(GCRYPT_URL)
1821 libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2
1822 $(EXTRACT_BZ2)
1823 patch -p0 < Patches/gcrypt.patch
1825 CIPHDIG= --enable-ciphers=aes,des,rfc2268,arcfour --enable-digests=sha1,md5,rmd160 --enable-publickey-digests=dsa
1827 .gcrypt: libgcrypt .gpg-error
1828 ifdef HAVE_WIN32
1829 (cd $<; ./autogen.sh && $(HOSTCC) ./configure $(HOSTCONF) --target=i586-mingw32msvc --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(CIPHDIG) --disable-shared --enable-static --disable-nls && make && make install)
1830 else
1831 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS) -lgpg-error" $(CIPHDIG) && make && make install)
1832 endif
1833 $(INSTALL_NAME)
1834 touch $@
1836 CLEAN_FILE += .gcrypt
1837 CLEAN_PKG += libgcrypt
1838 DISTCLEAN_PKG += libgcrypt-$(GCRYPT_VERSION).tar.bz2
1840 # ***************************************************************************
1841 # opencdk (requires by gnutls 2.x)
1842 # ***************************************************************************
1844 opencdk-$(OPENCDK_VERSION).tar.bz2:
1845 $(WGET) $(OPENCDK_URL)
1847 opencdk: opencdk-$(OPENCDK_VERSION).tar.bz2
1848 $(EXTRACT_BZ2)
1850 .opencdk: opencdk
1851 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(HOSTCC) && make && make install)
1852 touch $@
1854 CLEAN_FILE += .opencdk
1855 CLEAN_PKG += opencdk
1856 DISTCLEAN_PKG += opencdk-$(OPENCDK_VERSION).tar.bz2
1858 # ***************************************************************************
1859 # gnutls
1860 # ***************************************************************************
1862 gnutls-$(GNUTLS_VERSION).tar.bz2:
1863 $(WGET) $(GNUTLS_URL)
1865 gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2
1866 $(EXTRACT_BZ2)
1867 ifdef HAVE_WIN32
1868 patch -p0 < Patches/gnutls-win32.patch
1869 (cd $@; autoreconf)
1870 endif
1872 .gnutls: gnutls .gcrypt .gpg-error
1873 ifdef HAVE_WIN32
1874 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --target=i586-mingw32msvc --disable-cxx -disable-shared --enable-static --disable-nls --with-included-opencdk --with-included-libtasn1 && cd gl && make && cd ../lib && make && make install )
1875 else
1876 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --disable-cxx --with-included-opencdk --disable-guile && make && make install)
1877 endif
1878 $(INSTALL_NAME)
1879 touch $@
1881 CLEAN_FILE += .gnutls
1882 CLEAN_PKG += gnutls
1883 DISTCLEAN_PKG += gnutls-$(GNUTLS_VERSION).tar.bz2
1885 # ***************************************************************************
1886 # libopendaap
1887 # ***************************************************************************
1889 libopendaap-$(DAAP_VERSION).tar.bz2:
1890 $(WGET) $(DAAP_URL)
1892 libopendaap: libopendaap-$(DAAP_VERSION).tar.bz2
1893 $(EXTRACT_BZ2)
1894 patch -p0 < Patches/daap.patch
1896 .opendaap: libopendaap
1897 (cd $<; ./configure --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make install)
1898 $(INSTALL_NAME)
1899 touch $@
1901 CLEAN_FILE += .opendaap
1902 CLEAN_PKG += libopendaap
1903 DISTCLEAN_PKG += libopendaap-$(DAAP_VERSION).tar.bz2
1905 # ***************************************************************************
1906 # glib
1907 # ***************************************************************************
1909 glib-$(GLIB_VERSION).tar.bz2:
1910 $(WGET) $(GLIB_URL)
1912 glib: glib-$(GLIB_VERSION).tar.bz2
1913 $(EXTRACT_BZ2)
1914 (cd $@; patch -p0 < ../Patches/glib-remove-gtkdoc.patch)
1915 ifdef HAVE_DARWIN_64
1916 (cd $@; patch -p0 < ../Patches/glib-Darwin64.patch)
1917 endif
1919 .glib: glib
1920 (cd $<; sh autogen.sh --prefix=$(PREFIX) --host=$(HOST) && make && make install)
1921 touch $@
1923 CLEAN_FILE += .glib
1924 CLEAN_PKG += glib
1925 DISTCLEAN_PKG += glib-$(GLIB_VERSION).tar.gz
1927 # ***************************************************************************
1928 # libIDL
1929 # ***************************************************************************
1931 libIDL-$(LIBIDL_VERSION).tar.bz2:
1932 $(WGET) $(LIBIDL_URL)
1934 libIDL: libIDL-$(LIBIDL_VERSION).tar.bz2
1935 $(EXTRACT_BZ2)
1937 .IDL: libIDL
1938 (cd $<; ./configure --prefix=$(PREFIX) --host=$(HOST) && make && make install )
1939 touch $@
1941 CLEAN_FILE += .IDL
1942 CLEAN_PKG += libIDL
1943 DISTCLEAN_PKG += libIDL-$(LIBIDL_VERSION).tar.gz
1945 # ***************************************************************************
1946 # Gecko SDK
1947 # ***************************************************************************
1949 gecko-sdk:
1950 $(SVN) co $(NPAPI_HEADERS_SVN_URL) -r $(NPAPI_HEADERS_SVN_REVISION) gecko-sdk/include
1952 .gecko: gecko-sdk
1953 rm -rf $(PREFIX)/gecko-sdk
1954 mv gecko-sdk $(PREFIX)
1955 mkdir gecko-sdk #creating an empty dir is faster than copying the whole dir
1956 (cd $<)
1957 touch $@
1959 CLEAN_FILE += .gecko
1960 CLEAN_PKG += gecko-sdk
1961 DISTCLEAN_PKG += xulrunner-1.9.2.en-US.mac-i386.sdk.tar.bz2
1963 # ***************************************************************************
1964 # Gecko SDK win32
1965 # ***************************************************************************
1967 xulrunner-1.9.2.en-US.win32.sdk.zip:
1968 $(WGET) $(GECKO_SDK_WIN32_URL)
1970 libIDL-0.6.3-win32-bin.zip:
1971 $(WGET) $(LIBIDL_WIN32_BIN_URL)
1973 glib-19990228.zip:
1974 $(WGET) $(GLIB_WIN32_BIN_URL)
1976 .gecko-win32: xulrunner-1.9.2.en-US.win32.sdk.zip libIDL-0.6.3-win32-bin.zip glib-19990228.zip
1977 unzip xulrunner-1.9.2.en-US.win32.sdk.zip
1978 rm -rf $(PREFIX)/gecko-sdk
1979 mv xulrunner-sdk $(PREFIX)/gecko-sdk
1980 unzip -j libIDL-0.6.3-win32-bin.zip libIDL-0.6.3-win32-bin/libIDL-0.6.dll -d $(PREFIX)/gecko-sdk/bin
1981 unzip glib-19990228.zip glib-1.2.dll -d $(PREFIX)/gecko-sdk/bin
1982 chmod a+x $(PREFIX)/gecko-sdk/bin/*
1983 touch $@
1985 CLEAN_FILE += .gecko-win32
1986 CLEAN_PKG += gecko-sdk-win32
1987 DISTCLEAN_PKG += xulrunner-1.9.2.en-US.win32.sdk.zip libIDL-0.6.3-win32-bin.zip glib-19990228.zip
1989 # ***************************************************************************
1990 # mozilla-macosx
1992 # Note that this dependency needs to be compiled against the 10.4u SDK using
1993 # using GCC-4.0. Using newer releases of one of these won't lead to a
1994 # successful compilation! Adapt the respective variables in ../config.mak!
1995 # ***************************************************************************
1997 firefox-$(MOZILLA_VERSION)-source.tar.bz2:
1998 $(WGET) $(MOZILLA_URL)
2000 mozilla: firefox-$(MOZILLA_VERSION)-source.tar.bz2
2001 $(EXTRACT_BZ2)
2002 (cd $@; patch -p0 < ../Patches/firefox-darwin.patch)
2004 .mozilla-macosx: mozilla .glib .IDL
2005 ifneq($(SDK_TARGET),"10.4")
2006 echo "Compiling the mozilla target requires the 10.4 SDK!"
2007 exit -1
2008 endif
2009 (cd $<; ./configure --prefix=$(PREFIX)/gecko-sdk-new --enable-default-toolkit=cairo-cocoa --enable-standalone-modules=xpcom,plugin --enable-application=xulrunner && make && make install)
2010 touch $@
2012 CLEAN_FILE += .mozilla-macosx
2013 CLEAN_PKG += mozilla
2014 DISTCLEAN_PKG += firefox-source-$(MOZILLA_VERSION).tar.bz2
2016 # ***************************************************************************
2017 # libjpeg
2018 # ***************************************************************************
2020 jpegsrc.v$(JPEG_VERSION).tar.gz:
2021 $(WGET) $(JPEG_URL)
2023 jpeg-$(JPEG_VERSION): jpegsrc.v$(JPEG_VERSION).tar.gz
2024 $(EXTRACT_GZ)
2026 .jpeg: jpeg-$(JPEG_VERSION)
2027 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(HOSTCC) && make && make install)
2028 $(RANLIB) $(PREFIX)/lib/libjpeg.a
2029 touch $@
2031 CLEAN_FILE += .jpeg
2032 CLEAN_PKG += jpeg-7
2033 DISTCLEAN_PKG += jpegsrc.v$(JPEG_VERSION).tar.gz
2035 # ***************************************************************************
2036 # tiff
2037 # ***************************************************************************
2039 tiff-$(TIFF_VERSION).tar.gz:
2040 $(WGET) $(TIFF_URL)
2042 tiff: tiff-$(TIFF_VERSION).tar.gz
2043 $(EXTRACT_GZ)
2045 .tiff: tiff
2046 ifdef HAVE_WIN32
2047 (cd $<; ./configure --target=i586-mingw32msvc --with-CFLAGS="$(CFLAGS)" --with-JPEG=no --with-ZIP=no --prefix=$(PREFIX) --host=$(HOST) &&make -C port && make -C libtiff && make -C libtiff install)
2048 else
2049 (cd $<; ./configure --with-CFLAGS="$(CFLAGS)" --with-JPEG=no --with-ZIP=no --prefix=$(PREFIX) && make -C port &&make -C libtiff && make -C libtiff install)
2050 endif
2051 $(INSTALL_NAME)
2052 touch $@
2054 CLEAN_FILE += .tiff
2055 CLEAN_PKG += tiff
2056 DISTCLEAN_PKG += tiff-$(TIFF_VERSION).tar.gz
2058 # ***************************************************************************
2059 # LibSDL
2060 # ***************************************************************************
2062 ifndef HAVE_DARWIN_OS
2063 SDL-$(SDL_VERSION).tar.gz:
2064 $(WGET) $(SDL_URL)
2066 SDL: SDL-$(SDL_VERSION).tar.gz
2067 $(EXTRACT_GZ)
2068 else
2069 SDL:
2070 $(SVN) co http://svn.libsdl.org/trunk/SDL -r 4444 SDL
2071 (cd $@; sh autogen.sh)
2072 endif
2074 .SDL: SDL
2075 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-audio --disable-video-x11 --disable-video-aalib --disable-video-dga --disable-video-fbcon --disable-video-directfb --disable-video-ggi --disable-video-svga --disable-directx --enable-joystick --disable-cdrom --disable-threads --disable-sdl-dlopen CFLAGS="$(CFLAGS)" && make && make install)
2076 $(INSTALL_NAME)
2077 touch $@
2079 CLEAN_FILE += .SDL
2080 CLEAN_PKG += SDL
2081 DISTCLEAN_PKG += SDL-$(SDL_VERSION).tar.gz
2083 # ***************************************************************************
2084 # SDL_image
2085 # ***************************************************************************
2087 SDL_image-$(SDL_IMAGE_VERSION).tar.gz:
2088 $(WGET) $(SDL_IMAGE_URL)
2090 SDL_image: SDL_image-$(SDL_IMAGE_VERSION).tar.gz
2091 $(EXTRACT_GZ)
2092 patch -p0 < Patches/SDL_image.patch
2094 .SDL_image: SDL_image .SDL .png .jpeg .tiff
2095 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --enable-tif --disable-sdltest && make && make install)
2096 $(INSTALL_NAME)
2097 touch $@
2099 CLEAN_FILE += .SDL_image
2100 CLEAN_PKG += SDL_image
2101 DISTCLEAN_PKG += SDL_image-$(SDL_IMAGE_VERSION).tar.gz
2103 # ***************************************************************************
2104 # Musepack decoder library (libmpcdec)
2105 # ***************************************************************************
2107 libmpcdec-$(MUSE_VERSION).tar.bz2:
2108 $(WGET) $(MUSE_URL)
2110 mpcdec: libmpcdec-$(MUSE_VERSION).tar.bz2
2111 $(EXTRACT_BZ2)
2112 patch -p0 < Patches/mpcdec.patch
2113 (cd $@; autoreconf -ivf)
2115 .mpcdec: mpcdec
2116 ifdef HAVE_WIN32
2117 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS=-D_PTRDIFF_T=mpc_int32_t && make && make install)
2118 else
2119 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2120 endif
2121 ifdef HAVE_DARWIN_OS
2122 $(INSTALL_NAME)
2123 endif
2124 touch $@
2126 CLEAN_FILE += .mpcdec
2127 CLEAN_PKG += mpcdec
2128 DISTCLEAN_PKG += libmpcdec-$(MUSE_VERSION).tar.bz2
2130 # ***************************************************************************
2131 # Dirac
2132 # ***************************************************************************
2134 dirac-$(DIRAC_VERSION).tar.gz:
2135 $(WGET) $(DIRAC_URL)
2137 dirac: dirac-$(DIRAC_VERSION).tar.gz
2138 $(EXTRACT_GZ)
2139 ifdef HAVE_CYGWIN
2140 # incorrect compile warning with cygwin compiler 3.4.4
2141 patch -p0 < Patches/dirac-cygwin.patch
2142 endif
2143 patch -p0 < Patches/dirac-noutils.patch
2144 (cd $@; ./bootstrap)
2146 DIRAC_SUBDIRS = libdirac_byteio libdirac_common libdirac_motionest libdirac_encoder libdirac_decoder
2148 ifdef HAVE_WIN32
2149 DIRAC_SUBDIRS += win32
2150 endif
2152 .dirac: dirac
2153 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && DOC_DIR="" make $(DIRAC_SUBDIRS) && DOC_DIR="" make install)
2154 touch $@
2156 # for MacOS X, dirac is split into two libraries, which needs be installed using two targets
2157 .dirac_encoder: .dirac
2158 $(INSTALL_NAME)
2159 touch $@
2161 .dirac_decoder: .dirac
2162 $(INSTALL_NAME)
2163 touch $@
2165 CLEAN_FILE += .dirac
2166 CLEAN_PKG += dirac
2167 DISTCLEAN_PKG += dirac-$(DIRAC_VERSION).tar.gz
2169 # *************************************************************************
2170 # DirectX headers
2171 # *************************************************************************
2172 win32-dx7headers.tgz:
2173 $(WGET) $(DX_HEADERS_URL)
2174 .dx_headers: win32-dx7headers.tgz
2175 tar xzf $< -C $(PREFIX)/include
2176 touch $@
2177 CLEAN_FILE += .dx_headers
2178 DISTCLEAN_PKG += win32-dx7headers.tgz
2180 # *************************************************************************
2181 # DirectShow headers
2182 # *************************************************************************
2183 dshow-headers.tgz:
2184 $(WGET) $(DSHOW_HEADERS_URL)
2186 dxva2api.h:
2187 $(WGET) $(DXVA2_URL)
2189 .dshow_headers: dshow-headers.tgz dxva2api.h
2190 tar xzf $< -C $(PREFIX)/include
2191 cp dxva2api.h $(PREFIX)/include
2192 touch $@
2194 CLEAN_FILE += .dshow_headers
2195 DISTCLEAN_PKG += dshow-headers.tgz dxva2api.h
2197 # ***************************************************************************
2198 # libexpat
2199 # ***************************************************************************
2201 expat-$(EXPAT_VERSION).tar.gz:
2202 $(WGET) $(EXPAT_URL)
2204 expat: expat-$(EXPAT_VERSION).tar.gz
2205 $(EXTRACT_GZ)
2207 .expat: expat
2208 ifdef HAVE_DARWIN_OS
2209 (cd $< aclocal --force && libtoolize --force && autoconf --force && autoheader --force )
2210 endif
2211 (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
2212 touch $@
2214 CLEAN_FILE += .expat
2215 CLEAN_PKG += expat
2216 DISTCLEAN_PKG += expat-$(EXPAT_VERSION).tar.gz
2218 # ***************************************************************************
2219 # CyberLink C++ UPnP library
2220 # ***************************************************************************
2222 clinkcc$(CLINKCC_VERSION).tar.gz:
2223 $(WGET) $(CLINKCC_URL)
2225 clinkcc: clinkcc$(CLINKCC_VERSION).tar.gz
2226 tar xzf $<
2227 mv $(patsubst %.tar.gz,Cyberlink,$(patsubst %.tgz,Cyberlink,$(notdir $<))) $@ || true
2228 touch $@
2229 patch -p0 < Patches/clinkcc.patch
2230 ifdef HAVE_DARWIN_OS
2231 patch -p0 < Patches/clinkcc_osx.patch
2232 endif
2233 (cd $@; ./bootstrap)
2235 .clinkcc: clinkcc
2236 (cd $<;./configure --prefix=$(PREFIX) --enable-expat && make && chmod 755 config/install-sh && make install )
2237 touch $@
2239 CLEAN_FILE += .clinkcc
2240 CLEAN_PKG += clinkcc
2241 DISTCLEAN_PKG += clinkcc$(CLINKCC_VERSION).tar.gz
2243 # ***************************************************************************
2244 # YASM assembler
2245 # ***************************************************************************
2247 yasm-$(YASM_VERSION).tar.gz:
2248 $(WGET) $(YASM_URL)
2250 yasm: yasm-$(YASM_VERSION).tar.gz
2251 $(EXTRACT_GZ)
2253 .yasm: yasm
2254 (cd $< && $(HOSTCC) ./configure --prefix=$(PREFIX) --host=$(HOST) && make && make install)
2255 touch $@
2257 CLEAN_FILE += .yasm
2258 CLEAN_PKG += yasm
2259 DISTCLEAN_PKG += yasm-$(YASM_VERSION).tar.gz
2261 # ***************************************************************************
2262 # kate
2263 # ***************************************************************************
2265 libkate-$(KATE_VERSION).tar.gz:
2266 $(WGET) $(KATE_URL)
2268 libkate: libkate-$(KATE_VERSION).tar.gz
2269 $(EXTRACT_GZ)
2271 .kate: libkate .ogg
2272 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-valgrind --disable-doc && make && make install)
2273 $(INSTALL_NAME)
2274 touch $@
2276 CLEAN_FILE += .kate
2277 CLEAN_PKG += libkate
2278 DISTCLEAN_PKG += libkate-$(KATE_VERSION).tar.gz
2280 # ***************************************************************************
2281 # tiger
2282 # ***************************************************************************
2284 libtiger-$(TIGER_VERSION).tar.gz:
2285 $(WGET) $(TIGER_URL)
2287 libtiger: libtiger-$(TIGER_VERSION).tar.gz
2288 $(EXTRACT_GZ)
2290 .tiger: libtiger .kate
2291 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2292 $(INSTALL_NAME)
2293 touch $@
2295 CLEAN_FILE += .tiger
2296 CLEAN_PKG += libtiger
2297 DISTCLEAN_PKG += libtiger-$(TIGER_VERSION).tar.gz
2299 # ***************************************************************************
2300 # Copy aclocal files
2301 # This is necessary for --missing aclocal to succeed after a
2302 # configure.ac/Makefile.am change in the vlc root dir
2303 # **************************************************************************
2305 .aclocal:
2306 cp -R $(PREFIX)/share/aclocal/* ../../../m4/
2307 touch $@
2309 CLEAN_FILE += .aclocal
2311 # ***************************************************************************
2312 # TagLib read and editing of tags of popular audio formats
2313 # ***************************************************************************
2315 taglib-$(TAGLIB_VERSION).tar.gz:
2316 $(WGET) $(TAGLIB_URL)
2318 taglib: taglib-$(TAGLIB_VERSION).tar.gz
2319 $(EXTRACT_GZ)
2320 ifdef HAVE_WIN32
2321 patch -p0 < Patches/taglib-static.patch
2322 endif
2323 ifdef HAVE_CYGWIN
2324 patch -p0 < Patches/taglib-cygwin.patch
2325 endif
2327 .tag: taglib
2328 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2329 $(INSTALL_NAME)
2330 touch $@
2332 CLEAN_FILE += .tag
2333 CLEAN_PKG += taglib
2334 DISTCLEAN_PKG += taglib-$(TAGLIB_VERSION).tar.gz
2336 # ***************************************************************************
2337 # pthreads for win32
2338 # ***************************************************************************
2340 pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz:
2341 $(WGET) $(PTHREADS_URL)
2343 pthreads: pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
2344 $(EXTRACT_GZ)
2345 (cd $@; patch -p0 < ../Patches/pthreads-detach.patch)
2346 ifdef HAVE_WIN64
2347 (patch -p0 < Patches/pthreads-win64.patch)
2348 endif
2350 .pthreads: pthreads
2351 (cd $<; $(HOSTCC) make $(PTHREADSCONF) GC GC-static && mkdir -p $(PREFIX)/include && cp -v pthread.h sched.h semaphore.h $(PREFIX)/include/ && mkdir -p $(PREFIX)/lib && cp -v *.a *.dll $(PREFIX)/lib/)
2352 $(INSTALL_NAME)
2353 touch $@
2355 CLEAN_FILE += .pthreads
2356 CLEAN_PKG += pthreads
2357 DISTCLEAN_PKG += pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
2359 # ***************************************************************************
2360 # ncurses library (with wide chars support)
2361 # ***************************************************************************
2363 ncurses-$(NCURSES_VERSION).tar.gz:
2364 $(WGET) $(NCURSES_URL)
2366 ncurses: ncurses-$(NCURSES_VERSION).tar.gz
2367 $(EXTRACT_GZ)
2369 .ncurses: ncurses
2370 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=/usr --without-debug --enable-widec --without-develop --without-shared && make -C ncurses && make -C include && make -C ncurses DESTDIR=$(PREFIX) install && make -C include DESTDIR=$(PREFIX) install)
2371 (cp -R $(PREFIX)/usr/* $(PREFIX) && rm -rf $(PREFIX)/usr)
2372 touch $@
2374 CLEAN_FILE += .ncurses
2375 CLEAN_PKG += ncurses
2376 DISTCLEAN_PKG += ncurses-$(NCURSES_VERSION).tar.gz
2378 # ***************************************************************************
2379 # FluidSynth library (Midi)
2380 # ***************************************************************************
2382 fluidsynth-$(FLUID_VERSION).tar.gz:
2383 $(WGET) $(FLUID_URL)
2385 fluidsynth: fluidsynth-$(FLUID_VERSION).tar.gz
2386 $(EXTRACT_GZ)
2387 ifdef HAVE_WIN32
2388 patch -p0 < Patches/fluid-win32.patch
2389 cd $@; ./autogen.sh || true
2390 endif
2392 .fluid: fluidsynth
2393 cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) \
2394 --disable-ladspa \
2395 --disable-oss-support \
2396 --disable-alsa-support \
2397 --disable-midishare \
2398 --disable-jack-support \
2399 --disable-coreaudio \
2400 --disable-lash \
2401 --disable-ladcca \
2402 --disable-portaudio-support \
2403 --without-readline
2404 cd $< && make
2405 cd $< && make install
2406 touch $@
2408 CLEAN_FILE += .fluid
2409 CLEAN_PKG += fluidsynth
2410 DISTCLEAN_PKG += fluidsynth-$(FLUID_VERSION).tar.gz
2412 # ***************************************************************************
2413 # liboil
2414 # ***************************************************************************
2416 liboil-$(OIL_VERSION).tar.gz:
2417 $(WGET) $(OIL_URL)
2419 liboil: liboil-$(OIL_VERSION).tar.gz
2420 $(EXTRACT_GZ)
2421 patch -d liboil -p1 < Patches/liboil-noshared.patch
2422 patch -d liboil -p1 < Patches/liboil-win64.patch
2423 patch -d liboil -p1 < Patches/liboil-Xcompile.patch
2424 (cd $@; autoreconf)
2426 .liboil: liboil
2427 ifdef HAVE_DARWIN_OS
2428 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)")
2429 else
2430 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O2")
2431 endif
2432 (cd $<; make && make install)
2433 touch $@
2435 CLEAN_FILE += .liboil
2436 CLEAN_PKG += liboil
2437 DISTCLEAN_PKG += liboil-$(OIL_VERSION).tar.gz
2439 # ***************************************************************************
2440 # Schroedinger library
2441 # ***************************************************************************
2443 schroedinger-$(SCHROED_VERSION).tar.gz:
2444 $(WGET) $(SCHROED_URL)
2446 schroedinger: schroedinger-$(SCHROED_VERSION).tar.gz
2447 $(EXTRACT_GZ)
2448 patch -p0 < Patches/schroedinger-notests.patch
2449 (cd $@; autoreconf -iv)
2451 .schroedinger: schroedinger .liboil
2452 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --with-thread=none --disable-gtk-doc --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make && make install)
2453 touch $@
2455 CLEAN_FILE += .schroedinger
2456 CLEAN_PKG += schroedinger
2457 DISTCLEAN_PKG += schroedinger-$(SCHROED_VERSION).tar.gz
2459 # ***************************************************************************
2460 # libass
2461 # ***************************************************************************
2463 libass-$(ASS_VERSION).tar.bz2:
2464 $(WGET) $(ASS_URL)
2466 libass: libass-$(ASS_VERSION).tar.bz2
2467 $(EXTRACT_BZ2)
2468 (cd $@; autoreconf -ivf)
2470 .libass: libass .freetype
2471 (cd $<; $(HOSTCC) ./configure --disable-png --disable-shared $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make && make install)
2472 touch $@
2474 CLEAN_FILE += .libass
2475 CLEAN_PKG += libass
2476 DISTCLEAN_PKG += libass-$(ASS_VERSION).tar.bz2
2478 # ***************************************************************************
2479 # Sparkle
2480 # ***************************************************************************
2482 Sparkle-$(SPARKLE_VERSION).zip:
2483 $(WGET) $(SPARKLE_URL)
2485 .Sparkle: Sparkle-$(SPARKLE_VERSION).zip
2486 rm -rf $@ || true
2487 unzip $<
2488 rm -rf $(PREFIX)/Sparkle
2489 mv Sparkle $(PREFIX)
2490 touch $@
2492 CLEAN_FILE += .Sparkle
2493 CLEAN_PKG += Sparkle
2494 DISTCLEAN_PKG += Sparkle-$(SPARKLE_VERSION).zip
2496 # ***************************************************************************
2497 # UPNP library
2498 # ***************************************************************************
2500 libupnp-$(UPNP_VERSION).tar.bz2:
2501 $(WGET) $(UPNP_URL)
2503 libupnp: libupnp-$(UPNP_VERSION).tar.bz2
2504 $(EXTRACT_BZ2)
2506 .libupnp: libupnp
2507 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-samples --without-documentation --disable-webserver CFLAGS="$(CFLAGS) -O3" && make && make install)
2508 touch $@
2510 CLEAN_FILE += .libupnp
2511 CLEAN_PKG += libupnp
2512 DISTCLEAN_PKG += libupnp-$(UPNP_VERSION).tar.bz2
2514 # ***************************************************************************
2515 # GSM
2516 # ***************************************************************************
2517 gsm-$(GSM_VERSION).tar.gz:
2518 $(WGET) $(GSM_URL)
2520 gsm: gsm-$(GSM_VERSION).tar.gz
2521 rm -rf $@ || true
2522 gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
2523 mv gsm-1.0-* gsm || true
2524 ifneq ($(HOST),$(BUILD))
2525 (patch -p0 < Patches/gsm-cross.patch)
2526 endif
2527 ifdef HAVE_DARWIN_OS
2528 (cd $@; sed -e 's%-O2%-O2\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' -e 's%# LDFLAGS =%LDFLAGS = $(EXTRA_LDFLAGS)%' -e 's%gcc%$(CC)%' -i.orig Makefile)
2529 endif
2531 .gsm: gsm
2532 (cd $<; $(HOSTCC) make && mkdir -p $(PREFIX)/include/gsm && cp inc/gsm.h $(PREFIX)/include/gsm && cp lib/libgsm.a $(PREFIX)/lib)
2533 touch $@
2535 CLEAN_FILE += .gsm
2536 CLEAN_PKG += gsm
2537 DISTCLEAN_PKG += gsm-$(GSM_VERSION).tar.gz
2539 # ***************************************************************************
2540 ### GLEW
2541 # ***************************************************************************
2542 glew-$(GLEW_VERSION)-src.tgz:
2543 $(WGET) $(GLEW_URL)
2545 glew: glew-$(GLEW_VERSION)-src.tgz
2546 $(EXTRACT_GZ)
2547 (patch -p0 < Patches/glew-win32.patch)
2549 .glew: glew
2550 (cd $<; $(HOSTCC) CFLAGS="$(CFLAGS) -DGLEW_STATIC" make && $(HOSTCC) GLEW_DEST=$(PREFIX) make install)
2551 ifdef HAVE_WIN32
2552 rm -rf $(PREFIX)/lib/libglew32.dll*
2553 endif
2554 touch $@
2556 CLEAN_FILE += .glew
2557 CLEAN_PKG += glew
2558 DISTCLEAN_PKG += glew-$(GLEW_VERSION)-src.tgz
2561 # ***************************************************************************
2562 # projectM
2563 # ***************************************************************************
2564 libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz:
2565 $(WGET) $(LIBPROJECTM_URL)
2567 libprojectM: libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz
2568 rm -rf $@ || true
2569 gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
2570 mv projectM-$(LIBPROJECTM_VERSION)-Source $@ || true
2571 patch -p0 < Patches/libprojectM-win32.patch
2572 cd $@; rm CMakeCache.txt
2574 .libprojectM: libprojectM .glew
2575 (cd $<; $(HOSTCC) CPPFLAGS="$(CPPFLAGS)" cmake . -DCMAKE_TOOLCHAIN_FILE=../../toolchain.cmake -DINCLUDE-PROJECTM-LIBVISUAL:BOOL=OFF -DDISABLE_NATIVE_PRESETS:BOOL=ON -DUSE_FTGL:BOOL=OFF -DINCLUDE-PROJECTM-PULSEAUDIO:BOOL=OFF -DINCLUDE-PROJECTM-QT:BOOL=OFF -DBUILD_PROJECTM_STATIC:BOOL=ON -DCMAKE_INSTALL_PREFIX=$(PREFIX) && make install)
2576 ifdef HAVE_WIN32
2577 (cd $<;cp Renderer/libRenderer.a MilkdropPresetFactory/libMilkdropPresetFactory.a $(PREFIX)/lib)
2578 endif
2579 touch $@
2581 CLEAN_FILE += .libprojectM
2582 CLEAN_PKG += libprojectM
2583 DISTCLEAN_PKG += libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz
2585 # ***************************************************************************
2586 # X11 C Bindings
2587 # ***************************************************************************
2589 libxcb-$(XCB_VERSION).tar.bz2:
2590 $(WGET) $(XCB_URL)/$@
2592 libxcb: libxcb-$(XCB_VERSION).tar.bz2
2593 -rm -rf $@
2594 bzcat $< | tar xf -
2595 mv libxcb-$(XCB_VERSION) $@
2596 touch $@
2598 .xcb: libxcb
2599 cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) \
2600 --disable-shared \
2601 --disable-composite \
2602 --disable-damage \
2603 --disable-dpms \
2604 --disable-glx \
2605 --enable-randr \
2606 --disable-record \
2607 --enable-render \
2608 --disable-resource \
2609 --disable-screensaver \
2610 --disable-shape \
2611 --enable-shm \
2612 --disable-sync \
2613 --disable-xevie \
2614 --disable-xfixes \
2615 --disable-xfree86-dri \
2616 --disable-xinerama \
2617 --disable-xinput \
2618 --disable-xprint \
2619 --disable-selinux \
2620 --disable-xtest \
2621 --enable-xv \
2622 --disable-xvmc \
2623 --disable-build-docs
2624 cd $< && make
2625 cd $< && sed -i -e s,^Requires.private:,Requires:,g xcb.pc
2626 cd $< && make install
2627 touch $@
2629 xcb-util-$(XCB_UTIL_VERSION).tar.bz2:
2630 $(WGET) $(XCB_UTIL_URL)/$@
2632 xcb-util: xcb-util-$(XCB_UTIL_VERSION).tar.bz2
2633 -rm -rf $@
2634 bzcat $< | tar xf -
2635 mv xcb-util-$(XCB_UTIL_VERSION) $@
2636 touch $@
2638 .xcb-util: xcb-util .xcb
2639 cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)
2640 cd $< && make install
2641 touch $@
2643 CLEAN_FILE += .xcb-util .xcb
2644 CLEAN_PKG += xcb-util xcb
2645 DISTCLEAN_PKG += xcb-util-$(XCB_UTIL_VERSION).tar.bz2 libxcb-$(XCB_VERSION).tar.bz2
2647 # ***************************************************************************
2648 # Peflags utility (Windows only)
2649 # ***************************************************************************
2651 peflags/peflags.c:
2652 mkdir -p peflags
2653 cd peflags && $(WGET) $(PEFLAGS_URL)/peflags.c
2655 .peflags: peflags/peflags.c
2656 cd peflags && gcc peflags.c -o peflags
2657 install -d $(PREFIX)/bin
2658 cd peflags && install ./peflags $(PREFIX)/bin
2659 touch $@
2661 CLEAN_PKG += peflags
2662 CLEAN_FILE += .peflags
2664 # ***************************************************************************
2665 # Regex
2666 # ***************************************************************************
2667 regex-$(REGEX_VERSION).tar.gz:
2668 $(WGET) $(REGEX_URL)
2670 regex: regex-$(REGEX_VERSION).tar.gz
2671 $(EXTRACT_GZ)
2673 .regex: regex
2674 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make subirs= && $(AR) ru libregex.a regex.o && $(RANLIB) libregex.a && cp -v regex.h $(PREFIX)/include && cp -v libregex.a $(PREFIX)/lib )
2675 touch $@
2677 CLEAN_FILE += .regex
2678 CLEAN_PKG += regex
2679 DISTCLEAN_PKG += regex-$(REGEX_VERSION).tar.gz
2681 # ***************************************************************************
2682 # SQLite
2683 # ***************************************************************************
2684 sqlite-amalgamation-$(SQLITE_VERSION).tar.gz:
2685 $(WGET) $(SQLITE_URL)
2687 sqlite-$(SQLITE_VERSION): sqlite-amalgamation-$(SQLITE_VERSION).tar.gz
2688 $(EXTRACT_GZ)
2690 .sqlite3: sqlite-$(SQLITE_VERSION)
2691 (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install )
2692 touch $@
2694 CLEAN_FILE += .sqlite3
2695 CLEAN_PKG += sqlite-$(SQLITE_VERSION)
2696 DISTCLEAN_PKG += sqlite-amalgamation-$(SQLITE_VERSION).tar.gz
2699 # ***************************************************************************
2700 # Some cleaning
2701 # ***************************************************************************
2703 clean-dots: FORCE
2704 rm -f $(CLEAN_FILE)
2706 clean: clean-dots
2707 rm -rf $(CLEAN_PKG)
2709 clean-src: clean
2710 rm -rf $(DISTCLEAN_PKG)
2712 clean-svn:
2713 rm -rf ffmpeg tremor x264 libdca pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz portaudio live555-$(LIVEDOTCOM_VERSION).tar.gz live libass
2715 distclean: clean-src
2717 # ***************************************************************************
2718 # Download all the sources and package unversionned copies of subversion trees
2719 # ***************************************************************************
2721 source: $(SOURCE) $(DISTCLEAN_PKG)