Makefile 78.5 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
	patch -p0 < Patches/libtheora-includes.patch
759

760 761
THEORACONF = --disable-sdltest --disable-oggtest --disable-vorbistest --disable-examples

762
ifdef HAVE_DARWIN_64
763 764
THEORACONF += --disable-asm
endif
765 766 767
ifdef HAVE_WIN64
THEORACONF += --disable-asm
endif
768

769
.theora: libtheora .ogg
770
ifdef HAVE_DARWIN_OS
771 772
	cd $<; ($(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(THEORACONF) && make && make install)
else
773 774 775 776 777 778 779 780 781
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
782
endif
783 784
	$(INSTALL_NAME)
	touch $@
785 786 787 788 789

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

Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
790 791 792 793 794
# ***************************************************************************
# shout
# ***************************************************************************

libshout-$(SHOUT_VERSION).tar.gz:
795
	$(WGET) $(SHOUT_URL)
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
796 797

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

803
.shout: libshout .theora .ogg .speex .vorbis
804 805 806
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) &&  make && make install )
	$(INSTALL_NAME)
	touch $@
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
807 808 809 810 811

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

812 813 814 815 816
# ***************************************************************************
# flac
# ***************************************************************************

flac-$(FLAC_VERSION).tar.gz:
817
	$(WGET) $(FLAC_URL)
818 819

flac: flac-$(FLAC_VERSION).tar.gz
820
	$(EXTRACT_GZ)
821
ifdef HAVE_WIN32
822
	patch -p0 < Patches/flac-win32.patch
823
endif
824
ifdef HAVE_DARWIN_OS
Felix Paul Kühne's avatar
Felix Paul Kühne committed
825
	( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
826
endif
827 828

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

830
.flac: flac .ogg
831
ifdef HAVE_WIN32
832
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS) && cd src&& make -C libFLAC&& make -C libFLAC install && cd .. && make -C include install)
833
else
834
ifdef HAVE_DARWIN_OS
835
ifdef HAVE_DARWIN_OS_ON_INTEL
836
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-asm-optimizations && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
837
else
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
endif
840
else
841
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  $(FLAC_DISABLE_FLAGS) && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
842
endif
843
endif
844 845
	$(INSTALL_NAME)
	touch $@
846

Damien Fouilleul's avatar
Damien Fouilleul committed
847
CLEAN_FILE += .flac
848 849 850 851 852 853 854 855
CLEAN_PKG += flac
DISTCLEAN_PKG += flac-$(FLAC_VERSION).tar.gz

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

speex-$(SPEEX_VERSION).tar.gz:
856
	$(WGET) $(SPEEX_URL)
857 858

speex: speex-$(SPEEX_VERSION).tar.gz
859 860
	$(EXTRACT_GZ)
	patch -p0 < Patches/speex.patch
861 862

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

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

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

875
faad2-$(FAAD2_VERSION).tar.gz:
876
	$(WGET) $(FAAD2_URL)
877

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

883
.faad: faad2
Rafaël Carré's avatar
Rafaël Carré committed
884
	(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)
885
	touch $@
886 887

CLEAN_FILE += .faad
888 889
CLEAN_PKG += faad2
DISTCLEAN_PKG += faad2-$(FAAD2_VERSION).tar.gz
890 891 892 893 894 895

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

lame-$(LAME_VERSION).tar.gz:
896
	$(WGET) $(LAME_URL)
897 898

lame: lame-$(LAME_VERSION).tar.gz
899
	$(EXTRACT_GZ)
900 901

.lame: lame
902 903
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-analyser-hooks --disable-decoder --disable-shared --disable-gtktest --disable-frontend && make && make install)
	touch $@
904 905 906 907 908 909 910 911 912 913

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

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

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

libebml: libebml-$(LIBEBML_VERSION).tar.bz2
917
	$(EXTRACT_BZ2)
918
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
919
	(cd $@; patch -p0 < ../Patches/libebml-svn-win32.patch)
920
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
921
ifdef HAVE_WIN64
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
922
	patch -p0 < Patches/libebml-win64.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
923
endif
924 925

.ebml: libebml
926
ifdef HAVE_WIN32
927
	(cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC2) CFLAGS="$(CFLAGS) -DWIN32" SHARED=no && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC2))
928
else
929 930
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libebml.a
931
endif
932
	touch $@
933

934 935 936 937 938 939 940 941
CLEAN_FILE += .ebml
CLEAN_PKG += libebml
DISTCLEAN_PKG += libebml-$(LIBEBML_VERSION).tar.bz2

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

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

945
libmatroska: libmatroska-$(LIBMATROSKA_VERSION).tar.bz2
946
	$(EXTRACT_BZ2)
947
	patch -p0 < ./Patches/libmatroska-kaxblock.patch
948
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
949
	(cd $@; patch -p0 < ../Patches/libmatroska-win32.patch)
950
endif
951

952 953
.matroska: libmatroska .ebml
ifdef HAVE_WIN32
954
	(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))
955
else
956 957
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libmatroska.a
958
endif
959
	touch $@
960

961

962 963 964 965 966
CLEAN_FILE += .matroska
CLEAN_PKG += libmatroska
DISTCLEAN_PKG += libmatroska-$(LIBMATROSKA_VERSION).tar.bz2

# ***************************************************************************
967 968 969 970 971 972 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
# 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
1001
DISTCLEAN_PKG += amrwb-$(LIBAMR_WB_VERSION).tar.bz2
1002 1003 1004

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

1005 1006 1007
# ffmpeg
# ***************************************************************************

1008
ifdef SVN
1009
ffmpeg:
1010
	$(SVN) co $(FFMPEG_SVN) ffmpeg
1011 1012 1013
ifdef HAVE_ISA_THUMB
	patch -p0 < Patches/ffmpeg-avcodec-no-thumb.patch
endif
1014
ifdef HAVE_WINCE
Rafaël Carré's avatar
Rafaël Carré committed
1015
	patch -p1 < Patches/ffmpeg-svn-wince.patch
1016
endif
1017
ifdef HAVE_UCLIBC
1018 1019
	patch -p0 < Patches/ffmpeg-svn-uclibc.patch
	patch -p0 < Patches/ffmpeg-svn-internal-define.patch
1020
	patch -p0 < Patches/ffmpeg-svn-libavformat.patch
1021
endif
1022 1023 1024
ifdef HAVE_WIN32
	(cd $@; patch -p0 < ../Patches/ffmpeg-svn-win32.patch)
