Makefile 70.9 KB
Newer Older
1
#***************************************************************************
2 3
# src/Makefile : Dearchive and compile all files necessary
# ***************************************************************************
4
# Copyright (C) 2003 - 2007 the VideoLAN team
5 6 7 8
# $Id$
#
# Authors: Christophe Massiot <massiot@via.ecp.fr>
#          Derk-Jan Hartman <hartman at videolan dot org>
9
#          Eric Petit <titer@m0k.org>
10
#          Felix Kühne <fkuehne@users.sourceforge.net>
Christophe Mutricy's avatar
Christophe Mutricy committed
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>
15 16 17 18 19 20 21 22 23 24 25 26 27
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
Antoine Cellerier's avatar
Antoine Cellerier committed
28
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
29 30 31 32 33 34 35 36 37
# ***************************************************************************

include ../config.mak
include ./packages.mak

# ***************************************************************************
# Set a clean environment
# ***************************************************************************

38 39
export PATH := $(PREFIX)/bin:$(EXTRA_PATH):$(PATH)
export PKG_CONFIG_PATH
40
export PKG_CONFIG_LIBDIR = $(PREFIX)/lib/pkgconfig
41
export DYLD_LIBRARY_PATH = $(PREFIX)/lib
42 43
# following is required for configure scripts that check dyld libraries
# by building and running a test app 
44
export DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):$(PREFIX)/vlc-lib
45
export MACOSX_DEPLOYMENT_TARGET = $(SDK_TARGET)
46
export LIBRARY_PATH := $(PREFIX)/lib:$(LIBRARY_PATH)
47 48 49
export CFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
export CPPFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
export CXXFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
50 51 52 53 54 55 56 57 58
export LDFLAGS = -L$(PREFIX)/lib $(EXTRA_LDFLAGS)

# ***************************************************************************
# Cross compilation variables
# We'll usually use --host=<platform>, except for a few libraries which
# don't handle it (gotta set CC/CXX/etc), and obviously FFmpeg has its own
# way of doing it... ;)
# ***************************************************************************

59 60 61 62 63 64
ifneq ($(CC),)
HOSTCC+= CC="$(CC)"
endif
ifneq ($(CXX),)
HOSTCC+= CXX="$(CXX)"
endif
65 66 67
ifneq ($(LD),)
HOSTCC+= LD="$(LD)"
endif
68 69 70 71 72 73
ifneq ($(RANLIB),)
HOSTCC+= RANLIB="$(RANLIB)"
endif
ifneq ($(AR),)
HOSTCC+= AR="$(AR)"
endif
74 75 76 77
ifneq ($(STRIP),)
HOSTCC+= STRIP="$(STRIP)"
endif

78

79 80 81 82 83
# Define ranlib on non-cross compilation setups
ifeq ($(RANLIB),)
RANLIB=ranlib
endif

84 85 86
# For libebml/libmatroska. Grrr.
ifneq ($(AR),)
HOSTCC2=$(HOSTCC) AR="$(AR) rcvu"
87 88
else
HOSTCC2=$(HOSTCC)
89 90
endif

91 92 93 94 95
# For ffmpeg if not cross compiling
ifneq ($(CC),)
  FFMPEGCONF=--cc="$(CC)"
endif

96
#
97
# cross compiling
98
#
99 100
#This should be inside the if block but some config scripts are buggy
HOSTCONF=--target=$(HOST) --host=$(HOST) --build=$(BUILD) --program-prefix=""
101 102 103 104 105
ifneq ($(BUILD),$(HOST))
    #
    # Compiling for MinGW under Cygwin could be deemed as cross compiling
    # unfortunately there isn't a complete separate GCC toolchain for MinGW under Cygwin
    #
106
    ifndef HAVE_CYGWIN
107
        # We are REALLY cross compiling
108
        FFMPEGCONF=--cross-prefix=$(HOST)- --cross-compile
109
        X264CONF=--host=$(HOST)
110
        PTHREADSCONF="CROSS=$(HOST)-"
111 112
    else
        # We are compiling for MinGW on Cygwin
113
        PTHREADSCONF=$(HOSTCC)
114
    endif
115
endif
116 117

#
118
# Special target-dependant options
119
#
120
ifdef HAVE_WIN32
121
HOSTCONF+= --without-pic --disable-shared --enable-msw --with-included-opencdk --with-included-libtasn1 --disable-dependency-tracking
122
FFMPEGCONF+= --target-os=mingw32 --enable-memalign-hack --cpu=i686 --disable-debug
123 124 125 126
endif

ifdef HAVE_WINCE
HOSTCONF+= --without-pic --disable-shared
127
FFMPEGCONF+= --enable-mingwce --cpu=armv4l --disable-debug --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
128 129 130
endif

ifdef HAVE_UCLIBC
131
ifdef HAVE_BIGENDIAN
132
FFMPEGCONF+= --arch=armeb --enable-armv5te --enable-iwmmxt
133 134 135
else
FFMPEGCONF+= --arch=armv4l
endif
136
FFMPEGCONF+= --enable-small --disable-debug --disable-mpegaudio-hp
137
FFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99
138
else
Jean-Paul Saman's avatar
Jean-Paul Saman committed
139
FFMPEGCONF+= --enable-libmp3lame --enable-libfaac --enable-liba52 --enable-swscaler
140 141
endif

142
ifdef HAVE_BEOS
143
FFMPEGCONF+= --cpu=x86 --disable-debug --disable-audio-beos
144 145
endif

146
ifdef HAVE_DARWIN_OS_ON_INTEL
147
FFMPEGCONF += --enable-memalign-hack --cpu=pentium-m
148 149
endif

150
ifdef NO_TEXT_RELOCATION
151 152 153
FFMPEGCONF += --disable-mmx
endif

154
ifdef HAVE_DARWIN_OS
155
X264CONF += --enable-pic
156
ifdef HAVE_DARWIN_OS_ON_INTEL
157 158
FFMPEG_CFLAGS += -DHAVE_LRINTF
endif
159 160
endif

161 162 163 164
ifdef HAVE_AMR
FFMPEGCONF+= --enable-libamr --enable-libamr-nb --enable-libamr-wb
endif

165 166
DATE=`date +%Y-%m-%d`

167 168 169
# ***************************************************************************
# Standard rules
# ***************************************************************************
170 171 172
# Generated by ./bootstrap from default configuration in src/Distributions
# 
include ../distro.mak
173 174 175 176 177 178 179 180

FORCE:

# ***************************************************************************
# Useful macros
# ***************************************************************************

define EXTRACT_GZ
181
	rm -rf $@ || true
Christophe Mutricy's avatar
oups  
Christophe Mutricy committed
182
	gunzip -c $< | tar xf - --exclude='[*?:<>\|]' 
183 184
	mv $(patsubst %.tar.gz,%,$(patsubst %.tgz,%,$(notdir $<))) $@ || true
	touch $@
185 186 187
endef

define EXTRACT_BZ2
188 189 190 191
	rm -rf $@ || true
	bunzip2 -c $< | tar xf - --exclude='[*?:<>\|]' 
	mv $(patsubst %.tar.bz2,%,$(notdir $<)) $@ || true
	touch $@
192 193
endef

194
define EXTRACT_ZIP
195 196 197 198
	rm -rf $@ || true
	unzip $<
	mv $(patsubst %.zip,%,$(notdir $<)) $@ || true
	touch $@
199 200
endef

201 202 203 204 205 206
### Darwin-specific ###
# These macros prepare the dynamic libraries for inclusion in the Mac OS X
# bundle. For instance if you're building a library named libtoto.dylib,
# which depends on the contrib library libtata.dylib, you should have the
# following entry :
# .toto: toto_directory .tata
207 208 209 210 211
#	cd $< ; ./configure --prefix=$(PREFIX)
#	$(MAKE) -C $<
#	$(MAKE) -C $< install
#	$(INSTALL_NAME)
#	touch $@
212 213

ifdef HAVE_DARWIN_OS
214 215 216 217 218 219
# the original libtoto.dylib is copied from contrib/lib to vlc-lib as
# vlc_libtoto.dylib. a soft link to this library is created in contrib/lib
# using the orginal dylib name. if libtoto.la also exists, the library named
# in dlname is also changed to a soft-link to vlc-lib in order to support
# libtool. to satisfy VLC.app dyld search, vlc_libtoto.dylib dyld id is changed
# to @executable_path/lib/vlc_libtoto.dylib 
220 221

define INSTALL_NAME
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
	if which install_name_tool >/dev/null; then \
		mkdir -p $(PREFIX)/vlc-lib ; \
		libname='lib$(patsubst .%,%,$@)' ; \
		dlname="$$libname.dylib" ; \
		cp $(PREFIX)/lib/$$dlname \
			$(PREFIX)/vlc-lib/vlc_$$dlname ; \
		rm $(PREFIX)/lib/$$dlname ; \
		ln -s $(PREFIX)/vlc-lib/vlc_$$dlname \
			$(PREFIX)/lib/$$dlname ; \
		if [ -f $(PREFIX)/lib/$$libname.la ]; then \
			eval ltname=`sed -n 's/dlname=//p' $(PREFIX)/lib/$$libname.la`; \
			rm $(PREFIX)/lib/$$ltname ; \
			ln -s $(PREFIX)/vlc-lib/vlc_$$dlname \
				$(PREFIX)/lib/$$ltname ; \
		fi ; \
		install_name_tool \
			-id @executable_path/lib/vlc_$$dlname \
			$(PREFIX)/vlc-lib/vlc_$$dlname ; \
	fi
241
endef
242

243 244 245 246 247 248
endif

ifeq ($(HOST),i586-pc-beos)
# We test if the file actually exists, as sometimes (but not always)
# libtool won't accept to build the shared library
define INSTALL_NAME
249 250 251 252 253
	if test -f $(PREFIX)/lib/lib$(patsubst .%,%,$@).so ; then \
		mkdir -p $(PREFIX)/vlc-lib ; \
		cp $(PREFIX)/lib/lib$(patsubst .%,%,$@).so \
		  $(PREFIX)/vlc-lib/ ; \
	fi
254 255 256 257 258 259 260 261 262
endef
endif

# ***************************************************************************
# perl
# ***************************************************************************

ifeq ($(BUILD),i586-pc-beos)
perl-$(PERL_VERSION).tar.gz:
263
	$(WGET) $(PERL_URL)
264 265

perl: perl-$(PERL_VERSION).tar.gz
266 267
	$(EXTRACT_GZ)
	sed -i.orig 's%prefix="/boot/home/config"%prefix="$(PREFIX)"%'  perl/hints/beos.sh
268 269

.perl: perl
270 271
	(cd $<; ./Configure -d -e && make && make install && ln -sf perl5/$(PERL_VERSION)/BePC-beos/CORE/libperl.so $(PREFIX)/lib/libperl.so)
	touch $@
272 273 274 275 276 277 278 279 280 281

CLEAN_FILE += .perl
CLEAN_PKG += perl
DISTCLEAN_PKG += perl-$(PERL_VERSION).tar.gz
endif

# ***************************************************************************
# autoconf
# ***************************************************************************

282
autoconf-$(AUTOCONF_VERSION).tar.bz2:
283
	$(WGET) $(AUTOCONF_URL)
284

285
autoconf: autoconf-$(AUTOCONF_VERSION).tar.bz2
286
	$(EXTRACT_BZ2)
287 288

.autoconf: autoconf
289 290
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
291 292 293

CLEAN_FILE += .autoconf
CLEAN_PKG += autoconf
294
DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.bz2
295 296 297 298 299 300

# ***************************************************************************
# libtool
# ***************************************************************************

ifdef HAVE_DARWIN_OS
301 302 303 304 305 306 307 308
libtool-$(LIBTOOL_VERSION).tar.gz:
	$(WGET) $(LIBTOOL_URL)

libtool: libtool-$(LIBTOOL_VERSION).tar.gz
	$(EXTRACT_GZ)

.libtool: libtool
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
309 310
	ln -sf libtool $(PREFIX)/bin/glibtool
	ln -sf libtoolize $(PREFIX)/bin/glibtoolize
