Makefile 79.1 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 --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+= --enable-mingwce --cpu=armv4l --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
FFMPEGCONF+= --enable-libmp3lame --enable-libgsm
141 142
endif

143
ifdef HAVE_DARWIN_OS_ON_INTEL
144
FFMPEGCONF += --enable-memalign-hack
145 146 147
endif

ifdef HAVE_DARWIN_OS
148
X264CONF=--host=$(HOST)
149
X264CONF += --enable-pic
150
FFMPEGCONF += --cc=$(CC)
151
FFMPEGCONF += --arch=$(ARCH)
152
ifdef HAVE_DARWIN_64
153
FFMPEGCONF += --cpu=core2
154
X264CONF+=--host=x86_64-apple-darwin10
155
endif
156
ifdef HAVE_DARWIN_OS_ON_INTEL
157 158
FFMPEG_CFLAGS += -DHAVE_LRINTF
endif
159
endif
160

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

165
ifdef HAVE_LINUX
166
ifdef HAVE_MAEMO
167 168 169
ifneq ($(filter -m%=cortex-a8, $(EXTRA_CFLAGS)),)
FFMPEGCONF += --disable-runtime-cpudetect --enable-neon --cpu=cortex-a8
endif
170 171 172 173
# 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
174
FFMPEGCONF += --enable-pic
175 176 177
X264CONF += --enable-pic
endif

178 179 180 181
ifdef HAVE_ISA_THUMB
NOTHUMB ?= -mno-thumb
endif

182 183
DATE=`date +%Y-%m-%d`

184 185 186
# ***************************************************************************
# Standard rules
# ***************************************************************************
187
# Generated by ./bootstrap from default configuration in src/Distributions
188
#
189
include ../distro.mak
190 191 192 193 194 195 196 197

FORCE:

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

define EXTRACT_GZ
198
	rm -rf $@ || true
199
	gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
200 201
	mv $(patsubst %.tar.gz,%,$(patsubst %.tgz,%,$(notdir $<))) $@ || true
	touch $@
202 203 204
endef

define EXTRACT_BZ2
205
	rm -rf $@ || true
206
	bunzip2 -c $< | tar xf - --exclude='[*?:<>\|]'
207 208
	mv $(patsubst %.tar.bz2,%,$(notdir $<)) $@ || true
	touch $@
209 210
endef

211
define EXTRACT_ZIP
212 213 214 215
	rm -rf $@ || true
	unzip $<
	mv $(patsubst %.zip,%,$(notdir $<)) $@ || true
	touch $@
216 217
endef

218 219 220 221 222 223
### 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
224 225 226 227 228
#	cd $< ; ./configure --prefix=$(PREFIX)
#	$(MAKE) -C $<
#	$(MAKE) -C $< install
#	$(INSTALL_NAME)
#	touch $@
229 230 231 232 233

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

234
autoconf-$(AUTOCONF_VERSION).tar.bz2:
235
	$(WGET) $(AUTOCONF_URL)
236

237
autoconf: autoconf-$(AUTOCONF_VERSION).tar.bz2
238
	$(EXTRACT_BZ2)
239 240

.autoconf: autoconf
241 242
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
243 244 245

CLEAN_FILE += .autoconf
CLEAN_PKG += autoconf
246
DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.bz2
247

248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
# ***************************************************************************
# 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

270 271 272
# ***************************************************************************
# CMake
# ***************************************************************************
Rafaël Carré's avatar
Rafaël Carré committed
273 274 275 276 277
cmake-$(CMAKE_VERSION).tar.gz:
	$(WGET) $(CMAKE_URL)

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

Rafaël Carré's avatar
Rafaël Carré committed
279 280
#cmake:
#	cvs -d :pserver:anonymous:cmake@www.cmake.org:/cvsroot/CMake co -d cmake CMake
281 282

.cmake: cmake
283 284 285 286 287 288
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@

CLEAN_FILE += .cmake
CLEAN_PKG += cmake

289 290 291 292 293
# ***************************************************************************
# libtool
# ***************************************************************************

ifdef HAVE_DARWIN_OS
294 295 296 297 298 299 300 301
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)
302 303
	ln -sf libtool $(PREFIX)/bin/glibtool
	ln -sf libtoolize $(PREFIX)/bin/glibtoolize
304
	touch $@
305 306 307

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

310 311 312 313 314 315 316
endif

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

automake-$(AUTOMAKE_VERSION).tar.gz:
317
	$(WGET) $(AUTOMAKE_URL)
318 319

automake: automake-$(AUTOMAKE_VERSION).tar.gz
320
	$(EXTRACT_GZ)
321 322

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

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

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

334
pkg-config-$(PKGCFG_VERSION).tar.gz:
335
	$(WGET) $(PKGCFG_URL)
336

337
pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz
338 339 340
	$(EXTRACT_GZ)
	patch -d pkgconfig/glib-1.2.8 -p 1 < Patches/glib.patch
	patch -d pkgconfig -p0 < Patches/pkgcfg.patch
341
	(cd $@; autoconf)
342 343

.pkgcfg: pkgconfig
344
	(cd pkgconfig; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
345
	touch $@
346 347 348

CLEAN_FILE += .pkgcfg
CLEAN_PKG += pkgconfig
349
DISTCLEAN_PKG += pkg-config-$(PKGCFG_VERSION).tar.gz
350 351 352 353 354 355

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

gettext-$(GETTEXT_VERSION).tar.gz:
356
	$(WGET) $(GETTEXT_URL)
357 358

gettext: gettext-$(GETTEXT_VERSION).tar.gz
359
	$(EXTRACT_GZ)
360
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
361
	patch -p0 < Patches/gettext-win32.patch
362
endif
VideoLAN's avatar
VideoLAN committed
363 364 365
ifdef HAVE_DARWIN_OS
	patch -p0 < Patches/gettext-macosx.patch
endif
366

367
.intl: gettext .iconv
368
ifdef HAVE_WIN32
369
	( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-relocatable --with-iconv-prefix=$(PREFIX) --disable-java --disable-native-java)
370
else
371
	( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-java --disable-native-java --without-emacs)
372
endif
373
ifneq ($(HOST),$(BUILD))
374 375
  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
376
	( cd $< && make -C gettext-runtime/intl && patch -p1 < ../Patches/libintl.patch && make -C gettext-runtime/intl install && make -C gettext-tools/misc install )
377 378 379 380
  else
    # We are compiling for MinGW on Cygwin -- build the full current gettext
	( cd $< && make && patch -p1 < ../Patches/libintl.patch && make install )
  endif
381 382
else
# Build and install the whole gettext
383
	( cd $< && make && patch -p1 < ../Patches/libintl.patch && make install )
384 385 386
endif
# Work around another non-sense of autoconf.
ifdef HAVE_WIN32
387
	(cd ../include; sed -i.orig '311 c #if 0' libintl.h)
388
endif
389 390
	$(INSTALL_NAME)
	touch $@
391 392 393 394 395 396 397 398 399 400

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

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

libiconv-$(LIBICONV_VERSION).tar.gz:
401
	$(WGET) $(LIBICONV_URL)
402 403

libiconv: libiconv-$(LIBICONV_VERSION).tar.gz
404
	$(EXTRACT_GZ)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
405 406
ifdef HAVE_WIN64
	patch -p0 < Patches/libiconv-win64.patch
407
endif
408

409 410 411 412 413
libiconv-snowleopard.tar.bz2:
	$(WGET) $(LIBICONVMAC_URL)

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

415
ifdef HAVE_DARWIN_OS
416
ifdef HAVE_DARWIN_10
417 418 419 420
.iconv: libiconv-snowleopard
	(cd libiconv-snowleopard && cp libiconv.* ../../lib/)
	touch $@
else
421
.iconv:
422
	touch $@
423
endif
424
else
425
.iconv: libiconv
426 427 428
	(cd libiconv; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls && make && make install)
	$(INSTALL_NAME)
	touch $@
429
endif
430 431 432 433 434

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

435 436 437 438 439 440 441
# ***************************************************************************
# fontconfig
# ***************************************************************************

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

442
fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz Patches/fontconfig.patch
443
	$(EXTRACT_GZ)
444
	patch -p0 < Patches/fontconfig-nodocs.patch
445 446
ifdef HAVE_WIN32
	patch -p0 < Patches/fontconfig.patch
447
	patch -p0 < Patches/fontconfig-noxml2.patch
448
endif
449
	(cd $@; autoreconf -ivf)
450

Rafaël Carré's avatar
Rafaël Carré committed
451
.fontconfig: fontconfig .xml .freetype
452 453
ifdef HAVE_WIN32
  ifdef HAVE_CYGWIN
454
	(cd $<;  ./configure --target=$(HOST) --disable-pic --disable-shared --disable-docs --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 && make && make install)
455
  else
456
	(cd $<; $(HOSTCC)  ./configure $(HOSTCONF) --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --disable-libxml2 --disable-docs && make && make install)
457 458
  endif
else
459
  ifdef HAVE_DARWIN_OS
460
	(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))