endif
1025 1026 1027 1028
ifdef NO_TEXT_RELOCATION
	echo "Broken LD. Fix your tools."
	exit -1
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1029
	(cd $@; patch -p1 < ../Patches/eac3_spectral.patch)
1030
else
1031
ffmpeg-$(FFMPEG_VERSION).tar.gz:
1032 1033
	echo "ffmpeg snapshot is too old, you MUST use subversion !"
	exit -1
1034
	$(WGET) $(FFMPEG_URL)
1035

1036 1037 1038
ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz
	$(EXTRACT_GZ)
endif
1039

Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1040
FFMPEGCONF += \
1041
	--disable-debug \
Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1042 1043 1044 1045 1046 1047 1048 1049
	--enable-gpl \
	--enable-postproc \
	--disable-ffserver \
	--disable-ffmpeg \
	--disable-ffplay \
	--disable-devices \
	--disable-protocols \
	--disable-network
1050
ifdef HAVE_WIN32
1051 1052 1053
FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=ac3 --enable-libmp3lame --enable-w32threads
else
FFMPEGCONFG += --enable-pthreads
1054
endif
1055

1056
ifdef HAVE_WINCE
1057
.ffmpeg: ffmpeg .zlib
1058
else
1059 1060 1061
ifdef HAVE_UCLIBC
.ffmpeg: ffmpeg
else
1062
.ffmpeg: ffmpeg .lame .gsm
1063
endif
1064
endif
1065
	(cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --extra-cflags="$(CFLAGS) $(FFMPEG_CFLAGS)" --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) --disable-shared --enable-static && make && make install-libs install-headers)
1066
	touch $@
1067

1068 1069
ifdef SVN
ffmpeg-source: ffmpeg
1070
	tar cv --exclude=.svn ffmpeg | bzip2 > ffmpeg-$(DATE).tar.bz2
1071 1072 1073 1074

SOURCE += ffmpeg-source
endif

1075
CLEAN_FILE += .ffmpeg
1076
CLEAN_PKG += ffmpeg
1077 1078 1079 1080 1081 1082
DISTCLEAN_PKG += ffmpeg-$(FFMPEG_VERSION).tar.gz

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

1083 1084 1085
libdvdcss-$(LIBDVDCSS_VERSION).tar.gz:
	$(WGET) $(LIBDVDCSS_URL)

1086
ifdef SVN
1087
libdvdcss:
1088
	$(SVN) co svn://svn.videolan.org/libdvdcss/trunk libdvdcss
1089
	cd $@ && sh bootstrap
1090
else
1091
libdvdcss: libdvdcss-$(LIBDVDCSS_VERSION).tar.gz
1092
	$(EXTRACT_GZ)
1093
endif
1094 1095

.dvdcss: libdvdcss
1096 1097 1098
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --disable-doc --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
1099

1100 1101
ifdef SVN
libdvdcss-source: libdvdcss
1102
	tar cv --exclude=.svn libdvdcss | bzip2 > libdvdcss-$(DATE).tar.bz2
1103 1104 1105 1106

SOURCE += libdvdcss-source
endif

1107 1108 1109 1110
CLEAN_FILE += .dvdcss
CLEAN_PKG += libdvdcss
DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.gz

1111 1112 1113
# ***************************************************************************
# dummy dvdread to trigger the INSTALL_NAME script
# ***************************************************************************
1114 1115 1116
# .dvdread: .dvdnav
# 	$(INSTALL_NAME)
# 	touch $@
1117
#
1118 1119 1120 1121 1122 1123 1124
# CLEAN_FILE += .dvdread

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


1125
libdvdread:
1126 1127
	$(SVN) co $(LIBDVDREAD_SVN)  libdvdread
	(cd $@; patch  -p 0 < ../Patches/libdvdread.patch)
1128
ifdef HAVE_WIN32
1129
	(cd $@; patch  -p 0 < ../Patches/libdvdread-win32.patch)
1130
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1131
	(cd $@; sh autogen.sh noconfig)
1132 1133

.libdvdread: libdvdread .dvdcss
1134
	(cd libdvdread; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --with-libdvdcss=$(PREFIX) && make && make install)
1135 1136
	$(INSTALL_NAME)
	touch $@
1137

1138 1139
CLEAN_FILE += .libdvdread
CLEAN_PKG += libdvdread
1140
#DISTCLEAN_PKG += libdvdread-$(LIBDVDREAD_VERSION).tar.gz
1141 1142 1143 1144 1145

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

1146 1147
ifdef SVN
libdvdnav:
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1148
	$(SVN) co $(LIBDVDNAV_SVN)  libdvdnav
1149
	patch -d libdvdnav -p0 < Patches/libdvdnav.patch
1150 1151
	(cd $@; ./autogen.sh noconfig)
else
1152
libdvdnav-$(LIBDVDNAV_VERSION).tar.gz:
1153
	$(WGET) $(LIBDVDNAV_URL)
1154

1155 1156
libdvdnav: libdvdnav-$(LIBDVDNAV_VERSION).tar.gz
	$(EXTRACT_GZ)
1157
	patch -p0 < Patches/libdvdnav.patch
1158 1159 1160
ifdef HAVE_WIN32
	patch -p0 < Patches/libdvdnav-win32.patch
endif
1161
	(cd $@; ./autogen.sh noconfig)
1162
endif
1163

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1164
.dvdnav: libdvdnav .libdvdread
1165
ifdef HAVE_WIN32
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1166
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) && make && make install)
1167
else
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1168
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --enable-static --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -Dlseek64=lseek -Doff64_t=off_t" && make && make install)
1169
endif
1170 1171
	$(INSTALL_NAME)
	touch $@
1172 1173 1174

CLEAN_FILE += .dvdnav
CLEAN_PKG += libdvdnav
1175
DISTCLEAN_PKG += libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2
1176 1177 1178 1179 1180

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

1181
libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz:
1182
	$(WGET) $(LIBDVBPSI_URL)
1183

1184
libdvbpsi: libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1185
	$(EXTRACT_GZ)
1186 1187

.dvbpsi: libdvbpsi
1188 1189 1190
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd src && make && make install)
	$(INSTALL_NAME)
	touch $@
1191 1192 1193

CLEAN_FILE += .dvbpsi
CLEAN_PKG += libdvbpsi
1194
DISTCLEAN_PKG += libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1195 1196 1197 1198 1199

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

1200
live555-$(LIVEDOTCOM_VERSION).tar.gz:
1201
	$(WGET) $(LIVEDOTCOM_URL)
