Makefile 77.8 KB
Newer Older
1
#***************************************************************************
2 3
# src/Makefile : Dearchive and compile all files necessary
# ***************************************************************************
4
# Copyright (C) 2003 - 2009 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 Paul Kühne <fkuehne at videolan dot org>
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 MACOSX_DEPLOYMENT_TARGET = $(SDK_TARGET)
42
export LIBRARY_PATH := $(PREFIX)/lib:$(LIBRARY_PATH)
43 44 45
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)
46
export LDFLAGS = -L$(PREFIX)/lib $(EXTRA_LDFLAGS)
47 48 49 50 51
ifdef HAVE_DARWIN_OS
export CC
export CXX
export LD
endif
52 53 54 55 56 57 58 59

# ***************************************************************************
# 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... ;)
# ***************************************************************************

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

79

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

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

92
FFMPEGCONF=
93 94

# cross compiling
95 96
#This should be inside the if block but some config scripts are buggy
HOSTCONF=--target=$(HOST) --host=$(HOST) --build=$(BUILD) --program-prefix=""
97 98 99 100 101
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
    #
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 108
    else
        # We are compiling for MinGW on Cygwin
109
        PTHREADSCONF=$(HOSTCC)
110
    endif
111
endif
112 113

#
114
# Special target-dependant options
115
#
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
125 126 127

ifdef HAVE_WINCE
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 130 131
endif

ifdef HAVE_UCLIBC
132
ifdef HAVE_BIGENDIAN
133
FFMPEGCONF+= --arch=armeb --enable-armv5te --enable-iwmmxt
134 135 136
else
FFMPEGCONF+= --arch=armv4l
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
144

145
ifdef HAVE_DARWIN_OS_ON_INTEL
146
FFMPEGCONF += --enable-memalign-hack
147 148 149
endif

ifdef HAVE_DARWIN_OS
150
X264CONF=--host=$(HOST)
151
X264CONF += --enable-pic
152 153 154
ifdef HAVE_DARWIN_32
FFMPEGCONF += --cc=gcc-4.0
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 164
FFMPEG_CFLAGS += -DHAVE_LRINTF
endif
165
endif
166

167
ifdef HAVE_AMR
168
FFMPEGCONF+= --enable-libamr-nb --enable-libamr-wb --enable-nonfree
169 170
endif

171
ifdef HAVE_LINUX
172
FFMPEGCONF+= --target-os=linux
173
ifdef HAVE_MAEMO
174 175 176
ifneq ($(filter -m%=cortex-a8, $(EXTRA_CFLAGS)),)
FFMPEGCONF += --disable-runtime-cpudetect --enable-neon --cpu=cortex-a8
endif
177 178 179 180
# Really, this could be done on all Linux platforms, not just Maemo.
# Installing statically-linked VLC plugins is so much simpler.
HOSTCONF += --with-pic --disable-shared
endif
181
FFMPEGCONF += --enable-pic
182 183 184
X264CONF += --enable-pic
endif

185 186 187 188
ifdef HAVE_ISA_THUMB
NOTHUMB ?= -mno-thumb
endif

189 190
X264CONF+= --disable-avs-input --disable-lavf-input --disable-ffms-input --disable-mp4-output

191 192
DATE=`date +%Y-%m-%d`

193 194 195
# ***************************************************************************
# Standard rules
# ***************************************************************************
196
# Generated by ./bootstrap from default configuration in src/Distributions
197
#
198
include ../distro.mak
199 200 201 202 203 204 205 206

FORCE:

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

define EXTRACT_GZ
207
	rm -rf $@ || true
208
	gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
209 210
	mv $(patsubst %.tar.gz,%,$(patsubst %.tgz,%,$(notdir $<))) $@ || true
	touch $@
211 212 213
endef

define EXTRACT_BZ2
214
	rm -rf $@ || true
215
	bunzip2 -c $< | tar xf - --exclude='[*?:<>\|]'
216 217
	mv $(patsubst %.tar.bz2,%,$(notdir $<)) $@ || true
	touch $@
218 219
endef

220
define EXTRACT_ZIP
221 222 223 224
	rm -rf $@ || true
	unzip $<
	mv $(patsubst %.zip,%,$(notdir $<)) $@ || true
	touch $@
225 226
endef

227 228 229 230 231 232
### 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
233 234 235 236 237
#	cd $< ; ./configure --prefix=$(PREFIX)
#	$(MAKE) -C $<
#	$(MAKE) -C $< install
#	$(INSTALL_NAME)
#	touch $@
238

239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
# ***************************************************************************
# errno
# ***************************************************************************

errno:
	mkdir -p $@
	$(WGET) $(ERRNO_URL)/errno.h -O $@/errno.h

.errno: errno
	mkdir -p $(PREFIX)/include
	cp $</errno.h $(PREFIX)/include
	touch $@

CLEAN_FILE += .errno
CLEAN_PKG += errno

255 256 257 258
# ***************************************************************************
# autoconf
# ***************************************************************************

259
autoconf-$(AUTOCONF_VERSION).tar.bz2:
260
	$(WGET) $(AUTOCONF_URL)
261

262
autoconf: autoconf-$(AUTOCONF_VERSION).tar.bz2
263
	$(EXTRACT_BZ2)
264 265

.autoconf: autoconf
266 267
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
268 269 270

CLEAN_FILE += .autoconf
CLEAN_PKG += autoconf
271
DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.bz2
272

273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
# ***************************************************************************
# gnumake
# ***************************************************************************

make-$(GNUMAKE_VERSION).tar.bz2:
	$(WGET) $(GNUMAKE_URL)

gnumake: make-$(GNUMAKE_VERSION).tar.bz2
	$(EXTRACT_BZ2)

.gnumake: gnumake
ifdef HAVE_DARWIN_OS
ifndef HAVE_DARWIN_9
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
endif
endif
	touch $@

CLEAN_FILE += .gnumake
CLEAN_PKG += gnumake
DISTCLEAN_PKG += make-$(GNUMAKE_VERSION).tar.bz2

295 296 297
# ***************************************************************************
# CMake
# ***************************************************************************
Rafaël Carré's avatar
Rafaël Carré committed
298 299 300 301 302
cmake-$(CMAKE_VERSION).tar.gz:
	$(WGET) $(CMAKE_URL)

cmake: cmake-$(CMAKE_VERSION).tar.gz
	$(EXTRACT_GZ)
303

304
.cmake: cmake
305 306 307 308 309 310
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@

CLEAN_FILE += .cmake
CLEAN_PKG += cmake

311 312 313 314 315
# ***************************************************************************
# libtool
# ***************************************************************************

ifdef HAVE_DARWIN_OS
316 317 318 319 320 321 322 323
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)
324 325
	ln -sf libtool $(PREFIX)/bin/glibtool
	ln -sf libtoolize $(PREFIX)/bin/glibtoolize
326
	touch $@
327 328 329

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

332 333 334 335 336 337 338
endif

# ***************************************************************************
# automake
# ***************************************************************************

automake-$(AUTOMAKE_VERSION).tar.gz:
339
	$(WGET) $(AUTOMAKE_URL)
340 341

automake: automake-$(AUTOMAKE_VERSION).tar.gz
342
	$(EXTRACT_GZ)
343 344

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

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

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

356
pkg-config-$(PKGCFG_VERSION).tar.gz:
357
	$(WGET) $(PKGCFG_URL)
358

359
pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz
360
	$(EXTRACT_GZ)
361
	(cd $@; autoconf)
362 363

.pkgcfg: pkgconfig
364
	(cd pkgconfig; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
365
	touch $@
366 367 368

CLEAN_FILE += .pkgcfg
CLEAN_PKG += pkgconfig
369
DISTCLEAN_PKG += pkg-config-$(PKGCFG_VERSION).tar.gz
370 371 372 373 374 375

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

gettext-$(GETTEXT_VERSION).tar.gz:
376
	$(WGET) $(GETTEXT_URL)
377 378

gettext: gettext-$(GETTEXT_VERSION).tar.gz
379
	$(EXTRACT_GZ)
VideoLAN's avatar
VideoLAN committed
380 381 382
ifdef HAVE_DARWIN_OS
	patch -p0 < Patches/gettext-macosx.patch
endif
383

384
.intl: gettext .iconv
385
ifdef HAVE_WIN32
386
	( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-relocatable --with-iconv-prefix=$(PREFIX) --disable-java --disable-native-java)
387
else
388
	( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-java --disable-native-java --without-emacs)
389
endif
390
ifneq ($(HOST),$(BUILD))
391 392
  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
393
	( cd $< && make -C gettext-runtime/intl && make -C gettext-runtime/intl install && make -C gettext-tools/misc install )
394 395
  else
    # We are compiling for MinGW on Cygwin -- build the full current gettext
396
	( cd $< && make && make install )
397
  endif
398 399
else
# Build and install the whole gettext
400
	( cd $< && make && make install )
401 402 403
endif
# Work around another non-sense of autoconf.
ifdef HAVE_WIN32
404
	(cd $(PREFIX)/include; sed -i.orig '314 c #if 0' libintl.h)
405
endif
406 407
	$(INSTALL_NAME)
	touch $@
408 409 410 411 412 413 414 415 416 417

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

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

libiconv-$(LIBICONV_VERSION).tar.gz:
418
	$(WGET) $(LIBICONV_URL)
419 420

libiconv: libiconv-$(LIBICONV_VERSION).tar.gz
421
	$(EXTRACT_GZ)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
422 423
ifdef HAVE_WIN64
	patch -p0 < Patches/libiconv-win64.patch
424
endif
425 426 427 428
ifdef HAVE_WINCE
	patch -p0 < Patches/libiconv-wince.patch
	patch -p0 < Patches/libiconv-wince-hack.patch
endif
429

430 431 432 433 434
libiconv-snowleopard.tar.bz2:
	$(WGET) $(LIBICONVMAC_URL)

libiconv-snowleopard: libiconv-snowleopard.tar.bz2
	$(EXTRACT_BZ2)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
435

436
ifdef HAVE_DARWIN_OS
437
ifdef HAVE_DARWIN_10
438
.iconv: libiconv-snowleopard
439
	(cd libiconv-snowleopard && cp libiconv.* $(PREFIX)/lib/)
440 441
	touch $@
else
442
.iconv:
443
	touch $@
444
endif
445
else
446
.iconv: libiconv
447 448 449
	(cd libiconv; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls && make && make install)
	$(INSTALL_NAME)
	touch $@
450
endif
451 452 453 454 455

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

456 457 458 459 460 461 462
# ***************************************************************************
# fontconfig
# ***************************************************************************

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

463
fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz Patches/fontconfig.patch
464
	$(EXTRACT_GZ)
465
	patch -p0 < Patches/fontconfig-march.patch
466
	patch -p0 < Patches/fontconfig-nodocs.patch
467 468
ifdef HAVE_WIN32
	patch -p0 < Patches/fontconfig.patch
469
	patch -p0 < Patches/fontconfig-noxml2.patch
470
	(cd $@; autoreconf -ivf)
471
endif
472

Rafaël Carré's avatar
Rafaël Carré committed
473
.fontconfig: fontconfig .xml .freetype
474 475
ifdef HAVE_WIN32
  ifdef HAVE_CYGWIN
476
	(cd $<; ./configure --target=$(HOST) --disable-pic --disable-shared --disable-docs --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --disable-libxml2 && make && make install)
477
  else
478
	(cd $<; $(HOSTCC)  ./configure $(HOSTCONF) --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --disable-libxml2 --disable-docs && make && make install)
479 480
  endif
else
481
  ifdef HAVE_DARWIN_OS
482
	(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))