461
  else
462
	(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)
463
  endif
464 465 466 467 468 469 470 471
endif
	$(INSTALL_NAME)
	touch $@

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

472 473 474 475 476
# ***************************************************************************
# freetype2
# ***************************************************************************

freetype-$(FREETYPE2_VERSION).tar.gz:
477
	$(WGET) $(FREETYPE2_URL)
478 479

freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
480
	$(EXTRACT_GZ)
481 482

.freetype: freetype2
483
ifdef HAVE_CYGWIN
484
	(cd $<; ./configure --target=$(HOST) --disable-pic --disable-shared --prefix=$(PREFIX) && make && make install)
485
else
486
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
487
endif
488 489
	$(INSTALL_NAME)
	touch $@
490 491 492 493 494 495 496 497 498

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

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

499
fribidi-$(FRIBIDI_VERSION).tar.gz:
500
	$(WGET) $(FRIBIDI_URL)
501

502 503
fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz
	$(EXTRACT_GZ)
504
	patch -p0 < Patches/fribidi.patch
505
	( cd $@; rm -f configure; ./bootstrap)
506

507
.fribidi: fribidi .iconv
508
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  && make && make install)
509 510
	$(INSTALL_NAME)
	touch $@
511 512 513

CLEAN_FILE += .fribidi
CLEAN_PKG += fribidi
514
DISTCLEAN_PKG += fribidi-$(FRIBIDI_VERSION).tar.gz
515 516 517 518 519 520

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

a52dec-$(A52DEC_VERSION).tar.gz:
521
	$(WGET) $(A52DEC_URL)
522 523

a52dec: a52dec-$(A52DEC_VERSION).tar.gz
524
	$(EXTRACT_GZ)
525
ifeq ($(ARCH),armel)
526 527
	(cd $@ ; patch -p0 < ../Patches/liba52-fixed.diff)
endif
528 529

.a52: a52dec
530 531
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd liba52 && make && make install && cd ../include && make && make install)
	touch $@
532 533 534 535 536 537 538 539 540

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

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

Christophe Mutricy's avatar
Christophe Mutricy committed
541 542
libmpeg2-$(LIBMPEG2_VERSION).tar.gz:
	$(WGET) $(LIBMPEG2_URL)
543

Christophe Mutricy's avatar
Christophe Mutricy committed
544
libmpeg2: libmpeg2-$(LIBMPEG2_VERSION).tar.gz
545
	$(EXTRACT_GZ)
546 547
	cd libmpeg2 && patch -p0 < ../Patches/libmpeg2-mc-neon.patch
	cd libmpeg2 && ./bootstrap
548

Christophe Mutricy's avatar
Christophe Mutricy committed
549
.mpeg2: libmpeg2
550 551
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --without-x --disable-sdl && cd libmpeg2 && make && make install && cd ../include && make && make install)
	touch $@
552 553

CLEAN_FILE += .mpeg2
Christophe Mutricy's avatar
Christophe Mutricy committed
554 555
CLEAN_PKG += libmpeg2
DISTCLEAN_PKG += libmpeg2-$(LIBMPEG2_VERSION).tar.gz
556 557 558 559 560 561

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

libid3tag-$(LIBID3TAG_VERSION).tar.gz:
562
	$(WGET) $(LIBID3TAG_URL)
563 564

libid3tag: libid3tag-$(LIBID3TAG_VERSION).tar.gz
565
	$(EXTRACT_GZ)
566
	patch -d libid3tag -p0 < Patches/libid3tag-0.15.1b-fix-CVE-2008-2109.patch
567 568 569
ifdef HAVE_DARWIN_OS
	( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
endif
570 571

.id3tag: libid3tag
572 573 574
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
575 576 577 578 579

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

580 581 582 583 584 585 586 587 588 589 590
# ***************************************************************************
# 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
591
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared && make && make install )
592 593 594 595 596 597
	touch $@

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

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

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

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

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

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

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

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

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

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

libogg-$(OGG_VERSION).tar.gz:
671
	$(WGET) $(OGG_URL)
672 673

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

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

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

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

libvorbis-$(VORBIS_VERSION).tar.gz:
696
	$(WGET) $(VORBIS_URL)
697 698

libvorbis: libvorbis-$(VORBIS_VERSION).tar.gz
699
	$(EXTRACT_GZ)
700 701

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

.vorbisenc: .vorbis .ogg
707 708
#	$(INSTALL_NAME)
	touch $@
709 710 711 712 713

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

714 715 716 717 718
# ***************************************************************************
# tremor
# ***************************************************************************

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

tremor: tremor-$(TREMOR_VERSION).tar.bz2
730
	$(EXTRACT_BZ2)
731 732 733
endif

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

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

SOURCE += tremor-source
endif

745 746
CLEAN_FILE += .tremor
CLEAN_PKG += tremor
747
#DISTCLEAN_PKG += tremor-$(TREMOR_VERSION).tar.bz2 #no tremor snapshot
748

749 750 751 752 753
# ***************************************************************************
# theora
# ***************************************************************************

libtheora-$(THEORA_VERSION).tar.bz2:
754
	$(WGET) $(THEORA_URL)
755 756

libtheora: libtheora-$(THEORA_VERSION).tar.bz2
757
	$(EXTRACT_BZ2)
758
ifdef HAVE_DARWIN_OS
759 760 761 762 763
ifdef HAVE_DARWIN_OS_ON_INTEL
	patch -p0 < Patches/theora_mac_intel32.patch
else
	patch -p0 < Patches/theora_mac_ppc.patch
endif
764
endif
765
	patch -p0 < Patches/libtheora-includes.patch
766

767 768
THEORACONF = --disable-sdltest --disable-oggtest --disable-vorbistest --disable-examples

769
ifdef HAVE_DARWIN_64
770 771
THEORACONF += --disable-asm
endif
772 773 774
ifdef HAVE_WIN64
THEORACONF += --disable-asm
endif
775

776
.theora: libtheora .ogg
777 778 779 780 781 782 783 784 785 786 787 788
ifdef HAVE_DARWIN_OS
	cd $<; $(HOSTCC) ./autogen.sh $(HOSTCONF) --prefix=$(PREFIX) $(THEORACONF)
endif
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
789 790
	$(INSTALL_NAME)
	touch $@
791 792 793 794 795

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

Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
796 797 798 799 800
# ***************************************************************************
# shout
# ***************************************************************************

libshout-$(SHOUT_VERSION).tar.gz:
801
	$(WGET) $(SHOUT_URL)
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
802 803

libshout: libshout-$(SHOUT_VERSION).tar.gz
804
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
805
ifdef HAVE_WIN32
806
	patch -p0 < Patches/libshout-win32.patch
Christophe Mutricy's avatar
Christophe Mutricy committed
807
endif
808

809
.shout: libshout .theora .ogg .speex .vorbis
810 811 812
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) &&  make && make install )
	$(INSTALL_NAME)
	touch $@
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
813 814 815 816 817

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

818 819 820 821 822
# ***************************************************************************
# flac
# ***************************************************************************

flac-$(FLAC_VERSION).tar.gz:
823
	$(WGET) $(FLAC_URL)
824 825

flac: flac-$(FLAC_VERSION).tar.gz
826
	$(EXTRACT_GZ)
827
ifdef HAVE_WIN32
828
	patch -p0 < Patches/flac-win32.patch
829
endif
830
ifdef HAVE_DARWIN_OS
Felix Paul Kühne's avatar
Felix Paul Kühne committed
831
	( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
832
endif
833 834

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

836
.flac: flac .ogg
837
ifdef HAVE_WIN32
838
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS) && cd src&& make -C libFLAC&& make -C libFLAC install && cd .. && make -C include install)
839
else
840
ifdef HAVE_DARWIN_OS
841
ifdef HAVE_DARWIN_OS_ON_INTEL
842
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-asm-optimizations && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
843
else
844
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS) && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
845
endif
846
else
847
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  $(FLAC_DISABLE_FLAGS) && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
848
endif
849
endif
850 851
	$(INSTALL_NAME)
	touch $@
852

Damien Fouilleul's avatar
Damien Fouilleul committed
853
CLEAN_FILE += .flac
854 855 856 857 858 859 860 861
CLEAN_PKG += flac
DISTCLEAN_PKG += flac-$(FLAC_VERSION).tar.gz

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

speex-$(SPEEX_VERSION).tar.gz:
862
	$(WGET) $(SPEEX_URL)
863 864

speex: speex-$(SPEEX_VERSION).tar.gz
865 866
	$(EXTRACT_GZ)
	patch -p0 < Patches/speex.patch
867 868

.speex: speex
869 870 871
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-ogg=no && make && make install)
	$(INSTALL_NAME)
	touch $@
872 873 874 875 876 877 878 879 880

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

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

881
faad2-$(FAAD2_VERSION).tar.gz:
882
	$(WGET) $(FAAD2_URL)
883

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

889
.faad: faad2
Rafaël Carré's avatar
Rafaël Carré committed
890
	(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)
891
	touch $@
892 893