1202

1203
live: live555-$(LIVEDOTCOM_VERSION).tar.gz
1204
	$(EXTRACT_GZ)
1205
	patch -p0 < Patches/live-noapps.patch
1206
	patch -p0 < Patches/live-uselocale.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1207 1208 1209
ifdef HAVE_WIN64
	patch -p0 < Patches/live-win64.patch
endif
1210 1211

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

CLEAN_FILE += .live
CLEAN_PKG += live
1243
DISTCLEAN_PKG += live555-$(LIVEDOTCOM_VERSION).tar.gz
1244 1245 1246 1247 1248 1249

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

goom$(GOOM2k4_VERSION).tar.gz:
1250 1251
	$(WGET) $(GOOM2k4_URL)
	mv goom-$(GOOM2k4_VERSION)-src.tar.gz goom$(GOOM2k4_VERSION).tar.gz
1252 1253

goom: goom$(GOOM2k4_VERSION).tar.gz
1254
	$(EXTRACT_GZ)
1255
ifdef HAVE_WIN32
1256
	(cd $@; dos2unix configure.in)
Rafaël Carré's avatar
Rafaël Carré committed
1257
	patch -p0 < Patches/goom2k4-0-win32.patch
1258 1259
else
	patch -p0 < Patches/goom2k4-0-mmx.patch
1260
endif
1261
	patch -p0 < Patches/goom2k4-0-memleaks.patch
1262
	patch -p0 < Patches/goom2k4-autotools.patch
1263
	(cd $@; rm -f configure; ACLOCAL="aclocal -I m4/" autoreconf -ivf)
1264 1265

.goom2k4: goom
1266
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --disable-glibtest --disable-gtktest && make && make install)
1267
	touch $@
1268 1269 1270

CLEAN_FILE += .goom2k4
CLEAN_PKG += goom
1271
DISTCLEAN_PKG += goom$(GOOM2k4_VERSION).tar.gz
1272 1273 1274 1275 1276 1277

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

libcaca-$(LIBCACA_VERSION).tar.gz:
1278
	$(WGET) $(LIBCACA_URL)
1279 1280

libcaca: libcaca-$(LIBCACA_VERSION).tar.gz
1281
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
1282
	patch -p0 < Patches/libcaca-static.patch
1283
ifdef HAVE_DARWIN_OS
1284 1285
	patch -p0 < Patches/libcaca-osx-sdkofourchoice.patch
	(cd $@; sed -e 's%/Developer/SDKs/MacOSX10.4u.sdk%$(MACOSX_SDK)%' -i.orig  configure)
1286
endif
1287 1288

.caca: libcaca
1289
ifdef HAVE_WIN32
1290
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-win32 --disable-x11 --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx && make && make install)
1291
else
1292
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx && make && make install)
1293
endif
1294
	touch $@
1295 1296 1297 1298 1299 1300

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

# ***************************************************************************
Antoine Cellerier's avatar
Antoine Cellerier committed
1301
# libdca
1302 1303
# ***************************************************************************

1304 1305 1306 1307 1308
libdca-$(LIBDCA_VERSION).tar.bz2:
	$(WGET) $(LIBDCA_URL)