483
  else
484
	(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)
485
  endif
486 487 488 489 490 491 492 493
endif
	$(INSTALL_NAME)
	touch $@

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

494 495 496 497 498
# ***************************************************************************
# freetype2
# ***************************************************************************

freetype-$(FREETYPE2_VERSION).tar.gz:
499
	$(WGET) $(FREETYPE2_URL)
500 501

freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
502
	$(EXTRACT_GZ)
503 504

.freetype: freetype2
505 506 507
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
508 509 510 511 512 513 514 515 516

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

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

517
fribidi-$(FRIBIDI_VERSION).tar.gz:
518
	$(WGET) $(FRIBIDI_URL)
519

520 521
fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz
	$(EXTRACT_GZ)
522
	patch -p0 < Patches/fribidi.patch
523
	( cd $@; rm -f configure; ./bootstrap)
524

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

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

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

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

a52dec: a52dec-$(A52DEC_VERSION).tar.gz
542
	$(EXTRACT_GZ)
543
ifeq ($(ARCH),armel)
544 545
	(cd $@ ; patch -p0 < ../Patches/liba52-fixed.diff)
endif
546 547

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

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

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

Christophe Mutricy's avatar
Christophe Mutricy committed
559 560
libmpeg2-$(LIBMPEG2_VERSION).tar.gz:
	$(WGET) $(LIBMPEG2_URL)
561

Christophe Mutricy's avatar
Christophe Mutricy committed
562
libmpeg2: libmpeg2-$(LIBMPEG2_VERSION).tar.gz
563
	$(EXTRACT_GZ)
564
	patch -p0 < Patches/libmpeg2-arm-pld.patch
565 566
	cd libmpeg2 && patch -p0 < ../Patches/libmpeg2-mc-neon.patch
	cd libmpeg2 && ./bootstrap
567

Christophe Mutricy's avatar
Christophe Mutricy committed
568
.mpeg2: libmpeg2
569 570
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --without-x --disable-sdl && cd libmpeg2 && make && make install && cd ../include && make && make install)
	touch $@
571 572

CLEAN_FILE += .mpeg2
Christophe Mutricy's avatar
Christophe Mutricy committed
573 574
CLEAN_PKG += libmpeg2
DISTCLEAN_PKG += libmpeg2-$(LIBMPEG2_VERSION).tar.gz
575

576 577 578 579 580 581 582 583 584 585 586
# ***************************************************************************
# pcre
# ***************************************************************************

pcre-$(PCRE_VERSION).tar.bz2:
	$(WGET) $(PCRE_URL)

pcre: pcre-$(PCRE_VERSION).tar.bz2
	$(EXTRACT_BZ2)

.pcre: pcre
Rafaël Carré's avatar
Rafaël Carré committed
587
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared && make && make install )
588 589 590 591 592 593
	touch $@

CLEAN_FILE += .pcre
CLEAN_PKG += pcre
DISTCLEAN_PKG += pcre-$(PCRE_VERSION).tar.bz2

594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620
# ***************************************************************************
# 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)
621 622 623
ifdef HAVE_DARWIN_OS
	(cd $@; sed -e 's%gcc%$(CC)%' -e 's%LDFLAGS=%LDFLAGS=$(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)%' -i.orig  src/Makefile)
endif
624 625

.lua: lua
626
ifdef HAVE_WIN32
627
	( 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 ../..)
Christophe Mutricy's avatar
Christophe Mutricy committed
628 629
	(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)
630
else
Christophe Mutricy's avatar
Christophe Mutricy committed
631 632
	(cd $<&& patch -p1) < Patches/lua-noreadline.patch
	(cd $<&& $(HOSTCC) make $(LUA_MAKEPLATEFORM) && make install INSTALL_TOP=$(PREFIX))
633
endif
634 635 636 637 638 639
	touch $@

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

640 641 642 643 644
# ***************************************************************************
# libmad
# ***************************************************************************

libmad-$(LIBMAD_VERSION).tar.gz:
645
	$(WGET) $(LIBMAD_URL)
646 647

libmad: libmad-$(LIBMAD_VERSION).tar.gz
648
	$(EXTRACT_GZ)