311
	touch $@
312 313 314

CLEAN_PKG += libtool
DISTCLEAN_PKG += libtool-$(LIBTOOL_VERSION).tar.gz
315 316
CLEAN_FILE += .libtool

317 318 319 320
endif

ifeq ($(BUILD),i586-pc-beos)
libtool-$(LIBTOOL_VERSION).tar.gz:
321
	$(WGET) $(LIBTOOL_URL)
322 323

libtool: libtool-$(LIBTOOL_VERSION).tar.gz
324
	$(EXTRACT_GZ)
325 326

.libtool: libtool
327 328
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
329 330 331 332 333

CLEAN_PKG += libtool
DISTCLEAN_PKG += libtool-$(LIBTOOL_VERSION).tar.gz
CLEAN_FILE += .libtool

334 335
endif

336 337 338 339 340
# ***************************************************************************
# automake
# ***************************************************************************

automake-$(AUTOMAKE_VERSION).tar.gz:
341
	$(WGET) $(AUTOMAKE_URL)
342 343

automake: automake-$(AUTOMAKE_VERSION).tar.gz
344
	$(EXTRACT_GZ)
345 346

.automake: automake
347 348
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
349 350 351 352 353 354 355 356 357

CLEAN_FILE += .automake
CLEAN_PKG += automake
DISTCLEAN_PKG += automake-$(AUTOMAKE_VERSION).tar.gz

# ***************************************************************************
# pkgconfig
# ***************************************************************************

358
pkg-config-$(PKGCFG_VERSION).tar.gz:
359
	$(WGET) $(PKGCFG_URL)
360

361
pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz
362 363 364
	$(EXTRACT_GZ)
	patch -d pkgconfig/glib-1.2.8 -p 1 < Patches/glib.patch
	patch -d pkgconfig -p0 < Patches/pkgcfg.patch
365 366

.pkgcfg: pkgconfig
367 368
	(cd pkgconfig; autoconf && ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
369 370 371

CLEAN_FILE += .pkgcfg
CLEAN_PKG += pkgconfig
372
DISTCLEAN_PKG += pkg-config-$(PKGCFG_VERSION).tar.gz
373 374 375 376 377 378

# ***************************************************************************
# gettext
# ***************************************************************************

gettext-$(GETTEXT_VERSION).tar.gz:
379
	$(WGET) $(GETTEXT_URL)
380 381

gettext: gettext-$(GETTEXT_VERSION).tar.gz
382
	$(EXTRACT_GZ)
383
ifdef HAVE_DARWIN_OS
Rafaël Carré's avatar
Rafaël Carré committed
384
	patch -p0 < Patches/gettext-macosx.patch 
385
endif
386
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
387
	patch -p0 < Patches/gettext-win32.patch
388
endif
389

390
.intl: gettext .iconv
391
ifdef HAVE_WIN32
392
	( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-relocatable --with-iconv-prefix=$(PREFIX) --disable-java --disable-native-java)
393
else
394
	( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-java --disable-native-java --without-emacs)
395
endif
396 397 398
ifeq ($(BUILD),i586-pc-beos)
# The ugliest kludge ever - so libtool correctly links shared libraries
# on BeOS. Sorry, I just can't figure out how libtool works
399
	( cd $< && for f in `find . -name libtool`; do  sed -e 's/ -shared / -nostart /' -e 's/^predep_objects.*/predep_objects=""/' -i  $$f; chmod +x $$f; done )
400 401
endif
ifneq ($(HOST),$(BUILD))
402 403
  ifndef HAVE_CYGWIN
    # We'll use the installed gettext and only need to cross-compile libintl, also build autopoint and gettextsize tools need for VLC bootstrap
404
	( cd $< && make -C gettext-runtime/intl && patch -p1 < ../Patches/libintl.patch && make -C gettext-runtime/intl install && make -C gettext-tools/misc install )
405 406 407 408
  else
    # We are compiling for MinGW on Cygwin -- build the full current gettext
	( cd $< && make && patch -p1 < ../Patches/libintl.patch && make install )
  endif
409 410
else
# Build and install the whole gettext
411
	( cd $< && make && patch -p1 < ../Patches/libintl.patch && make install )
412 413 414
endif
# Work around another non-sense of autoconf.
ifdef HAVE_WIN32
415
	(cd ../include; sed -i.orig '311 c #if 0' libintl.h)
416
endif
417 418
	$(INSTALL_NAME)
	touch $@
419 420 421 422 423 424 425 426 427 428

CLEAN_FILE += .intl
CLEAN_PKG += gettext
DISTCLEAN_PKG += gettext-$(GETTEXT_VERSION).tar.gz

# ***************************************************************************
# libiconv
# ***************************************************************************

libiconv-$(LIBICONV_VERSION).tar.gz:
429
	$(WGET) $(LIBICONV_URL)
430 431

libiconv: libiconv-$(LIBICONV_VERSION).tar.gz
432
	$(EXTRACT_GZ)
433
ifdef HAVE_DARWIN_OS
Rafaël Carré's avatar
Rafaël Carré committed
434
	patch -p0 < Patches/libiconv.patch
435
endif
436
	patch -p0 < Patches/libiconv-autoconf-uclibc.patch
437

438
ifdef HAVE_DARWIN_OS
439
.iconv:
440
	touch $@
441
else
442
.iconv: libiconv
443 444 445
	(cd libiconv; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls && make && make install)
	$(INSTALL_NAME)
	touch $@
446
endif
447 448 449 450 451

CLEAN_FILE += .iconv
CLEAN_PKG += libiconv
DISTCLEAN_PKG += libiconv-$(LIBICONV_VERSION).tar.gz

452 453 454 455 456 457 458
# ***************************************************************************
# fontconfig
# ***************************************************************************

fontconfig-$(FONTCONFIG_VERSION).tar.gz:
	$(WGET) $(FONTCONFIG_URL)

459
fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz Patches/fontconfig.patch
460 461
	$(EXTRACT_GZ)
	patch -p0 < Patches/fontconfig.patch
462
	patch -p0 < Patches/fontconfig-nodocs.patch
463 464 465 466

.fontconfig: fontconfig
ifdef HAVE_WIN32
  ifdef HAVE_CYGWIN
467
	(cd $<; autoreconf && LIBXML2_CFLAGS=`$(PREFIX)/bin/xml2-config --cflags` ./configure --target=$(HOST) --disable-pic --disable-shared --disable-docs --with-cache-dir=WINDOWSTEMPDIR --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 && make && make install)
468
  else
469
	(cd $<; autoreconf && $(HOSTCC) LIBXML2_CFLAGS=`$(PREFIX)/bin/xml2-config --cflags` ./configure $(HOSTCONF) --with-cache-dir=WINDOWSTEMPDIR --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 --disable-docs && make && make install)
470 471
  endif
else
472
  ifdef HAVE_DARWIN_OS
473
	(cd $<; autoreconf && $(HOSTCC) LIBXML2_CFLAGS=`xml2-config --cflags` LIBXML2_LIBS=`xml2-config --libs` ./configure $(HOSTCONF) --with-cache-dir=/var/cache/fontconfig --with-confdir=/etc/fonts --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 --disable-docs && make && make install-exec && (cd fontconfig ; make install-data))
474
  else
475
	(cd $<; autoreconf && $(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)
476
  endif
477 478 479 480 481 482 483 484
endif
	$(INSTALL_NAME)
	touch $@

CLEAN_FILE += .fontconfig
CLEAN_PKG += fontconfig
DISTCLEAN_PKG += fontconfig-$(FONTCONFIG_VERSION).tar.gz

485 486 487 488 489
# ***************************************************************************
# freetype2
# ***************************************************************************

freetype-$(FREETYPE2_VERSION).tar.gz:
490
	$(WGET) $(FREETYPE2_URL)
491 492

freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
493
	$(EXTRACT_GZ)
494
	patch -p0 < Patches/freetype-cross.patch
495 496

.freetype: freetype2
497
ifdef HAVE_CYGWIN
498
	(cd $<; ./configure --target=$(HOST) --disable-pic --disable-shared --prefix=$(PREFIX) && make && make install)
499
else
500
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
501
endif
502 503
	$(INSTALL_NAME)
	touch $@
504 505 506 507 508 509 510 511 512

CLEAN_FILE += .freetype
CLEAN_PKG += freetype2
DISTCLEAN_PKG += freetype-$(FREETYPE2_VERSION).tar.gz

# ***************************************************************************
# fribidi
# ***************************************************************************

513
fribidi-$(FRIBIDI_VERSION).tar.gz:
514
	$(WGET) $(FRIBIDI_URL)
515

516 517
fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
518
	patch -p0 < Patches/fribidi.patch.real
519
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
520
	patch -p0 <Patches/fribidi-win32.patch
521
endif
522 523 524 525
ifdef HAVE_UCLIBC
	patch -p0 < Patches/fribidi-uclibc.patch
endif

526
.fribidi: fribidi .iconv
527 528 529
	(cd $<; rm -f configure; ./bootstrap && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  && make && make install)
	$(INSTALL_NAME)
	touch $@
530 531 532

CLEAN_FILE += .fribidi
CLEAN_PKG += fribidi
533
DISTCLEAN_PKG += fribidi-$(FRIBIDI_VERSION).tar.gz
534 535 536 537 538 539

# ***************************************************************************
# liba52
# ***************************************************************************

a52dec-$(A52DEC_VERSION).tar.gz:
540
	$(WGET) $(A52DEC_URL)
541 542

a52dec: a52dec-$(A52DEC_VERSION).tar.gz
543
	$(EXTRACT_GZ)
544 545

.a52: a52dec
546 547
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd liba52 && make && make install && cd ../include && make && make install)
	touch $@
548 549 550 551 552 553 554 555 556 557

CLEAN_FILE += .a52
CLEAN_PKG += a52dec
DISTCLEAN_PKG += a52dec-$(A52DEC_VERSION).tar.gz

# ***************************************************************************
# mpeg2dec
# ***************************************************************************

#mpeg2dec:
558 559 560 561
#	@echo "*** Please press return here : ***"
#	cvs -d $(MPEG2DEC_CVSROOT) login
#	cvs -d $(MPEG2DEC_CVSROOT) co mpeg2dec
#	(cd $@; ./bootstrap)
562

Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
563
mpeg2dec-$(MPEG2DEC_VERSION).tar.gz:
564
	$(WGET) $(MPEG2DEC_URL)
565 566

# It is easier to use bootstrapped versions...
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
567
#mpeg2dec-$(MPEG2DEC_VERSION).tar.gz:
568 569
#	$(WGET) $(MPEG2DEC_SNAPSHOT)
#	mv mpeg2dec-$(MPEG2DEC_DATE).tar.gz $@
570 571

mpeg2dec: mpeg2dec-$(MPEG2DEC_VERSION).tar.gz
572
	$(EXTRACT_GZ)
573 574

.mpeg2: mpeg2dec
575 576
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --without-x --disable-sdl && cd libmpeg2 && make && make install && cd ../include && make && make install)
	touch $@
577 578 579 580 581 582 583 584 585 586 587

CLEAN_FILE += .mpeg2
CLEAN_PKG += mpeg2dec
#DISTCLEAN_PKG += mpeg2dec-$(MPEG2DEC_VERSION)-cvs.tar.gz
DISTCLEAN_PKG += mpeg2dec-$(MPEG2DEC_VERSION).tar.gz

# ***************************************************************************
# libid3tag
# ***************************************************************************

libid3tag-$(LIBID3TAG_VERSION).tar.gz:
588
	$(WGET) $(LIBID3TAG_URL)
589 590

libid3tag: libid3tag-$(LIBID3TAG_VERSION).tar.gz
591
	$(EXTRACT_GZ)
592 593

.id3tag: libid3tag
594 595 596
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
597 598 599 600 601

CLEAN_FILE += .id3tag
CLEAN_PKG += libid3tag
DISTCLEAN_PKG += libid3tag-$(LIBID3TAG_VERSION).tar.gz