CLEAN_FILE += .faad
894 895
CLEAN_PKG += faad2
DISTCLEAN_PKG += faad2-$(FAAD2_VERSION).tar.gz
896 897 898 899 900 901

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

lame-$(LAME_VERSION).tar.gz:
902
	$(WGET) $(LAME_URL)
903 904

lame: lame-$(LAME_VERSION).tar.gz
905
	$(EXTRACT_GZ)
906 907

.lame: lame
908 909
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-analyser-hooks --disable-decoder --disable-shared --disable-gtktest --disable-frontend && make && make install)
	touch $@
910 911 912 913 914 915 916 917 918 919

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

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

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

libebml: libebml-$(LIBEBML_VERSION).tar.bz2
923
	$(EXTRACT_BZ2)
924
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
925
	(cd $@; patch -p0 < ../Patches/libebml-svn-win32.patch)
926
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
927
ifdef HAVE_WIN64
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
928
	patch -p0 < Patches/libebml-win64.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
929
endif
930 931

.ebml: libebml
932
ifdef HAVE_WIN32
933
	(cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC2) CFLAGS="$(CFLAGS) -DWIN32" SHARED=no && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC2))
934
else
935 936
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libebml.a
937
endif
938
	touch $@
939

940 941 942 943 944 945 946 947
CLEAN_FILE += .ebml
CLEAN_PKG += libebml
DISTCLEAN_PKG += libebml-$(LIBEBML_VERSION).tar.bz2

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

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

951
libmatroska: libmatroska-$(LIBMATROSKA_VERSION).tar.bz2
952
	$(EXTRACT_BZ2)
953
	patch -p0 < ./Patches/libmatroska-kaxblock.patch
954
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
955
	(cd $@; patch -p0 < ../Patches/libmatroska-win32.patch)
956
endif
957

958 959
.matroska: libmatroska .ebml
ifdef HAVE_WIN32
960
	(cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC2) SHARED=no EBML_DLL=no libmatroska.a && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC2))
961
else
962 963
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libmatroska.a
964
endif
965
	touch $@
966

967

968 969 970 971 972
CLEAN_FILE += .matroska
CLEAN_PKG += libmatroska
DISTCLEAN_PKG += libmatroska-$(LIBMATROSKA_VERSION).tar.bz2

# ***************************************************************************
973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006
# 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
1007
DISTCLEAN_PKG += amrwb-$(LIBAMR_WB_VERSION).tar.bz2
1008 1009 1010

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

1011 1012 1013
# ffmpeg
# ***************************************************************************

1014
ifdef SVN
1015
ffmpeg:
1016
	$(SVN) co $(FFMPEG_SVN) ffmpeg
1017 1018 1019
ifdef HAVE_ISA_THUMB
	patch -p0 < Patches/ffmpeg-avcodec-no-thumb.patch
endif
1020
ifdef HAVE_WINCE
Rafaël Carré's avatar
Rafaël Carré committed
1021
	patch -p1 < Patches/ffmpeg-svn-wince.patch
1022
endif
1023
ifdef HAVE_DARWIN_OS
1024
ifdef HAVE_DARWIN_OS_ON_INTEL
1025
	(cd $@; patch -p0 < ../Patches/ffmpeg-macosx-intel-mmx.patch)
1026
else
1027
	(cd $@; patch -p0 < ../Patches/ffmpeg-darwin-ppc-mdynamic.patch)
1028
endif
1029
endif
1030
ifdef HAVE_UCLIBC
1031 1032
	patch -p0 < Patches/ffmpeg-svn-uclibc.patch
	patch -p0 < Patches/ffmpeg-svn-internal-define.patch
1033
	patch -p0 < Patches/ffmpeg-svn-libavformat.patch
1034
endif
1035 1036 1037
ifdef HAVE_WIN32
	(cd $@; patch -p0 < ../Patches/ffmpeg-svn-win32.patch)
endif
1038 1039 1040 1041
ifdef NO_TEXT_RELOCATION
	echo "Broken LD. Fix your tools."
	exit -1
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1042
	(cd $@; patch -p1 < ../Patches/eac3_spectral.patch)
1043
else
1044
ffmpeg-$(FFMPEG_VERSION).tar.gz:
1045 1046
	echo "ffmpeg snapshot is too old, you MUST use subversion !"
	exit -1
1047
	$(WGET) $(FFMPEG_URL)
1048

1049 1050 1051
ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz
	$(EXTRACT_GZ)
endif
1052

Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1053
FFMPEGCONF += \
1054
	--disable-debug \
Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1055 1056 1057 1058 1059 1060 1061 1062
	--enable-gpl \
	--enable-postproc \
	--disable-ffserver \
	--disable-ffmpeg \
	--disable-ffplay \
	--disable-devices \
	--disable-protocols \
	--disable-network
1063
ifdef HAVE_WIN32
1064
FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=ac3 --enable-libmp3lame
1065
endif
1066

1067
ifdef HAVE_WINCE
1068
.ffmpeg: ffmpeg .zlib
1069
else
1070 1071 1072
ifdef HAVE_UCLIBC
.ffmpeg: ffmpeg
else
1073
.ffmpeg: ffmpeg .lame .gsm
1074
endif
1075
endif
1076
	(cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --extra-cflags="$(CFLAGS) $(FFMPEG_CFLAGS)" --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) --disable-shared --enable-static && make && make install-libs install-headers)
1077
	touch $@
1078

1079 1080
ifdef SVN
ffmpeg-source: ffmpeg
1081
	tar cv --exclude=.svn ffmpeg | bzip2 > ffmpeg-$(DATE).tar.bz2
1082 1083 1084 1085

SOURCE += ffmpeg-source
endif

1086
CLEAN_FILE += .ffmpeg
1087
CLEAN_PKG += ffmpeg
1088 1089 1090 1091 1092 1093
DISTCLEAN_PKG += ffmpeg-$(FFMPEG_VERSION).tar.gz

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

1094 1095 1096
libdvdcss-$(LIBDVDCSS_VERSION).tar.gz:
	$(WGET) $(LIBDVDCSS_URL)

1097
ifdef SVN
1098
libdvdcss:
1099
	$(SVN) co svn://svn.videolan.org/libdvdcss/trunk libdvdcss
1100
	cd $@ && sh bootstrap
1101
else
1102
libdvdcss: libdvdcss-$(LIBDVDCSS_VERSION).tar.gz
1103
	$(EXTRACT_GZ)
1104
endif
1105 1106

.dvdcss: libdvdcss
1107 1108 1109
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --disable-doc --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
1110

1111 1112
ifdef SVN
libdvdcss-source: libdvdcss
1113
	tar cv --exclude=.svn libdvdcss | bzip2 > libdvdcss-$(DATE).tar.bz2
1114 1115 1116 1117

SOURCE += libdvdcss-source
endif

1118 1119 1120 1121
CLEAN_FILE += .dvdcss
CLEAN_PKG += libdvdcss
DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.gz

1122 1123 1124
# ***************************************************************************
# dummy dvdread to trigger the INSTALL_NAME script
# ***************************************************************************
1125 1126 1127
# .dvdread: .dvdnav
# 	$(INSTALL_NAME)
# 	touch $@
1128
#
1129 1130 1131 1132 1133 1134 1135
# CLEAN_FILE += .dvdread

# ***************************************************************************
# libdvdread: We use dvdnav's dvdread
# ***************************************************************************


1136
libdvdread:
1137 1138
	$(SVN) co $(LIBDVDREAD_SVN)  libdvdread
	(cd $@; patch  -p 0 < ../Patches/libdvdread.patch)
1139
ifdef HAVE_WIN32
1140
	(cd $@; patch  -p 0 < ../Patches/libdvdread-win32.patch)
1141
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1142
	(cd $@; sh autogen.sh noconfig)
1143 1144

.libdvdread: libdvdread .dvdcss
1145
	(cd libdvdread; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --with-libdvdcss=$(PREFIX) && make && make install)
1146 1147
	$(INSTALL_NAME)
	touch $@
1148

1149 1150
CLEAN_FILE += .libdvdread
CLEAN_PKG += libdvdread
1151
#DISTCLEAN_PKG += libdvdread-$(LIBDVDREAD_VERSION).tar.gz
1152 1153 1154 1155 1156

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

1157 1158
ifdef SVN
libdvdnav:
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1159
	$(SVN) co $(LIBDVDNAV_SVN)  libdvdnav
1160
	patch -d libdvdnav -p0 < Patches/libdvdnav.patch
1161 1162
	(cd $@; ./autogen.sh noconfig)
else
1163
libdvdnav-$(LIBDVDNAV_VERSION).tar.gz:
1164
	$(WGET) $(LIBDVDNAV_URL)
1165

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1175
.dvdnav: libdvdnav .libdvdread
1176
ifdef HAVE_WIN32
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1177
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) && make && make install)
1178
else
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1179
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -Dlseek64=lseek -Doff64_t=off_t" && make && make install)
1180
endif
1181 1182
	$(INSTALL_NAME)
	touch $@
1183 1184 1185

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

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