649
ifdef HAVE_DARWIN_OS
650
	( cd $@; sed -e 's%-march=i486%$(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)%' -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
651
endif
652 653

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

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

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

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

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

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

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

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

libvorbis-$(VORBIS_VERSION).tar.gz:
692
	$(WGET) $(VORBIS_URL)
693 694

libvorbis: libvorbis-$(VORBIS_VERSION).tar.gz
695
	$(EXTRACT_GZ)
696
	patch -p0 < Patches/vorbis-noapps.patch
697 698

.vorbis: libvorbis .ogg
699
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
700 701
#	$(INSTALL_NAME)
	touch $@
702 703

.vorbisenc: .vorbis .ogg
704 705
#	$(INSTALL_NAME)
	touch $@
706 707 708 709 710

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

711 712 713 714 715
# ***************************************************************************
# tremor
# ***************************************************************************

ifdef SVN
716
tremor:
717
	$(SVN) co http://svn.xiph.org/trunk/Tremor tremor
718
	(cd $@ && patch -p0 < ../Patches/tremor.patch)
719
	(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)
720 721
else
tremor-$(TREMOR_VERSION).tar.bz2:
722 723
	echo "tremor snapshot does not exist, you MUST use subversion !"
	exit -1
724
	$(WGET) $(TREMOR_URL)
725 726

tremor: tremor-$(TREMOR_VERSION).tar.bz2
727
	$(EXTRACT_BZ2)
728 729 730
endif

.tremor: tremor .ogg
731
	(cd $<; $(HOSTCC) ./autogen.sh $(HOSTCONF) --prefix=$(PREFIX) --disable-shared CFLAGS="$(NOTHUMB)" && make && make install)
732 733
	$(INSTALL_NAME)
	touch $@
734

735 736
ifdef SVN
tremor-source: tremor
737
	tar cv --exclude=.svn tremor | bzip2 > tremor-$(DATE).tar.bz2
738 739 740 741

SOURCE += tremor-source
endif

742 743
CLEAN_FILE += .tremor
CLEAN_PKG += tremor
744
#DISTCLEAN_PKG += tremor-$(TREMOR_VERSION).tar.bz2 #no tremor snapshot
745

746 747 748 749 750
# ***************************************************************************
# theora
# ***************************************************************************

libtheora-$(THEORA_VERSION).tar.bz2:
751
	$(WGET) $(THEORA_URL)
752 753

libtheora: libtheora-$(THEORA_VERSION).tar.bz2
754
	$(EXTRACT_BZ2)
755
	patch -p0 < Patches/libtheora-includes.patch
756

757 758
THEORACONF = --disable-sdltest --disable-oggtest --disable-vorbistest --disable-examples

759
ifdef HAVE_DARWIN_64
760 761
THEORACONF += --disable-asm
endif
762 763 764
ifdef HAVE_WIN64
THEORACONF += --disable-asm
endif
765

766
.theora: libtheora .ogg
767
ifdef HAVE_DARWIN_OS
768 769
	cd $<; ($(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(THEORACONF) && make && make install)
else
770 771 772 773 774 775 776 777 778
ifdef HAVE_WIN32
	cd $<; $(HOSTCC) ./autogen.sh $(HOSTCONF) --prefix=$(PREFIX) $(THEORACONF)
endif
	if test ! -f $</config.status; then \
		cd $< ; \
		$(HOSTCC) ./configure $(HOSTCONF) \
			--prefix=$(PREFIX) $(THEORACONF) ; \
	fi
	cd $< && make && make install
779
endif
780 781
	$(INSTALL_NAME)
	touch $@
782 783 784 785 786

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

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

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

libshout: libshout-$(SHOUT_VERSION).tar.gz
795
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
796
ifdef HAVE_WIN32
797
	patch -p0 < Patches/libshout-win32.patch
Christophe Mutricy's avatar
Christophe Mutricy committed
798
endif
799

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
ifdef HAVE_DARWIN_OS
Felix Paul Kühne's avatar
Felix Paul Kühne committed
822
	( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
823
endif
824 825

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

827
.flac: flac .ogg
828
ifdef HAVE_DARWIN_OS_ON_INTEL
829 830
	cd $< && \
	$(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-asm-optimizations $(FLAC_DISABLE_FLAGS)
831
else
832 833
	cd $< && \
	$(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  $(FLAC_DISABLE_FLAGS)
834
endif
835
	cd $</src && \
836 837
	make -C libFLAC && \
	echo 'Requires.private: ogg' >> libFLAC/flac.pc && \
838 839
	make -C libFLAC install
	cd $< && make -C include install
840 841
	$(INSTALL_NAME)
	touch $@
842

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

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

speex-$(SPEEX_VERSION).tar.gz:
852
	$(WGET) $(SPEEX_URL)
853 854

speex: speex-$(SPEEX_VERSION).tar.gz
855 856
	$(EXTRACT_GZ)
	patch -p0 < Patches/speex.patch
857 858

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

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

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

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

874 875
faad2: faad2-$(FAAD2_VERSION).tar.gz
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
876
	(cd $@; echo|$(CC) -iquote . -E - || sed -i 's/-iquote /-I/' libfaad/Makefile.am; sh ./bootstrap)
877
	patch -p0 < Patches/faad-arm-fixed.patch
878

879
.faad: faad2
Rafaël Carré's avatar
Rafaël Carré committed
880
	(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)
881
	touch $@
882 883

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

887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933
# ***************************************************************************
# libebml
# ***************************************************************************

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

libebml: libebml-$(LIBEBML_VERSION).tar.bz2
	$(EXTRACT_BZ2)

.ebml: libebml
ifdef HAVE_WIN32
	(cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC) SHARED=no && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC))
else
	(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 $@

CLEAN_FILE += .ebml
CLEAN_PKG += libebml
DISTCLEAN_PKG += libebml-$(LIBEBML_VERSION).tar.bz2

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

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

libmatroska: libmatroska-$(LIBMATROSKA_VERSION).tar.bz2
	$(EXTRACT_BZ2)

.matroska: libmatroska .ebml
ifdef HAVE_WIN32
	(cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC) SHARED=no EBML_DLL=no libmatroska.a && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC))
else
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libmatroska.a
endif
	touch $@


CLEAN_FILE += .matroska
CLEAN_PKG += libmatroska
DISTCLEAN_PKG += libmatroska-$(LIBMATROSKA_VERSION).tar.bz2

934 935 936 937 938

# ***************************************************************************
# libvp8
# ***************************************************************************

939 940
#ibvpx-$(VPX_VERSION).tar.bz2:
#$(WGET) $(VPX_URL)
941

942 943
libvpx: 
	$(GIT) clone git://review.webmproject.org/libvpx.git
944 945 946

ifdef HAVE_WIN32
VPX_TARGET=x86-win32-gcc
947
CROSS=
948
else
949 950 951 952 953 954 955 956 957 958 959
ifdef HAVE_DARWIN_OS
ifdef HAVE_DARWIN_64
VPX_TARGET=x86_64-darwin9-gcc
else
ifdef HAVE_DARWIN_OS_ON_INTEL
VPX_TARGET=x86-darwin9-gcc
else
VPX_TARGET=ppc32-darwin9-gcc
endif
endif
else
960 961
VPX_TARGET=FIXME
endif
962
endif
963

964
.libvpx: libvpx
965
	(cd $<; CROSS=$(HOST)- ./configure --target=$(VPX_TARGET) --disable-install-bins --disable-install-srcs --disable-install-libs --disable-examples && make && make install)
966 967
	(rm -rf $(PREFIX)/include/vpx/ && mkdir $(PREFIX)/include/vpx/; cd $< && cp vpx/*.h vpx_ports/*.h $(PREFIX)/include/vpx/) # Of course, why the hell would one expect it to be listed or in make install?
	rm $(PREFIX)/include/vpx/config.h
968
	(cd $<; $(RANLIB) libvpx.a && cp libvpx.a $(PREFIX)/lib) # Of course, why the hell would one expect it to be listed or in make install?
969 970
	touch $@

971 972 973
CLEAN_FILE += .libvpx
CLEAN_PKG += libvpx
#DISTCLEAN_PKG += libvpx-$(VPX_VERSION).tar.bz2
974

975 976 977 978 979
# ***************************************************************************
# lame
# ***************************************************************************

lame-$(LAME_VERSION).tar.gz:
980
	$(WGET) $(LAME_URL)
981 982

lame: lame-$(LAME_VERSION).tar.gz
983
	$(EXTRACT_GZ)
984 985

.lame: lame
986 987
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-analyser-hooks --disable-decoder --disable-shared --disable-gtktest --disable-frontend && make && make install)
	touch $@
988 989 990 991 992 993 994

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


# ***************************************************************************
995 996 997 998 999 1000 1001 1002 1003 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
# 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
1029
DISTCLEAN_PKG += amrwb-$(LIBAMR_WB_VERSION).tar.bz2
1030 1031 1032

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

1033 1034 1035
# ffmpeg
# ***************************************************************************

1036
ifdef SVN
1037 1038 1039
ifdef HAVE_WIN32
ffmpeg: .dshow_headers
else
1040
ffmpeg:
1041
endif
1042
	$(SVN) co $(FFMPEG_SVN) ffmpeg
1043 1044 1045
ifdef HAVE_ISA_THUMB
	patch -p0 < Patches/ffmpeg-avcodec-no-thumb.patch
endif
1046 1047 1048
ifdef HAVE_WIN64
	(cd ffmpeg/libswscale; patch -p0 < ../../Patches/ffmpeg-win64.patch;)
endif
1049
ifdef HAVE_UCLIBC
1050 1051
	patch -p0 < Patches/ffmpeg-svn-uclibc.patch
	patch -p0 < Patches/ffmpeg-svn-internal-define.patch
1052
	patch -p0 < Patches/ffmpeg-svn-libavformat.patch
1053
endif
1054 1055 1056
ifdef HAVE_WIN32
	sed -i "s/std=c99/std=gnu99/" ffmpeg/configure
endif
1057
else
1058
ffmpeg-$(FFMPEG_VERSION).tar.gz:
1059 1060
	echo "ffmpeg snapshot is too old, you MUST use subversion !"
	exit -1
1061
	$(WGET) $(FFMPEG_URL)
1062

1063 1064 1065
ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz
	$(EXTRACT_GZ)
endif
1066

Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1067
FFMPEGCONF += \
1068
	--disable-debug \
Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1069 1070 1071 1072 1073 1074 1075
	--enable-gpl \
	--enable-postproc \
	--disable-ffserver \
	--disable-ffmpeg \
	--disable-ffplay \
	--disable-devices \
	--disable-protocols \
1076
	--disable-avfilter \
Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1077
	--disable-network
1078
ifdef HAVE_WIN64
1079
FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --enable-libmp3lame --enable-w32threads --disable-dxva2 --disable-bsfs 
1080
else
1081
ifdef HAVE_WIN32
1082
FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --enable-libmp3lame --enable-w32threads --enable-dxva2 --disable-bsfs --enable-libvpx
1083
else
1084
FFMPEGCONF += --enable-pthreads
1085
endif
1086
FFMPEG_CFLAGS += --std=gnu99
1087
endif
1088

1089
ifdef HAVE_WINCE
1090
.ffmpeg: ffmpeg .zlib
1091
else
1092 1093 1094
ifdef HAVE_UCLIBC
.ffmpeg: ffmpeg
else
1095 1096 1097
ifeq ($(ARCH),armel)
.ffmpeg: ffmpeg .lame .gsm .zlib
else
1098
.ffmpeg: ffmpeg .lame .gsm .libvpx .zlib
1099
endif
1100
endif
1101
endif
1102
	(cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --extra-cflags="$(FFMPEG_CFLAGS) -DHAVE_STDINT_H" --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) --disable-shared --enable-static && make && make install-libs install-headers)
1103
	touch $@
1104

1105 1106
ifdef SVN
ffmpeg-source: ffmpeg
1107
	tar cv --exclude=.svn ffmpeg | bzip2 > ffmpeg-$(DATE).tar.bz2
1108 1109 1110 1111

SOURCE += ffmpeg-source
endif

1112
CLEAN_FILE += .ffmpeg
1113
CLEAN_PKG += ffmpeg
1114 1115 1116 1117 1118 1119
DISTCLEAN_PKG += ffmpeg-$(FFMPEG_VERSION).tar.gz

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

1120
libdvdcss-$(LIBDVDCSS_VERSION).tar.bz2:
1121 1122
	$(WGET) $(LIBDVDCSS_URL)

1123 1124 1125 1126 1127 1128 1129 1130
# ifdef SVN
# libdvdcss:
#	$(SVN) co svn://svn.videolan.org/libdvdcss/trunk libdvdcss
#	cd $@ && sh bootstrap
# else
libdvdcss: libdvdcss-$(LIBDVDCSS_VERSION).tar.bz2
	$(EXTRACT_BZ2)
# endif
1131 1132

.dvdcss: libdvdcss
1133 1134 1135
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --disable-doc --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
1136

1137 1138 1139 1140 1141 1142
# ifdef SVN
# libdvdcss-source: libdvdcss
# 	tar cv --exclude=.svn libdvdcss | bzip2 > libdvdcss-$(DATE).tar.bz2
#
# SOURCE += libdvdcss-source
# endif
1143

1144 1145
CLEAN_FILE += .dvdcss
CLEAN_PKG += libdvdcss
1146
DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.bz2
1147

1148 1149 1150
# ***************************************************************************
# libdvdread: We use dvdnav's dvdread
# ***************************************************************************
1151
libdvdread:
1152
	$(SVN) co $(LIBDVDREAD_SVN)  libdvdread
1153
	(cd $@; patch  -p 0 < ../Patches/libdvdread-dvdcss-static.patch)
1154
ifdef HAVE_WIN32
1155
	(cd $@; patch  -p 0 < ../Patches/libdvdread-win32.patch)
1156
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1157
	(cd $@; sh autogen.sh noconfig)
1158 1159

.libdvdread: libdvdread .dvdcss
1160
	(cd libdvdread; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --with-libdvdcss=$(PREFIX) && make && make install)
1161 1162
	$(INSTALL_NAME)
	touch $@
1163

1164 1165
CLEAN_FILE += .libdvdread
CLEAN_PKG += libdvdread
1166
#DISTCLEAN_PKG += libdvdread-$(LIBDVDREAD_VERSION).tar.gz
1167 1168 1169 1170 1171

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

1172 1173
ifdef SVN
libdvdnav:
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1174
	$(SVN) co $(LIBDVDNAV_SVN)  libdvdnav
1175
	patch -d libdvdnav -p0 < Patches/libdvdnav.patch
1176 1177
	(cd $@; ./autogen.sh noconfig)
else
1178
libdvdnav-$(LIBDVDNAV_VERSION).tar.gz:
1179
	$(WGET) $(LIBDVDNAV_URL)
1180

1181 1182
libdvdnav: libdvdnav-$(LIBDVDNAV_VERSION).tar.gz
	$(EXTRACT_GZ)
1183
	patch -p0 < Patches/libdvdnav.patch
1184 1185 1186
ifdef HAVE_WIN32
	patch -p0 < Patches/libdvdnav-win32.patch
endif
1187
	(cd $@; ./autogen.sh noconfig)
1188
endif
1189

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1190
.dvdnav: libdvdnav .libdvdread
1191
ifdef HAVE_WIN32
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1192
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) && make && make install)
1193
else
1194
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make && make install)
1195
endif
1196 1197
	$(INSTALL_NAME)
	touch $@
1198 1199 1200

CLEAN_FILE += .dvdnav
CLEAN_PKG += libdvdnav
1201
DISTCLEAN_PKG += libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2
1202 1203 1204 1205 1206

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

1207
libdvbpsi-$(LIBDVBPSI_VERSION).tar.gz:
1208
	$(WGET) $(LIBDVBPSI_URL)
1209

1210
libdvbpsi: libdvbpsi-$(LIBDVBPSI_VERSION).tar.gz
1211
	$(EXTRACT_GZ)
1212 1213

.dvbpsi: libdvbpsi
1214 1215 1216
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd src && make && make install)
	$(INSTALL_NAME)
	touch $@
1217 1218 1219

CLEAN_FILE += .dvbpsi
CLEAN_PKG += libdvbpsi
1220
DISTCLEAN_PKG += libdvbpsi-$(LIBDVBPSI_VERSION).tar.gz
1221 1222 1223 1224 1225

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

1226
live555-$(LIVEDOTCOM_VERSION).tar.gz:
1227
	$(WGET) $(LIVEDOTCOM_URL)
1228

1229
live: live555-$(LIVEDOTCOM_VERSION).tar.gz
1230
	$(EXTRACT_GZ)
1231
	patch -p0 < Patches/live-uselocale.patch
1232
	patch -p0 < Patches/live-inet_ntop.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1233 1234 1235
ifdef HAVE_WIN64
	patch -p0 < Patches/live-win64.patch
endif
1236
ifndef HAVE_WIN32
1237
ifndef HAVE_WINCE
1238 1239
	patch -p0 < Patches/live-getaddrinfo.patch
endif
1240
endif
1241 1242

.live: live
1243 1244 1245
ifdef HAVE_WIN32
	(cd $<;./genMakefiles mingw && make $(HOSTCC))
else
Pierre Ynard's avatar
Pierre Ynard committed
1246
ifdef HAVE_WINCE
1247
	(cd $<; sed -e 's/-lws2_32/-lws2/g' -i.orig config.mingw)
Pierre Ynard's avatar
Pierre Ynard committed
1248 1249
	(cd $<;./genMakefiles mingw && make $(HOSTCC))
else
1250
ifdef HAVE_DARWIN_OS
1251
	(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)
1252
	(cd $<; ./genMakefiles macosx && make)
1253
else
1254
	(cd $<; sed -e 's/=/= EXTRA_CPPFLAGS/' -e 's%EXTRA_CPPFLAGS%-I/include%' -i.orig groupsock/Makefile.head)
1255 1256 1257 1258
ifdef HAVE_UCLIBC
ifdef HAVE_BIGENDIAN
	(cd $<; ./genMakefiles armeb-uclibc && make $(HOSTCC))
endif
1259
else
1260
ifeq ($(ARCH)$(HAVE_MAEMO),armel)
1261
	(cd $<; ./genMakefiles armlinux && make $(HOSTCC))
1262
else
1263
	(cd $<; sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig config.linux)
1264
	(cd $<; ./genMakefiles linux && make $(HOSTCC))
1265
endif
1266
endif
Pierre Ynard's avatar
Pierre Ynard committed
1267
endif
1268
endif
1269
endif
1270
	mkdir -p $(PREFIX)/lib $(PREFIX)/include
1271 1272 1273 1274 1275 1276 1277 1278
	cp $</groupsock/libgroupsock.a $(PREFIX)/lib
	cp $</liveMedia/libliveMedia.a $(PREFIX)/lib
	cp $</UsageEnvironment/libUsageEnvironment.a $(PREFIX)/lib
	cp $</BasicUsageEnvironment/libBasicUsageEnvironment.a $(PREFIX)/lib
	cp $</groupsock/include/*.hh $</groupsock/include/*.h $(PREFIX)/include
	cp $</liveMedia/include/*.hh $(PREFIX)/include
	cp $</UsageEnvironment/include/*.hh $(PREFIX)/include
	cp $</BasicUsageEnvironment/include/*.hh $(PREFIX)/include
1279
	touch $@
1280 1281 1282

CLEAN_FILE += .live
CLEAN_PKG += live
1283
DISTCLEAN_PKG += live555-$(LIVEDOTCOM_VERSION).tar.gz
1284 1285 1286 1287 1288 1289

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

goom$(GOOM2k4_VERSION).tar.gz:
1290 1291
	$(WGET) $(GOOM2k4_URL)
	mv goom-$(GOOM2k4_VERSION)-src.tar.gz goom$(GOOM2k4_VERSION).tar.gz
1292 1293

goom: goom$(GOOM2k4_VERSION).tar.gz
1294
	$(EXTRACT_GZ)
1295
ifdef HAVE_WIN32
1296
	(cd $@; fromdos configure.in)
Rafaël Carré's avatar
Rafaël Carré committed
1297
	patch -p0 < Patches/goom2k4-0-win32.patch
1298 1299
else
	patch -p0 < Patches/goom2k4-0-mmx.patch
1300
endif
1301
	patch -p0 < Patches/goom2k4-0-memleaks.patch
1302
	patch -p0 < Patches/goom2k4-autotools.patch
1303
	(cd $@; rm -f configure; ACLOCAL="aclocal -I m4/" autoreconf -ivf)
1304 1305

.goom2k4: goom
1306
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --disable-glibtest --disable-gtktest && make && make install)
1307
	touch $@
1308 1309 1310

CLEAN_FILE += .goom2k4
CLEAN_PKG += goom
1311
DISTCLEAN_PKG += goom$(GOOM2k4_VERSION).tar.gz
1312 1313 1314 1315 1316 1317

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

libcaca-$(LIBCACA_VERSION).tar.gz:
1318
	$(WGET) $(LIBCACA_URL)
1319 1320

libcaca: libcaca-$(LIBCACA_VERSION).tar.gz
1321
	$(EXTRACT_GZ)
1322
ifdef HAVE_DARWIN_OS
1323 1324
	patch -p0 < Patches/libcaca-osx-sdkofourchoice.patch
	(cd $@; sed -e 's%/Developer/SDKs/MacOSX10.4u.sdk%$(MACOSX_SDK)%' -i.orig  configure)
1325
endif
1326 1327 1328 1329
ifdef HAVE_WIN32
	patch -p0 < Patches/libcaca-win32-static.patch
endif

1330 1331

.caca: libcaca
1332
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx && cd caca && make && make install)
1333
	touch $@
1334 1335 1336 1337 1338 1339

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

# ***************************************************************************
Antoine Cellerier's avatar
Antoine Cellerier committed
1340
# libdca
1341 1342
# ***************************************************************************

1343 1344 1345 1346 1347
libdca-$(LIBDCA_VERSION).tar.bz2:
	$(WGET) $(LIBDCA_URL)

libdca: libdca-$(LIBDCA_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1348 1349 1350
ifdef HAVE_DARWIN_9
	( cd $@; patch -p0 < ../Patches/libdca-llvm-gcc.patch )
endif
1351

1352
.dca: libdca
1353
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1354
	$(INSTALL_NAME)
1355
	touch $@
1356

1357
CLEAN_FILE += .dca
Antoine Cellerier's avatar
Antoine Cellerier committed
1358
CLEAN_PKG += libdca
1359
DISTCLEAN_PKG += libdca-$(LIBDCA_VERSION).tar.bz2
1360

1361
# ***************************************************************************
1362
# libx264
1363 1364
# ***************************************************************************

1365 1366 1367
x264-$(X264_VERSION).tar.gz:
	$(WGET) $(X264_URL)

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1368 1369 1370 1371 1372 1373 1374
ifdef GIT
x264:
	$(GIT) clone git://git.videolan.org/x264.git
ifdef HAVE_WIN32
	(cd x264; patch -p0 < ../Patches/x264-svn-win32.patch )
endif
else
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1375 1376 1377
x264:
	echo "x264 snapshot is too old, you MUST use Git !"
	exit -1
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1378

1379
endif
1380

1381 1382
ifdef HAVE_WIN32
.x264: x264 .pthreads
1383 1384 1385
  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
1386
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" --enable-pthread && make && make install)
1387
  endif
1388
else
1389
ifdef HAVE_DARWIN_OS_ON_INTEL
1390
  .x264: x264 .yasm
1391
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1392 1393
else
  .x264: x264
1394
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1395
endif
1396
endif
1397
	touch $@
1398

1399
ifdef GIT
1400
x264-source: x264
1401 1402
	cd x264 && \
	git archive --format=tar HEAD | bzip2 > ../x264-$(DATE).tar.bz2
1403

1404
SOURCE += x264-source
1405 1406
endif

1407 1408 1409 1410
CLEAN_FILE += .x264
CLEAN_PKG += x264
DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz

1411 1412 1413 1414 1415
# ***************************************************************************
# libmodplug
# ***************************************************************************

libmodplug-$(MODPLUG_VERSION).tar.gz:
1416
	$(WGET) $(MODPLUG_URL)
1417 1418

libmodplug: libmodplug-$(MODPLUG_VERSION).tar.gz
1419
	$(EXTRACT_GZ)
1420 1421

.mod: libmodplug
1422 1423
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
1424 1425 1426 1427 1428 1429 1430 1431 1432

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

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

1433
libcddb-$(CDDB_VERSION).tar.bz2:
1434
	$(WGET) $(CDDB_URL)
1435

1436
libcddb: libcddb-$(CDDB_VERSION).tar.bz2
1437
	$(EXTRACT_BZ2)
1438 1439 1440 1441 1442
	(cd $@; patch -p0 < ../Patches/libcddb-cross.patch )
ifdef HAVE_WIN32
	(cd $@; patch -p0 < ../Patches/libcddb-win32.patch )
endif
	(cd $@; autoreconf -fisv)
1443

1444 1445
ifdef HAVE_WIN32
.cddb: libcddb .regex
1446
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --without-iconv CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make && make install)
1447
else
1448
.cddb: libcddb
1449
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" LDFLAGS="$(LDFLAGS) -liconv" && make && make install)
1450
endif
1451
	touch $@
1452 1453 1454

CLEAN_FILE += .cddb
CLEAN_PKG += libcddb
1455
DISTCLEAN_PKG += libcddb-$(CDDB_VERSION).tar.bz2
1456 1457 1458 1459 1460 1461

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

vcdimager-$(VCDIMAGER_VERSION).tar.gz:
1462
	$(WGET) $(VCDIMAGER_URL)
1463 1464

vcdimager: vcdimager-$(VCDIMAGER_VERSION).tar.gz
1465
	$(EXTRACT_GZ)
1466 1467 1468

ifdef HAVE_DARWIN_OS
.vcdimager: vcdimager
1469 1470
	(cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static LDFLAGS="$(LDFLAGS) -framework CoreFoundation -framework IOKit" && make && make install)
	touch $@
1471 1472
else
.vcdimager: vcdimager
1473 1474
	(cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485
endif

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

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

libcdio-$(CDIO_VERSION).tar.gz:
1486
	$(WGET) $(CDIO_URL)
1487 1488

libcdio: libcdio-$(CDIO_VERSION).tar.gz
1489
	$(EXTRACT_GZ)
1490
	patch -p0 < Patches/libcdio-install-cdparanoia-pc.patch
1491 1492 1493
ifdef HAVE_DARWIN_OS
	patch -p0 < Patches/libcdio-modernOSX.patch
endif
1494 1495

.cdio: libcdio
1496
	(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)
1497
	touch $@
1498 1499 1500 1501 1502

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

1503 1504 1505 1506
# ***************************************************************************
# qt4 (win32 binary)
# ***************************************************************************

1507
qt4-$(QT4_VERSION)-win32-bin.tar.bz2:
1508
	$(WGET) $(QT4_URL)
Clément Stenac's avatar
Clément Stenac committed
1509

1510
qt4_win32: qt4-$(QT4_VERSION)-win32-bin.tar.bz2
1511
	$(EXTRACT_BZ2)
1512
	chmod -R 755 qt4_win32
Clément Stenac's avatar
Clément Stenac committed
1513

1514
.qt4_win32: qt4_win32
1515
	(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)
1516
ifeq ($(BUILD),i686-pc-cygwin)
1517
	(cd qt4_win32;cp bin/*.exe $(PREFIX)/bin)
1518
else
1519
	(cd qt4_win32;cp bin/* $(PREFIX)/bin)
1520
endif
1521
	touch $@
Clément Stenac's avatar
Clément Stenac committed
1522

1523 1524
CLEAN_FILE += .qt4_win32
CLEAN_PKG += qt4_win32
1525
DISTCLEAN_PKG += qt4-$(QT4_VERSION)-win32-bin.tar.bz2
Clément Stenac's avatar
Clément Stenac committed
1526

1527 1528 1529 1530 1531 1532 1533
# ***************************************************************************
# qt4 (trolltech binaries)
# ***************************************************************************

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

1534
Qt_win32: qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1535
	mkdir Qt
1536
	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
1537 1538 1539
	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 {} \;
1540
	find Qt/translations -type f -a ! -name 'qt_*.qm' -exec rm {} \;
1541 1542 1543 1544
	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
1545

1546
.Qt_win32: Qt_win32
1547
	mkdir -p $(PREFIX)/bin $(PREFIX)/include/qt4/src $(PREFIX)/lib/pkgconfig $(PREFIX)/share/qt4/translations
1548 1549 1550 1551
	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
1552
	cp Qt/lib/pkgconfig/* $(PREFIX)/lib/pkgconfig
1553
	cp Qt/translations/* $(PREFIX)/share/qt4/translations
1554
	touch $@
1555

1556 1557
CLEAN_FILE += .Qt_win32
CLEAN_PKG += Qt_win32
1558
DISTCLEAN_PKG += qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1559

1560 1561 1562 1563
# ***************************************************************************
# qt4 (source-code compilation for Mac)
# ***************************************************************************

1564
qt-everywhere-opensource-src-$(QT4_MAC_VERSION).tar.gz:
1565 1566
	$(WGET) $(QT4_MAC_URL)

1567
qt4_mac: qt-everywhere-opensource-src-$(QT4_MAC_VERSION).tar.gz
1568 1569 1570
	$(EXTRACT_GZ)

.qt4_mac: qt4_mac
1571
	(cd qt4_mac; ./configure -prefix $(PREFIX) -release -fast -no-qt3support -nomake "examples demos" -sdk $(MACOSX_SDK) -no-framework -arch $(ARCH) && make && make install)
1572 1573 1574 1575
	touch $@

CLEAN_FILE += .qt4_mac
CLEAN_PKG += qt4_mac
1576
DISTCLEAN_PKG += qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz
1577

1578 1579 1580 1581 1582
# ***************************************************************************
# zlib
# ***************************************************************************

zlib-$(ZLIB_VERSION).tar.gz:
1583
	$(WGET) $(ZLIB_URL)
1584 1585

zlib: zlib-$(ZLIB_VERSION).tar.gz
1586
	$(EXTRACT_GZ)
1587 1588
	patch -p0 < Patches/zlib-wince.patch
	patch -p0 < Patches/zlib-static.patch
1589 1590

.zlib: zlib
1591
	(cd zlib; $(HOSTCC) ./configure --prefix=$(PREFIX) --static && make install)
1592 1593
	$(INSTALL_NAME)
	touch $@
1594 1595 1596 1597 1598

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

1599
# ***************************************************************************
1600
# PortAudio
1601 1602 1603
# ***************************************************************************

pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz:
1604
	$(WGET) $(PORTAUDIO_URL)
1605 1606

portaudio: pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1607
	$(EXTRACT_GZ)
1608
ifneq ($(HOST),$(BUILD))
Rafaël Carré's avatar
Rafaël Carré committed
1609
	(patch -p0 < Patches/portaudio-cross.patch;cd $@;  autoconf)
1610
endif
1611

1612
.portaudio: portaudio
1613 1614 1615
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make  install)
	$(INSTALL_NAME)
	touch $@
1616 1617 1618

CLEAN_FILE += .portaudio
CLEAN_PKG += portaudio
1619
DISTCLEAN_PKG += pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1620

1621 1622 1623 1624 1625
# ***************************************************************************
# xml
# ***************************************************************************

libxml2-$(XML_VERSION).tar.gz:
1626
	$(WGET) $(XML_URL)
1627 1628

xml: libxml2-$(XML_VERSION).tar.gz
1629
	$(EXTRACT_GZ)
Jean-Paul Saman's avatar
Jean-Paul Saman committed
1630 1631 1632
ifdef HAVE_UCLIBC
	patch -p0 < Patches/xml2-uclibc.patch
endif
1633

1634
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
1635

1636
.xml: xml
1637
  ifdef HAVE_CYGWIN
1638
	(cd xml; ac_cv_header_pthread_h="no" CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1639
  else
1640
	(cd xml; CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1641
  endif
1642
ifndef HAVE_DARWIN_OS
1643
	$(INSTALL_NAME)
1644
endif
1645
	touch $@
1646 1647 1648 1649 1650

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

1651 1652 1653 1654 1655
# ***************************************************************************
# twolame
# ***************************************************************************

twolame-$(TWOLAME_VERSION).tar.gz:
1656
	$(WGET) $(TWOLAME_URL)
1657 1658

twolame: twolame-$(TWOLAME_VERSION).tar.gz
1659
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
1660
ifdef HAVE_WIN32
1661
	(cd twolame/win32; $(WGET) "http://twolame.svn.sourceforge.net/viewvc/*checkout*/twolame/trunk/win32/winutil.h")
1662
endif
1663 1664

.twolame: twolame
1665
	(cd twolame; $(HOSTCC) CFLAGS="${CFLAGS}  -DLIBTWOLAME_STATIC" ./configure $(HOSTCONF) --prefix=$(PREFIX) &&  cd libtwolame && make && make install && cd .. && make install-data)
1666 1667
	$(INSTALL_NAME)
	touch $@
1668 1669 1670

CLEAN_FILE += .twolame
CLEAN_PKG += twolame
1671
DISTCLEAN_PKG += twolame-$(TWOLAME_VERSION).tar.gz
1672 1673 1674 1675 1676 1677

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

libpng-$(PNG_VERSION).tar.bz2:
1678
	$(WGET) $(PNG_URL)
1679 1680

libpng: libpng-$(PNG_VERSION).tar.bz2
1681
	$(EXTRACT_BZ2)
1682
ifdef HAVE_WIN32
1683
	(cd $@; cat ../Patches/libpng-win32.patch | sed s,??PREFIX??,$(PREFIX), | patch -p0)
1684
else
1685
	(cat Patches/libpng-osx.patch | sed -e 's%??PREFIX??%$(PREFIX)%' -e 's%??EXTRA_CFLAGS??%$(EXTRA_CFLAGS)%' -e 's%??EXTRA_LDFLAGS??%$(EXTRA_LDFLAGS)%' | patch -p0)
1686
endif
Rafaël Carré's avatar
Rafaël Carré committed
1687
	(patch -p0 < Patches/libpng-makefile.patch)
1688

1689
.png: libpng .zlib
1690
ifdef HAVE_DARWIN_OS
1691
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1692 1693
else
ifdef HAVE_WIN32
1694
	(cd $<; rm -f INSTALL; cp scripts/makefile.cygwin Makefile && make $(HOSTCC) && make install-static)
1695 1696
else
ifeq ($(PNG_VERSION),1.2.8)
1697
	(cd $<; PREFIX=$(PREFIX) DESTDIR=$(PREFIX) cp scripts/makefile.linux Makefile && make && make install)
1698
else
1699
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1700
endif
1701
endif
1702
endif
1703 1704
	$(INSTALL_NAME)
	touch $@
1705 1706 1707

CLEAN_FILE += .png
CLEAN_PKG += libpng
1708
DISTCLEAN_PKG += libpng-$(PNG_VERSION).tar.bz2
1709 1710 1711 1712 1713 1714

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

zvbi-$(ZVBI_VERSION).tar.bz2:
1715
	$(WGET) $(ZVBI_URL)
1716 1717

zvbi: zvbi-$(ZVBI_VERSION).tar.bz2
1718
	$(EXTRACT_BZ2)
1719
ifdef HAVE_WIN32
1720
	(cd $@; patch -p1 < ../Patches/zvbi-win32.patch; patch -p1 < ../Patches/zvbi-makefile.patch; autoreconf -ivf)
1721
endif
1722

1723 1724 1725
ifdef HAVE_WIN32
.zvbi: zvbi .pthreads
else
1726
.zvbi: zvbi
1727
endif
1728
ifdef HAVE_DARWIN_OS
1729
	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -fnested-functions" && make && make install)
1730 1731
else
ifdef HAVE_WIN32
1732
	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -DPTW32_STATIC_LIB --std=gnu99"  && make && make install)
1733
else
1734
	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make -C src && make -C src install)
1735
endif
1736
endif
1737
	$(INSTALL_NAME)
1738
	touch $@
1739 1740 1741

CLEAN_FILE += .zvbi
CLEAN_PKG += zvbi
1742
DISTCLEAN_PKG += zvbi-$(ZVBI_VERSION).tar.bz2
1743 1744

# ***************************************************************************
1745 1746 1747 1748 1749 1750 1751 1752 1753
# libraw1394
# ***************************************************************************

libraw1394-$(LIBRAW1394_VERSION).tar.gz:
	$(WGET) $(LIBRAW1394_URL)

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

1754
.raw1394: libraw1394
1755
	(cd $<; ./configure --prefix=$(PREFIX) && make && make DESTDIR=$(PREFIX) install)
1756
#	sed 's/^typedef u_int8_t  byte_t;/\/* typedef u_int8_t  byte_t;\*\//'
1757
	touch $@
1758

1759
CLEAN_FILE += .raw1394
1760
CLEAN_PKG += libraw1394
1761
DISTCLEAN_PKG += libraw1394-$(LIBRAW1394_VERSION).tar.gz
1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772

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

libdc1394-$(LIBDC1394_VERSION).tar.gz:
	$(WGET) $(LIBDC1394_URL)

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

1773
.dc1394: libdc1394
1774 1775
	(cd $<; ./configure --prefix=$(PREFIX) && \
	 patch -p1 < ../Patches/libdc1394-noexamples.patch && \
1776
	 make && make DESTDIR=$(PREFIX) install)
1777
	touch $@
1778

1779
CLEAN_FILE += .dc1394
1780
CLEAN_PKG += libdc1394
1781
DISTCLEAN_PKG += libdc1394-$(LIBDC1394_VERSION).tar.gz
1782 1783

# ***************************************************************************
1784
# gpg-error
1785 1786
# ***************************************************************************

1787
libgpg-error-$(GPGERROR_VERSION).tar.bz2:
1788
	$(WGET) $(GPGERROR_URL)
1789

1790 1791
libgpg-error: libgpg-error-$(GPGERROR_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1792
ifdef HAVE_WIN32
1793 1794
#	patch -p 0 < Patches/libgpg-error-win32.patch
#	(cd $@; ./autogen.sh)
1795
endif
1796

1797
.gpg-error: libgpg-error
1798
ifdef HAVE_DARWIN_OS_ON_INTEL
1799
	(cd $<; ./autogen.sh)
1800
endif
1801
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls --disable-shared --disable-languages && make && make install)
1802 1803
#	$(INSTALL_NAME)
	touch $@
1804

1805
CLEAN_FILE += .gpg-error
1806
CLEAN_PKG += libgpg-error
1807
DISTCLEAN_PKG += libgpg-error-$(GPGERROR_VERSION).tar.bz2
1808 1809 1810 1811 1812

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

1813
libgcrypt-$(GCRYPT_VERSION).tar.bz2:
1814
	$(WGET) $(GCRYPT_URL)
1815

1816
libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2
1817
	$(EXTRACT_BZ2)
Rafaël Carré's avatar
Rafaël Carré committed
1818
	patch -p0 < Patches/gcrypt.patch
1819

1820
CIPHDIG= --enable-ciphers=aes,des,rfc2268,arcfour --enable-digests=sha1,md5,rmd160 --enable-publickey-digests=dsa
1821

1822
.gcrypt: libgcrypt .gpg-error
1823
ifdef HAVE_WIN32
1824
	(cd $<; ./autogen.sh && $(HOSTCC) ./configure $(HOSTCONF) --target=i586-mingw32msvc --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(CIPHDIG) --disable-shared --enable-static --disable-nls && make && make install)
1825
else
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1826
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS) -lgpg-error" $(CIPHDIG) && make && make install)
1827
endif
1828 1829
	$(INSTALL_NAME)
	touch $@
1830 1831 1832

CLEAN_FILE += .gcrypt
CLEAN_PKG += libgcrypt
1833
DISTCLEAN_PKG += libgcrypt-$(GCRYPT_VERSION).tar.bz2
1834

1835 1836 1837 1838 1839 1840 1841
# ***************************************************************************
# opencdk (requires by gnutls 2.x)
# ***************************************************************************

opencdk-$(OPENCDK_VERSION).tar.bz2:
	$(WGET) $(OPENCDK_URL)

1842
opencdk: opencdk-$(OPENCDK_VERSION).tar.bz2
1843 1844 1845 1846 1847 1848 1849 1850 1851 1852
	$(EXTRACT_BZ2)

.opencdk: opencdk
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(HOSTCC) && make && make install)
	touch $@