602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
# ***************************************************************************
# lua
# ***************************************************************************

ifdef HAVE_WIN32
LUA_MAKEPLATEFORM=mingw
else
ifdef HAVE_DARWIN_OS
LUA_MAKEPLATEFORM=macosx
else
ifdef HAVE_LINUX
LUA_MAKEPLATEFORM=linux
else
ifdef HAVE_BSD
LUA_MAKEPLATEFORM=bsd
else
LUA_MAKEPLATEFORM=generic
endif
endif
endif
endif

lua-$(LUA_VERSION).tar.gz:
	$(WGET) $(LUA_URL)

lua: lua-$(LUA_VERSION).tar.gz
	$(EXTRACT_GZ)

.lua: lua
631
ifdef HAVE_WIN32
632
	( cd $<; sed -i.orig 's/lua luac/lua.exe/' Makefile ; cd src; sed -i.orig 's/CC=/#CC=/' Makefile; cd ../..;)
633 634
	(cd $<; $(HOSTCC) make $(LUA_MAKEPLATEFORM); cd src; $(HOSTCC) make liblua.a; cd ..;$(HOSTCC) make install INSTALL_TOP=$(PREFIX); $(RANLIB) $(PREFIX)/lib/liblua.a)
	(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)
635
else 
636
	(cd $<; $(HOSTCC) make $(LUA_MAKEPLATEFORM) && make install INSTALL_TOP=$(PREFIX))
637
endif
638 639 640 641 642 643
	touch $@

CLEAN_FILE += .lua
CLEAN_PKG += lua
DISTCLEAN_PKG += lua-$(LUA_VERSION).tar.gz

644 645 646 647 648
# ***************************************************************************
# libmad
# ***************************************************************************

libmad-$(LIBMAD_VERSION).tar.gz:
649
	$(WGET) $(LIBMAD_URL)
650 651

libmad: libmad-$(LIBMAD_VERSION).tar.gz
652
	$(EXTRACT_GZ)
653 654

.mad: libmad
655 656 657
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="-O3" && make && make install)
	$(INSTALL_NAME)
	touch $@
658 659 660 661 662 663 664 665 666 667

CLEAN_FILE += .mad
CLEAN_PKG += libmad
DISTCLEAN_PKG += libmad-$(LIBMAD_VERSION).tar.gz

# ***************************************************************************
# ogg
# ***************************************************************************

libogg-$(OGG_VERSION).tar.gz:
668
	$(WGET) $(OGG_URL)
669 670

libogg: libogg-$(OGG_VERSION).tar.gz
671
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
672 673
	patch -p0 < Patches/ogg.patch
	patch -p0 < Patches/libogg-1.1.patch
674
ifdef HAVE_WINCE
Rafaël Carré's avatar
Rafaël Carré committed
675
	patch -p0 < Patches/libogg-wince.patch
676
endif
677
	(cd $@; autoconf)
678 679

.ogg: libogg
680 681 682
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make install)
	$(INSTALL_NAME)
	touch $@
683 684 685 686 687 688 689 690 691 692

CLEAN_FILE += .ogg
CLEAN_PKG += libogg
DISTCLEAN_PKG += libogg-$(OGG_VERSION).tar.gz

# ***************************************************************************
# vorbis
# ***************************************************************************

#vorbis:
693 694 695 696
#	@echo "*** Please type \"anoncvs\" here : ***"
#	cvs -d $(OGG_CVSROOT) login
#	cvs -d $(OGG_CVSROOT) co vorbis
#	(cd $@; ./autogen.sh)
Rafaël Carré's avatar
Rafaël Carré committed
697
#	patch -p0 < Patches/vorbis.patch
698 699

libvorbis-$(VORBIS_VERSION).tar.gz:
700
	$(WGET) $(VORBIS_URL)
701 702

libvorbis: libvorbis-$(VORBIS_VERSION).tar.gz
703
	$(EXTRACT_GZ)
704
	patch -p0 < Patches/libvorbis.patch
705
	(cd $@; autoconf)
706 707

.vorbis: libvorbis .ogg
708 709
# FIXME: shared libs disabled for now because of linking errors
#   -- titer 2005/09/16
710 711 712
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared && make && make install)
#	$(INSTALL_NAME)
	touch $@
713 714

.vorbisenc: .vorbis .ogg
715 716
#	$(INSTALL_NAME)
	touch $@
717 718 719 720 721

CLEAN_FILE += .vorbis .vorbisenc
CLEAN_PKG += libvorbis
DISTCLEAN_PKG += libvorbis-$(VORBIS_VERSION).tar.gz

722 723 724 725 726 727
# ***************************************************************************
# tremor
# ***************************************************************************

ifdef SVN
tremor: 
728
	$(SVN) co http://svn.xiph.org/trunk/Tremor tremor
729 730
	(cd $@ && patch -p0 < ../Patches/tremor.patch)
	(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 && ./autogen.sh)
731 732
else
tremor-$(TREMOR_VERSION).tar.bz2:
733 734
	echo "tremor snapshot does not exist, you MUST use subversion !"
	exit -1
735
	$(WGET) $(TREMOR_URL)
736 737

tremor: tremor-$(TREMOR_VERSION).tar.bz2
738
	$(EXTRACT_BZ2)
739 740 741
endif

.tremor: tremor .ogg
742 743 744
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared && make && make install)
	$(INSTALL_NAME)
	touch $@
745

746 747
ifdef SVN
tremor-source: tremor
748
	tar cfvz tremor-$(DATE).tar.gz tremor
749 750 751 752

SOURCE += tremor-source
endif

753 754
CLEAN_FILE += .tremor
CLEAN_PKG += tremor
755
#DISTCLEAN_PKG += tremor-$(TREMOR_VERSION).tar.bz2 #no tremor snapshot
756

757 758 759 760 761
# ***************************************************************************
# theora
# ***************************************************************************

libtheora-$(THEORA_VERSION).tar.bz2:
762
	$(WGET) $(THEORA_URL)
763 764

libtheora: libtheora-$(THEORA_VERSION).tar.bz2
765 766 767
	$(EXTRACT_BZ2)
	patch -p0 < Patches/theora.patch
	(cd $@; autoconf)
768

769
.theora: libtheora .ogg
770
ifdef HAVE_BEOS
771
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-sdltest --disable-oggtest --disable-vorbistest --disable-asm --disable-examples && make && make install)
772
else
773
  ifdef NO_TEXT_RELOCATION
774 775
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-asm --disable-sdltest --disable-oggtest --disable-vorbistest --disable-asm --disable-examples && make && make install)
  else
776
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-sdltest --disable-oggtest --disable-vorbistest --disable-examples && make && make install)
777
  endif
778
endif
779 780
	$(INSTALL_NAME)
	touch $@
781 782 783 784 785

CLEAN_FILE += .theora
CLEAN_PKG += libtheora
DISTCLEAN_PKG += libtheora-$(THEORA_VERSION).tar.bz2

Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
786 787 788 789 790
# ***************************************************************************
# shout
# ***************************************************************************

libshout-$(SHOUT_VERSION).tar.gz:
791
	$(WGET) $(SHOUT_URL)
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
792 793

libshout: libshout-$(SHOUT_VERSION).tar.gz
794
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
795
ifdef HAVE_WIN32
796
	patch -p0 < Patches/libshout-win32.patch
797
	(cd $@; autoreconf && automake)
Christophe Mutricy's avatar
Christophe Mutricy committed
798 799
endif
  
800
.shout: libshout .theora .ogg .speex .vorbis
801 802 803
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) &&  make && make install )
	$(INSTALL_NAME)
	touch $@
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
804 805 806 807 808

CLEAN_FILE += .shout
CLEAN_PKG += libshout
DISTCLEAN_PKG += libshout-$(SHOUT_VERSION).tar.gz

809 810 811 812 813
# ***************************************************************************
# flac
# ***************************************************************************

flac-$(FLAC_VERSION).tar.gz:
814
	$(WGET) $(FLAC_URL)
815 816

flac: flac-$(FLAC_VERSION).tar.gz
817
	$(EXTRACT_GZ)
818
ifdef HAVE_WIN32
819
	patch -p0 < Patches/flac-win32.patch
820
endif
821 822

FLAC_DISABLE_FLAGS = --disable-oggtest --disable-xmms-plugin --disable-cpplibs
823

Damien Fouilleul's avatar
Damien Fouilleul committed
824
.flac: flac .ogg 
825
ifdef HAVE_WIN32
826
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS) && cd src&& make -C libFLAC&& make -C libFLAC install && cd .. && make -C include install)
827
else
828
ifdef HAVE_DARWIN_OS
829
ifdef HAVE_DARWIN_OS_ON_INTEL
830
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-asm-optimizations && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
831
else
832
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS) && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
833
endif
834
else
835
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  $(FLAC_DISABLE_FLAGS) && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
836
endif
837
endif
838 839
	$(INSTALL_NAME)
	touch $@
840

Damien Fouilleul's avatar
Damien Fouilleul committed
841
CLEAN_FILE += .flac
842 843 844 845 846 847 848 849
CLEAN_PKG += flac
DISTCLEAN_PKG += flac-$(FLAC_VERSION).tar.gz

# ***************************************************************************
# speex
# ***************************************************************************

speex-$(SPEEX_VERSION).tar.gz:
850
	$(WGET) $(SPEEX_URL)
851 852

speex: speex-$(SPEEX_VERSION).tar.gz
853 854
	$(EXTRACT_GZ)
	patch -p0 < Patches/speex.patch
855
ifdef HAVE_BEOS
856
	patch -p0 < Patches/speex-BeOS.patch
857
endif
858 859

.speex: speex
860 861 862
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-ogg=no && make && make install)
	$(INSTALL_NAME)
	touch $@
863 864 865 866 867 868 869 870 871

CLEAN_FILE += .speex
CLEAN_PKG += speex
DISTCLEAN_PKG += speex-$(SPEEX_VERSION).tar.gz

# ***************************************************************************
# faad2
# ***************************************************************************

872
faad2-$(FAAD2_VERSION).tar.gz:
873
	$(WGET) $(FAAD2_URL)
874

875 876 877
faad2: faad2-$(FAAD2_VERSION).tar.gz
	$(EXTRACT_GZ)
	(cd $@; ./bootstrap)
878

879
.faad: faad2
880
	(cd $< && $(HOSTCC) ./configure $(HOSTCONF) --disable-shared --prefix=$(PREFIX) CFLAGS="-O3" && sed -i.orig "s/shrext_cmds/shrext/g" libtool && make -C libfaad && make -C libfaad install)
881
	touch $@
882 883

CLEAN_FILE += .faad
884 885
CLEAN_PKG += faad2
DISTCLEAN_PKG += faad2-$(FAAD2_VERSION).tar.gz
886 887 888 889 890

# ***************************************************************************
# faac
# ***************************************************************************

891
faac-$(FAAC_VERSION).tar.gz:
892
	$(WGET) $(FAAC_URL)
893

894 895
faac: faac-$(FAAC_VERSION).tar.gz
	$(EXTRACT_GZ)
896 897

.faac: faac
898
	(cd $<; ./bootstrap && $(HOSTCC) ./configure $(HOSTCONF) --without-mp4v2 --prefix=$(PREFIX) --disable-shared && make && make install)
899
	touch $@
900 901 902

CLEAN_FILE += .faac
CLEAN_PKG += faac
903
DISTCLEAN_PKG += faac-$(FAAC_VERSION).tar.gz
904 905 906 907 908 909

# ***************************************************************************
# lame
# ***************************************************************************

lame-$(LAME_VERSION).tar.gz:
910
	$(WGET) $(LAME_URL)
911 912

lame: lame-$(LAME_VERSION).tar.gz
913
	$(EXTRACT_GZ)
914 915

.lame: lame
916 917
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-analyser-hooks --disable-decoder --disable-shared --disable-gtktest --disable-frontend && make && make install)
	touch $@
918 919 920 921 922 923 924 925 926 927