1192
libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz:
1193
	$(WGET) $(LIBDVBPSI_URL)
1194

1195
libdvbpsi: libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1196
	$(EXTRACT_GZ)
1197 1198

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

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

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

1211
live555-$(LIVEDOTCOM_VERSION).tar.gz:
1212
	$(WGET) $(LIVEDOTCOM_URL)
1213

1214
live: live555-$(LIVEDOTCOM_VERSION).tar.gz
1215
	$(EXTRACT_GZ)
1216
	patch -p0 < Patches/live-noapps.patch
1217
	patch -p0 < Patches/live-uselocale.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1218 1219 1220
ifdef HAVE_WIN64
	patch -p0 < Patches/live-win64.patch
endif
1221 1222

.live: live
1223 1224 1225
ifdef HAVE_WIN32
	(cd $<;./genMakefiles mingw && make $(HOSTCC))
else
1226
ifdef HAVE_DARWIN_OS
1227
	(cd $<; sed -e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' -e 's%cc%$(CC)%'  -e 's%c++%$(CXX)%' -i.orig  config.macosx)
1228
	(cd $<; ./genMakefiles macosx && make)
1229
else
1230
	(cd $<; sed -e 's/=/= EXTRA_CPPFLAGS/' -e 's%EXTRA_CPPFLAGS%-I/include%' -i.orig groupsock/Makefile.head)
1231 1232 1233 1234 1235
ifdef HAVE_UCLIBC
ifdef HAVE_BIGENDIAN
	(cd $<; ./genMakefiles armeb-uclibc && make $(HOSTCC))
endif
else
1236
	(cd $<; sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig config.linux)
1237
	(cd $<; ./genMakefiles linux && make $(HOSTCC))
1238
endif
1239
endif
1240
endif
1241
	mkdir -p $(PREFIX)/lib $(PREFIX)/include
1242 1243 1244 1245 1246 1247 1248 1249
	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
1250
	touch $@
1251 1252 1253

CLEAN_FILE += .live
CLEAN_PKG += live
1254
DISTCLEAN_PKG += live555-$(LIVEDOTCOM_VERSION).tar.gz
1255 1256 1257 1258 1259 1260

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

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

goom: goom$(GOOM2k4_VERSION).tar.gz
1265
	$(EXTRACT_GZ)
1266
ifdef HAVE_WIN32
1267
	(cd $@; dos2unix configure.in)
Rafaël Carré's avatar
Rafaël Carré committed
1268
	patch -p0 < Patches/goom2k4-0-win32.patch
1269 1270
else
	patch -p0 < Patches/goom2k4-0-mmx.patch
1271
endif
1272
	patch -p0 < Patches/goom2k4-0-memleaks.patch
1273
	patch -p0 < Patches/goom2k4-autotools.patch
1274
	(cd $@; rm -f configure; ACLOCAL="aclocal -I m4/" autoreconf -ivf)
1275 1276

.goom2k4: goom
1277
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --disable-glibtest --disable-gtktest && make && make install)
1278
	touch $@
1279 1280 1281

CLEAN_FILE += .goom2k4
CLEAN_PKG += goom
1282
DISTCLEAN_PKG += goom$(GOOM2k4_VERSION).tar.gz
1283 1284 1285 1286 1287 1288

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

libcaca-$(LIBCACA_VERSION).tar.gz:
1289
	$(WGET) $(LIBCACA_URL)
1290 1291

libcaca: libcaca-$(LIBCACA_VERSION).tar.gz
1292
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
1293
	patch -p0 < Patches/libcaca-static.patch
1294 1295
ifdef HAVE_DARWIN_OS
	#remove me at next libcaca upgrade
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1296 1297
	patch -p0 < Patches/libcaca_driver_cocoa.diff
	patch -p0 < Patches/libcaca_macosx.diff
1298 1299
	patch -p0 < Patches/libcaca-osx-sdkofourchoice.patch
	(cd $@; sed -e 's%/Developer/SDKs/MacOSX10.4u.sdk%$(MACOSX_SDK)%' -i.orig  configure)
1300
endif
1301 1302

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

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

# ***************************************************************************
Antoine Cellerier's avatar
Antoine Cellerier committed
1315
# libdca
1316 1317
# ***************************************************************************

1318 1319 1320 1321 1322
libdca-$(LIBDCA_VERSION).tar.bz2:
	$(WGET) $(LIBDCA_URL)

libdca: libdca-$(LIBDCA_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1323 1324 1325
ifdef HAVE_DARWIN_9
	( cd $@; patch -p0 < ../Patches/libdca-llvm-gcc.patch )
endif
1326

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

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

1336
# ***************************************************************************
1337
# libx264
1338 1339
# ***************************************************************************

1340 1341 1342
x264-$(X264_VERSION).tar.gz:
	$(WGET) $(X264_URL)

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355
ifdef GIT
x264:
	$(GIT) clone git://git.videolan.org/x264.git
	patch -p0 < Patches/x264-svn-info-threads.patch
ifdef HAVE_WIN32
	(cd x264; patch -p0 < ../Patches/x264-svn-win32.patch )
endif
ifdef HAVE_DARWIN_OS
	(cd $@; patch -p0 < ../Patches/x264-svn-darwin.patch )
endif

else

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

1368 1369
ifdef HAVE_WIN32
.x264: x264 .pthreads
1370 1371 1372
  ifdef HAVE_CYGWIN
	(cd $<; $(HOSTCC) RANLIB="ranlib" AR="ar" STRIP="strip" ./configure $(X264CONF) --prefix="$(PREFIX)" --extra-cflags="-I$(PREFIX)/include" --extra-ldflags="-L$(PREFIX)/lib" && make && make install)
  else
1373
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" --enable-pthread && make && make install)
1374
  endif
1375
else
1376
ifdef HAVE_DARWIN_OS_ON_INTEL
1377
  .x264: x264 .yasm
1378
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1379 1380
else
  .x264: x264
1381
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1382
endif
1383
endif
1384
	touch $@
1385

1386
ifdef GIT
1387
x264-source: x264
1388 1389
	cd x264 && \
	git archive --format=tar HEAD | bzip2 > ../x264-$(DATE).tar.bz2
1390

1391
SOURCE += x264-source
1392 1393
endif

1394 1395 1396 1397
CLEAN_FILE += .x264
CLEAN_PKG += x264
DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz

1398 1399 1400 1401 1402
# ***************************************************************************
# libmodplug
# ***************************************************************************

libmodplug-$(MODPLUG_VERSION).tar.gz:
1403
	$(WGET) $(MODPLUG_URL)
1404 1405

libmodplug: libmodplug-$(MODPLUG_VERSION).tar.gz
1406
	$(EXTRACT_GZ)
1407
ifdef HAVE_WIN32
1408
	patch -p0 < Patches/libmodplug-win32.patch
1409
	(cd $@; autoreconf -ivf )
1410
endif
1411 1412

.mod: libmodplug
1413 1414
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
1415 1416 1417 1418 1419 1420 1421 1422 1423

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

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

1424
libcddb-$(CDDB_VERSION).tar.bz2:
1425
	$(WGET) $(CDDB_URL)
1426

1427
libcddb: libcddb-$(CDDB_VERSION).tar.bz2
1428
	$(EXTRACT_BZ2)
1429 1430 1431 1432 1433
	(cd $@; patch -p0 < ../Patches/libcddb-cross.patch )
ifdef HAVE_WIN32
	(cd $@; patch -p0 < ../Patches/libcddb-win32.patch )
endif
	(cd $@; autoreconf -fisv)
1434

1435 1436
ifdef HAVE_WIN32
.cddb: libcddb .regex
1437
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --without-iconv CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make && make install)
1438
else
1439
.cddb: libcddb
1440
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" LDFLAGS="$(LDFLAGS) -liconv" && make && make install)
1441
endif
1442
	touch $@
1443 1444 1445

CLEAN_FILE += .cddb
CLEAN_PKG += libcddb
1446
DISTCLEAN_PKG += libcddb-$(CDDB_VERSION).tar.bz2
1447 1448 1449 1450 1451 1452

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

vcdimager-$(VCDIMAGER_VERSION).tar.gz:
1453
	$(WGET) $(VCDIMAGER_URL)
1454 1455

vcdimager: vcdimager-$(VCDIMAGER_VERSION).tar.gz
1456
	$(EXTRACT_GZ)
1457 1458 1459

ifdef HAVE_DARWIN_OS
.vcdimager: vcdimager
1460 1461
	(cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static LDFLAGS="$(LDFLAGS) -framework CoreFoundation -framework IOKit" && make && make install)
	touch $@