CLEAN_FILE += .opencdk
CLEAN_PKG += opencdk
DISTCLEAN_PKG += opencdk-$(OPENCDK_VERSION).tar.bz2

1853 1854 1855 1856 1857
# ***************************************************************************
# gnutls
# ***************************************************************************

gnutls-$(GNUTLS_VERSION).tar.bz2:
1858
	$(WGET) $(GNUTLS_URL)
1859 1860

gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2
1861
	$(EXTRACT_BZ2)
1862
ifdef HAVE_WIN32
1863
	patch -p0 < Patches/gnutls-win32.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1864
	(cd $@; autoreconf)
1865
endif
1866

1867
.gnutls: gnutls .gcrypt .gpg-error
1868
ifdef HAVE_WIN32
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1869
	(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 )
1870
else
1871
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --disable-cxx --with-included-opencdk --disable-guile && make && make install)
1872
endif
1873 1874
	$(INSTALL_NAME)
	touch $@
1875 1876 1877

CLEAN_FILE += .gnutls
CLEAN_PKG += gnutls
1878
DISTCLEAN_PKG += gnutls-$(GNUTLS_VERSION).tar.bz2
1879 1880 1881 1882 1883 1884

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

libopendaap-$(DAAP_VERSION).tar.bz2:
1885
	$(WGET) $(DAAP_URL)