CLEAN_FILE += .lame
CLEAN_PKG += lame
DISTCLEAN_PKG += lame-$(LAME_VERSION).tar.gz

# ***************************************************************************
# libebml
# ***************************************************************************

libebml-$(LIBEBML_VERSION).tar.bz2:
928
	$(WGET) $(LIBEBML_URL)
929

930 931 932
## No reasons to use SVN anymore
#ifdef SVN
#libebml:
933
#	$(SVN) co http://svn.matroska.org/svn/matroska/trunk/libebml libebml
934
#else
935
libebml: libebml-$(LIBEBML_VERSION).tar.bz2
936
	$(EXTRACT_BZ2)
937 938
#endif

939
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
940
	(cd $@; patch -p0 < ../Patches/libebml-svn-win32.patch)
941
endif
942 943

.ebml: libebml
944
ifdef HAVE_WIN32
945
	(cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC2) CFLAGS="$(CFLAGS) -DWIN32" SHARED=no && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC2))
946
else
947 948 949 950
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libebml.a
endif	
	touch $@
951 952 953 954 955 956
## No reasons to use SVN anymore
#ifdef SVN
#libebml-source: libebml
#	tar cfvz  libebml-$(DATE).tar.gz libebml
#SOURCE += libebml-source	
#endif
957

958 959 960 961 962 963 964 965
CLEAN_FILE += .ebml
CLEAN_PKG += libebml
DISTCLEAN_PKG += libebml-$(LIBEBML_VERSION).tar.bz2

# ***************************************************************************
# libmatroska
# ***************************************************************************

966 967 968
libmatroska-$(LIBMATROSKA_VERSION).tar.bz2:
	$(WGET) $(LIBMATROSKA_URL)

969 970 971
## No reasons to use SVN anymore
#if SVN
#libmatroska:
972
#	$(SVN) co http://svn.matroska.org/svn/matroska/trunk/libmatroska libmatroska
973
#else
974
libmatroska: libmatroska-$(LIBMATROSKA_VERSION).tar.bz2
975
	$(EXTRACT_BZ2)
976 977
#endif 

978
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
979
	(cd $@; patch -p0 < ../Patches/libmatroska-win32.patch)
980
endif
981

982 983
.matroska: libmatroska .ebml
ifdef HAVE_WIN32
984
	(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))
985
else
986 987
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libmatroska.a
988
endif
989
	touch $@
990

991 992 993 994 995 996 997
## No reasons to use SVN anymore
#ifdef SVN
#libmatroska-source: libmatroska
#	tar cfvz libmatroska-$(DATE).tar.gz libmatroska
#
#SOURCE += libmatroska-source
#endif
998

999 1000 1001 1002 1003
CLEAN_FILE += .matroska
CLEAN_PKG += libmatroska
DISTCLEAN_PKG += libmatroska-$(LIBMATROSKA_VERSION).tar.bz2

# ***************************************************************************
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037
# libamrnb
# ***************************************************************************

amrnb-$(LIBAMR_NB_VERSION).tar.bz2:
	$(WGET) $(LIBAMR_NB)

libamrnb: amrnb-$(LIBAMR_NB_VERSION).tar.bz2
	$(EXTRACT_BZ2)

.libamrnb: libamrnb
	(cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --enable-shared && make && make install)
	touch $@

CLEAN_FILE += .libamrnb
CLEAN_PKG += libamrnb
DISTCLEAN_PKG += amrnb-$(LIBAMR_NB_VERSION).tar.bz2

# ***************************************************************************
# libamrwb
# ***************************************************************************

amrwb-$(LIBAMR_WB_VERSION).tar.bz2:
	$(WGET) $(LIBAMR_WB)

libamrwb: amrwb-$(LIBAMR_WB_VERSION).tar.bz2
	$(EXTRACT_BZ2)

.libamrwb: libamrwb
	(cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --enable-shared && make && make install)
	touch $@


CLEAN_FILE += .libamrwb
CLEAN_PKG += libamrwb
1038
DISTCLEAN_PKG += amrwb-$(LIBAMR_WB_VERSION).tar.bz2
1039 1040 1041

# ***************************************************************************

1042 1043 1044
# ffmpeg
# ***************************************************************************

1045
ifdef SVN
1046
ffmpeg:
Felix Paul Kühne's avatar
Felix Paul Kühne committed
1047
	$(SVN) co $(FFMPEG_SVN) ffmpeg
1048 1049
	(cd "$@" && patch -p0 < ../Patches/ffmpeg-svn-swscale-pc.patch && \
	 patch -p1 < ../Patches/ffmpeg-svn-avdevices.patch)
1050
ifeq ($(HOST),i586-pc-beos)
Rafaël Carré's avatar
Rafaël Carré committed
1051
	(cd $@; patch -p0 < ../Patches/ffmpeg-svn-beos.patch)
1052
endif
1053
ifdef HAVE_WINCE
Rafaël Carré's avatar
Rafaël Carré committed
1054
	patch -p1 < Patches/ffmpeg-svn-wince.patch
1055
endif
1056 1057 1058
ifdef HAVE_BEOS
	(cd $@; patch -p0 < ../Patches/ffmpeg-alignment.patch)
endif
1059
ifdef HAVE_DARWIN_OS
1060
	(cd $@; patch -p0 < ../Patches/ffmpeg-macosx-intel-mmx.patch)
1061
endif
1062
ifdef NO_TEXT_RELOCATION
1063 1064
	(cd $@; patch -p0 < ../Patches/ffmpeg-svn-mmx_removal-darwin9.patch)
endif
1065
ifdef HAVE_UCLIBC
1066 1067
	patch -p0 < Patches/ffmpeg-svn-uclibc.patch
	patch -p0 < Patches/ffmpeg-svn-internal-define.patch
1068
	patch -p0 < Patches/ffmpeg-svn-libavformat.patch
1069
endif
1070

1071
else
1072
ffmpeg-$(FFMPEG_VERSION).tar.gz:
1073 1074
	echo "ffmpeg snapshot is too old, you MUST use subversion !"
	exit -1
1075
	$(WGET) $(FFMPEG_URL)
1076

1077 1078 1079
ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz
	$(EXTRACT_GZ)
endif
1080

1081
ifdef HAVE_WINCE
1082
.ffmpeg: ffmpeg .zlib
1083
else
1084 1085 1086
ifdef HAVE_UCLIBC
.ffmpeg: ffmpeg
else
1087 1088
.ffmpeg: ffmpeg .faac .lame
endif
1089
endif
1090
	(cd $<; $(HOSTCC) ./configure $(FFMPEGCONF) --prefix=$(PREFIX) --extra-cflags="$(CFLAGS) $(FFMPEG_CFLAGS) -DRUNTIME_CPUDETECT" --extra-ldflags="$(LDFLAGS)" --enable-gpl --enable-pp --disable-vhook --disable-ffserver --disable-ffmpeg --disable-ffplay && make && make install-libs install-headers)
1091
	touch $@
1092

1093 1094
ifdef SVN
ffmpeg-source: ffmpeg
1095
	tar cfvz ffmpeg-$(DATE).tar.gz ffmpeg
1096 1097 1098 1099

SOURCE += ffmpeg-source
endif

1100
CLEAN_FILE += .ffmpeg
1101
CLEAN_PKG += ffmpeg ffmpeg.cvs
1102 1103 1104 1105 1106 1107
DISTCLEAN_PKG += ffmpeg-$(FFMPEG_VERSION).tar.gz

# ***************************************************************************
# libdvdcss
# ***************************************************************************

1108 1109 1110
libdvdcss-$(LIBDVDCSS_VERSION).tar.gz:
	$(WGET) $(LIBDVDCSS_URL)

1111 1112
ifdef SVN
libdvdcss: 
1113
	$(SVN) co svn://svn.videolan.org/libdvdcss/trunk libdvdcss
1114
	cd $@ && sh bootstrap
1115
else
1116
libdvdcss: libdvdcss-$(LIBDVDCSS_VERSION).tar.gz
1117
	$(EXTRACT_GZ)
1118
endif
1119 1120

.dvdcss: libdvdcss
1121 1122 1123
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --disable-doc --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
1124

1125 1126
ifdef SVN
libdvdcss-source: libdvdcss
1127
	tar cfvz libdvdcss-$(DATE).tar.gz libdvdcss
1128 1129 1130 1131

SOURCE += libdvdcss-source
endif

1132 1133 1134 1135
CLEAN_FILE += .dvdcss
CLEAN_PKG += libdvdcss
DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.gz

1136 1137 1138 1139
# ***************************************************************************
# dummy dvdread to trigger the INSTALL_NAME script
# ***************************************************************************
.dvdread: .dvdnav
1140
	$(INSTALL_NAME)
1141 1142 1143
ifdef HAVE_DARWIN_OS
	install_name_tool -change $(PREFIX)/lib/libdvdread.4.dylib @executable_path/lib/vlc_libdvdread.dylib $(PREFIX)/vlc-lib/vlc_libdvdnav.dylib
endif
1144
	touch $@
1145 1146 1147 1148 1149 1150 1151

CLEAN_FILE += .dvdread

# ***************************************************************************
# libdvdnav
# ***************************************************************************

1152 1153
ifdef SVN
libdvdnav:
1154
	$(SVN) co $(LIBDVDNAV_SVN)  libdvdnav
1155
	patch -p0 < Patches/libdvdnav.patch
1156 1157 1158
ifdef HAVE_WIN32
	patch -p0 < Patches/libdvdnav-win32.patch
endif
1159 1160
	(cd $@; ./autogen.sh noconfig)
else
1161
libdvdnav-$(LIBDVDNAV_VERSION).tar.gz:
1162
	$(WGET) $(LIBDVDNAV_URL)
1163

1164 1165
libdvdnav: libdvdnav-$(LIBDVDNAV_VERSION).tar.gz
	$(EXTRACT_GZ)
1166
	patch -p0 < Patches/libdvdnav.patch
1167 1168 1169
ifdef HAVE_WIN32
	patch -p0 < Patches/libdvdnav-win32.patch
endif
1170
	(cd $@; ./autogen.sh noconfig)
1171
endif
1172

1173
.dvdnav: libdvdnav .dvdcss
1174
ifdef HAVE_WIN32	
1175
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) --with-libdvdcss=$(PREFIX) && make && make install)
1176
else
1177
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) --with-libdvdcss=$(PREFIX) CFLAGS="$(CFLAGS) -Dlseek64=lseek -Doff64_t=off_t" && make && make install)
1178
endif
1179 1180
	$(INSTALL_NAME)
	touch $@
1181 1182 1183

CLEAN_FILE += .dvdnav
CLEAN_PKG += libdvdnav
1184
DISTCLEAN_PKG += libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2
1185 1186 1187 1188 1189

# ***************************************************************************
# libdvbpsi
# ***************************************************************************

1190
libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz:
1191
	$(WGET) $(LIBDVBPSI_URL)
1192

1193
libdvbpsi: libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1194
	$(EXTRACT_GZ)
1195 1196

.dvbpsi: libdvbpsi
1197 1198 1199
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd src && make && make install)
	$(INSTALL_NAME)
	touch $@
1200 1201 1202

CLEAN_FILE += .dvbpsi
CLEAN_PKG += libdvbpsi
1203
DISTCLEAN_PKG += libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1204 1205 1206 1207 1208

# ***************************************************************************
# live
# ***************************************************************************

1209
live555-$(LIVEDOTCOM_VERSION).tar.gz:
1210
	$(WGET) $(LIVEDOTCOM_URL)
1211

1212
live: live555-$(LIVEDOTCOM_VERSION).tar.gz
1213
	$(EXTRACT_GZ)
1214
	patch -p0 < Patches/live-noapps.patch
1215 1216

.live: live
1217 1218 1219
ifdef HAVE_WIN32  
	(cd $<;./genMakefiles mingw && make $(HOSTCC)) 