1462 1463
else
.vcdimager: vcdimager
1464 1465
	(cd $<; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476
endif

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

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

libcdio-$(CDIO_VERSION).tar.gz:
1477
	$(WGET) $(CDIO_URL)
1478 1479

libcdio: libcdio-$(CDIO_VERSION).tar.gz
1480
	$(EXTRACT_GZ)
1481
	patch -p0 < Patches/libcdio-install-cdparanoia-pc.patch
1482 1483 1484
ifdef HAVE_DARWIN_OS
	patch -p0 < Patches/libcdio-modernOSX.patch
endif
1485 1486

.cdio: libcdio
1487
	(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)
1488
	touch $@
1489 1490 1491 1492 1493

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

1494 1495 1496 1497
# ***************************************************************************
# qt4 (win32 binary)
# ***************************************************************************

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

1501
qt4_win32: qt4-$(QT4_VERSION)-win32-bin.tar.bz2
1502
	$(EXTRACT_BZ2)
1503
	chmod -R 755 qt4_win32
Clément Stenac's avatar
Clément Stenac committed
1504

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

1514 1515
CLEAN_FILE += .qt4_win32
CLEAN_PKG += qt4_win32
1516
DISTCLEAN_PKG += qt4-$(QT4_VERSION)-win32-bin.tar.bz2
Clément Stenac's avatar
Clément Stenac committed
1517

1518 1519 1520 1521 1522 1523 1524
# ***************************************************************************
# qt4 (trolltech binaries)
# ***************************************************************************

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

1525
Qt_win32: qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1526
	mkdir Qt
1527
	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
1528 1529 1530
	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 {} \;
1531
	find Qt/translations -type f -a ! -name 'qt_*.qm' -exec rm {} \;
1532 1533 1534 1535
	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
1536

1537
.Qt_win32: Qt_win32
1538
	mkdir -p $(PREFIX)/bin $(PREFIX)/include/qt4/src $(PREFIX)/lib/pkgconfig $(PREFIX)/share/qt4/translations
1539 1540 1541 1542
	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
1543
	cp Qt/lib/pkgconfig/* $(PREFIX)/lib/pkgconfig
1544
	cp Qt/translations/* $(PREFIX)/share/qt4/translations
1545
	touch $@
1546

1547 1548
CLEAN_FILE += .Qt_win32
CLEAN_PKG += Qt_win32
1549
DISTCLEAN_PKG += qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1550

1551 1552 1553 1554
# ***************************************************************************
# qt4 (source-code compilation for Mac)
# ***************************************************************************

1555
qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz:
1556 1557
	$(WGET) $(QT4_MAC_URL)

1558
qt4_mac: qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz
1559 1560 1561
	$(EXTRACT_GZ)

.qt4_mac: qt4_mac
1562
	(cd qt4_mac; ./configure -prefix $(PREFIX) -release -fast -no-qt3support -nomake "examples demos" -sdk $(MACOSX_SDK) -no-framework -arch $(ARCH) && make && make install)
1563 1564 1565 1566
	touch $@

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

1569 1570 1571 1572 1573
# ***************************************************************************
# zlib
# ***************************************************************************

zlib-$(ZLIB_VERSION).tar.gz:
1574
	$(WGET) $(ZLIB_URL)
1575 1576

zlib: zlib-$(ZLIB_VERSION).tar.gz
1577
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
1578
	patch -p0 < Patches/zlib.patch
1579 1580

.zlib: zlib
1581 1582 1583
	(cd zlib; $(HOSTCC2) ./configure --prefix=$(PREFIX) && make install)
	$(INSTALL_NAME)
	touch $@
1584 1585 1586 1587 1588

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

1589
# ***************************************************************************
1590
# PortAudio
1591 1592 1593
# ***************************************************************************

pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz:
1594
	$(WGET) $(PORTAUDIO_URL)
1595 1596

portaudio: pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1597
	$(EXTRACT_GZ)
1598
ifneq ($(HOST),$(BUILD))
Rafaël Carré's avatar
Rafaël Carré committed
1599
	(patch -p0 < Patches/portaudio-cross.patch;cd $@;  autoconf)
1600
endif
1601

1602
.portaudio: portaudio
1603 1604 1605
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make  install)
	$(INSTALL_NAME)
	touch $@
1606 1607 1608

CLEAN_FILE += .portaudio
CLEAN_PKG += portaudio
1609
DISTCLEAN_PKG += pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1610

1611 1612 1613 1614 1615
# ***************************************************************************
# xml
# ***************************************************************************

libxml2-$(XML_VERSION).tar.gz:
1616
	$(WGET) $(XML_URL)
1617 1618

xml: libxml2-$(XML_VERSION).tar.gz
1619
	$(EXTRACT_GZ)
Jean-Paul Saman's avatar
Jean-Paul Saman committed
1620 1621 1622
ifdef HAVE_UCLIBC
	patch -p0 < Patches/xml2-uclibc.patch
endif
1623

1624
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
1625

1626
.xml: xml
1627
  ifdef HAVE_CYGWIN
1628
	(cd xml; ac_cv_header_pthread_h="no" CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1629
  else
1630
	(cd xml; CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1631
  endif
1632
ifndef HAVE_DARWIN_OS
1633
	$(INSTALL_NAME)
1634
endif
1635
	touch $@
1636 1637 1638 1639 1640

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

1641 1642 1643 1644 1645
# ***************************************************************************
# twolame
# ***************************************************************************

twolame-$(TWOLAME_VERSION).tar.gz:
1646
	$(WGET) $(TWOLAME_URL)
1647 1648

twolame: twolame-$(TWOLAME_VERSION).tar.gz
1649
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
1650
ifdef HAVE_WIN32
1651
	(cd twolame/win32; $(WGET) "http://twolame.svn.sourceforge.net/viewvc/*checkout*/twolame/trunk/win32/winutil.h")
1652
endif
1653 1654

.twolame: twolame
1655
	(cd twolame; $(HOSTCC) CFLAGS="${CFLAGS}  -DLIBTWOLAME_STATIC" ./configure $(HOSTCONF) --prefix=$(PREFIX) &&  make && make install)
1656 1657
	$(INSTALL_NAME)
	touch $@
1658 1659 1660

CLEAN_FILE += .twolame
CLEAN_PKG += twolame
1661
DISTCLEAN_PKG += twolame-$(TWOLAME_VERSION).tar.gz
1662 1663 1664 1665 1666 1667

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

libpng-$(PNG_VERSION).tar.bz2:
1668
	$(WGET) $(PNG_URL)
1669 1670

libpng: libpng-$(PNG_VERSION).tar.bz2
1671
	$(EXTRACT_BZ2)
1672
ifdef HAVE_WIN32
1673
	(cd $@; cat ../Patches/libpng-win32.patch | sed s,??PREFIX??,$(PREFIX), | patch -p0)
1674
else
1675
	(cat Patches/libpng-osx.patch | sed -e 's%??PREFIX??%$(PREFIX)%' -e 's%??EXTRA_CFLAGS??%$(EXTRA_CFLAGS)%' -e 's%??EXTRA_LDFLAGS??%$(EXTRA_LDFLAGS)%' | patch -p0)
1676
endif
Rafaël Carré's avatar
Rafaël Carré committed
1677
	(patch -p0 < Patches/libpng-makefile.patch)
1678
ifdef HAVE_DARWIN_OS_ON_INTEL
Rafaël Carré's avatar
Rafaël Carré committed
1679
	(patch -p0 < Patches/libpng-darwin-mactel.patch)
1680
endif
1681

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

CLEAN_FILE += .png
CLEAN_PKG += libpng
1701
DISTCLEAN_PKG += libpng-$(PNG_VERSION).tar.bz2
1702 1703 1704 1705 1706 1707

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

zvbi-$(ZVBI_VERSION).tar.bz2:
1708
	$(WGET) $(ZVBI_URL)
1709 1710

zvbi: zvbi-$(ZVBI_VERSION).tar.bz2
1711
	$(EXTRACT_BZ2)
1712
ifdef HAVE_WIN32
1713
	(cd $@; patch -p1 < ../Patches/zvbi-win32.patch; patch -p1 < ../Patches/zvbi-makefile.patch; autoreconf -ivf)
1714
endif
1715

1716 1717 1718
ifdef HAVE_WIN32
.zvbi: zvbi .pthreads
else
1719
.zvbi: zvbi
1720
endif
1721
ifdef HAVE_DARWIN_OS
1722
	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -fnested-functions" && make && make install)
1723 1724
else
ifdef HAVE_WIN32
1725
	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -DPTW32_STATIC_LIB --std=gnu99"  && make && make install)
1726
else
1727
	(cd $<; ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && make -C src && make -C src install)
1728
endif
1729
endif
1730
	$(INSTALL_NAME)
1731
	touch $@
1732 1733 1734

CLEAN_FILE += .zvbi
CLEAN_PKG += zvbi
1735
DISTCLEAN_PKG += zvbi-$(ZVBI_VERSION).tar.bz2
1736 1737

# ***************************************************************************
1738 1739 1740 1741 1742 1743 1744 1745 1746
# libraw1394
# ***************************************************************************

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

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

1747
.raw1394: libraw1394
1748
	(cd $<; ./configure --prefix=$(PREFIX) && make && make DESTDIR=$(PREFIX) install)
1749
#	sed 's/^typedef u_int8_t  byte_t;/\/* typedef u_int8_t  byte_t;\*\//'
1750
	touch $@
1751

1752
CLEAN_FILE += .raw1394
1753
CLEAN_PKG += libraw1394
1754
DISTCLEAN_PKG += libraw1394-$(LIBRAW1394_VERSION).tar.gz
1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765

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

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

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

1766
.dc1394: libdc1394
1767 1768
	(cd $<; ./configure --prefix=$(PREFIX) && \
	 patch -p1 < ../Patches/libdc1394-noexamples.patch && \
1769
	 make && make DESTDIR=$(PREFIX) install)
1770
	touch $@
1771

1772
CLEAN_FILE += .dc1394
1773
CLEAN_PKG += libdc1394
1774
DISTCLEAN_PKG += libdc1394-$(LIBDC1394_VERSION).tar.gz
1775 1776

# ***************************************************************************
1777
# gpg-error
1778 1779
# ***************************************************************************

1780
libgpg-error-$(GPGERROR_VERSION).tar.bz2:
1781
	$(WGET) $(GPGERROR_URL)
1782

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

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

1794
CLEAN_FILE += .gpg-error
1795
CLEAN_PKG += libgpg-error
1796
DISTCLEAN_PKG += libgpg-error-$(GPGERROR_VERSION).tar.bz2
1797 1798 1799 1800 1801

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

1802
libgcrypt-$(GCRYPT_VERSION).tar.bz2:
1803
	$(WGET) $(GCRYPT_URL)
1804

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

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

1811
.gcrypt: libgcrypt .gpg-error
1812
ifdef HAVE_WIN32
1813
	(cd $<; ./autogen.sh && $(HOSTCC) ./configure $(HOSTCONF) --target=i586-mingw32msvc --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(CIPHDIG) --disable-shared --enable-static --disable-nls && make && make install)
1814
else
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1815
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS) -lgpg-error" $(CIPHDIG) && make && make install)
1816
endif
1817 1818
	$(INSTALL_NAME)
	touch $@