libdca: libdca-$(LIBDCA_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1309 1310 1311
ifdef HAVE_DARWIN_9
	( cd $@; patch -p0 < ../Patches/libdca-llvm-gcc.patch )
endif
1312

1313
.dca: libdca
1314
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1315
	$(INSTALL_NAME)
1316
	touch $@
1317

1318
CLEAN_FILE += .dca
Antoine Cellerier's avatar
Antoine Cellerier committed
1319
CLEAN_PKG += libdca
1320
DISTCLEAN_PKG += libdca-$(LIBDCA_VERSION).tar.bz2
1321

1322
# ***************************************************************************
1323
# libx264
1324 1325
# ***************************************************************************

1326 1327 1328
x264-$(X264_VERSION).tar.gz:
	$(WGET) $(X264_URL)

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338
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

else

1339
x264: x264-$(X264_VERSION).tar.gz
1340
	$(EXTRACT_GZ)
1341
ifdef HAVE_WIN32
1342
  ifndef HAVE_CYGWIN
Rafaël Carré's avatar
Rafaël Carré committed
1343
	(cd x264;patch -p0 <../Patches/x264-20050624-win32.patch)
1344
  endif
1345
else
Rafaël Carré's avatar
Rafaël Carré committed
1346
	patch -p0 < Patches/x264.patch
1347
	rm x264/x264.c
1348
endif
1349
endif
1350

1351 1352
ifdef HAVE_WIN32
.x264: x264 .pthreads
1353 1354 1355
  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
1356
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" --enable-pthread && make && make install)
1357
  endif
1358
else
1359
ifdef HAVE_DARWIN_OS_ON_INTEL
1360
  .x264: x264 .yasm
1361
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1362 1363
else
  .x264: x264
1364
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1365
endif
1366
endif
1367
	touch $@
1368

1369
ifdef GIT
1370
x264-source: x264
1371 1372
	cd x264 && \
	git archive --format=tar HEAD | bzip2 > ../x264-$(DATE).tar.bz2
1373

1374
SOURCE += x264-source
1375 1376
endif

1377 1378 1379 1380
CLEAN_FILE += .x264
CLEAN_PKG += x264
DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz

1381 1382 1383 1384 1385
# ***************************************************************************
# libmodplug
# ***************************************************************************

libmodplug-$(MODPLUG_VERSION).tar.gz:
1386
	$(WGET) $(MODPLUG_URL)
1387 1388

libmodplug: libmodplug-$(MODPLUG_VERSION).tar.gz
1389
	$(EXTRACT_GZ)
1390
ifdef HAVE_WIN32
1391
	patch -p0 < Patches/libmodplug-win32.patch
1392
	(cd $@; autoreconf -ivf )
1393
endif
1394 1395

.mod: libmodplug
1396 1397
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
	touch $@
1398 1399 1400 1401 1402 1403 1404 1405 1406

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

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

1407
libcddb-$(CDDB_VERSION).tar.bz2:
1408
	$(WGET) $(CDDB_URL)
1409

1410
libcddb: libcddb-$(CDDB_VERSION).tar.bz2
1411
	$(EXTRACT_BZ2)
1412 1413 1414 1415 1416
	(cd $@; patch -p0 < ../Patches/libcddb-cross.patch )
ifdef HAVE_WIN32
	(cd $@; patch -p0 < ../Patches/libcddb-win32.patch )
endif
	(cd $@; autoreconf -fisv)
1417

1418 1419
ifdef HAVE_WIN32
.cddb: libcddb .regex
1420
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --without-iconv CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" && make && make install)
1421
else
1422
.cddb: libcddb
1423
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" LDFLAGS="$(LDFLAGS) -liconv" && make && make install)
1424
endif
1425
	touch $@
1426 1427 1428

CLEAN_FILE += .cddb
CLEAN_PKG += libcddb
1429
DISTCLEAN_PKG += libcddb-$(CDDB_VERSION).tar.bz2
1430 1431 1432 1433 1434 1435

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

vcdimager-$(VCDIMAGER_VERSION).tar.gz:
1436
	$(WGET) $(VCDIMAGER_URL)
1437 1438

vcdimager: vcdimager-$(VCDIMAGER_VERSION).tar.gz
1439
	$(EXTRACT_GZ)
1440 1441 1442

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

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

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

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

libcdio: libcdio-$(CDIO_VERSION).tar.gz
1463
	$(EXTRACT_GZ)
1464
	patch -p0 < Patches/libcdio-install-cdparanoia-pc.patch
1465 1466 1467
ifdef HAVE_DARWIN_OS
	patch -p0 < Patches/libcdio-modernOSX.patch
endif
1468 1469

.cdio: libcdio
1470
	(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)
1471
	touch $@
1472 1473 1474 1475 1476

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

1477 1478 1479 1480
# ***************************************************************************
# qt4 (win32 binary)
# ***************************************************************************

1481
qt4-$(QT4_VERSION)-win32-bin.tar.bz2:
1482
	$(WGET) $(QT4_URL)
Clément Stenac's avatar
Clément Stenac committed
1483

1484
qt4_win32: qt4-$(QT4_VERSION)-win32-bin.tar.bz2
1485
	$(EXTRACT_BZ2)
1486
	chmod -R 755 qt4_win32
Clément Stenac's avatar
Clément Stenac committed
1487

1488
.qt4_win32: qt4_win32
1489
	(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)
1490
ifeq ($(BUILD),i686-pc-cygwin)
1491
	(cd qt4_win32;cp bin/*.exe $(PREFIX)/bin)
1492
else
1493
	(cd qt4_win32;cp bin/* $(PREFIX)/bin)
1494
endif
1495
	touch $@
Clément Stenac's avatar
Clément Stenac committed
1496

1497 1498
CLEAN_FILE += .qt4_win32
CLEAN_PKG += qt4_win32
1499
DISTCLEAN_PKG += qt4-$(QT4_VERSION)-win32-bin.tar.bz2
Clément Stenac's avatar
Clément Stenac committed
1500

1501 1502 1503 1504 1505 1506 1507
# ***************************************************************************
# qt4 (trolltech binaries)
# ***************************************************************************

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

1508
Qt_win32: qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1509
	mkdir Qt
1510
	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
1511 1512 1513
	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 {} \;
1514
	find Qt/translations -type f -a ! -name 'qt_*.qm' -exec rm {} \;
1515 1516 1517 1518
	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
1519

1520
.Qt_win32: Qt_win32
1521
	mkdir -p $(PREFIX)/bin $(PREFIX)/include/qt4/src $(PREFIX)/lib/pkgconfig $(PREFIX)/share/qt4/translations
1522 1523 1524 1525
	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
1526
	cp Qt/lib/pkgconfig/* $(PREFIX)/lib/pkgconfig
1527
	cp Qt/translations/* $(PREFIX)/share/qt4/translations
1528
	touch $@
1529

1530 1531
CLEAN_FILE += .Qt_win32
CLEAN_PKG += Qt_win32
1532
DISTCLEAN_PKG += qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1533

1534 1535 1536 1537
# ***************************************************************************
# qt4 (source-code compilation for Mac)
# ***************************************************************************

1538
qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz:
1539 1540
	$(WGET) $(QT4_MAC_URL)

1541
qt4_mac: qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz
1542 1543 1544
	$(EXTRACT_GZ)

.qt4_mac: qt4_mac
1545
	(cd qt4_mac; ./configure -prefix $(PREFIX) -release -fast -no-qt3support -nomake "examples demos" -sdk $(MACOSX_SDK) -no-framework -arch $(ARCH) && make && make install)
1546 1547 1548 1549
	touch $@

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

1552 1553 1554 1555 1556
# ***************************************************************************
# zlib
# ***************************************************************************

zlib-$(ZLIB_VERSION).tar.gz:
1557
	$(WGET) $(ZLIB_URL)
1558 1559

zlib: zlib-$(ZLIB_VERSION).tar.gz
1560
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
1561
	patch -p0 < Patches/zlib.patch
1562 1563

.zlib: zlib
1564 1565 1566
	(cd zlib; $(HOSTCC2) ./configure --prefix=$(PREFIX) && make install)
	$(INSTALL_NAME)
	touch $@
1567 1568 1569 1570 1571

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

1572
# ***************************************************************************
1573
# PortAudio
1574 1575 1576
# ***************************************************************************

pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz:
1577
	$(WGET) $(PORTAUDIO_URL)
1578 1579

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

1585
.portaudio: portaudio
1586 1587 1588
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make  install)
	$(INSTALL_NAME)
	touch $@
1589 1590 1591

CLEAN_FILE += .portaudio
CLEAN_PKG += portaudio
1592
DISTCLEAN_PKG += pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1593

1594 1595 1596 1597 1598
# ***************************************************************************
# xml
# ***************************************************************************

libxml2-$(XML_VERSION).tar.gz:
1599
	$(WGET) $(XML_URL)
1600 1601

xml: libxml2-$(XML_VERSION).tar.gz
1602
	$(EXTRACT_GZ)
Jean-Paul Saman's avatar
Jean-Paul Saman committed
1603 1604 1605
ifdef HAVE_UCLIBC
	patch -p0 < Patches/xml2-uclibc.patch
endif
1606

1607
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
1608

1609
.xml: xml
1610
  ifdef HAVE_CYGWIN
1611
	(cd xml; ac_cv_header_pthread_h="no" CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1612
  else
1613
	(cd xml; CFLAGS="-DLIBXML_STATIC" $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(XMLCONF) && make && make install)
1614
  endif
1615
ifndef HAVE_DARWIN_OS
1616
	$(INSTALL_NAME)
1617
endif
1618
	touch $@
1619 1620 1621 1622 1623

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

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

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

twolame: twolame-$(TWOLAME_VERSION).tar.gz
1632
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
1633
ifdef HAVE_WIN32
1634
	(cd twolame/win32; $(WGET) "http://twolame.svn.sourceforge.net/viewvc/*checkout*/twolame/trunk/win32/winutil.h")
1635
endif
1636 1637

.twolame: twolame
1638
	(cd twolame; $(HOSTCC) CFLAGS="${CFLAGS}  -DLIBTWOLAME_STATIC" ./configure $(HOSTCONF) --prefix=$(PREFIX) &&  make && make install)
1639 1640
	$(INSTALL_NAME)
	touch $@
1641 1642 1643

CLEAN_FILE += .twolame
CLEAN_PKG += twolame
1644
DISTCLEAN_PKG += twolame-$(TWOLAME_VERSION).tar.gz
1645 1646 1647 1648 1649 1650

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

libpng-$(PNG_VERSION).tar.bz2:
1651
	$(WGET) $(PNG_URL)
1652 1653

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

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

CLEAN_FILE += .png
CLEAN_PKG += libpng
1684
DISTCLEAN_PKG += libpng-$(PNG_VERSION).tar.bz2
1685 1686 1687 1688 1689 1690

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

zvbi-$(ZVBI_VERSION).tar.bz2:
1691
	$(WGET) $(ZVBI_URL)
1692 1693

zvbi: zvbi-$(ZVBI_VERSION).tar.bz2
1694
	$(EXTRACT_BZ2)
1695
ifdef HAVE_WIN32
1696
	(cd $@; patch -p1 < ../Patches/zvbi-win32.patch; patch -p1 < ../Patches/zvbi-makefile.patch; autoreconf -ivf)
1697
endif
1698

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

CLEAN_FILE += .zvbi
CLEAN_PKG += zvbi
1718
DISTCLEAN_PKG += zvbi-$(ZVBI_VERSION).tar.bz2
1719 1720

# ***************************************************************************
1721 1722 1723 1724 1725 1726 1727 1728 1729
# libraw1394
# ***************************************************************************

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

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

1730
.raw1394: libraw1394
1731
	(cd $<; ./configure --prefix=$(PREFIX) && make && make DESTDIR=$(PREFIX) install)
1732
#	sed 's/^typedef u_int8_t  byte_t;/\/* typedef u_int8_t  byte_t;\*\//'
1733
	touch $@
1734

1735
CLEAN_FILE += .raw1394
1736
CLEAN_PKG += libraw1394
1737
DISTCLEAN_PKG += libraw1394-$(LIBRAW1394_VERSION).tar.gz
1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748

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

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

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

1749
.dc1394: libdc1394
1750 1751
	(cd $<; ./configure --prefix=$(PREFIX) && \
	 patch -p1 < ../Patches/libdc1394-noexamples.patch && \
1752
	 make && make DESTDIR=$(PREFIX) install)
1753
	touch $@
1754

1755
CLEAN_FILE += .dc1394
1756
CLEAN_PKG += libdc1394
1757
DISTCLEAN_PKG += libdc1394-$(LIBDC1394_VERSION).tar.gz
1758 1759

# ***************************************************************************
1760
# gpg-error
1761 1762
# ***************************************************************************

1763
libgpg-error-$(GPGERROR_VERSION).tar.bz2:
1764
	$(WGET) $(GPGERROR_URL)
1765

1766 1767
libgpg-error: libgpg-error-$(GPGERROR_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1768

1769
.gpg-error: libgpg-error
1770
ifdef HAVE_DARWIN_OS_ON_INTEL
1771
	(cd $<; ./autogen.sh)
1772
endif
1773
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls --disable-shared --disable-languages && make && make install)
1774 1775
#	$(INSTALL_NAME)
	touch $@
1776

1777
CLEAN_FILE += .gpg-error
1778
CLEAN_PKG += libgpg-error
1779
DISTCLEAN_PKG += libgpg-error-$(GPGERROR_VERSION).tar.bz2
1780 1781 1782 1783 1784

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

1785
libgcrypt-$(GCRYPT_VERSION).tar.bz2:
1786
	$(WGET) $(GCRYPT_URL)
1787

1788
libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2
1789
	$(EXTRACT_BZ2)
Rafaël Carré's avatar
Rafaël Carré committed
1790
	patch -p0 < Patches/gcrypt.patch
1791

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

1794
.gcrypt: libgcrypt .gpg-error
1795
ifdef HAVE_WIN32
1796
	(cd $<; ./autogen.sh && $(HOSTCC) ./configure $(HOSTCONF) --target=i586-mingw32msvc --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(CIPHDIG) --disable-shared --enable-static --disable-nls && make && make install)
1797
else
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1798
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS) -lgpg-error" $(CIPHDIG) && make && make install)
1799
endif
1800 1801
	$(INSTALL_NAME)
	touch $@
1802 1803 1804

CLEAN_FILE += .gcrypt
CLEAN_PKG += libgcrypt
1805
DISTCLEAN_PKG += libgcrypt-$(GCRYPT_VERSION).tar.bz2
1806

1807 1808 1809 1810 1811 1812 1813
# ***************************************************************************
# opencdk (requires by gnutls 2.x)
# ***************************************************************************

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

1814
opencdk: opencdk-$(OPENCDK_VERSION).tar.bz2
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824
	$(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

1825 1826 1827 1828 1829
# ***************************************************************************
# gnutls
# ***************************************************************************

gnutls-$(GNUTLS_VERSION).tar.bz2:
1830
	$(WGET) $(GNUTLS_URL)
1831 1832

gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2
1833
	$(EXTRACT_BZ2)
1834
ifdef HAVE_WIN32
1835
	patch -p0 < Patches/gnutls-win32.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1836
	(cd $@; autoreconf)
1837
endif
1838

1839
.gnutls: gnutls .gcrypt .gpg-error
1840
ifdef HAVE_WIN32
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1841
	(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 )
1842
else
1843
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --disable-cxx --with-included-opencdk --disable-guile && make && make install)
1844
endif
1845 1846
	$(INSTALL_NAME)
	touch $@
1847 1848 1849

CLEAN_FILE += .gnutls
CLEAN_PKG += gnutls
1850
DISTCLEAN_PKG += gnutls-$(GNUTLS_VERSION).tar.bz2
1851 1852 1853 1854 1855 1856

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

libopendaap-$(DAAP_VERSION).tar.bz2:
1857
	$(WGET) $(DAAP_URL)
1858 1859

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

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

1868
CLEAN_FILE += .opendaap
1869
CLEAN_PKG += libopendaap
1870
DISTCLEAN_PKG += libopendaap-$(DAAP_VERSION).tar.bz2
1871 1872 1873 1874 1875

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

1876
glib-$(GLIB_VERSION).tar.bz2:
1877
	$(WGET) $(GLIB_URL)
1878

1879 1880
glib: glib-$(GLIB_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1881
	(cd $@; patch -p0 < ../Patches/glib-remove-gtkdoc.patch)
1882
ifdef HAVE_DARWIN_64
1883 1884
	(cd $@; patch -p0 < ../Patches/glib-Darwin64.patch)
endif
1885 1886

.glib: glib
1887
	(cd $<; sh autogen.sh --prefix=$(PREFIX) --host=$(HOST) && make && make install)
1888
	touch $@
1889

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

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

1898
libIDL-$(LIBIDL_VERSION).tar.bz2:
1899
	$(WGET) $(LIBIDL_URL)
1900

1901 1902
libIDL: libIDL-$(LIBIDL_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1903

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

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

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

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

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

.gecko: gecko-sdk
1923 1924 1925
	rm -rf ../gecko-sdk
	mv gecko-sdk ..
	mkdir gecko-sdk #creating an empty dir is faster than copying the whole dir
1926 1927
	(cd $<)
	touch $@
1928 1929 1930

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

1933 1934 1935 1936
# ***************************************************************************
# Gecko SDK win32
# ***************************************************************************

1937
gecko-sdk-i586-pc-msvc-1.8b1.zip:
1938
	$(WGET) $(GECKO_SDK_WIN32_URL)
1939 1940

libIDL-0.6.3-win32-bin.zip:
1941
	$(WGET) $(LIBIDL_WIN32_BIN_URL)
1942

1943
glib-19990228.zip:
1944
	$(WGET) $(GLIB_WIN32_BIN_URL)
1945

1946
.gecko-win32: gecko-sdk-i586-pc-msvc-1.8b1.zip libIDL-0.6.3-win32-bin.zip glib-19990228.zip
1947 1948 1949 1950 1951 1952 1953
	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 $@
1954 1955 1956

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

1959
# ***************************************************************************
1960
# mozilla-macosx
1961 1962 1963 1964
#
# 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!
1965 1966
# ***************************************************************************

1967
firefox-$(MOZILLA_VERSION)-source.tar.bz2:
1968
	$(WGET) $(MOZILLA_URL)
1969

1970
mozilla: firefox-$(MOZILLA_VERSION)-source.tar.bz2
1971
	$(EXTRACT_BZ2)
1972
	(cd $@; patch -p0 < ../Patches/firefox-darwin.patch)
1973

1974 1975 1976 1977 1978 1979
.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)
1980
	touch $@
1981

1982
CLEAN_FILE += .mozilla-macosx
1983 1984
CLEAN_PKG += mozilla
DISTCLEAN_PKG += firefox-source-$(MOZILLA_VERSION).tar.bz2
1985

1986 1987 1988 1989
# ***************************************************************************
# libjpeg
# ***************************************************************************

1990
jpegsrc.v$(JPEG_VERSION).tar.gz:
1991
	$(WGET) $(JPEG_URL)
1992

1993
jpeg-7: jpegsrc.v$(JPEG_VERSION).tar.gz
1994
	$(EXTRACT_GZ)
1995

1996 1997
.jpeg: jpeg-7
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" $(HOSTCC) && make && make install)
1998 1999
	$(RANLIB) $(PREFIX)/lib/libjpeg.a
	touch $@
2000 2001

CLEAN_FILE += .jpeg
2002 2003
CLEAN_PKG += jpeg-7
DISTCLEAN_PKG += jpegsrc.v$(JPEG_VERSION).tar.gz
2004 2005 2006 2007 2008 2009

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

tiff-$(TIFF_VERSION).tar.gz:
2010
	$(WGET) $(TIFF_URL)
2011

2012
tiff: tiff-$(TIFF_VERSION).tar.gz
2013
	$(EXTRACT_GZ)
2014 2015

.tiff: tiff
2016
ifdef HAVE_WIN32
2017
	(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)
2018
else
2019
	(cd $<; ./configure --with-CFLAGS="$(CFLAGS)" --with-JPEG=no --with-ZIP=no --prefix=$(PREFIX) && make -C port &&make -C libtiff && make -C libtiff install)
2020
endif
2021
	$(INSTALL_NAME)
2022
	touch $@
2023 2024 2025 2026 2027 2028

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

# ***************************************************************************
2029
# LibSDL
2030 2031
# ***************************************************************************

2032
ifndef HAVE_DARWIN_OS
2033
SDL-$(SDL_VERSION).tar.gz:
2034
	$(WGET) $(SDL_URL)
2035

2036
SDL: SDL-$(SDL_VERSION).tar.gz
2037
	$(EXTRACT_GZ)
2038
else
2039
SDL:
2040 2041 2042
	$(SVN) co http://svn.libsdl.org/trunk/SDL -r 4444 SDL
	(cd $@; sh autogen.sh)
endif
2043 2044

.SDL: SDL
2045 2046 2047
	(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 $@
2048 2049 2050 2051 2052 2053 2054 2055 2056 2057

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

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

SDL_image-$(SDL_IMAGE_VERSION).tar.gz:
2058
	$(WGET) $(SDL_IMAGE_URL)
2059

2060
SDL_image: SDL_image-$(SDL_IMAGE_VERSION).tar.gz
2061
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
2062
	patch -p0 < Patches/SDL_image.patch
2063 2064

.SDL_image: SDL_image .SDL .png .jpeg .tiff
2065 2066 2067
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --enable-tif --disable-sdltest && make && make install)
	$(INSTALL_NAME)
	touch $@
2068 2069 2070 2071 2072

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

2073 2074 2075 2076 2077
# ***************************************************************************
# Musepack decoder library (libmpcdec)
# ***************************************************************************

libmpcdec-$(MUSE_VERSION).tar.bz2:
2078
	$(WGET) $(MUSE_URL)
2079

2080
mpcdec: libmpcdec-$(MUSE_VERSION).tar.bz2
2081
	$(EXTRACT_BZ2)
2082
	patch -p0 < Patches/mpcdec.patch
2083
	(cd $@; autoreconf -ivf)
2084

2085
.mpcdec: mpcdec
2086
ifdef HAVE_WIN32
2087
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS=-D_PTRDIFF_T=mpc_int32_t && make && make install)
2088
else
2089
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2090 2091
endif
ifdef HAVE_DARWIN_OS
2092
	$(INSTALL_NAME)
2093
endif
2094
	touch $@
2095

2096 2097
CLEAN_FILE += .mpcdec
CLEAN_PKG += mpcdec
2098 2099
DISTCLEAN_PKG += libmpcdec-$(MUSE_VERSION).tar.bz2

2100
# ***************************************************************************
2101 2102
# Dirac
# ***************************************************************************
2103 2104

dirac-$(DIRAC_VERSION).tar.gz:
2105
	$(WGET) $(DIRAC_URL)
2106 2107

dirac: dirac-$(DIRAC_VERSION).tar.gz
2108
	$(EXTRACT_GZ)
2109
ifdef HAVE_CYGWIN
2110
	# incorrect compile warning with cygwin compiler 3.4.4
2111 2112
	patch -p0 <Patches/dirac-cygwin.patch
endif
2113
ifndef HAVE_DARWIN_OS
2114
	(cd $@; aclocal -I m4 && autoconf && automake)
2115 2116 2117
else
	(cd $@; ./bootstrap)
endif
2118

2119 2120 2121 2122
DIRAC_SUBDIRS = libdirac_byteio libdirac_common libdirac_motionest libdirac_encoder libdirac_decoder

ifdef HAVE_WIN32
DIRAC_SUBDIRS += win32
2123
endif
2124

2125
.dirac: dirac
2126
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  CFLAGS="$(CFLAGS)" && DOC_DIR="" make $(DIRAC_SUBDIRS) && DOC_DIR="" make install)
2127
	touch $@