else 
1220
ifdef HAVE_DARWIN_OS
1221 1222
	(cd $<; sed -e 's%EXTRA_CFLAGS%$(EXTRA_CFLAGS)%' -e 's%EXTRA_LDFLAGS%$(EXTRA_LDFLAGS)%' -i.orig  config.macosx)
	(cd $<; ./genMakefiles macosx && make)
1223
else
1224
	(cd $<; sed -e 's/=/= EXTRA_CPPFLAGS/' -e 's%EXTRA_CPPFLAGS%-I/include%' -i.orig groupsock/Makefile.head)
1225 1226 1227 1228 1229
ifdef HAVE_UCLIBC
ifdef HAVE_BIGENDIAN
	(cd $<; ./genMakefiles armeb-uclibc && make $(HOSTCC))
endif
else
1230
	(cd $<; ./genMakefiles linux && make $(HOSTCC))
1231
endif
1232
endif
1233
endif
1234
	touch $@
1235 1236 1237

CLEAN_FILE += .live
CLEAN_PKG += live
1238
DISTCLEAN_PKG += live555-$(LIVEDOTCOM_VERSION).tar.gz
1239 1240 1241 1242 1243 1244

# ***************************************************************************
# goom
# ***************************************************************************

#goom-macosx-altivec-bin.tar.gz:
1245
#	$(WGET) $(GOOM_URL)
1246 1247

#goom: goom-macosx-altivec-bin.tar.gz
1248
#	$(EXTRACT_GZ)
1249 1250

#.goom: goom
1251 1252
#	(cd $<;)
#	touch $@
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262

#CLEAN_FILE += .goom
#CLEAN_PKG += goom
#DISTCLEAN_PKG += goom-macosx-altivec-bin.tar.gz

# ***************************************************************************
# goom2k4
# ***************************************************************************

goom$(GOOM2k4_VERSION).tar.gz:
1263 1264
	$(WGET) $(GOOM2k4_URL)
	mv goom-$(GOOM2k4_VERSION)-src.tar.gz goom$(GOOM2k4_VERSION).tar.gz
1265 1266

goom: goom$(GOOM2k4_VERSION).tar.gz
1267
	$(EXTRACT_GZ)
1268
ifdef HAVE_DARWIN_OS
Rafaël Carré's avatar
Rafaël Carré committed
1269
	patch -p0 < Patches/goom.patch
1270 1271
endif
ifdef HAVE_WIN32
1272
	(cd $@; dos2unix configure.in)
Rafaël Carré's avatar
Rafaël Carré committed
1273
	patch -p0 < Patches/goom2k4-0-win32.patch
1274
endif
1275
	patch -p0 < Patches/goom2k4-0-mmx.patch
1276 1277

.goom2k4: goom
1278
ifdef HAVE_DARWIN_OS
1279
	(cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
1280
else
1281
	(cd $< && rm -f configure; aclocal -I m4/ && automake --add-missing && autoconf configure.in > configure && $(HOSTCC) sh ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --disable-glibtest --disable-gtktest && make && make install)
1282
endif
1283
	touch $@
1284 1285 1286

CLEAN_FILE += .goom2k4
CLEAN_PKG += goom
1287
DISTCLEAN_PKG += goom$(GOOM2k4_VERSION).tar.gz
1288 1289 1290 1291 1292 1293

# ***************************************************************************
# libcaca
# ***************************************************************************

libcaca-$(LIBCACA_VERSION).tar.gz:
1294
	$(WGET) $(LIBCACA_URL)
1295 1296

libcaca: libcaca-$(LIBCACA_VERSION).tar.gz
1297
	$(EXTRACT_GZ)
1298 1299 1300 1301
ifdef HAVE_DARWIN_OS
	#remove me at next libcaca upgrade
	patch -p0 < Patches/caca_driver_cocoa.diff
	patch -p0 < Patches/caca_macosx.diff
1302 1303 1304
ifndef HAVE_DARWIN_OS_ON_INTEL
	patch -p0 < Patches/caca-osx-ppc.patch
endif
1305
endif
1306 1307

.caca: libcaca
1308
ifdef HAVE_WIN32
1309
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-win32 --disable-x11 --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx && make && make install)
1310
else
1311
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx && make && make install)
1312
endif
1313
	touch $@
1314 1315 1316 1317 1318 1319

CLEAN_FILE += .caca
CLEAN_PKG += libcaca
DISTCLEAN_PKG += libcaca-$(LIBCACA_VERSION).tar.gz

# ***************************************************************************
Antoine Cellerier's avatar
Antoine Cellerier committed
1320
# libdca
1321 1322
# ***************************************************************************

1323 1324 1325 1326 1327
libdca-$(LIBDCA_VERSION).tar.bz2:
	$(WGET) $(LIBDCA_URL)