1819 1820 1821

CLEAN_FILE += .gcrypt
CLEAN_PKG += libgcrypt
1822
DISTCLEAN_PKG += libgcrypt-$(GCRYPT_VERSION).tar.bz2
1823

1824 1825 1826 1827 1828 1829 1830
# ***************************************************************************
# opencdk (requires by gnutls 2.x)
# ***************************************************************************

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

1831
opencdk: opencdk-$(OPENCDK_VERSION).tar.bz2
1832 1833 1834 1835 1836 1837 1838 1839 1840 1841
	$(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

1842 1843 1844 1845 1846
# ***************************************************************************
# gnutls
# ***************************************************************************

gnutls-$(GNUTLS_VERSION).tar.bz2:
1847
	$(WGET) $(GNUTLS_URL)
1848 1849

gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2
1850
	$(EXTRACT_BZ2)
1851
ifdef HAVE_WIN32
1852
	patch -p0 < Patches/gnutls-win32.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1853
	(cd $@; autoreconf)
1854
endif
1855

1856
.gnutls: gnutls .gcrypt .gpg-error
1857
ifdef HAVE_WIN32
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1858
	(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 )
1859
else
1860
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --disable-cxx --with-included-opencdk --disable-guile && make && make install)
1861
endif
1862 1863
	$(INSTALL_NAME)
	touch $@
1864 1865 1866

CLEAN_FILE += .gnutls
CLEAN_PKG += gnutls
1867
DISTCLEAN_PKG += gnutls-$(GNUTLS_VERSION).tar.bz2
1868 1869 1870 1871 1872 1873

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

libopendaap-$(DAAP_VERSION).tar.bz2:
1874
	$(WGET) $(DAAP_URL)
1875 1876

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

1880
.opendaap: libopendaap
1881 1882 1883
	(cd $<; ./configure --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make install)
	$(INSTALL_NAME)
	touch $@
1884

1885
CLEAN_FILE += .opendaap
1886
CLEAN_PKG += libopendaap
1887
DISTCLEAN_PKG += libopendaap-$(DAAP_VERSION).tar.bz2
1888 1889 1890 1891 1892

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

1893
glib-$(GLIB_VERSION).tar.bz2:
1894
	$(WGET) $(GLIB_URL)
1895