2128 2129 2130

# for MacOS X, dirac is split into two libraries, which needs be installed using two targets
.dirac_encoder: .dirac
2131 2132
	$(INSTALL_NAME)
	touch $@
2133 2134

.dirac_decoder: .dirac
2135 2136
	$(INSTALL_NAME)
	touch $@
2137 2138 2139 2140 2141 2142 2143 2144 2145

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

# *************************************************************************
# DirectX headers
# *************************************************************************
win32-dx7headers.tgz:
2146
	$(WGET) $(DX_HEADERS_URL)
2147
.dx_headers: win32-dx7headers.tgz
2148 2149
	(cd ../include ; tar xzf ../src/$<)
	touch $@
2150 2151
CLEAN_FILE += .dx_headers
DISTCLEAN_PKG += win32-dx7headers.tgz
2152

2153 2154 2155 2156
# *************************************************************************
# DirectShow headers
# *************************************************************************
dshow-headers.tgz:
2157
	$(WGET) $(DSHOW_HEADERS_URL)
2158
.dshow_headers: dshow-headers.tgz
2159 2160
	(cd ../include ; tar xzf ../src/$<)
	touch $@
2161 2162
CLEAN_FILE += .dshow_headers
DISTCLEAN_PKG += dshow-headers.tgz
2163 2164 2165 2166 2167 2168

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