1886 1887

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

1891
.opendaap: libopendaap
1892 1893 1894
	(cd $<; ./configure --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make install)
	$(INSTALL_NAME)
	touch $@
1895

1896
CLEAN_FILE += .opendaap
1897
CLEAN_PKG += libopendaap
1898
DISTCLEAN_PKG += libopendaap-$(DAAP_VERSION).tar.bz2
1899

1900 1901 1902 1903
# ***************************************************************************
# Gecko SDK
# ***************************************************************************

1904
gecko-sdk:
1905
	$(SVN) co $(NPAPI_HEADERS_SVN_URL) -r $(NPAPI_HEADERS_SVN_REVISION) gecko-sdk/include
1906 1907

.gecko: gecko-sdk
1908 1909
	rm -rf $(PREFIX)/gecko-sdk
	mv gecko-sdk $(PREFIX)
1910
	mkdir gecko-sdk #creating an empty dir is faster than copying the whole dir
1911 1912
	(cd $<)
	touch $@
1913 1914 1915

CLEAN_FILE += .gecko
CLEAN_PKG += gecko-sdk
1916
DISTCLEAN_PKG += gecko-sdk
1917

1918 1919 1920 1921
# ***************************************************************************
# libjpeg
# ***************************************************************************

1922
jpegsrc.v$(JPEG_VERSION).tar.gz:
1923
	$(WGET) $(JPEG_URL)