libdca: libdca-$(LIBDCA_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1328

1329
.dca: libdca
1330
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1331
	$(INSTALL_NAME)
1332
	touch $@
1333

1334
CLEAN_FILE += .dca
Antoine Cellerier's avatar
Antoine Cellerier committed
1335
CLEAN_PKG += libdca
1336
DISTCLEAN_PKG += libdca-$(LIBDCA_VERSION).tar.bz2
1337

1338
# ***************************************************************************
1339
# libx264
1340 1341
# ***************************************************************************

1342 1343 1344
x264-$(X264_VERSION).tar.gz:
	$(WGET) $(X264_URL)

1345 1346
ifdef SVN
x264: 
1347
	$(SVN) co svn://svn.videolan.org/x264/trunk/ x264
1348
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
1349
	(cd x264; patch -p0 < ../Patches/x264-svn-win32.patch )
1350
endif
1351 1352 1353
ifdef HAVE_DARWIN_OS
	(cd $@; patch -p 0 < ../Patches/x264-svn-darwin.patch )
endif
1354
else
1355 1356

x264: x264-$(X264_VERSION).tar.gz
1357
	$(EXTRACT_GZ)
1358
ifdef HAVE_WIN32
1359
  ifndef HAVE_CYGWIN
Rafaël Carré's avatar
Rafaël Carré committed
1360
	(cd x264;patch -p0 <../Patches/x264-20050624-win32.patch)
1361
  endif
1362
else
Rafaël Carré's avatar
Rafaël Carré committed
1363
	patch -p0 < Patches/x264.patch
1364
	rm x264/x264.c
1365
endif
1366
endif
1367

1368 1369
ifdef HAVE_WIN32
.x264: x264 .pthreads
1370 1371 1372
  ifdef HAVE_CYGWIN
	(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)
  else
1373
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1374
  endif
1375
else
1376
.x264: x264
1377
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1378
endif
1379
	touch $@
1380

1381
ifdef SVN
1382 1383
x264-source: x264
	tar cfvz x264-$(DATE).tar.gz x264
1384

1385
SOURCE += x264-source
1386 1387
endif

1388 1389 1390 1391
CLEAN_FILE += .x264
CLEAN_PKG += x264
DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz

1392 1393 1394 1395 1396
# ***************************************************************************
# libmodplug
# ***************************************************************************

libmodplug-$(MODPLUG_VERSION).tar.gz:
1397
	$(WGET) $(MODPLUG_URL)
1398 1399

libmodplug: libmodplug-$(MODPLUG_VERSION).tar.gz
1400
	$(EXTRACT_GZ)
1401 1402

.mod: libmodplug
1403 1404
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
1405 1406 1407 1408 1409 1410 1411 1412 1413

CLEAN_FILE += .mod
CLEAN_PKG += libmodplug
DISTCLEAN_PKG += libmodplug-$(MODPLUG_VERSION).tar.gz

# ***************************************************************************
# libcddb
# ***************************************************************************

1414
libcddb-$(CDDB_VERSION).tar.bz2:
1415
	$(WGET) $(CDDB_URL)
1416

1417
libcddb: libcddb-$(CDDB_VERSION).tar.bz2
1418
	$(EXTRACT_BZ2)
1419 1420

.cddb: libcddb
1421 1422
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" LDFLAGS="$(LDFLAGS) -liconv" && make && make install)
	touch $@
1423 1424 1425

CLEAN_FILE += .cddb
CLEAN_PKG += libcddb
1426
DISTCLEAN_PKG += libcddb-$(CDDB_VERSION).tar.bz2
1427 1428 1429 1430 1431 1432

# ***************************************************************************
# vcdimager
# ***************************************************************************

vcdimager-$(VCDIMAGER_VERSION).tar.gz:
1433
	$(WGET) $(VCDIMAGER_URL)
1434 1435

vcdimager: vcdimager-$(VCDIMAGER_VERSION).tar.gz
1436
	$(EXTRACT_GZ)
1437 1438 1439

ifdef HAVE_DARWIN_OS
.vcdimager: vcdimager
1440 1441
	(cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static LDFLAGS="$(LDFLAGS) -framework CoreFoundation -framework IOKit" && make && make install)
	touch $@
1442 1443
else
.vcdimager: vcdimager
1444 1445
	(cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456
endif

CLEAN_FILE += .vcdimager
CLEAN_PKG += vcdimager
DISTCLEAN_PKG += vcdimager-$(VCDIMAGER_VERSION).tar.gz

# ***************************************************************************
# libcdio
# ***************************************************************************

libcdio-$(CDIO_VERSION).tar.gz:
1457
	$(WGET) $(CDIO_URL)
1458 1459

libcdio: libcdio-$(CDIO_VERSION).tar.gz
1460
	$(EXTRACT_GZ)
1461 1462

.cdio: libcdio
1463 1464
	(cd $<; sed -e 's%@ENABLE_CPP_TRUE@SUBDIRS = C++%@ENABLE_CPP_TRUE@SUBDIRS = %' -i.orig example/Makefile.in && ./configure --prefix=$(PREFIX) --without-vcdinfo --disable-shared && make && make install)
	touch $@
1465 1466 1467 1468 1469

CLEAN_FILE += .cdio
CLEAN_PKG += libcdio
DISTCLEAN_PKG += libcdio-$(CDIO_VERSION).tar.gz

1470 1471 1472 1473 1474
# ***************************************************************************
# wxWidgets
# ***************************************************************************

wxWidgets-$(WXWIDGETS_VERSION).tar.gz:
1475
	$(WGET) $(WXWIDGETS_URL)
1476 1477

wxwidgets: wxWidgets-$(WXWIDGETS_VERSION).tar.gz
1478 1479 1480
	$(EXTRACT_GZ)
	(cd wxwidgets; patch -p0 < ../Patches/wxwidgets_uri.patch)
#	(cd wxwidgets; patch -p1 <../Patches/wxMSW-win32.patch)
1481 1482

.wxwidgets: wxwidgets
1483 1484 1485
	(cd wxwidgets; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-optimise --disable-debug --enable-unicode --disable-threads --disable-gif --disable-pcx --disable-iff --disable-pnm --without-zlib  --without-libpng --without-libjpeg --without-libtiff --without-regex  --disable-zipstream --disable-fs_zip --enable-no_rtti  --enable-no_exceptions --disable-exceptions --disable-stl --disable-html --without-expat --disable-protocols --disable-protocol --disable-xrc --disable-sound --disable-dialupman --disable-mediactrl  --disable-joystick --disable-grid --disable-datepick --disable-postscript--disable-filesystem --disable-fileproto --disable-ipc --disable-sockets --disable-precomp-headers && make && make install)
	$(INSTALL_NAME)
	touch $@
1486 1487 1488 1489 1490

CLEAN_FILE += .wxwidgets
CLEAN_PKG += wxwidgets
DISTCLEAN_PKG += wxWidgets-$(WXWIDGETS_VERSION).tar.gz

1491 1492 1493 1494
# ***************************************************************************
# qt4 (win32 binary)
# ***************************************************************************

Clément Stenac's avatar
Clément Stenac committed
1495
qt4-$(QT4_VERSION)-win32-bin.tar.gz:
1496
	$(WGET) $(QT4_URL)
Clément Stenac's avatar
Clément Stenac committed
1497

Clément Stenac's avatar
Clément Stenac committed
1498
qt4: qt4-$(QT4_VERSION)-win32-bin.tar.gz
1499
	$(EXTRACT_GZ)
Clément Stenac's avatar
Clément Stenac committed
1500

1501
.qt4: qt4
1502
	(cd qt4;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)
1503
ifeq ($(BUILD),i686-pc-cygwin)
1504
	(cd qt4;cp bin/*.exe $(PREFIX)/bin)
1505
else
1506
	(cd qt4;cp bin/* $(PREFIX)/bin)
1507
endif
1508
	touch $@
Clément Stenac's avatar
Clément Stenac committed
1509 1510 1511

CLEAN_FILE += .qt4
CLEAN_PKG += qt4
1512
DISTCLEAN_PKG += qt4-$(QT4_VERSION)-win32-bin.tar.gz
Clément Stenac's avatar
Clément Stenac committed
1513

1514 1515 1516 1517 1518 1519 1520 1521
# ***************************************************************************
# qt4 (trolltech binaries)
# ***************************************************************************

qt-win-opensource-$(QT4T_VERSION)-mingw.exe:
	wget $(QT4T_URL)

Qt: qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1522
	mkdir Qt
1523
	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
1524 1525 1526
	mv Qt/\$$OUTDIR/bin\ /* Qt/ && rmdir Qt/\$$OUTDIR/bin\  Qt/\$$OUTDIR
	find Qt -name '* ' -exec sh -c "mv \"{}\" `echo {}`" \;
	find Qt/src -name '*.cpp' -exec rm {} \;
1527
	find Qt/translations -type f -a ! -name 'qt_*.qm' -exec rm {} \;
1528 1529 1530 1531
	find Qt/include -name '*.h' -exec sh -c "mv {} {}.tmp; sed 's,..\/..\/src,..\/src,' {}.tmp > {}; rm -f {}.tmp" \;
	mkdir Qt/lib/pkgconfig
	sed -e s,@@VERSION@@,$(QT4T_VERSION), -e s,@@PREFIX@@,$(PREFIX), Patches/QtCore.pc.in > Qt/lib/pkgconfig/QtCore.pc
	sed -e s,@@VERSION@@,$(QT4T_VERSION), -e s,@@PREFIX@@,$(PREFIX), Patches/QtGui.pc.in > Qt/lib/pkgconfig/QtGui.pc
1532 1533

.Qt: Qt
1534
	mkdir -p $(PREFIX)/bin $(PREFIX)/include/qt4/src $(PREFIX)/lib/pkgconfig $(PREFIX)/share/qt4/translations
1535 1536 1537 1538
	cp Qt/bin/moc.exe Qt/bin/rcc.exe Qt/bin/uic.exe $(PREFIX)/bin
	cp -r Qt/include/QtCore Qt/include/QtGui $(PREFIX)/include/qt4
	cp -r Qt/src/corelib Qt/src/gui $(PREFIX)/include/qt4/src
	cp Qt/lib/libQtCore4.a Qt/lib/libQtGui4.a $(PREFIX)/lib
1539 1540
	cp Qt/lib/pkgconfig/* $(PREFIX)/lib/pkgconfig
	cp Qt/translations/* $(PREFIX)/share/qt4/translations 
1541
	touch $@
1542 1543 1544

CLEAN_FILE += .Qt
CLEAN_PKG += Qt
1545
DISTCLEAN_PKG += qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1546

1547 1548 1549 1550 1551
# ***************************************************************************
# zlib
# ***************************************************************************

zlib-$(ZLIB_VERSION).tar.gz:
1552
	$(WGET) $(ZLIB_URL)
1553 1554

zlib: zlib-$(ZLIB_VERSION).tar.gz
1555
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
1556
	patch -p0 < Patches/zlib.patch
1557 1558

.zlib: zlib
1559 1560 1561
	(cd zlib; $(HOSTCC2) ./configure --prefix=$(PREFIX) && make install)
	$(INSTALL_NAME)
	touch $@
1562 1563 1564 1565 1566

CLEAN_FILE += .zlib
CLEAN_PKG += zlib
DISTCLEAN_PKG += zlib-$(ZLIB_VERSION).tar.gz

1567 1568 1569 1570 1571
# ***************************************************************************
# PortAudio 
# ***************************************************************************

pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz:
1572
	$(WGET) $(PORTAUDIO_URL)
1573 1574

portaudio: pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1575
	$(EXTRACT_GZ)
1576
ifneq ($(HOST),$(BUILD))
Rafaël Carré's avatar
Rafaël Carré committed
1577
	(patch -p0 < Patches/portaudio-cross.patch;cd $@;  autoconf)
1578
endif
1579 1580

.portaudio: portaudio 
1581 1582 1583
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make  install)
	$(INSTALL_NAME)
	touch $@
1584 1585 1586

CLEAN_FILE += .portaudio
CLEAN_PKG += portaudio
1587
DISTCLEAN_PKG += pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1588

1589 1590 1591 1592 1593
# ***************************************************************************
# xml
# ***************************************************************************

libxml2-$(XML_VERSION).tar.gz:
1594
	$(WGET) $(XML_URL)
1595 1596

xml: libxml2-$(XML_VERSION).tar.gz
1597
	$(EXTRACT_GZ)
1598
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
1599
	patch -p0 < Patches/xml2-win32.patch
1600
	rm -f xml/aclocal.m4
1601
endif
Jean-Paul Saman's avatar
Jean-Paul Saman committed
1602 1603 1604
ifdef HAVE_UCLIBC
	patch -p0 < Patches/xml2-uclibc.patch
endif
1605 1606

.xml: xml
1607 1608 1609
ifdef HAVE_WIN32
	(cd xml; aclocal && automake && autoreconf)
endif
1610 1611 1612
  ifdef HAVE_CYGWIN
	(cd xml; ac_cv_header_pthread_h="no" CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --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 && make && make install)
  else
1613
	(cd xml; CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --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 && make && make install)
1614
  endif
1615
ifndef HAVE_DARWIN_OS
1616
	$(INSTALL_NAME)
1617
endif
1618
	touch $@
1619 1620 1621 1622 1623

CLEAN_FILE += .xml
CLEAN_PKG += xml
DISTCLEAN_PKG += libxml2-$(XML_VERSION).tar.gz

1624 1625 1626 1627 1628
# ***************************************************************************
# twolame
# ***************************************************************************

twolame-$(TWOLAME_VERSION).tar.gz:
1629
	$(WGET) $(TWOLAME_URL)
1630 1631

twolame: twolame-$(TWOLAME_VERSION).tar.gz
1632
	$(EXTRACT_GZ)
1633
ifdef HAVE_BEOS
Rafaël Carré's avatar
Rafaël Carré committed
1634
	patch -p0 < Patches/twolame-BeOS.patch
1635
endif
1636 1637

.twolame: twolame
Christophe Mutricy's avatar
Christophe Mutricy committed
1638
ifdef HAVE_WIN32
1639
	(cd twolame/win32; $(WGET) "http://twolame.svn.sourceforge.net/viewvc/*checkout*/twolame/trunk/win32/winutil.h")
Christophe Mutricy's avatar
Christophe Mutricy committed
1640
endif	
1641
	(cd twolame; $(HOSTCC) CFLAGS="${CFLAGS}  -DLIBTWOLAME_STATIC" ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd libtwolame &&  make && make install)
1642 1643
	$(INSTALL_NAME)
	touch $@
1644 1645 1646

CLEAN_FILE += .twolame
CLEAN_PKG += twolame
1647
DISTCLEAN_PKG += twolame-$(TWOLAME_VERSION).tar.gz
1648 1649 1650 1651 1652 1653

# ***************************************************************************
# libpng
# ***************************************************************************

libpng-$(PNG_VERSION).tar.bz2:
1654
	$(WGET) $(PNG_URL)
1655 1656

libpng: libpng-$(PNG_VERSION).tar.bz2
1657
	$(EXTRACT_BZ2)
1658
ifdef HAVE_WIN32
1659
	(cd $@; cat ../Patches/libpng-win32.patch | sed s,??PREFIX??,$(PREFIX), | patch -p0)
1660
else
1661
	(cat Patches/libpng-osx.patch | sed -e 's%??PREFIX??%$(PREFIX)%' -e 's%??EXTRA_CFLAGS??%$(EXTRA_CFLAGS)%' -e 's%??EXTRA_LDFLAGS??%$(EXTRA_LDFLAGS)%' | patch -p0)
1662
endif
Rafaël Carré's avatar
Rafaël Carré committed
1663
	(patch -p0 < Patches/libpng-makefile.patch)
1664
ifdef HAVE_DARWIN_OS_ON_INTEL
Rafaël Carré's avatar
Rafaël Carré committed
1665
	(patch -p0 < Patches/libpng-darwin-mactel.patch)
1666
endif
1667

1668
.png: libpng 
1669
ifdef HAVE_DARWIN_OS
1670
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1671 1672
else
ifdef HAVE_WIN32
1673
	(cd $<; rm -f INSTALL; cp scripts/makefile.cygwin Makefile && make $(HOSTCC) && make install-static)
1674 1675
else
ifeq ($(PNG_VERSION),1.2.8)
1676
	(cd $<; PREFIX=$(PREFIX) DESTDIR=$(PREFIX) cp scripts/makefile.linux Makefile && make && make install)
1677
else
1678
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1679
endif
1680
endif
1681
endif
1682 1683
	$(INSTALL_NAME)
	touch $@
1684 1685 1686

CLEAN_FILE += .png
CLEAN_PKG += libpng
1687
DISTCLEAN_PKG += libpng-$(PNG_VERSION).tar.bz2
1688 1689 1690 1691 1692 1693

# ***************************************************************************
# libzvbi
# ***************************************************************************

zvbi-$(ZVBI_VERSION).tar.bz2:
1694
	$(WGET) $(ZVBI_URL)
1695 1696

zvbi: zvbi-$(ZVBI_VERSION).tar.bz2
1697
	$(EXTRACT_BZ2)
1698

1699 1700 1701
ifdef HAVE_WIN32
.zvbi: zvbi .pthreads
else
1702
.zvbi: zvbi
1703
endif
1704
ifdef HAVE_DARWIN_OS
1705
	(cd $<; ./configure --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -fnested-functions" && make && make install)
1706 1707 1708
else
	(cd $<; ./configure --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make && make install)
endif
1709
	$(INSTALL_NAME)
1710
	touch $@
1711 1712 1713

CLEAN_FILE += .zvbi
CLEAN_PKG += zvbi
1714
DISTCLEAN_PKG += zvbi-$(ZVBI_VERSION).tar.bz2
1715 1716

# ***************************************************************************
1717 1718 1719 1720 1721
# libraw1394
# ***************************************************************************

#ifdef SVN
#libraw1394:
1722
#	$(SVN) co -r 325 $(LIBDC1394_SVN)/libraw1394/trunk/libraw1394  libraw1394
1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737
#        (cd $<; libtoolize --copy --force; \
#                autopoint -f; \
#                aclocal -I extras/contrib/share/aclocal; \
#                autoconf; \
#                autoheader; \
#                automake --add-missing --copy -Wall)
#
#else
libraw1394-$(LIBRAW1394_VERSION).tar.gz:
	$(WGET) $(LIBRAW1394_URL)

libraw1394: libraw1394-$(LIBRAW1394_VERSION).tar.gz
	$(EXTRACT_GZ)
#endif

1738
.raw1394: libraw1394
1739
	(cd $<; ./configure --prefix=$(PREFIX) && make && make DESTDIR=$(PRFIX) install)
1740
#	sed 's/^typedef u_int8_t  byte_t;/\/* typedef u_int8_t  byte_t;\*\//'
1741 1742
	touch $@
	
1743
CLEAN_FILE += .raw1394
1744
CLEAN_PKG += libraw1394
1745
DISTCLEAN_PKG += libraw1394-$(LIBRAW1394_VERSION).tar.gz
1746 1747 1748 1749 1750 1751 1752

# ***************************************************************************
# libdc1394
# ***************************************************************************

#ifdef SVN
#libdc1394:
1753
#	$(SVN) co -r 325 $(LIBDC1394_SVN)/libdc1394/trunk/libdc1394  libdc1394
1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768
#        (cd $<; libtoolize --copy --force; \
#                autopoint -f; \
#                aclocal -I extras/contrib/share/aclocal; \
#                autoconf; \
#                autoheader; \
#                automake --add-missing --copy -Wall)
#
#else
libdc1394-$(LIBDC1394_VERSION).tar.gz:
	$(WGET) $(LIBDC1394_URL)

libdc1394: libdc1394-$(LIBDC1394_VERSION).tar.gz
	$(EXTRACT_GZ)
#endif

1769
.dc1394: libdc1394
1770 1771 1772 1773 1774
	(cd $<; ./configure --prefix=$(PREFIX) && \
	 patch -p1 < ../Patches/libdc1394-noexamples.patch && \
	 make && make DESTDIR=$(PRFIX) install)
	touch $@
	
1775
CLEAN_FILE += .dc1394
1776
CLEAN_PKG += libdc1394
1777
DISTCLEAN_PKG += libdc1394-$(LIBDC1394_VERSION).tar.gz
1778 1779

# ***************************************************************************
1780 1781 1782
# gpg-error 
# ***************************************************************************

1783
libgpg-error-$(GPGERROR_VERSION).tar.bz2:
1784
	$(WGET) $(GPGERROR_URL)
1785

1786 1787
libgpg-error: libgpg-error-$(GPGERROR_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1788

1789
.gpg-error: libgpg-error
1790
ifdef HAVE_DARWIN_OS_ON_INTEL
1791
	(cd $<; ./autogen.sh)
1792
endif
1793 1794 1795
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls --disable-shared && make && make install)
#	$(INSTALL_NAME)
	touch $@
1796

1797
CLEAN_FILE += .gpg-error
1798
CLEAN_PKG += libgpg-error
1799
DISTCLEAN_PKG += libgpg-error-$(GPGERROR_VERSION).tar.bz2
1800 1801 1802 1803 1804

# ***************************************************************************
# libgcrypt
# ***************************************************************************

1805
libgcrypt-$(GCRYPT_VERSION).tar.bz2:
1806
	$(WGET) $(GCRYPT_URL)
1807

1808
libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2
1809
	$(EXTRACT_BZ2)
Rafaël Carré's avatar
Rafaël Carré committed
1810
	patch -p0 < Patches/gcrypt.patch
1811

1812
.gcrypt: libgcrypt .gpg-error
1813
ifdef HAVE_WIN32
1814
	(cd $<; ./autogen.sh && $(HOSTCC) ./configure $(HOSTCONF) --target=i586-mingw32msvc --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && sed -i 46s@sys/times.h@sys/time.h@ cipher/random.c && make && make install)
1815
else
1816
ifdef HAVE_DARWIN_OS_ON_INTEL
1817
	(cd $<; $(HOSTCC) ./configure --host=$(HOST) --build=$(BUILD) --prefix=$(PREFIX) --disable-asm CFLAGS="$(CFLAGS)" && make && make install)
1818
endif
1819
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make && make install)
1820
endif
1821 1822
	$(INSTALL_NAME)
	touch $@
1823 1824 1825

CLEAN_FILE += .gcrypt
CLEAN_PKG += libgcrypt
1826
DISTCLEAN_PKG += libgcrypt-$(GCRYPT_VERSION).tar.bz2
1827 1828 1829 1830 1831 1832

# ***************************************************************************
# gnutls
# ***************************************************************************

gnutls-$(GNUTLS_VERSION).tar.bz2:
1833
	$(WGET) $(GNUTLS_URL)
1834 1835

gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2
1836
	$(EXTRACT_BZ2)
1837
ifdef HAVE_WIN32
1838
	patch -p0 < Patches/gnutls-win32.patch
1839
	(cd $@; cd lgl; ln -sf alloca_.h alloca.h) 
1840
endif
1841

1842
.gnutls: gnutls .gcrypt .gpg-error
1843
ifdef HAVE_WIN32
1844
	(cd $<; autoconf && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --target=i586-mingw32msvc && cd gl && make && cd ../lgl && make &&  cd ../lib &&make && make install && cd ../includes && make install)
1845
else
1846
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --disable-cxx && cd gl && make && cd ../lgl && make &&  cd ../lib &&make && make install && cd ../includes && make install)
1847
endif
1848 1849
	$(INSTALL_NAME)
	touch $@
1850 1851 1852

CLEAN_FILE += .gnutls
CLEAN_PKG += gnutls
1853
DISTCLEAN_PKG += gnutls-$(GNUTLS_VERSION).tar.bz2
1854 1855 1856 1857 1858 1859

# ***************************************************************************
# libopendaap
# ***************************************************************************

libopendaap-$(DAAP_VERSION).tar.bz2:
1860
	$(WGET) $(DAAP_URL)
1861 1862

libopendaap: libopendaap-$(DAAP_VERSION).tar.bz2
1863
	$(EXTRACT_BZ2)
Rafaël Carré's avatar
Rafaël Carré committed
1864
	patch -p0 < Patches/daap.patch
1865

1866
.opendaap: libopendaap
1867 1868 1869
	(cd $<; ./configure --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make install)
	$(INSTALL_NAME)
	touch $@
1870

1871
CLEAN_FILE += .opendaap
1872
CLEAN_PKG += libopendaap
1873
DISTCLEAN_PKG += libopendaap-$(DAAP_VERSION).tar.bz2
1874 1875 1876 1877 1878 1879

# ***************************************************************************
# glib
# ***************************************************************************

glib-$(GLIB_VERSION).tar.gz:
1880
	$(WGET) $(GLIB_URL)
1881 1882

glib: glib-$(GLIB_VERSION).tar.gz
1883
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
1884
	patch -p0 < Patches/glib.patch
1885 1886

.glib: glib
1887 1888
	(cd $<; ./configure --prefix=$(PREFIX) --host=powerpc-apple-macos && make && make install)
	touch $@
1889 1890 1891

CLEAN_FILE += .glibl
CLEAN_PKG += glib
1892
DISTCLEAN_PKG += glib-$(GLIB_VERSION).tar.gz
1893 1894 1895 1896 1897 1898

# ***************************************************************************
# libIDL
# ***************************************************************************

libIDL-$(LIBIDL_VERSION).tar.gz:
1899
	$(WGET) $(LIBIDL_URL)
1900 1901

libIDL: libIDL-$(LIBIDL_VERSION).tar.gz
1902
	$(EXTRACT_GZ)
1903

1904
.IDL: libIDL
1905 1906
	(cd $<; ./configure --prefix=$(PREFIX) --host=powerpc-apple-macos && make && make install )
	touch $@
1907

1908
CLEAN_FILE += .IDL
1909
CLEAN_PKG += libIDL
1910
DISTCLEAN_PKG += libIDL-$(LIBIDL_VERSION).tar.gz
1911

1912 1913 1914 1915 1916
# ***************************************************************************
# Gecko SDK
# ***************************************************************************

gecko-sdk-ppc-macosx10.2-1.7.5.tar.gz:
1917
	$(WGET) $(GECKO_SDK_MAC_URL)
1918 1919

gecko-sdk: gecko-sdk-ppc-macosx10.2-1.7.5.tar.gz
1920
	$(EXTRACT_GZ)
1921 1922

.gecko: gecko-sdk
1923 1924
	(cd $<)
	touch $@
1925 1926 1927 1928 1929

CLEAN_FILE += .gecko
CLEAN_PKG += gecko-sdk
DISTCLEAN_PKG += gecko-sdk-ppc-macosx10.2-1.7.5.tar.gz

1930 1931 1932 1933
# ***************************************************************************
# Gecko SDK win32
# ***************************************************************************

1934
gecko-sdk-i586-pc-msvc-1.8b1.zip:
1935
	$(WGET) $(GECKO_SDK_WIN32_URL)
1936 1937

libIDL-0.6.3-win32-bin.zip:
1938
	$(WGET) $(LIBIDL_WIN32_BIN_URL)
1939

1940
glib-19990228.zip:
1941
	$(WGET) $(GLIB_WIN32_BIN_URL)
1942

1943
.gecko-win32: gecko-sdk-i586-pc-msvc-1.8b1.zip libIDL-0.6.3-win32-bin.zip glib-19990228.zip
1944 1945 1946 1947 1948 1949 1950
	unzip gecko-sdk-i586-pc-msvc-1.8b1.zip
	rm -rf ../gecko-sdk
	mv gecko-sdk ..
	unzip -j libIDL-0.6.3-win32-bin.zip libIDL-0.6.3-win32-bin/libIDL-0.6.dll -d ../gecko-sdk/bin
	unzip glib-19990228.zip glib-1.2.dll -d ../gecko-sdk/bin
	chmod a+x ../gecko-sdk/bin/*
	touch $@
1951 1952 1953

CLEAN_FILE += .gecko-win32
CLEAN_PKG += gecko-sdk-win32
1954
DISTCLEAN_PKG += gecko-sdk-i586-pc-msvc-1.8b1.zip libIDL-0.6.3-win32-bin.zip glib-19990228.zip
1955

1956
# ***************************************************************************
1957
# mozilla-macosx
1958 1959 1960
# ***************************************************************************

mozilla-source-$(MOZILLA_VERSION).tar.bz2:
1961
	$(WGET) $(MOZILLA_URL)
1962 1963

mozilla: mozilla-source-$(MOZILLA_VERSION).tar.bz2
1964
	$(EXTRACT_BZ2)
1965

1966
.mozilla-macosx: mozilla-macosx
1967 1968
	(cd $<; ./configure --prefix=$(PREFIX) --enable-default-toolkit=mac --enable-standalone-modules=xpcom,plugin && make && make install)
	touch $@
1969

1970 1971
CLEAN_FILE += .mozilla-macosx
CLEAN_PKG += mozilla-macosx
1972
DISTCLEAN_PKG += mozilla-source-$(MOZILLA_VERSION).tar.bz2
1973

1974 1975 1976 1977 1978
# ***************************************************************************
# libjpeg
# ***************************************************************************

jpeg-$(JPEG_VERSION).tar.gz:
1979
	$(WGET) $(JPEG_URL)
1980 1981

jpeg: jpeg-$(JPEG_VERSION).tar.gz 
1982
	$(EXTRACT_GZ)
1983 1984

.jpeg: jpeg
1985 1986 1987
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(HOSTCC) && make && make install-lib)
	$(RANLIB) $(PREFIX)/lib/libjpeg.a
	touch $@
1988 1989 1990 1991 1992 1993 1994 1995 1996 1997

CLEAN_FILE += .jpeg
CLEAN_PKG += jpeg
DISTCLEAN_PKG += jpeg-$(JPEG_VERSION).tar.gz

# ***************************************************************************
# tiff
# ***************************************************************************

tiff-$(TIFF_VERSION).tar.gz:
1998
	$(WGET) $(TIFF_URL)
1999 2000

tiff: tiff-$(TIFF_VERSION).tar.gz 
2001
	$(EXTRACT_GZ)
2002 2003

.tiff: tiff
2004
ifdef HAVE_WIN32
2005
	(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)
2006
else
2007
	(cd $<; ./configure --with-CFLAGS="$(CFLAGS)" --with-JPEG=no --with-ZIP=no --prefix=$(PREFIX) && make -C port &&make -C libtiff && make -C libtiff install)
2008
endif
2009
	$(INSTALL_NAME)
2010
	touch $@
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020

CLEAN_FILE += .tiff
CLEAN_PKG += tiff
DISTCLEAN_PKG += tiff-$(TIFF_VERSION).tar.gz

# ***************************************************************************
# SDL
# ***************************************************************************

SDL-$(SDL_VERSION).tar.gz:
2021
	$(WGET) $(SDL_URL)
2022 2023

SDL: SDL-$(SDL_VERSION).tar.gz 
2024
	$(EXTRACT_GZ)
2025 2026

.SDL: SDL
2027 2028 2029
	(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)
	$(INSTALL_NAME)
	touch $@
2030 2031 2032 2033 2034 2035 2036 2037 2038 2039

CLEAN_FILE += .SDL
CLEAN_PKG += SDL
DISTCLEAN_PKG += SDL-$(SDL_VERSION).tar.gz

# ***************************************************************************
# SDL_image
# ***************************************************************************

SDL_image-$(SDL_IMAGE_VERSION).tar.gz:
2040
	$(WGET) $(SDL_IMAGE_URL)
2041 2042

SDL_image: SDL_image-$(SDL_IMAGE_VERSION).tar.gz 
2043
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
2044
	patch -p0 < Patches/SDL_image.patch
2045 2046

.SDL_image: SDL_image .SDL .png .jpeg .tiff
2047 2048 2049
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --enable-tif --disable-sdltest && make && make install)
	$(INSTALL_NAME)
	touch $@
2050 2051 2052 2053 2054

CLEAN_FILE += .SDL_image
CLEAN_PKG += SDL_image
DISTCLEAN_PKG += SDL_image-$(SDL_IMAGE_VERSION).tar.gz

2055 2056 2057 2058 2059
# ***************************************************************************
# Musepack decoder library (libmpcdec)
# ***************************************************************************

libmpcdec-$(MUSE_VERSION).tar.bz2:
2060
	$(WGET) $(MUSE_URL)
2061

2062
mpcdec: libmpcdec-$(MUSE_VERSION).tar.bz2 
2063
	$(EXTRACT_BZ2)
2064
	patch -p0 < Patches/mpcdec.patch
2065
	(cd $@; autoreconf)
2066

2067
.mpcdec: mpcdec
2068
ifdef HAVE_WIN32 
2069
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS=-D_PTRDIFF_T=mpc_int32_t && make && make install)
2070
else
2071
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2072 2073
endif
ifdef HAVE_DARWIN_OS
2074
	$(INSTALL_NAME)
2075
endif
2076
	touch $@
2077

2078 2079
CLEAN_FILE += .mpcdec
CLEAN_PKG += mpcdec
2080 2081
DISTCLEAN_PKG += libmpcdec-$(MUSE_VERSION).tar.bz2

2082
# ***************************************************************************
2083 2084
# Dirac
# ***************************************************************************
2085 2086

dirac-$(DIRAC_VERSION).tar.gz:
2087
	$(WGET) $(DIRAC_URL)
2088 2089

dirac: dirac-$(DIRAC_VERSION).tar.gz
2090
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
2091
	patch -p0 <Patches/dirac-cross.patch
2092
ifdef HAVE_CYGWIN
2093
	# incorrect compile warning with cygwin compiler 3.4.4
2094 2095
	patch -p0 <Patches/dirac-cygwin.patch
endif
2096
	(cd $@; aclocal && autoconf && automake)
2097

2098 2099 2100 2101
DIRAC_SUBDIRS = libdirac_byteio libdirac_common libdirac_motionest libdirac_encoder libdirac_decoder

ifdef HAVE_WIN32
DIRAC_SUBDIRS += win32
2102
endif
2103

2104
.dirac: dirac
2105
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  CFLAGS="$(CFLAGS)" && DOC_DIR="" make $(DIRAC_SUBDIRS) && DOC_DIR="" make install)
2106
	touch $@
2107 2108 2109

# for MacOS X, dirac is split into two libraries, which needs be installed using two targets
.dirac_encoder: .dirac
2110 2111
	$(INSTALL_NAME)
	touch $@
2112 2113

.dirac_decoder: .dirac
2114 2115
	$(INSTALL_NAME)
	touch $@
2116 2117 2118 2119 2120 2121 2122 2123 2124

CLEAN_FILE += .dirac
CLEAN_PKG += dirac
DISTCLEAN_PKG += dirac-$(DIRAC_VERSION).tar.gz

# *************************************************************************
# DirectX headers
# *************************************************************************
win32-dx7headers.tgz:
2125
	$(WGET) $(DX_HEADERS_URL)
2126
.dx_headers: win32-dx7headers.tgz
2127 2128
	(cd ../include ; tar xzf ../src/$<)
	touch $@
2129 2130 2131 2132 2133 2134 2135
CLEAN_FILE += .dx_headers
DISTCLEAN_PKG += win32-dx7headers.tgz
 
# *************************************************************************
# DirectShow headers
# *************************************************************************
dshow-headers.tgz:
2136
	$(WGET) $(DSHOW_HEADERS_URL)
2137
.dshow_headers: dshow-headers.tgz
2138 2139
	(cd ../include ; tar xzf ../src/$<)
	touch $@
2140 2141
CLEAN_FILE += .dshow_headers
DISTCLEAN_PKG += dshow-headers.tgz
2142 2143 2144 2145 2146 2147

# ***************************************************************************
# libexpat
# ***************************************************************************

expat-$(EXPAT_VERSION).tar.gz:
2148
	$(WGET) $(EXPAT_URL)
2149 2150

expat: expat-$(EXPAT_VERSION).tar.gz
2151
	$(EXTRACT_GZ)
2152 2153

.expat: expat
2154
ifdef HAVE_DARWIN_OS
2155
	(cd $< aclocal --force && libtoolize --force && autoconf --force && autoheader --force )
2156
endif
2157 2158
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
2159 2160 2161 2162 2163 2164 2165 2166 2167 2168

CLEAN_FILE += .expat
CLEAN_PKG += expat
DISTCLEAN_PKG += expat-$(EXPAT_VERSION).tar.gz

# ***************************************************************************
# CyberLink C++ UPnP library
# ***************************************************************************

clinkcc$(CLINKCC_VERSION).tar.gz:
2169
	$(WGET) $(CLINKCC_URL)
2170 2171

clinkcc: clinkcc$(CLINKCC_VERSION).tar.gz
2172 2173 2174
	tar xzf $<
	mv $(patsubst %.tar.gz,Cyberlink,$(patsubst %.tgz,Cyberlink,$(notdir $<))) $@ || true
	touch $@
Rafaël Carré's avatar
Rafaël Carré committed
2175
	patch -p0 < Patches/clinkcc.patch
2176
ifdef HAVE_DARWIN_OS
Rafaël Carré's avatar
Rafaël Carré committed
2177
	patch -p0 < Patches/clinkcc_osx.patch
2178 2179 2180
endif

.clinkcc: clinkcc
2181 2182
	(cd $<; ./bootstrap && ./configure --prefix=$(PREFIX) --enable-expat && make && chmod 755 config/install-sh && make install )
	touch $@
2183 2184 2185

CLEAN_FILE += .clinkcc
CLEAN_PKG += clinkcc
2186
DISTCLEAN_PKG += clinkcc$(CLINKCC_VERSION).tar.gz
2187

2188 2189 2190 2191
# ***************************************************************************
# NASM assembler
# ***************************************************************************

2192
nasm-$(NASM_VERSION).tar.bz2:
2193
	$(WGET) $(NASM_URL)
2194 2195

nasm: nasm-$(NASM_VERSION).tar.bz2
2196
	$(EXTRACT_BZ2)
2197 2198

#nasm:
2199 2200 2201
#	echo $(NASM_CVSROOT) A > ./nasm.cvs
#	CVS_PASSFILE=./nasm.cvs cvs -z3 -d $(NASM_CVSROOT) co nasm
#	(cd $@ && autoconf && autoheader)
2202 2203

.nasm: nasm
2204 2205
	(cd $< && $(HOSTCC) ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
2206 2207 2208

CLEAN_FILE += .nasm
CLEAN_PKG += nasm nasm.cvs
2209
DISTCLEAN_PKG += nasm-$(NASM_VERSION).tar.bz2
2210

2211 2212 2213 2214 2215 2216 2217
# ***************************************************************************
# Copy aclocal files
# This is necessary for --missing aclocal to succeed after a
# configure.ac/Makefile.am change in the vlc root dir
# **************************************************************************

.aclocal:
2218 2219
	cp -R $(PREFIX)/share/aclocal/* $(PREFIX)/../../m4/
	touch $@
2220

Felix Paul Kühne's avatar
Felix Paul Kühne committed
2221
CLEAN_FILE += .aclocal
2222

2223 2224 2225 2226 2227
# ***************************************************************************
# UNICOWS (Unicode support for WINME/98/95)
# ***************************************************************************

libunicows-$(UNICOWS_VERSION).tar.gz:
2228 2229
	$(WGET) $(UNICOWS_URL)
	mv libunicows-$(UNICOWS_VERSION)-src.tar.gz $@ || true
2230 2231

libunicows: libunicows-$(UNICOWS_VERSION).tar.gz
2232
	$(EXTRACT_GZ)
2233 2234

.unicows: libunicows
2235 2236
	(cd $</src; make -f makefile.mingw32 PATHSEP='/' $(HOSTCC) && cp -f ../lib/mingw32/libunicows.a $(PREFIX)/lib)
	touch $@
2237 2238 2239

CLEAN_FILE += .unicows
CLEAN_PKG += libunicows
2240
DISTCLEAN_PKG += libunicows-$(UNICOWS_VERSION).tar.gz
2241

2242 2243 2244 2245 2246
# ***************************************************************************
# TagLib read and editing of tags of popular audio formats
# ***************************************************************************

taglib-$(TAGLIB_VERSION).tar.gz:
2247
	$(WGET) $(TAGLIB_URL)
2248 2249

taglib: taglib-$(TAGLIB_VERSION).tar.gz
2250
	$(EXTRACT_GZ)
2251 2252 2253
ifdef HAVE_CYGWIN
	patch -p0 <Patches/taglib-cygwin.patch
endif
2254 2255

.tag: taglib
2256 2257 2258
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
2259

2260 2261 2262 2263 2264 2265 2266
CLEAN_FILE += .tag
CLEAN_PKG += taglib
DISTCLEAN_PKG += taglib-$(TAGLIB_VERSION).tar.gz

# ***************************************************************************
# pthreads for win32
# ***************************************************************************
Christophe Mutricy's avatar
Christophe Mutricy committed
2267 2268 2269 2270 2271 2272 2273 2274

pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz:
	$(WGET) $(PTHREADS_URL)

pthreads: pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
	$(EXTRACT_GZ)

.pthreads: pthreads
2275
	(cd $<; $(HOSTCC) make $(PTHREADSCONF) GC-static && cp -v pthread.h sched.h semaphore.h $(PREFIX)/include/ && cp -v *.a $(PREFIX)/lib/)
Christophe Mutricy's avatar
Christophe Mutricy committed
2276 2277 2278
	$(INSTALL_NAME)
	touch $@

2279 2280 2281
CLEAN_FILE += .pthreads
CLEAN_PKG += pthreads
DISTCLEAN_PKG += pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298
# ***************************************************************************
# ncurses library (with wide chars support)
# ***************************************************************************

ncurses-$(NCURSES_VERSION).tar.gz:
	$(WGET) $(NCURSES_URL)

ncurses: ncurses-$(NCURSES_VERSION).tar.gz
	$(EXTRACT_GZ)

.ncurses: ncurses
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --without-debug --enable-widec --without-develop --without-shared && make && make install)
	touch $@

CLEAN_FILE += .ncurses
CLEAN_PKG += ncurses
DISTCLEAN_PKG += ncurses-$(NCURSES_VERSION).tar.gz
Christophe Mutricy's avatar
Christophe Mutricy committed
2299

2300
# ***************************************************************************
2301
# Some cleaning
2302 2303 2304
# ***************************************************************************

clean-dots: FORCE
2305
	rm -f $(CLEAN_FILE)
2306 2307

clean: clean-dots
2308
	rm -rf $(CLEAN_PKG)
2309 2310

clean-src: clean
2311
	rm -rf $(DISTCLEAN_PKG)
2312

2313
clean-svn:
2314
	rm -rf ffmpeg tremor x264 libdca
2315

2316
distclean: clean-src
2317

2318 2319 2320 2321
# ***************************************************************************
# Download all the sources and package unversionned copies of subversion trees
# ***************************************************************************

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2322
source: $(SOURCE) $(DISTCLEAN_PKG)