expat-$(EXPAT_VERSION).tar.gz:
2169
	$(WGET) $(EXPAT_URL)
2170 2171

expat: expat-$(EXPAT_VERSION).tar.gz
2172
	$(EXTRACT_GZ)
2173 2174

.expat: expat
2175
ifdef HAVE_DARWIN_OS
2176
	(cd $< aclocal --force && libtoolize --force && autoconf --force && autoheader --force )
2177
endif
2178 2179
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
2180 2181 2182 2183 2184 2185 2186 2187 2188 2189

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

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

clinkcc$(CLINKCC_VERSION).tar.gz:
2190
	$(WGET) $(CLINKCC_URL)
2191 2192

clinkcc: clinkcc$(CLINKCC_VERSION).tar.gz
2193 2194 2195
	tar xzf $<
	mv $(patsubst %.tar.gz,Cyberlink,$(patsubst %.tgz,Cyberlink,$(notdir $<))) $@ || true
	touch $@
Rafaël Carré's avatar
Rafaël Carré committed
2196
	patch -p0 < Patches/clinkcc.patch
2197
ifdef HAVE_DARWIN_OS
Rafaël Carré's avatar
Rafaël Carré committed
2198
	patch -p0 < Patches/clinkcc_osx.patch
2199
endif
2200
	(cd $@; ./bootstrap)