1924

1925
jpeg-$(JPEG_VERSION): jpegsrc.v$(JPEG_VERSION).tar.gz
1926
	$(EXTRACT_GZ)
1927

1928
.jpeg: jpeg-$(JPEG_VERSION)
1929
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(HOSTCC) && make && make install)
1930 1931
	$(RANLIB) $(PREFIX)/lib/libjpeg.a
	touch $@
1932 1933

CLEAN_FILE += .jpeg
1934 1935
CLEAN_PKG += jpeg-7
DISTCLEAN_PKG += jpegsrc.v$(JPEG_VERSION).tar.gz
1936 1937 1938 1939 1940 1941

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

tiff-$(TIFF_VERSION).tar.gz:
1942
	$(WGET) $(TIFF_URL)
1943

1944
tiff: tiff-$(TIFF_VERSION).tar.gz
1945
	$(EXTRACT_GZ)
1946 1947

.tiff: tiff
1948
ifdef HAVE_WIN32
1949
	(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)
1950
else
1951
	(cd $<; ./configure --with-CFLAGS="$(CFLAGS)" --with-JPEG=no --with-ZIP=no --prefix=$(PREFIX) && make -C port &&make -C libtiff && make -C libtiff install)
1952
endif
1953
	$(INSTALL_NAME)
1954
	touch $@
1955 1956 1957 1958 1959 1960

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

# ***************************************************************************
1961
# LibSDL
1962 1963
# ***************************************************************************

1964
ifndef HAVE_DARWIN_OS
1965
SDL-$(SDL_VERSION).tar.gz:
1966
	$(WGET) $(SDL_URL)
1967

1968
SDL: SDL-$(SDL_VERSION).tar.gz
1969
	$(EXTRACT_GZ)
1970
else
1971
SDL:
1972 1973 1974
	$(SVN) co http://svn.libsdl.org/trunk/SDL -r 4444 SDL
	(cd $@; sh autogen.sh)
endif
1975 1976

.SDL: SDL
1977 1978 1979
	(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 $@
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989

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

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

SDL_image-$(SDL_IMAGE_VERSION).tar.gz:
1990
	$(WGET) $(SDL_IMAGE_URL)
1991

1992
SDL_image: SDL_image-$(SDL_IMAGE_VERSION).tar.gz
1993
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
1994
	patch -p0 < Patches/SDL_image.patch
1995 1996

.SDL_image: SDL_image .SDL .png .jpeg .tiff
1997 1998 1999
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --enable-tif --disable-sdltest && make && make install)
	$(INSTALL_NAME)
	touch $@
2000 2001 2002 2003 2004

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

2005 2006 2007 2008 2009
# ***************************************************************************
# Musepack decoder library (libmpcdec)
# ***************************************************************************

libmpcdec-$(MUSE_VERSION).tar.bz2:
2010
	$(WGET) $(MUSE_URL)
2011

2012
mpcdec: libmpcdec-$(MUSE_VERSION).tar.bz2
2013
	$(EXTRACT_BZ2)
2014
	patch -p0 < Patches/mpcdec.patch
2015
	(cd $@; autoreconf -ivf)
2016

2017
.mpcdec: mpcdec
2018
ifdef HAVE_WIN32
2019
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS=-D_PTRDIFF_T=mpc_int32_t && make && make install)
2020
else
2021
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2022 2023
endif
ifdef HAVE_DARWIN_OS
2024
	$(INSTALL_NAME)
2025
endif
2026
	touch $@
2027

2028 2029
CLEAN_FILE += .mpcdec
CLEAN_PKG += mpcdec
2030 2031
DISTCLEAN_PKG += libmpcdec-$(MUSE_VERSION).tar.bz2

2032
# ***************************************************************************
2033 2034
# Dirac
# ***************************************************************************
2035 2036

dirac-$(DIRAC_VERSION).tar.gz:
2037
	$(WGET) $(DIRAC_URL)
2038 2039

dirac: dirac-$(DIRAC_VERSION).tar.gz
2040
	$(EXTRACT_GZ)
2041
ifdef HAVE_CYGWIN
2042
	# incorrect compile warning with cygwin compiler 3.4.4
2043
	patch -p0 < Patches/dirac-cygwin.patch
2044
endif
2045
	patch -p0 < Patches/dirac-noutils.patch
2046
	(cd $@; ./bootstrap)
2047

2048 2049 2050 2051
DIRAC_SUBDIRS = libdirac_byteio libdirac_common libdirac_motionest libdirac_encoder libdirac_decoder