1896 1897
glib: glib-$(GLIB_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1898
	(cd $@; patch -p0 < ../Patches/glib-remove-gtkdoc.patch)
1899
ifdef HAVE_DARWIN_64
1900 1901
	(cd $@; patch -p0 < ../Patches/glib-Darwin64.patch)
endif
1902 1903

.glib: glib
1904
	(cd $<; sh autogen.sh --prefix=$(PREFIX) --host=$(HOST) && make && make install)
1905
	touch $@
1906

1907
CLEAN_FILE += .glib
1908
CLEAN_PKG += glib
1909
DISTCLEAN_PKG += glib-$(GLIB_VERSION).tar.gz
1910 1911 1912 1913 1914

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

1915
libIDL-$(LIBIDL_VERSION).tar.bz2:
1916
	$(WGET) $(LIBIDL_URL)
1917

1918 1919
libIDL: libIDL-$(LIBIDL_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1920

1921
.IDL: libIDL
1922
	(cd $<; ./configure --prefix=$(PREFIX) --host=$(HOST) && make && make install )
1923
	touch $@
1924

1925
CLEAN_FILE += .IDL
1926
CLEAN_PKG += libIDL
1927
DISTCLEAN_PKG += libIDL-$(LIBIDL_VERSION).tar.gz
1928

1929 1930 1931 1932
# ***************************************************************************
# Gecko SDK
# ***************************************************************************

1933
gecko-sdk-ppc-macosx10.2-1.7.5.tar.gz:
1934
	$(WGET) $(GECKO_SDK_MAC_URL)
1935

1936 1937
gecko-sdk: gecko-sdk-ppc-macosx10.2-1.7.5.tar.gz
	$(EXTRACT_GZ)
1938 1939

.gecko: gecko-sdk
1940 1941 1942
	rm -rf ../gecko-sdk
	mv gecko-sdk ..
	mkdir gecko-sdk #creating an empty dir is faster than copying the whole dir
1943 1944
	(cd $<)
	touch $@
1945 1946 1947

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

1950 1951 1952 1953
# ***************************************************************************
# Gecko SDK win32
# ***************************************************************************

1954
gecko-sdk-i586-pc-msvc-1.8b1.zip:
1955
	$(WGET) $(GECKO_SDK_WIN32_URL)
1956 1957

libIDL-0.6.3-win32-bin.zip:
1958
	$(WGET) $(LIBIDL_WIN32_BIN_URL)
1959

1960
glib-19990228.zip:
1961
	$(WGET) $(GLIB_WIN32_BIN_URL)
1962

1963
.gecko-win32: gecko-sdk-i586-pc-msvc-1.8b1.zip libIDL-0.6.3-win32-bin.zip glib-19990228.zip
1964 1965 1966 1967 1968 1969 1970
	unzip gecko-sdk-i586-pc-msvc-1.8b1.zip
	rm -rf ../gecko-sdk
	mv gecko-sdk ..
	unzip -j libIDL-0.6.3-win32-bin.zip libIDL-0.6.3-win32-bin/libIDL-0.6.dll -d ../gecko-sdk/bin
	unzip glib-19990228.zip glib-1.2.dll -d ../gecko-sdk/bin
	chmod a+x ../gecko-sdk/bin/*
	touch $@
1971 1972 1973

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

1976
# ***************************************************************************
1977
# mozilla-macosx
1978 1979 1980 1981
#
# Note that this dependency needs to be compiled against the 10.4u SDK using
# using GCC-4.0. Using newer releases of one of these won't lead to a 
# successful compilation! Adapt the respective variables in ../config.mak!
1982 1983
# ***************************************************************************

1984
firefox-$(MOZILLA_VERSION)-source.tar.bz2:
1985
	$(WGET) $(MOZILLA_URL)
1986

1987
mozilla: firefox-$(MOZILLA_VERSION)-source.tar.bz2
1988
	$(EXTRACT_BZ2)
1989
	(cd $@; patch -p0 < ../Patches/firefox-darwin.patch)
1990

1991 1992 1993 1994 1995 1996
.mozilla-macosx: mozilla .glib .IDL
	ifneq($(SDK_TARGET),"10.4")
	echo "Compiling the mozilla target requires the 10.4 SDK!"
	exit -1
	endif
	(cd $<; ./configure --prefix=$(PREFIX)/gecko-sdk-new --enable-default-toolkit=cairo-cocoa --enable-standalone-modules=xpcom,plugin  --enable-application=xulrunner && make && make install)
1997
	touch $@
1998

1999
CLEAN_FILE += .mozilla-macosx
2000 2001
CLEAN_PKG += mozilla
DISTCLEAN_PKG += firefox-source-$(MOZILLA_VERSION).tar.bz2
2002

2003 2004 2005 2006
# ***************************************************************************
# libjpeg
# ***************************************************************************

2007
jpegsrc.v$(JPEG_VERSION).tar.gz:
2008
	$(WGET) $(JPEG_URL)
2009

2010
jpeg-7: jpegsrc.v$(JPEG_VERSION).tar.gz
2011
	$(EXTRACT_GZ)
2012

2013 2014
.jpeg: jpeg-7
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(HOSTCC) && make && make install)
2015 2016
	$(RANLIB) $(PREFIX)/lib/libjpeg.a
	touch $@
2017 2018

CLEAN_FILE += .jpeg
2019 2020
CLEAN_PKG += jpeg-7
DISTCLEAN_PKG += jpegsrc.v$(JPEG_VERSION).tar.gz
2021 2022 2023 2024 2025 2026

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

tiff-$(TIFF_VERSION).tar.gz:
2027
	$(WGET) $(TIFF_URL)
2028

2029
tiff: tiff-$(TIFF_VERSION).tar.gz
2030
	$(EXTRACT_GZ)
2031 2032

.tiff: tiff
2033
ifdef HAVE_WIN32
2034
	(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)
2035
else
2036
	(cd $<; ./configure --with-CFLAGS="$(CFLAGS)" --with-JPEG=no --with-ZIP=no --prefix=$(PREFIX) && make -C port &&make -C libtiff && make -C libtiff install)
2037
endif
2038
	$(INSTALL_NAME)
2039
	touch $@
2040 2041 2042 2043 2044 2045

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

# ***************************************************************************
2046
# LibSDL
2047 2048
# ***************************************************************************

2049
ifndef HAVE_DARWIN_OS
2050
SDL-$(SDL_VERSION).tar.gz:
2051
	$(WGET) $(SDL_URL)
2052

2053
SDL: SDL-$(SDL_VERSION).tar.gz
2054
	$(EXTRACT_GZ)
2055
else
2056
SDL:
2057 2058 2059
	$(SVN) co http://svn.libsdl.org/trunk/SDL -r 4444 SDL
	(cd $@; sh autogen.sh)
endif
2060 2061

.SDL: SDL
2062 2063 2064
	(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 $@
2065 2066 2067 2068 2069 2070 2071 2072 2073 2074

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

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

SDL_image-$(SDL_IMAGE_VERSION).tar.gz:
2075
	$(WGET) $(SDL_IMAGE_URL)
2076

2077
SDL_image: SDL_image-$(SDL_IMAGE_VERSION).tar.gz
2078
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
2079
	patch -p0 < Patches/SDL_image.patch
2080 2081

.SDL_image: SDL_image .SDL .png .jpeg .tiff
2082 2083 2084
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --enable-tif --disable-sdltest && make && make install)
	$(INSTALL_NAME)
	touch $@
2085 2086 2087 2088 2089

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

2090 2091 2092 2093 2094
# ***************************************************************************
# Musepack decoder library (libmpcdec)
# ***************************************************************************

libmpcdec-$(MUSE_VERSION).tar.bz2:
2095
	$(WGET) $(MUSE_URL)
2096

2097
mpcdec: libmpcdec-$(MUSE_VERSION).tar.bz2
2098
	$(EXTRACT_BZ2)
2099
	patch -p0 < Patches/mpcdec.patch
2100
	(cd $@; autoreconf -ivf)
2101

2102
.mpcdec: mpcdec
2103
ifdef HAVE_WIN32
2104
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS=-D_PTRDIFF_T=mpc_int32_t && make && make install)
2105
else
2106
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2107 2108
endif
ifdef HAVE_DARWIN_OS
2109
	$(INSTALL_NAME)
2110
endif
2111
	touch $@
2112

2113 2114
CLEAN_FILE += .mpcdec
CLEAN_PKG += mpcdec
2115 2116
DISTCLEAN_PKG += libmpcdec-$(MUSE_VERSION).tar.bz2

2117
# ***************************************************************************
2118 2119
# Dirac
# ***************************************************************************
2120 2121

dirac-$(DIRAC_VERSION).tar.gz:
2122
	$(WGET) $(DIRAC_URL)
2123 2124

dirac: dirac-$(DIRAC_VERSION).tar.gz
2125
	$(EXTRACT_GZ)
2126
ifdef HAVE_CYGWIN
2127
	# incorrect compile warning with cygwin compiler 3.4.4
2128 2129
	patch -p0 <Patches/dirac-cygwin.patch
endif
2130
ifndef HAVE_DARWIN_OS
2131
	(cd $@; aclocal -I m4 && autoconf && automake)
2132 2133 2134
else
	(cd $@; ./bootstrap)
endif
2135

2136 2137 2138 2139
DIRAC_SUBDIRS = libdirac_byteio libdirac_common libdirac_motionest libdirac_encoder libdirac_decoder

ifdef HAVE_WIN32
DIRAC_SUBDIRS += win32
2140
endif
2141

2142
.dirac: dirac
2143
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  CFLAGS="$(CFLAGS)" && DOC_DIR="" make $(DIRAC_SUBDIRS) && DOC_DIR="" make install)
2144
	touch $@
2145 2146 2147

# for MacOS X, dirac is split into two libraries, which needs be installed using two targets
.dirac_encoder: .dirac
2148 2149
	$(INSTALL_NAME)
	touch $@
2150 2151

.dirac_decoder: .dirac
2152 2153
	$(INSTALL_NAME)
	touch $@
2154 2155 2156 2157 2158 2159 2160 2161 2162

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

# *************************************************************************
# DirectX headers
# *************************************************************************
win32-dx7headers.tgz:
2163
	$(WGET) $(DX_HEADERS_URL)
2164
.dx_headers: win32-dx7headers.tgz
2165 2166
	(cd ../include ; tar xzf ../src/$<)
	touch $@
2167 2168
CLEAN_FILE += .dx_headers
DISTCLEAN_PKG += win32-dx7headers.tgz
2169

2170 2171 2172 2173
# *************************************************************************
# DirectShow headers
# *************************************************************************
dshow-headers.tgz:
2174
	$(WGET) $(DSHOW_HEADERS_URL)
2175
.dshow_headers: dshow-headers.tgz
2176 2177
	(cd ../include ; tar xzf ../src/$<)
	touch $@
2178 2179
CLEAN_FILE += .dshow_headers
DISTCLEAN_PKG += dshow-headers.tgz
2180 2181 2182 2183 2184 2185

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

expat-$(EXPAT_VERSION).tar.gz:
2186
	$(WGET) $(EXPAT_URL)
2187 2188

expat: expat-$(EXPAT_VERSION).tar.gz
2189
	$(EXTRACT_GZ)
2190 2191

.expat: expat
2192
ifdef HAVE_DARWIN_OS
2193
	(cd $< aclocal --force && libtoolize --force && autoconf --force && autoheader --force )
2194
endif
2195 2196
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
2197 2198 2199 2200 2201 2202 2203 2204 2205 2206

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

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

clinkcc$(CLINKCC_VERSION).tar.gz:
2207
	$(WGET) $(CLINKCC_URL)
2208 2209

clinkcc: clinkcc$(CLINKCC_VERSION).tar.gz
2210 2211 2212
	tar xzf $<
	mv $(patsubst %.tar.gz,Cyberlink,$(patsubst %.tgz,Cyberlink,$(notdir $<))) $@ || true
	touch $@
Rafaël Carré's avatar
Rafaël Carré committed
2213
	patch -p0 < Patches/clinkcc.patch
2214
ifdef HAVE_DARWIN_OS
Rafaël Carré's avatar
Rafaël Carré committed
2215
	patch -p0 < Patches/clinkcc_osx.patch
2216
endif
2217
	(cd $@; ./bootstrap)
2218 2219

.clinkcc: clinkcc
2220
	(cd $<;./configure --prefix=$(PREFIX) --enable-expat && make && chmod 755 config/install-sh && make install )
2221
	touch $@
2222 2223 2224

CLEAN_FILE += .clinkcc
CLEAN_PKG += clinkcc
2225
DISTCLEAN_PKG += clinkcc$(CLINKCC_VERSION).tar.gz
2226

2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237
# ***************************************************************************
# YASM assembler
# ***************************************************************************

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

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

.yasm: yasm
2238
	(cd $< && $(HOSTCC) ./configure --prefix=$(PREFIX) --host=$(HOST) && make && make install)
2239 2240 2241 2242
	touch $@

CLEAN_FILE += .yasm
CLEAN_PKG += yasm
2243
DISTCLEAN_PKG += yasm-$(YASM_VERSION).tar.gz
2244

2245
# ***************************************************************************
2246 2247 2248 2249 2250 2251 2252 2253 2254 2255
# kate
# ***************************************************************************

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

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

.kate: libkate .ogg
2256
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-valgrind --disable-doc && make && make install)
2257 2258 2259 2260 2261 2262 2263
	$(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
2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282
# ***************************************************************************
# 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

2283
# ***************************************************************************
2284 2285 2286 2287 2288 2289
# Copy aclocal files
# This is necessary for --missing aclocal to succeed after a
# configure.ac/Makefile.am change in the vlc root dir
# **************************************************************************

.aclocal:
2290 2291
	cp -R $(PREFIX)/share/aclocal/* $(PREFIX)/../../m4/
	touch $@
2292

Felix Paul Kühne's avatar
Felix Paul Kühne committed
2293
CLEAN_FILE += .aclocal
2294

2295 2296 2297 2298 2299
# ***************************************************************************
# TagLib read and editing of tags of popular audio formats
# ***************************************************************************

taglib-$(TAGLIB_VERSION).tar.gz:
2300
	$(WGET) $(TAGLIB_URL)
2301 2302

taglib: taglib-$(TAGLIB_VERSION).tar.gz
2303
	$(EXTRACT_GZ)
2304
ifdef HAVE_WIN32
2305
	patch -p0 < Patches/taglib-static.patch
2306
endif
2307
ifdef HAVE_CYGWIN
2308
	patch -p0 < Patches/taglib-cygwin.patch
2309
endif
2310 2311

.tag: taglib
2312
	(cd $<; $(HOSTCC)  ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2313 2314
	$(INSTALL_NAME)
	touch $@
2315

2316 2317 2318 2319 2320 2321 2322
CLEAN_FILE += .tag
CLEAN_PKG += taglib
DISTCLEAN_PKG += taglib-$(TAGLIB_VERSION).tar.gz

# ***************************************************************************
# pthreads for win32
# ***************************************************************************
Christophe Mutricy's avatar
Christophe Mutricy committed
2323 2324 2325 2326 2327 2328

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
2329
	(cd $@; patch -p0 < ../Patches/pthreads-detach.patch)
Christophe Mutricy's avatar
Christophe Mutricy committed
2330 2331

.pthreads: pthreads
Christophe Mutricy's avatar
Christophe Mutricy committed
2332
	(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
2333 2334 2335
	$(INSTALL_NAME)
	touch $@

2336 2337 2338
CLEAN_FILE += .pthreads
CLEAN_PKG += pthreads
DISTCLEAN_PKG += pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
2339

2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356
# ***************************************************************************
# ncurses library (with wide chars support)
# ***************************************************************************

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

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

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

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

2358 2359 2360 2361 2362 2363 2364 2365 2366
# ***************************************************************************
# FluidSynth library (Midi)
# ***************************************************************************

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

fluidsynth: fluidsynth-$(FLUID_VERSION).tar.gz
	$(EXTRACT_GZ)
2367 2368
ifdef HAVE_WIN32
	patch -p0 < Patches/fluid-win32.patch
2369
	cd $@; ./autogen.sh || true
2370
endif
2371 2372 2373 2374 2375 2376 2377

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

CLEAN_FILE += .fluid
CLEAN_PKG += fluidsynth
2378
DISTCLEAN_PKG += fluidsynth-$(FLUID_VERSION).tar.gz
2379

2380 2381 2382 2383 2384 2385 2386 2387 2388
# ***************************************************************************
# liboil
# ***************************************************************************

liboil-$(OIL_VERSION).tar.gz:
	$(WGET) $(OIL_URL)

liboil: liboil-$(OIL_VERSION).tar.gz
	$(EXTRACT_GZ)
2389
	patch -d liboil -p1 < Patches/liboil-noshared.patch
2390
	patch -d liboil -p1 < Patches/liboil-win64.patch
2391 2392 2393
	patch -d liboil -p1 < Patches/liboil-Xcompile.patch
	(cd $@; autoreconf)

2394

2395 2396

.liboil: liboil
2397
ifdef HAVE_DARWIN_OS
2398
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)")
2399 2400 2401 2402
else
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O2")
endif
	(cd $<; make && make install)
2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418
	touch $@

CLEAN_FILE += .liboil
CLEAN_PKG += liboil
DISTCLEAN_PKG += liboil-$(OIL_VERSION).tar.gz

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

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

schroedinger: schroedinger-$(SCHROED_VERSION).tar.gz
	$(EXTRACT_GZ)

2419
.schroedinger: schroedinger .liboil
2420
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --with-thread=none --disable-gstreamer --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make -C schroedinger && make -C schroedinger install)
2421 2422 2423 2424 2425
	touch $@

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

2427 2428 2429 2430 2431 2432 2433
# ***************************************************************************
# ASS library
# ***************************************************************************

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

2434 2435
libass:
	$(GIT) clone $(ASS_GIT)
2436
	(cd $@; autoreconf -ivf)
2437

2438
.libass: libass .freetype
2439
	(cd $<; $(HOSTCC) ./configure --disable-png $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make && make install)
2440 2441
	touch $@

2442 2443 2444
CLEAN_FILE += .libass
CLEAN_PKG += libass
DISTCLEAN_PKG += libass-$(ASS_VERSION).tar.bz2
2445

2446 2447 2448 2449
# ***************************************************************************
# Sparkle
# ***************************************************************************

2450
"Sparkle-$(SPARKLE_VERSION).zip":
2451 2452
	$(WGET) $(SPARKLE_URL)

2453
Sparkle: "Sparkle-$(SPARKLE_VERSION).zip"
2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466
	rm -rf $@ || true
	unzip $<
	touch $@

.Sparkle: Sparkle
	rm -rf ../Sparkle
	mv Sparkle ..
	mkdir Sparkle
	(cd $<)
	touch $@

CLEAN_FILE += .Sparkle
CLEAN_PKG += Sparkle
2467
DISTCLEAN_PKG += Sparkle-$(SPARKLE_VERSION).zip
2468

2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486
# ***************************************************************************
# UPNP library
# ***************************************************************************

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

libupnp: libupnp-$(UPNP_VERSION).tar.bz2
	$(EXTRACT_BZ2)

.libupnp: libupnp
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-samples --without-documentation --disable-webserver CFLAGS="$(CFLAGS) -O3" && make && make install)
	touch $@

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

2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499
# *********
# GSM
# *********
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
2500 2501 2502
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
2503 2504 2505 2506 2507 2508 2509 2510 2511

.gsm: gsm
	(cd $<; $(HOSTCC) make && cp inc/gsm.h $(PREFIX)/include && cp lib/libgsm.a  $(PREFIX)/lib)
	touch $@

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

2512 2513 2514 2515 2516 2517
# *********
# projectM
# *********
ifdef SVN
libprojectM:
	$(SVN) co $(LIBPROJECTM_SVN) libprojectM
2518
	patch -d libprojectM -p0 < Patches/libprojectM-fpic.patch
2519 2520 2521 2522 2523 2524 2525 2526 2527
else
libprojectM-$(LIBPROJECTM_VERSION).tar.bz2:
	$(WGET) $(LIBPROJECTM_URL)

libprojectM: libprojectM-$(LIBPROJECTM_VERSION).tar.bz2
	$(EXTRACT_BZ2)
endif

.libprojectM: libprojectM
2528
	(cd $</src; $(HOSTCC) CPPFLAGS="$(CPPFLAGS)" cmake . -DUSE_FBO:STRING=FALSE -DUSE_FBO:BOOL=OFF -DINCLUDE-PROJECTM-LIBVISUAL:BOOL=OFF -DINCLUDE-PROJECTM-PULSEAUDIO:BOOL=OFF -DINCLUDE-PROJECTM-QT:BOOL=OFF -DCMAKE_INSTALL_PREFIX=$(PREFIX) && make install)
2529 2530 2531 2532 2533
	touch $@

CLEAN_FILE += .libprojectM
CLEAN_PKG += libprojectM
DISTCLEAN_PKG += libprojectM-$(LIBPROJECTM_VERSION).tar.bz2
2534

2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589
# ***************************************************************************
# 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) \
		--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
	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 $@

2590 2591 2592 2593
CLEAN_FILES += .xcb-util .xcb
CLEAN_PKG += xcb-util xcb
DISTCLEAN_PKG += xcb-util-$(XCB_UTIL_VERSION).tar.bz2 libxcb-$(XCB_VERSION).tar.bz2

2594 2595 2596 2597
# ***************************************************************************
# Peflags utility (Windows only)
# ***************************************************************************

2598 2599 2600
peflags/peflags.c:
	mkdir -p peflags
	cd peflags && $(WGET) $(PEFLAGS_URL)/peflags.c
2601

2602
.peflags: peflags/peflags.c
2603 2604 2605
	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
2606 2607
	touch $@

2608 2609
CLEAN_PKG += peflags
CLEAN_FILES += .peflags
2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628

# ************
# Regex
# ************

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 )

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


2629
# ***************************************************************************
2630
# Some cleaning
2631 2632 2633
# ***************************************************************************

clean-dots: FORCE
2634
	rm -f $(CLEAN_FILE)
2635 2636

clean: clean-dots
2637
	rm -rf $(CLEAN_PKG)
2638 2639

clean-src: clean
2640
	rm -rf $(DISTCLEAN_PKG)
2641

2642
clean-svn:
2643
	rm -rf ffmpeg tremor x264 libdca pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz portaudio live555-$(LIVEDOTCOM_VERSION).tar.gz live libass
2644

2645
distclean: clean-src
2646

2647 2648 2649 2650
# ***************************************************************************
# Download all the sources and package unversionned copies of subversion trees
# ***************************************************************************

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