2201 2202

.clinkcc: clinkcc
2203
	(cd $<;./configure --prefix=$(PREFIX) --enable-expat && make && chmod 755 config/install-sh && make install )
2204
	touch $@
2205 2206 2207

CLEAN_FILE += .clinkcc
CLEAN_PKG += clinkcc
2208
DISTCLEAN_PKG += clinkcc$(CLINKCC_VERSION).tar.gz
2209

2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220
# ***************************************************************************
# YASM assembler
# ***************************************************************************

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

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

.yasm: yasm
2221
	(cd $< && $(HOSTCC) ./configure --prefix=$(PREFIX) --host=$(HOST) && make && make install)
2222 2223 2224 2225
	touch $@

CLEAN_FILE += .yasm
CLEAN_PKG += yasm
2226
DISTCLEAN_PKG += yasm-$(YASM_VERSION).tar.gz
2227

2228
# ***************************************************************************
2229 2230 2231 2232 2233 2234 2235 2236 2237 2238
# kate
# ***************************************************************************

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

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

.kate: libkate .ogg
2239
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-valgrind --disable-doc && make && make install)
2240 2241 2242 2243 2244 2245 2246
	$(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
2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265
# ***************************************************************************
# 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

2266
# ***************************************************************************
2267 2268 2269 2270 2271 2272
# Copy aclocal files
# This is necessary for --missing aclocal to succeed after a
# configure.ac/Makefile.am change in the vlc root dir
# **************************************************************************

.aclocal:
2273 2274
	cp -R $(PREFIX)/share/aclocal/* $(PREFIX)/../../m4/
	touch $@
2275

Felix Paul Kühne's avatar
Felix Paul Kühne committed
2276
CLEAN_FILE += .aclocal
2277

2278 2279 2280 2281 2282
# ***************************************************************************
# TagLib read and editing of tags of popular audio formats
# ***************************************************************************

taglib-$(TAGLIB_VERSION).tar.gz:
2283
	$(WGET) $(TAGLIB_URL)
2284 2285

taglib: taglib-$(TAGLIB_VERSION).tar.gz
2286
	$(EXTRACT_GZ)
2287
ifdef HAVE_WIN32
2288
	patch -p0 < Patches/taglib-static.patch
2289
endif
2290
ifdef HAVE_CYGWIN
2291
	patch -p0 < Patches/taglib-cygwin.patch
2292
endif
2293 2294

.tag: taglib
2295
	(cd $<; $(HOSTCC)  ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2296 2297
	$(INSTALL_NAME)
	touch $@
2298

2299 2300 2301 2302 2303 2304 2305
CLEAN_FILE += .tag
CLEAN_PKG += taglib
DISTCLEAN_PKG += taglib-$(TAGLIB_VERSION).tar.gz

# ***************************************************************************
# pthreads for win32
# ***************************************************************************
Christophe Mutricy's avatar
Christophe Mutricy committed
2306 2307 2308 2309 2310 2311

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

.pthreads: pthreads
Christophe Mutricy's avatar
Christophe Mutricy committed
2315
	(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
2316 2317 2318
	$(INSTALL_NAME)
	touch $@

2319 2320 2321
CLEAN_FILE += .pthreads
CLEAN_PKG += pthreads
DISTCLEAN_PKG += pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
2322

2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339
# ***************************************************************************
# 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
2340

2341 2342 2343 2344 2345 2346 2347 2348 2349
# ***************************************************************************
# FluidSynth library (Midi)
# ***************************************************************************

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

fluidsynth: fluidsynth-$(FLUID_VERSION).tar.gz
	$(EXTRACT_GZ)
2350 2351
ifdef HAVE_WIN32
	patch -p0 < Patches/fluid-win32.patch
2352
	cd $@; ./autogen.sh || true
2353
endif
2354 2355 2356 2357 2358 2359 2360

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

CLEAN_FILE += .fluid
CLEAN_PKG += fluidsynth
2361
DISTCLEAN_PKG += fluidsynth-$(FLUID_VERSION).tar.gz
2362

2363 2364 2365 2366 2367 2368 2369 2370 2371
# ***************************************************************************
# liboil
# ***************************************************************************

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

liboil: liboil-$(OIL_VERSION).tar.gz
	$(EXTRACT_GZ)
2372
	patch -d liboil -p1 < Patches/liboil-noshared.patch
2373
	patch -d liboil -p1 < Patches/liboil-win64.patch
2374 2375 2376
	patch -d liboil -p1 < Patches/liboil-Xcompile.patch
	(cd $@; autoreconf)

2377

2378 2379

.liboil: liboil
2380
ifdef HAVE_DARWIN_OS
2381
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)")
2382 2383 2384 2385
else
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O2")
endif
	(cd $<; make && make install)
2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401
	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)

2402
.schroedinger: schroedinger .liboil
2403
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --with-thread=none --disable-gstreamer --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make -C schroedinger && make -C schroedinger install)
2404 2405 2406 2407 2408
	touch $@

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

2410 2411 2412 2413 2414 2415 2416
# ***************************************************************************
# ASS library
# ***************************************************************************

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

2417 2418
libass:
	$(GIT) clone $(ASS_GIT)
2419
	(cd $@; autoreconf -ivf)
2420

2421
.libass: libass .freetype
2422
	(cd $<; $(HOSTCC) ./configure --disable-png $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make && make install)
2423 2424
	touch $@

2425 2426 2427
CLEAN_FILE += .libass
CLEAN_PKG += libass
DISTCLEAN_PKG += libass-$(ASS_VERSION).tar.bz2
2428

2429 2430 2431 2432
# ***************************************************************************
# Sparkle
# ***************************************************************************

Rafaël Carré's avatar
Rafaël Carré committed
2433
Sparkle-$(SPARKLE_VERSION).zip:
2434 2435
	$(WGET) $(SPARKLE_URL)

Rafaël Carré's avatar
Rafaël Carré committed
2436
.Sparkle: Sparkle-$(SPARKLE_VERSION).zip
2437 2438 2439 2440 2441 2442 2443 2444
	rm -rf $@ || true
	unzip $<
	rm -rf ../Sparkle
	mv Sparkle ..
	touch $@

CLEAN_FILE += .Sparkle
CLEAN_PKG += Sparkle
2445
DISTCLEAN_PKG += Sparkle-$(SPARKLE_VERSION).zip
2446

2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464
# ***************************************************************************
# 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

2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477
# *********
# 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
2478 2479 2480
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
2481 2482 2483 2484 2485 2486 2487 2488 2489

.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

2490 2491 2492 2493 2494 2495
# *********
# projectM
# *********
ifdef SVN
libprojectM:
	$(SVN) co $(LIBPROJECTM_SVN) libprojectM
2496
	patch -d libprojectM -p0 < Patches/libprojectM-fpic.patch
2497 2498 2499 2500 2501 2502 2503 2504 2505
else
libprojectM-$(LIBPROJECTM_VERSION).tar.bz2:
	$(WGET) $(LIBPROJECTM_URL)

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

.libprojectM: libprojectM
2506
	(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)
2507 2508 2509 2510 2511
	touch $@

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

2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 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
# ***************************************************************************
# 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 $@

2568 2569 2570 2571
CLEAN_FILES += .xcb-util .xcb
CLEAN_PKG += xcb-util xcb
DISTCLEAN_PKG += xcb-util-$(XCB_UTIL_VERSION).tar.bz2 libxcb-$(XCB_VERSION).tar.bz2

2572 2573 2574 2575
# ***************************************************************************
# Peflags utility (Windows only)
# ***************************************************************************

2576 2577 2578
peflags/peflags.c:
	mkdir -p peflags
	cd peflags && $(WGET) $(PEFLAGS_URL)/peflags.c
2579

2580
.peflags: peflags/peflags.c
2581 2582 2583
	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
2584 2585
	touch $@

2586 2587
CLEAN_PKG += peflags
CLEAN_FILES += .peflags
2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606

# ************
# 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


2607
# ***************************************************************************
2608
# Some cleaning
2609 2610 2611
# ***************************************************************************

clean-dots: FORCE
2612
	rm -f $(CLEAN_FILE)
2613 2614

clean: clean-dots
2615
	rm -rf $(CLEAN_PKG)
2616 2617

clean-src: clean
2618
	rm -rf $(DISTCLEAN_PKG)
2619

2620
clean-svn:
2621
	rm -rf ffmpeg tremor x264 libdca pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz portaudio live555-$(LIVEDOTCOM_VERSION).tar.gz live libass
2622

2623
distclean: clean-src
2624

2625 2626 2627 2628
# ***************************************************************************
# Download all the sources and package unversionned copies of subversion trees
# ***************************************************************************

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