ifdef HAVE_WIN32
DIRAC_SUBDIRS += win32
2052
endif
2053

2054
.dirac: dirac
2055
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  CFLAGS="$(CFLAGS)" && DOC_DIR="" make $(DIRAC_SUBDIRS) && DOC_DIR="" make install)
2056
	touch $@
2057 2058 2059

# for MacOS X, dirac is split into two libraries, which needs be installed using two targets
.dirac_encoder: .dirac
2060 2061
	$(INSTALL_NAME)
	touch $@
2062 2063

.dirac_decoder: .dirac
2064 2065
	$(INSTALL_NAME)
	touch $@
2066 2067 2068 2069 2070 2071 2072 2073 2074

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

# *************************************************************************
# DirectX headers
# *************************************************************************
win32-dx7headers.tgz:
2075
	$(WGET) $(DX_HEADERS_URL)
2076
.dx_headers: win32-dx7headers.tgz
2077
	tar xzf $< -C $(PREFIX)/include
2078
	touch $@
2079 2080
CLEAN_FILE += .dx_headers
DISTCLEAN_PKG += win32-dx7headers.tgz
2081

2082 2083 2084 2085
# *************************************************************************
# DirectShow headers
# *************************************************************************
dshow-headers.tgz:
2086
	$(WGET) $(DSHOW_HEADERS_URL)
2087 2088 2089 2090

dxva2api.h:
	$(WGET) $(DXVA2_URL)

2091 2092 2093 2094
d2d_headers.tar.gz:
	$(WGET) $(D2D_URL) -O $@

.dshow_headers: dshow-headers.tgz dxva2api.h d2d_headers.tar.gz
2095
	tar xzf $< -C $(PREFIX)/include
2096
	tar xzf d2d_headers.tar.gz -C $(PREFIX)/include
2097
	cp dxva2api.h $(PREFIX)/include
2098
	touch $@
2099

2100
CLEAN_FILE += .dshow_headers
2101
DISTCLEAN_PKG += dshow-headers.tgz dxva2api.h
2102 2103 2104 2105 2106 2107

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

expat-$(EXPAT_VERSION).tar.gz:
2108
	$(WGET) $(EXPAT_URL)
2109 2110

expat: expat-$(EXPAT_VERSION).tar.gz
2111
	$(EXTRACT_GZ)
2112 2113

.expat: expat
2114
ifdef HAVE_DARWIN_OS
2115
	(cd $< aclocal --force && libtoolize --force && autoconf --force && autoheader --force )
2116
endif
2117 2118
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
2119 2120 2121 2122 2123

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

2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134
# ***************************************************************************
# YASM assembler
# ***************************************************************************

yasm-$(YASM_VERSION).tar.gz:
	$(WGET) $(YASM_URL)

yasm: yasm-$(YASM_VERSION).tar.gz
	$(EXTRACT_GZ)

.yasm: yasm
2135
	(cd $< && $(HOSTCC) ./configure --prefix=$(PREFIX) --host=$(HOST) && make && make install)
2136 2137 2138 2139
	touch $@

CLEAN_FILE += .yasm
CLEAN_PKG += yasm
2140
DISTCLEAN_PKG += yasm-$(YASM_VERSION).tar.gz
2141

2142
# ***************************************************************************
2143 2144 2145 2146 2147 2148 2149 2150 2151 2152
# kate
# ***************************************************************************

libkate-$(KATE_VERSION).tar.gz:
	$(WGET) $(KATE_URL)

libkate: libkate-$(KATE_VERSION).tar.gz
	$(EXTRACT_GZ)

.kate: libkate .ogg
2153
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-valgrind --disable-doc && make && make install)
2154 2155 2156 2157 2158 2159 2160
	$(INSTALL_NAME)
	touch $@

CLEAN_FILE += .kate
CLEAN_PKG += libkate
DISTCLEAN_PKG += libkate-$(KATE_VERSION).tar.gz

ogg.k.ogg.k's avatar
ogg.k.ogg.k committed
2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179
# ***************************************************************************
# tiger
# ***************************************************************************

libtiger-$(TIGER_VERSION).tar.gz:
	$(WGET) $(TIGER_URL)

libtiger: libtiger-$(TIGER_VERSION).tar.gz
	$(EXTRACT_GZ)

.tiger: libtiger .kate
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@

CLEAN_FILE += .tiger
CLEAN_PKG += libtiger
DISTCLEAN_PKG += libtiger-$(TIGER_VERSION).tar.gz

2180
# ***************************************************************************
2181 2182 2183 2184 2185 2186
# Copy aclocal files
# This is necessary for --missing aclocal to succeed after a
# configure.ac/Makefile.am change in the vlc root dir
# **************************************************************************

.aclocal:
2187
	cp -R $(PREFIX)/share/aclocal/* ../../../m4/
2188
	touch $@
2189

Felix Paul Kühne's avatar
Felix Paul Kühne committed
2190
CLEAN_FILE += .aclocal
2191

2192 2193 2194 2195 2196
# ***************************************************************************
# TagLib read and editing of tags of popular audio formats
# ***************************************************************************

taglib-$(TAGLIB_VERSION).tar.gz:
2197
	$(WGET) $(TAGLIB_URL)
2198 2199

taglib: taglib-$(TAGLIB_VERSION).tar.gz
2200
	$(EXTRACT_GZ)
2201
ifdef HAVE_WIN32
2202
	patch -p0 < Patches/taglib-static.patch
2203
endif
2204
ifdef HAVE_CYGWIN
2205
	patch -p0 < Patches/taglib-cygwin.patch
2206
endif
2207 2208

.tag: taglib
2209
	(cd $<; $(HOSTCC)  ./configure $(HOSTCONF) --enable-mp4 --enable-asf --prefix=$(PREFIX) && make && make install)
2210 2211
	$(INSTALL_NAME)
	touch $@
2212

2213 2214 2215 2216 2217 2218 2219
CLEAN_FILE += .tag
CLEAN_PKG += taglib
DISTCLEAN_PKG += taglib-$(TAGLIB_VERSION).tar.gz

# ***************************************************************************
# pthreads for win32
# ***************************************************************************
Christophe Mutricy's avatar
Christophe Mutricy committed
2220 2221 2222 2223 2224 2225

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

pthreads: pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
	$(EXTRACT_GZ)
Hannes Domani's avatar
Hannes Domani committed
2226
	(cd $@; patch -p0 < ../Patches/pthreads-detach.patch)
2227
ifdef HAVE_WIN64
2228
	(patch -p0 < Patches/pthreads-win64.patch)
2229
endif
Christophe Mutricy's avatar
Christophe Mutricy committed
2230 2231

.pthreads: pthreads
Christophe Mutricy's avatar
Christophe Mutricy committed
2232
	(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/)
Christophe Mutricy's avatar
Christophe Mutricy committed
2233 2234 2235
	$(INSTALL_NAME)
	touch $@

2236 2237 2238
CLEAN_FILE += .pthreads
CLEAN_PKG += pthreads
DISTCLEAN_PKG += pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
2239

2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250
# ***************************************************************************
# ncurses library (with wide chars support)
# ***************************************************************************

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

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

.ncurses: ncurses
Rafaël Carré's avatar
Rafaël Carré committed
2251 2252
	(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)
	(cp -R $(PREFIX)/usr/* $(PREFIX) && rm -rf $(PREFIX)/usr)
2253 2254 2255 2256 2257
	touch $@

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

2259 2260 2261 2262 2263 2264 2265 2266 2267
# ***************************************************************************
# FluidSynth library (Midi)
# ***************************************************************************

fluidsynth-$(FLUID_VERSION).tar.gz:
	$(WGET) $(FLUID_URL)

fluidsynth: fluidsynth-$(FLUID_VERSION).tar.gz
	$(EXTRACT_GZ)
2268 2269
ifdef HAVE_WIN32
	patch -p0 < Patches/fluid-win32.patch
2270
	cd $@; ./autogen.sh || true
2271
endif
2272 2273

.fluid: fluidsynth
2274 2275 2276 2277
	cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) \
		--disable-ladspa \
		--disable-oss-support \
		--disable-alsa-support \
2278
		--disable-pulse-support \
2279 2280 2281 2282
		--disable-midishare \
		--disable-jack-support \
		--disable-coreaudio \
		--disable-lash \
2283
		--disable-ladcca \
2284
		--disable-portaudio-support \
2285
		--without-readline
2286 2287
	cd $< && make
	cd $< && make install
2288 2289 2290 2291
	touch $@

CLEAN_FILE += .fluid
CLEAN_PKG += fluidsynth
2292
DISTCLEAN_PKG += fluidsynth-$(FLUID_VERSION).tar.gz
2293

2294 2295 2296 2297
# ***************************************************************************
# liboil
# ***************************************************************************

2298 2299
orc-$(ORC_VERSION).tar.gz:
	$(WGET) $(ORC_URL)
2300

2301
orc: orc-$(ORC_VERSION).tar.gz
2302
	$(EXTRACT_GZ)
2303

2304
.orc: orc
2305
ifdef HAVE_DARWIN_OS
2306
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)")
2307
else
2308
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX))
2309 2310
endif
	(cd $<; make && make install)
2311 2312
	touch $@

2313 2314 2315
CLEAN_FILE += .orc
CLEAN_PKG += orc
DISTCLEAN_PKG += orc-$(ORC_VERSION).tar.gz
2316 2317 2318 2319 2320 2321 2322 2323 2324 2325

# ***************************************************************************
# Schroedinger library
# ***************************************************************************

schroedinger-$(SCHROED_VERSION).tar.gz:
	$(WGET) $(SCHROED_URL)

schroedinger: schroedinger-$(SCHROED_VERSION).tar.gz
	$(EXTRACT_GZ)
2326
	patch -p0 < Patches/schroedinger-notests.patch
2327
	(cd $@; autoreconf -iv)
2328

2329 2330 2331 2332 2333 2334 2335 2336
ifdef HAVE_WIN32
ORCC="wine $(PREFIX)/bin/orcc.exe"
else
ORCC="orcc"
endif

.schroedinger: schroedinger .orc
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --with-thread=none --disable-gtk-doc --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make ORCC=$(ORCC) && make install)
2337 2338 2339 2340 2341
	touch $@

CLEAN_FILE += .schroedinger
CLEAN_PKG += schroedinger
DISTCLEAN_PKG += schroedinger-$(SCHROED_VERSION).tar.gz
2342

2343
# ***************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2344
# libass
2345 2346 2347 2348 2349
# ***************************************************************************

libass-$(ASS_VERSION).tar.bz2:
	$(WGET) $(ASS_URL)

2350 2351
libass: libass-$(ASS_VERSION).tar.bz2
	$(EXTRACT_BZ2)
2352
	(cd $@; autoreconf -ivf)
2353

2354
.libass: libass .freetype
2355
	(cd $<; $(HOSTCC) ./configure --disable-png --disable-shared $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make && make install)
2356 2357
	touch $@

2358 2359 2360
CLEAN_FILE += .libass
CLEAN_PKG += libass
DISTCLEAN_PKG += libass-$(ASS_VERSION).tar.bz2
2361

2362 2363 2364 2365
# ***************************************************************************
# Sparkle
# ***************************************************************************

Rafaël Carré's avatar
Rafaël Carré committed
2366
Sparkle-$(SPARKLE_VERSION).zip:
2367 2368
	$(WGET) $(SPARKLE_URL)

Rafaël Carré's avatar
Rafaël Carré committed
2369
.Sparkle: Sparkle-$(SPARKLE_VERSION).zip
2370 2371
	rm -rf $@ || true
	unzip $<
2372 2373
	rm -rf $(PREFIX)/Sparkle
	mv Sparkle $(PREFIX)
2374 2375 2376 2377
	touch $@

CLEAN_FILE += .Sparkle
CLEAN_PKG += Sparkle
2378
DISTCLEAN_PKG += Sparkle-$(SPARKLE_VERSION).zip
2379

2380 2381 2382 2383 2384 2385 2386 2387 2388
# ***************************************************************************
# UPNP library
# ***************************************************************************

libupnp-$(UPNP_VERSION).tar.bz2:
	$(WGET) $(UPNP_URL)

libupnp: libupnp-$(UPNP_VERSION).tar.bz2
	$(EXTRACT_BZ2)
2389 2390
	patch -p0 < Patches/libupnp-mingw.patch
ifdef HAVE_WIN32
2391
	patch -p0 < Patches/libupnp-win32.patch
2392 2393 2394 2395 2396 2397 2398
	patch -p0 < Patches/libupnp-configure.patch
	cd $@; libtoolize&& autoreconf
endif

ifdef HAVE_WIN32
LIBUPNP_ECFLAGS=-DPTW32_STATIC_LIB
endif
2399 2400

.libupnp: libupnp
2401
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-samples --without-documentation --enable-static --disable-webserver CFLAGS="$(CFLAGS) -O3 -DUPNP_STATIC_LIB $(LIBUPNP_ECFLAGS)" && make && make install)
2402 2403 2404 2405 2406 2407
	touch $@

CLEAN_FILE += .libupnp
CLEAN_PKG += libupnp
DISTCLEAN_PKG += libupnp-$(UPNP_VERSION).tar.bz2

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2408
# ***************************************************************************
2409
# GSM
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2410
# ***************************************************************************
2411 2412 2413 2414 2415 2416 2417 2418 2419 2420
gsm-$(GSM_VERSION).tar.gz:
	$(WGET) $(GSM_URL)

gsm: gsm-$(GSM_VERSION).tar.gz
	rm -rf $@ || true
	gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
	mv gsm-1.0-* gsm || true
ifneq ($(HOST),$(BUILD))
	(patch -p0 < Patches/gsm-cross.patch)
endif
2421 2422 2423
ifdef HAVE_DARWIN_OS
	(cd $@; sed -e 's%-O2%-O2\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' -e 's%# LDFLAGS 	=%LDFLAGS 	= $(EXTRA_LDFLAGS)%' -e 's%gcc%$(CC)%' -i.orig  Makefile)
endif
2424 2425

.gsm: gsm
2426
	(cd $<; $(HOSTCC) make && mkdir -p $(PREFIX)/include/gsm && cp inc/gsm.h $(PREFIX)/include/gsm && cp lib/libgsm.a  $(PREFIX)/lib)
2427 2428 2429 2430 2431 2432
	touch $@

CLEAN_FILE += .gsm
CLEAN_PKG += gsm
DISTCLEAN_PKG += gsm-$(GSM_VERSION).tar.gz

2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443
# ***************************************************************************
### GLEW 
# ***************************************************************************
glew-$(GLEW_VERSION)-src.tgz:
	$(WGET) $(GLEW_URL)

glew: glew-$(GLEW_VERSION)-src.tgz
	$(EXTRACT_GZ)
	(patch -p0 < Patches/glew-win32.patch)

.glew: glew
2444 2445 2446 2447
	(cd $<; $(HOSTCC) CFLAGS="$(CFLAGS) -DGLEW_STATIC" make && $(HOSTCC) GLEW_DEST=$(PREFIX) make install)
ifdef HAVE_WIN32
	rm -rf $(PREFIX)/lib/libglew32.dll*
endif
2448 2449 2450 2451 2452 2453 2454
	touch $@

CLEAN_FILE += .glew
CLEAN_PKG += glew
DISTCLEAN_PKG += glew-$(GLEW_VERSION)-src.tgz


Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2455
# ***************************************************************************
2456
# projectM
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2457
# ***************************************************************************
2458
projectM-$(LIBPROJECTM_VERSION)-Source.tar.gz:
2459 2460
	$(WGET) $(LIBPROJECTM_URL)

2461
libprojectM: projectM-$(LIBPROJECTM_VERSION)-Source.tar.gz
2462 2463 2464
	rm -rf $@ || true
	gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
	mv projectM-$(LIBPROJECTM_VERSION)-Source $@ || true
2465
	patch -p0 < Patches/libprojectM-win32.patch
2466
	-cd $@; rm CMakeCache.txt
2467

2468
.libprojectM: libprojectM .glew
2469 2470 2471 2472
	(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)
ifdef HAVE_WIN32
	(cd $<;cp Renderer/libRenderer.a MilkdropPresetFactory/libMilkdropPresetFactory.a $(PREFIX)/lib)
endif
2473 2474 2475 2476
	touch $@

CLEAN_FILE += .libprojectM
CLEAN_PKG += libprojectM
2477
DISTCLEAN_PKG += libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz
2478

2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493
# ***************************************************************************
# X11 C Bindings
# ***************************************************************************

libxcb-$(XCB_VERSION).tar.bz2:
	$(WGET) $(XCB_URL)/$@

libxcb: libxcb-$(XCB_VERSION).tar.bz2
	-rm -rf $@
	bzcat $< | tar xf -
	mv libxcb-$(XCB_VERSION) $@
	touch $@

.xcb: libxcb
	cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) \
2494
		--disable-shared \
2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517
		--disable-composite \
		--disable-damage \
		--disable-dpms \
		--disable-glx \
		--enable-randr \
		--disable-record \
		--enable-render \
		--disable-resource \
		--disable-screensaver \
		--disable-shape \
		--enable-shm \
		--disable-sync \
		--disable-xevie \
		--disable-xfixes \
		--disable-xfree86-dri \
		--disable-xinerama \
		--disable-xinput \
		--disable-xprint \
		--disable-selinux \
		--disable-xtest \
		--enable-xv \
		--disable-xvmc \
		--disable-build-docs
2518 2519
	cd $< && make
	cd $< && sed -i -e s,^Requires.private:,Requires:,g xcb.pc
2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536
	cd $< && make install
	touch $@

xcb-util-$(XCB_UTIL_VERSION).tar.bz2:
	$(WGET) $(XCB_UTIL_URL)/$@

xcb-util: xcb-util-$(XCB_UTIL_VERSION).tar.bz2
	-rm -rf $@
	bzcat $< | tar xf -
	mv xcb-util-$(XCB_UTIL_VERSION) $@
	touch $@

.xcb-util: xcb-util .xcb
	cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)
	cd $< && make install
	touch $@

2537
CLEAN_FILE += .xcb-util .xcb
2538 2539 2540
CLEAN_PKG += xcb-util xcb
DISTCLEAN_PKG += xcb-util-$(XCB_UTIL_VERSION).tar.bz2 libxcb-$(XCB_VERSION).tar.bz2

2541 2542 2543 2544
# ***************************************************************************
# Peflags utility (Windows only)
# ***************************************************************************

2545 2546 2547
peflags/peflags.c:
	mkdir -p peflags
	cd peflags && $(WGET) $(PEFLAGS_URL)/peflags.c
2548

2549
.peflags: peflags/peflags.c
2550 2551 2552
	cd peflags && gcc peflags.c -o peflags
	install -d $(PREFIX)/bin
	cd peflags && install ./peflags $(PREFIX)/bin
Rafaël Carré's avatar
Rafaël Carré committed
2553 2554
	touch $@

2555
CLEAN_PKG += peflags
2556
CLEAN_FILE += .peflags
2557

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2558
# ***************************************************************************
2559
# Regex
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2560
# ***************************************************************************
2561 2562 2563 2564 2565 2566 2567 2568
regex-$(REGEX_VERSION).tar.gz:
	$(WGET) $(REGEX_URL)

regex: regex-$(REGEX_VERSION).tar.gz
	$(EXTRACT_GZ)

.regex: regex
	(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 )
2569
	touch $@
2570 2571 2572 2573 2574

CLEAN_FILE += .regex
CLEAN_PKG += regex
DISTCLEAN_PKG += regex-$(REGEX_VERSION).tar.gz

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2575
# ***************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2576
# SQLite
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2577
# ***************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2578 2579 2580 2581 2582 2583 2584 2585
sqlite-amalgamation-$(SQLITE_VERSION).tar.gz:
	$(WGET) $(SQLITE_URL)

sqlite-$(SQLITE_VERSION): sqlite-amalgamation-$(SQLITE_VERSION).tar.gz
	$(EXTRACT_GZ)

.sqlite3: sqlite-$(SQLITE_VERSION)
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install )
2586
	touch $@
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2587 2588

CLEAN_FILE += .sqlite3
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2589
CLEAN_PKG += sqlite-$(SQLITE_VERSION)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2590 2591 2592
DISTCLEAN_PKG += sqlite-amalgamation-$(SQLITE_VERSION).tar.gz


2593
# ***************************************************************************
2594
# Some cleaning
2595 2596 2597
# ***************************************************************************

clean-dots: FORCE
2598
	rm -f $(CLEAN_FILE)
2599 2600

clean: clean-dots
2601
	rm -rf $(CLEAN_PKG)
2602 2603

clean-src: clean
2604
	rm -rf $(DISTCLEAN_PKG)
2605

2606
clean-svn:
2607
	rm -rf ffmpeg tremor x264 libdca pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz portaudio live555-$(LIVEDOTCOM_VERSION).tar.gz live libass
2608

2609
distclean: clean-src
2610

2611 2612 2613 2614
# ***************************************************************************
# Download all the sources and package unversionned copies of subversion trees
# ***************************************************************************

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