Makefile 81 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+= --arch=armv4l --cpu=armv4t --disable-encoders --disable-muxers --disable-mpegaudio-hp --disable-decoder=snow --disable-decoder=vc9 --disable-decoder=wmv3 --disable-decoder=vorbis --disable-decoder=dvdsub --disable-decoder=dvbsub --disable-protocols
129 130 131
endif

ifdef HAVE_UCLIBC
132
ifdef HAVE_BIGENDIAN
133
FFMPEGCONF+= --arch=armeb --enable-armv5te --enable-iwmmxt
134 135 136
else
FFMPEGCONF+= --arch=armv4l
endif
137
FFMPEGCONF+= --enable-small --disable-mpegaudio-hp
138
FFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99
139
else
140
ifndef HAVE_WINCE
141
FFMPEGCONF+= --enable-libmp3lame --enable-libgsm
142
endif
143
endif
144

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

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

163
ifdef HAVE_AMR
164
FFMPEGCONF+= --enable-libamr-nb --enable-libamr-wb --enable-nonfree
165 166
endif

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

180 181 182 183
ifdef HAVE_ISA_THUMB
NOTHUMB ?= -mno-thumb
endif

184 185
DATE=`date +%Y-%m-%d`

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

FORCE:

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

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

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

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

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

232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
# ***************************************************************************
# errno
# ***************************************************************************

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

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

CLEAN_FILE += .errno
CLEAN_PKG += errno

248 249 250 251
# ***************************************************************************
# autoconf
# ***************************************************************************

252
autoconf-$(AUTOCONF_VERSION).tar.bz2:
253
	$(WGET) $(AUTOCONF_URL)
254

255
autoconf: autoconf-$(AUTOCONF_VERSION).tar.bz2
256
	$(EXTRACT_BZ2)
257 258

.autoconf: autoconf
259 260
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
261 262 263

CLEAN_FILE += .autoconf
CLEAN_PKG += autoconf
264
DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.bz2
265

266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
# ***************************************************************************
# 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

288 289 290
# ***************************************************************************
# CMake
# ***************************************************************************
Rafaël Carré's avatar
Rafaël Carré committed
291 292 293 294 295
cmake-$(CMAKE_VERSION).tar.gz:
	$(WGET) $(CMAKE_URL)

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

297
.cmake: cmake
298 299 300 301 302 303
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@

CLEAN_FILE += .cmake
CLEAN_PKG += cmake

304 305 306 307 308
# ***************************************************************************
# libtool
# ***************************************************************************

ifdef HAVE_DARWIN_OS
309 310 311 312 313 314 315 316
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)
317 318
	ln -sf libtool $(PREFIX)/bin/glibtool
	ln -sf libtoolize $(PREFIX)/bin/glibtoolize
319
	touch $@
320 321 322

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

325 326 327 328 329 330 331
endif

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

automake-$(AUTOMAKE_VERSION).tar.gz:
332
	$(WGET) $(AUTOMAKE_URL)
333 334

automake: automake-$(AUTOMAKE_VERSION).tar.gz
335
	$(EXTRACT_GZ)
336 337

.automake: automake
338 339
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
340 341 342 343 344 345 346 347 348

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

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

349
pkg-config-$(PKGCFG_VERSION).tar.gz:
350
	$(WGET) $(PKGCFG_URL)
351

352
pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz
353 354 355
	$(EXTRACT_GZ)
	patch -d pkgconfig/glib-1.2.8 -p 1 < Patches/glib.patch
	patch -d pkgconfig -p0 < Patches/pkgcfg.patch
356
	(cd $@; autoconf)
357 358

.pkgcfg: pkgconfig
359
	(cd pkgconfig; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
360
	touch $@
361 362 363

CLEAN_FILE += .pkgcfg
CLEAN_PKG += pkgconfig
364
DISTCLEAN_PKG += pkg-config-$(PKGCFG_VERSION).tar.gz
365 366 367 368 369 370

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

gettext-$(GETTEXT_VERSION).tar.gz:
371
	$(WGET) $(GETTEXT_URL)
372 373

gettext: gettext-$(GETTEXT_VERSION).tar.gz
374
	$(EXTRACT_GZ)
375
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
376
	patch -p0 < Patches/gettext-win32.patch
377
endif
VideoLAN's avatar
VideoLAN committed
378 379 380
ifdef HAVE_DARWIN_OS
	patch -p0 < Patches/gettext-macosx.patch
endif
381

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

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

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

libiconv-$(LIBICONV_VERSION).tar.gz:
416
	$(WGET) $(LIBICONV_URL)
417 418

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

428 429 430 431 432
libiconv-snowleopard.tar.bz2:
	$(WGET) $(LIBICONVMAC_URL)

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

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

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

454 455 456 457 458 459 460
# ***************************************************************************
# fontconfig
# ***************************************************************************

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

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

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

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

491 492 493 494 495
# ***************************************************************************
# freetype2
# ***************************************************************************

freetype-$(FREETYPE2_VERSION).tar.gz:
496
	$(WGET) $(FREETYPE2_URL)
497 498

freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
499
	$(EXTRACT_GZ)
500 501

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

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

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

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

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

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

CLEAN_FILE += .fribidi
CLEAN_PKG += fribidi
529
DISTCLEAN_PKG += fribidi-$(FRIBIDI_VERSION).tar.gz
530 531 532 533 534 535

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

a52dec-$(A52DEC_VERSION).tar.gz:
536
	$(WGET) $(A52DEC_URL)
537 538

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

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

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

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

Christophe Mutricy's avatar
Christophe Mutricy committed
556 557
libmpeg2-$(LIBMPEG2_VERSION).tar.gz:
	$(WGET) $(LIBMPEG2_URL)
558

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

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

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

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

libid3tag-$(LIBID3TAG_VERSION).tar.gz:
578
	$(WGET) $(LIBID3TAG_URL)
579 580

libid3tag: libid3tag-$(LIBID3TAG_VERSION).tar.gz
581
	$(EXTRACT_GZ)
582
	patch -d libid3tag -p0 < Patches/libid3tag-0.15.1b-fix-CVE-2008-2109.patch
583 584 585
ifdef HAVE_DARWIN_OS
	( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
endif
586 587

.id3tag: libid3tag
588 589 590
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
591 592 593 594 595

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

596 597 598 599 600 601 602 603 604 605 606
# ***************************************************************************
# 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
607
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared && make && make install )
608 609 610 611 612 613
	touch $@

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

614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640
# ***************************************************************************
# 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)
641 642 643
ifdef HAVE_DARWIN_OS
	(cd $@; sed -e 's%gcc%$(CC)%' -e 's%LDFLAGS=%LDFLAGS=$(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)%' -i.orig  src/Makefile)
endif
644 645

.lua: lua
646
ifdef HAVE_WIN32
647
	( 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
648 649
	(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)
650
else
Christophe Mutricy's avatar
Christophe Mutricy committed
651 652
	(cd $<&& patch -p1) < Patches/lua-noreadline.patch
	(cd $<&& $(HOSTCC) make $(LUA_MAKEPLATEFORM) && make install INSTALL_TOP=$(PREFIX))
653
endif
654 655 656 657 658 659
	touch $@

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

660 661 662 663 664
# ***************************************************************************
# libmad
# ***************************************************************************

libmad-$(LIBMAD_VERSION).tar.gz:
665
	$(WGET) $(LIBMAD_URL)
666 667

libmad: libmad-$(LIBMAD_VERSION).tar.gz
668
	$(EXTRACT_GZ)
669
ifdef HAVE_DARWIN_OS
670
	( cd $@; sed -e 's%-march=i486%$(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)%' -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
671
endif
672 673

.mad: libmad
674
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="-O3 $(NOTHUMB)" && make && make install)
675 676
	$(INSTALL_NAME)
	touch $@
677 678 679 680 681 682 683 684 685 686

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

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

libogg-$(OGG_VERSION).tar.gz:
687
	$(WGET) $(OGG_URL)
688 689

libogg: libogg-$(OGG_VERSION).tar.gz
690
	$(EXTRACT_GZ)
Rafaël Carré's avatar
Rafaël Carré committed
691 692
	patch -p0 < Patches/ogg.patch
	patch -p0 < Patches/libogg-1.1.patch
693
ifdef HAVE_WINCE
Rafaël Carré's avatar
Rafaël Carré committed
694
	patch -p0 < Patches/libogg-wince.patch
695
endif
696
	(cd $@; autoconf)
697 698

.ogg: libogg
699 700 701
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make install)
	$(INSTALL_NAME)
	touch $@
702 703 704 705 706 707 708 709 710 711

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

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

libvorbis-$(VORBIS_VERSION).tar.gz:
712
	$(WGET) $(VORBIS_URL)
713 714

libvorbis: libvorbis-$(VORBIS_VERSION).tar.gz
715
	$(EXTRACT_GZ)
716
	patch -p0 < Patches/vorbis-noapps.patch
717 718

.vorbis: libvorbis .ogg
719
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
720 721
#	$(INSTALL_NAME)
	touch $@
722 723

.vorbisenc: .vorbis .ogg
724 725
#	$(INSTALL_NAME)
	touch $@
726 727 728 729 730

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

731 732 733 734 735
# ***************************************************************************
# tremor
# ***************************************************************************

ifdef SVN
736
tremor:
737
	$(SVN) co http://svn.xiph.org/trunk/Tremor tremor
738
	(cd $@ && patch -p0 < ../Patches/tremor.patch)
739
	(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)
740 741
else
tremor-$(TREMOR_VERSION).tar.bz2:
742 743
	echo "tremor snapshot does not exist, you MUST use subversion !"
	exit -1
744
	$(WGET) $(TREMOR_URL)
745 746

tremor: tremor-$(TREMOR_VERSION).tar.bz2
747
	$(EXTRACT_BZ2)
748 749 750
endif

.tremor: tremor .ogg
751
	(cd $<; $(HOSTCC) ./autogen.sh $(HOSTCONF) --prefix=$(PREFIX) --disable-shared CFLAGS="$(NOTHUMB)" && make && make install)
752 753
	$(INSTALL_NAME)
	touch $@
754

755 756
ifdef SVN
tremor-source: tremor
757
	tar cv --exclude=.svn tremor | bzip2 > tremor-$(DATE).tar.bz2
758 759 760 761

SOURCE += tremor-source
endif

762 763
CLEAN_FILE += .tremor
CLEAN_PKG += tremor
764
#DISTCLEAN_PKG += tremor-$(TREMOR_VERSION).tar.bz2 #no tremor snapshot
765

766 767 768 769 770
# ***************************************************************************
# theora
# ***************************************************************************

libtheora-$(THEORA_VERSION).tar.bz2:
771
	$(WGET) $(THEORA_URL)
772 773

libtheora: libtheora-$(THEORA_VERSION).tar.bz2
774
	$(EXTRACT_BZ2)
775
	patch -p0 < Patches/libtheora-includes.patch
776

777 778
THEORACONF = --disable-sdltest --disable-oggtest --disable-vorbistest --disable-examples

779
ifdef HAVE_DARWIN_64
780 781
THEORACONF += --disable-asm
endif
782 783 784
ifdef HAVE_WIN64
THEORACONF += --disable-asm
endif
785

786
.theora: libtheora .ogg
787
ifdef HAVE_DARWIN_OS
788 789
	cd $<; ($(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(THEORACONF) && make && make install)
else
790 791 792 793 794 795 796 797 798
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
799
endif
800 801
	$(INSTALL_NAME)
	touch $@
802 803 804 805 806

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

Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
807 808 809 810 811
# ***************************************************************************
# shout
# ***************************************************************************

libshout-$(SHOUT_VERSION).tar.gz:
812
	$(WGET) $(SHOUT_URL)
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
813 814

libshout: libshout-$(SHOUT_VERSION).tar.gz
815
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
816
ifdef HAVE_WIN32
817
	patch -p0 < Patches/libshout-win32.patch
Christophe Mutricy's avatar
Christophe Mutricy committed
818
endif
819

820
.shout: libshout .theora .ogg .speex .vorbis
821 822 823
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) &&  make && make install )
	$(INSTALL_NAME)
	touch $@
Derk-Jan Hartman's avatar
Derk-Jan Hartman committed
824 825 826 827 828

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

829 830 831 832 833
# ***************************************************************************
# flac
# ***************************************************************************

flac-$(FLAC_VERSION).tar.gz:
834
	$(WGET) $(FLAC_URL)
835 836

flac: flac-$(FLAC_VERSION).tar.gz
837
	$(EXTRACT_GZ)
838
ifdef HAVE_WIN32
839
	patch -p0 < Patches/flac-win32.patch
840
endif
841
ifdef HAVE_DARWIN_OS
Felix Paul Kühne's avatar
Felix Paul Kühne committed
842
	( cd $@; sed -e 's%-dynamiclib%-dynamiclib -arch $(ARCH)%' -i.orig  configure )
843
endif
844 845

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

847
.flac: flac .ogg
848
ifdef HAVE_WIN32
849
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS) && cd src&& make -C libFLAC&& make -C libFLAC install && cd .. && make -C include install)
850
else
851
ifdef HAVE_DARWIN_OS
852
ifdef HAVE_DARWIN_OS_ON_INTEL
853
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-asm-optimizations && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
854
else
855
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) $(FLAC_DISABLE_FLAGS) && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
856
endif
857
else
858
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX)  $(FLAC_DISABLE_FLAGS) && cd src && make -C libFLAC && make -C libFLAC install  && cd .. && make -C include install)
859
endif
860
endif
861 862
	$(INSTALL_NAME)
	touch $@
863

Damien Fouilleul's avatar
Damien Fouilleul committed
864
CLEAN_FILE += .flac
865 866 867 868 869 870 871 872
CLEAN_PKG += flac
DISTCLEAN_PKG += flac-$(FLAC_VERSION).tar.gz

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

speex-$(SPEEX_VERSION).tar.gz:
873
	$(WGET) $(SPEEX_URL)
874 875

speex: speex-$(SPEEX_VERSION).tar.gz
876 877
	$(EXTRACT_GZ)
	patch -p0 < Patches/speex.patch
878 879

.speex: speex
880 881 882
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --enable-ogg=no && make && make install)
	$(INSTALL_NAME)
	touch $@
883 884 885 886 887 888 889 890 891

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

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

892
faad2-$(FAAD2_VERSION).tar.gz:
893
	$(WGET) $(FAAD2_URL)
894

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

900
.faad: faad2
Rafaël Carré's avatar
Rafaël Carré committed
901
	(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)
902
	touch $@
903 904

CLEAN_FILE += .faad
905 906
CLEAN_PKG += faad2
DISTCLEAN_PKG += faad2-$(FAAD2_VERSION).tar.gz
907 908 909 910 911 912

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

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

lame: lame-$(LAME_VERSION).tar.gz
916
	$(EXTRACT_GZ)
917 918

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

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

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

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

libebml: libebml-$(LIBEBML_VERSION).tar.bz2
934
	$(EXTRACT_BZ2)
935
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
936
	(cd $@; patch -p0 < ../Patches/libebml-svn-win32.patch)
937
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
938
ifdef HAVE_WIN64
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
939
	patch -p0 < Patches/libebml-win64.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
940
endif
941 942

.ebml: libebml
943
ifdef HAVE_WIN32
944
	(cd $<; make -C make/mingw32 prefix=$(PREFIX) $(HOSTCC2) CFLAGS="$(CFLAGS) -DWIN32" SHARED=no && make -C make/linux install_staticlib install_headers prefix=$(PREFIX) $(HOSTCC2))
945
else
946 947
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libebml.a
948
endif
949
	touch $@
950

951 952 953 954 955 956 957 958
CLEAN_FILE += .ebml
CLEAN_PKG += libebml
DISTCLEAN_PKG += libebml-$(LIBEBML_VERSION).tar.bz2

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

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

962
libmatroska: libmatroska-$(LIBMATROSKA_VERSION).tar.bz2
963
	$(EXTRACT_BZ2)
964
	patch -p0 < ./Patches/libmatroska-kaxblock.patch
965
ifdef HAVE_WIN32
Rafaël Carré's avatar
Rafaël Carré committed
966
	(cd $@; patch -p0 < ../Patches/libmatroska-win32.patch)
967
endif
968

969 970
.matroska: libmatroska .ebml
ifdef HAVE_WIN32
971
	(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))
972
else
973 974
	(cd $<; make -C make/linux prefix=$(PREFIX) $(HOSTCC2) staticlib && make -C make/linux install_staticlib install_headers prefix=$(PREFIX))
	$(RANLIB) $(PREFIX)/lib/libmatroska.a
975
endif
976
	touch $@
977

978

979 980 981 982 983
CLEAN_FILE += .matroska
CLEAN_PKG += libmatroska
DISTCLEAN_PKG += libmatroska-$(LIBMATROSKA_VERSION).tar.bz2

# ***************************************************************************
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017
# 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
1018
DISTCLEAN_PKG += amrwb-$(LIBAMR_WB_VERSION).tar.bz2
1019 1020 1021

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

1022 1023 1024
# ffmpeg
# ***************************************************************************

1025
ifdef SVN
1026 1027 1028 1029 1030
ifdef HAVE_WIN32
ffmpeg: .dshow_headers
else
ffmpeg: 
endif
1031
	$(SVN) co $(FFMPEG_SVN) ffmpeg
1032 1033 1034
ifdef HAVE_ISA_THUMB
	patch -p0 < Patches/ffmpeg-avcodec-no-thumb.patch
endif
1035
ifdef HAVE_UCLIBC
1036 1037
	patch -p0 < Patches/ffmpeg-svn-uclibc.patch
	patch -p0 < Patches/ffmpeg-svn-internal-define.patch
1038
	patch -p0 < Patches/ffmpeg-svn-libavformat.patch
1039
endif
1040
ifdef HAVE_WIN32
1041
	(cd $@; patch -p0 < ../Patches/ffmpeg-dxva2.patch)
1042
endif
1043 1044 1045 1046
ifdef NO_TEXT_RELOCATION
	echo "Broken LD. Fix your tools."
	exit -1
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1047
	(cd $@; patch -p1 < ../Patches/eac3_spectral.patch)
1048
else
1049
ffmpeg-$(FFMPEG_VERSION).tar.gz:
1050 1051
	echo "ffmpeg snapshot is too old, you MUST use subversion !"
	exit -1
1052
	$(WGET) $(FFMPEG_URL)
1053

1054 1055 1056
ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz
	$(EXTRACT_GZ)
endif
1057

Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1058
FFMPEGCONF += \
1059
	--disable-debug \
Rémi Denis-Courmont's avatar
Wrap  
Rémi Denis-Courmont committed
1060 1061 1062 1063 1064 1065 1066 1067
	--enable-gpl \
	--enable-postproc \
	--disable-ffserver \
	--disable-ffmpeg \
	--disable-ffplay \
	--disable-devices \
	--disable-protocols \
	--disable-network
1068
ifdef HAVE_WIN32
1069
FFMPEGCONF += --disable-bzlib --disable-decoder=dca --disable-encoder=vorbis --enable-libmp3lame --enable-w32threads --enable-dxva2 --disable-bsfs
1070 1071
else
FFMPEGCONFG += --enable-pthreads
1072
endif
1073

1074
ifdef HAVE_WINCE
1075
.ffmpeg: ffmpeg .zlib
1076
else
1077 1078 1079
ifdef HAVE_UCLIBC
.ffmpeg: ffmpeg
else
1080
.ffmpeg: ffmpeg .lame .gsm
1081
endif
1082
endif
1083
	(cd $<; $(HOSTCC) ./configure --prefix=$(PREFIX) --extra-cflags="$(CFLAGS) $(FFMPEG_CFLAGS)" --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) --disable-shared --enable-static && make && make install-libs install-headers)
1084
	touch $@
1085

1086 1087
ifdef SVN
ffmpeg-source: ffmpeg
1088
	tar cv --exclude=.svn ffmpeg | bzip2 > ffmpeg-$(DATE).tar.bz2
1089 1090 1091 1092

SOURCE += ffmpeg-source
endif

1093
CLEAN_FILE += .ffmpeg
1094
CLEAN_PKG += ffmpeg
1095 1096 1097 1098 1099 1100
DISTCLEAN_PKG += ffmpeg-$(FFMPEG_VERSION).tar.gz

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

1101 1102 1103
libdvdcss-$(LIBDVDCSS_VERSION).tar.gz:
	$(WGET) $(LIBDVDCSS_URL)

1104
ifdef SVN
1105
libdvdcss:
1106
	$(SVN) co svn://svn.videolan.org/libdvdcss/trunk libdvdcss
1107
	cd $@ && sh bootstrap
1108
else
1109
libdvdcss: libdvdcss-$(LIBDVDCSS_VERSION).tar.gz
1110
	$(EXTRACT_GZ)
1111
endif
1112 1113

.dvdcss: libdvdcss
1114 1115 1116
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --disable-doc --prefix=$(PREFIX) && make && make install)
	$(INSTALL_NAME)
	touch $@
1117

1118 1119
ifdef SVN
libdvdcss-source: libdvdcss
1120
	tar cv --exclude=.svn libdvdcss | bzip2 > libdvdcss-$(DATE).tar.bz2
1121 1122 1123 1124

SOURCE += libdvdcss-source
endif

1125 1126 1127 1128
CLEAN_FILE += .dvdcss
CLEAN_PKG += libdvdcss
DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.gz

1129 1130 1131
# ***************************************************************************
# dummy dvdread to trigger the INSTALL_NAME script
# ***************************************************************************
1132 1133 1134
# .dvdread: .dvdnav
# 	$(INSTALL_NAME)
# 	touch $@
1135
#
1136 1137 1138 1139 1140
# CLEAN_FILE += .dvdread

# ***************************************************************************
# libdvdread: We use dvdnav's dvdread
# ***************************************************************************
1141
libdvdread:
1142 1143
	$(SVN) co $(LIBDVDREAD_SVN)  libdvdread
	(cd $@; patch  -p 0 < ../Patches/libdvdread.patch)
1144
ifdef HAVE_WIN32
1145
	(cd $@; patch  -p 0 < ../Patches/libdvdread-win32.patch)
1146
endif
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1147
	(cd $@; sh autogen.sh noconfig)
1148 1149

.libdvdread: libdvdread .dvdcss
1150
	(cd libdvdread; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --with-libdvdcss=$(PREFIX) && make && make install)
1151 1152
	$(INSTALL_NAME)
	touch $@
1153

1154 1155
CLEAN_FILE += .libdvdread
CLEAN_PKG += libdvdread
1156
#DISTCLEAN_PKG += libdvdread-$(LIBDVDREAD_VERSION).tar.gz
1157 1158 1159 1160 1161

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

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

1171 1172
libdvdnav: libdvdnav-$(LIBDVDNAV_VERSION).tar.gz
	$(EXTRACT_GZ)
1173
	patch -p0 < Patches/libdvdnav.patch
1174 1175 1176
ifdef HAVE_WIN32
	patch -p0 < Patches/libdvdnav-win32.patch
endif
1177
	(cd $@; ./autogen.sh noconfig)
1178
endif
1179

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

CLEAN_FILE += .dvdnav
CLEAN_PKG += libdvdnav
1191
DISTCLEAN_PKG += libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2
1192 1193 1194 1195 1196

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

1197
libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz:
1198
	$(WGET) $(LIBDVBPSI_URL)
1199

1200
libdvbpsi: libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1201
	$(EXTRACT_GZ)
1202 1203

.dvbpsi: libdvbpsi
1204 1205 1206
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd src && make && make install)
	$(INSTALL_NAME)
	touch $@
1207 1208 1209

CLEAN_FILE += .dvbpsi
CLEAN_PKG += libdvbpsi
1210
DISTCLEAN_PKG += libdvbpsi5-$(LIBDVBPSI_VERSION).tar.gz
1211 1212 1213 1214 1215

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

1216
live555-$(LIVEDOTCOM_VERSION).tar.gz:
1217
	$(WGET) $(LIVEDOTCOM_URL)
1218

1219
live: live555-$(LIVEDOTCOM_VERSION).tar.gz
1220
	$(EXTRACT_GZ)
1221
	patch -p0 < Patches/live-noapps.patch
1222
	patch -p0 < Patches/live-uselocale.patch
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1223 1224 1225
ifdef HAVE_WIN64
	patch -p0 < Patches/live-win64.patch
endif
1226 1227

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

CLEAN_FILE += .live
CLEAN_PKG += live
1263
DISTCLEAN_PKG += live555-$(LIVEDOTCOM_VERSION).tar.gz
1264 1265 1266 1267 1268 1269

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

goom$(GOOM2k4_VERSION).tar.gz:
1270 1271
	$(WGET) $(GOOM2k4_URL)
	mv goom-$(GOOM2k4_VERSION)-src.tar.gz goom$(GOOM2k4_VERSION).tar.gz
1272 1273

goom: goom$(GOOM2k4_VERSION).tar.gz
1274
	$(EXTRACT_GZ)
1275
ifdef HAVE_WIN32
1276
	(cd $@; dos2unix configure.in)
Rafaël Carré's avatar
Rafaël Carré committed
1277
	patch -p0 < Patches/goom2k4-0-win32.patch
1278 1279
else
	patch -p0 < Patches/goom2k4-0-mmx.patch
1280
endif
1281
	patch -p0 < Patches/goom2k4-0-memleaks.patch
1282
	patch -p0 < Patches/goom2k4-autotools.patch
1283
	(cd $@; rm -f configure; ACLOCAL="aclocal -I m4/" autoreconf -ivf)
1284 1285

.goom2k4: goom
1286
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static --disable-glibtest --disable-gtktest && make && make install)
1287
	touch $@
1288 1289 1290

CLEAN_FILE += .goom2k4
CLEAN_PKG += goom
1291
DISTCLEAN_PKG += goom$(GOOM2k4_VERSION).tar.gz
1292 1293 1294 1295 1296 1297

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

libcaca-$(LIBCACA_VERSION).tar.gz:
1298
	$(WGET) $(LIBCACA_URL)
1299 1300

libcaca: libcaca-$(LIBCACA_VERSION).tar.gz
1301
	$(EXTRACT_GZ)
Christophe Mutricy's avatar
Christophe Mutricy committed
1302
	patch -p0 < Patches/libcaca-static.patch
1303
ifdef HAVE_DARWIN_OS
1304 1305
	patch -p0 < Patches/libcaca-osx-sdkofourchoice.patch
	(cd $@; sed -e 's%/Developer/SDKs/MacOSX10.4u.sdk%$(MACOSX_SDK)%' -i.orig  configure)
1306
endif
1307 1308

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

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

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

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

libdca: libdca-$(LIBDCA_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1329 1330 1331
ifdef HAVE_DARWIN_9
	( cd $@; patch -p0 < ../Patches/libdca-llvm-gcc.patch )
endif
1332

1333
.dca: libdca
1334
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
1335
	$(INSTALL_NAME)
1336
	touch $@
1337

1338
CLEAN_FILE += .dca
Antoine Cellerier's avatar
Antoine Cellerier committed
1339
CLEAN_PKG += libdca
1340
DISTCLEAN_PKG += libdca-$(LIBDCA_VERSION).tar.bz2
1341

1342
# ***************************************************************************
1343
# libx264
1344 1345
# ***************************************************************************

1346 1347 1348
x264-$(X264_VERSION).tar.gz:
	$(WGET) $(X264_URL)

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
1349 1350 1351 1352 1353 1354 1355 1356 1357 1358
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

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

1371 1372
ifdef HAVE_WIN32
.x264: x264 .pthreads
1373 1374 1375
  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
1376
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" --enable-pthread && make && make install)
1377
  endif
1378
else
1379
ifdef HAVE_DARWIN_OS_ON_INTEL
1380
  .x264: x264 .yasm
1381
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1382 1383
else
  .x264: x264
1384
	(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
1385
endif
1386
endif
1387
	touch $@
1388

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

1394
SOURCE += x264-source
1395 1396
endif

1397 1398 1399 1400
CLEAN_FILE += .x264
CLEAN_PKG += x264
DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz

1401 1402 1403 1404 1405
# ***************************************************************************
# libmodplug
# ***************************************************************************

libmodplug-$(MODPLUG_VERSION).tar.gz:
1406
	$(WGET) $(MODPLUG_URL)
1407 1408

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

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

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

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

1427
libcddb-$(CDDB_VERSION).tar.bz2:
1428
	$(WGET) $(CDDB_URL)
1429

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

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

CLEAN_FILE += .cddb
CLEAN_PKG += libcddb
1449
DISTCLEAN_PKG += libcddb-$(CDDB_VERSION).tar.bz2
1450 1451 1452 1453 1454 1455

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

vcdimager-$(VCDIMAGER_VERSION).tar.gz:
1456
	$(WGET) $(VCDIMAGER_URL)
1457 1458

vcdimager: vcdimager-$(VCDIMAGER_VERSION).tar.gz
1459
	$(EXTRACT_GZ)
1460 1461 1462

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

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

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

libcdio-$(CDIO_VERSION).tar.gz:
1480
	$(WGET) $(CDIO_URL)
1481 1482

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

.cdio: libcdio
1490
	(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)
1491
	touch $@
1492 1493 1494 1495 1496

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

1497 1498 1499 1500
# ***************************************************************************
# qt4 (win32 binary)
# ***************************************************************************

1501
qt4-$(QT4_VERSION)-win32-bin.tar.bz2:
1502
	$(WGET) $(QT4_URL)
Clément Stenac's avatar
Clément Stenac committed
1503

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

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

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

1521 1522 1523 1524 1525 1526 1527
# ***************************************************************************
# qt4 (trolltech binaries)
# ***************************************************************************

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

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

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

1550 1551
CLEAN_FILE += .Qt_win32
CLEAN_PKG += Qt_win32
1552
DISTCLEAN_PKG += qt-win-opensource-$(QT4T_VERSION)-mingw.exe
1553

1554 1555 1556 1557
# ***************************************************************************
# qt4 (source-code compilation for Mac)
# ***************************************************************************

1558
qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz:
1559 1560
	$(WGET) $(QT4_MAC_URL)

1561
qt4_mac: qt-mac-opensource-src-$(QT4_MAC_VERSION).tar.gz
1562 1563 1564
	$(EXTRACT_GZ)

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

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

1572 1573 1574 1575 1576
# ***************************************************************************
# zlib
# ***************************************************************************

zlib-$(ZLIB_VERSION).tar.gz:
1577
	$(WGET) $(ZLIB_URL)
1578 1579

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

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

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

1592
# ***************************************************************************
1593
# PortAudio
1594 1595 1596
# ***************************************************************************

pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz:
1597
	$(WGET) $(PORTAUDIO_URL)
1598 1599

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

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

CLEAN_FILE += .portaudio
CLEAN_PKG += portaudio
1612
DISTCLEAN_PKG += pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz
1613

1614 1615 1616 1617 1618
# ***************************************************************************
# xml
# ***************************************************************************

libxml2-$(XML_VERSION).tar.gz:
1619
	$(WGET) $(XML_URL)
1620 1621

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

1627
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
1628

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

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

1644 1645 1646 1647 1648
# ***************************************************************************
# twolame
# ***************************************************************************

twolame-$(TWOLAME_VERSION).tar.gz:
1649
	$(WGET) $(TWOLAME_URL)
1650 1651

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

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

CLEAN_FILE += .twolame
CLEAN_PKG += twolame
1664
DISTCLEAN_PKG += twolame-$(TWOLAME_VERSION).tar.gz
1665 1666 1667 1668 1669 1670

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

libpng-$(PNG_VERSION).tar.bz2:
1671
	$(WGET) $(PNG_URL)
1672 1673

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

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

CLEAN_FILE += .png
CLEAN_PKG += libpng
1704
DISTCLEAN_PKG += libpng-$(PNG_VERSION).tar.bz2
1705 1706 1707 1708 1709 1710

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

zvbi-$(ZVBI_VERSION).tar.bz2:
1711
	$(WGET) $(ZVBI_URL)
1712 1713

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

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

CLEAN_FILE += .zvbi
CLEAN_PKG += zvbi
1738
DISTCLEAN_PKG += zvbi-$(ZVBI_VERSION).tar.bz2
1739 1740

# ***************************************************************************
1741 1742 1743 1744 1745 1746 1747 1748 1749
# libraw1394
# ***************************************************************************

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

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

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

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

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

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

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

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

1775
CLEAN_FILE += .dc1394
1776
CLEAN_PKG += libdc1394
1777
DISTCLEAN_PKG += libdc1394-$(LIBDC1394_VERSION).tar.gz
1778 1779

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

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

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

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

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

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

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

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

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

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

CLEAN_FILE += .gcrypt
CLEAN_PKG += libgcrypt
1825
DISTCLEAN_PKG += libgcrypt-$(GCRYPT_VERSION).tar.bz2
1826

1827 1828 1829 1830 1831 1832 1833
# ***************************************************************************
# opencdk (requires by gnutls 2.x)
# ***************************************************************************

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

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

1845 1846 1847 1848 1849
# ***************************************************************************
# gnutls
# ***************************************************************************

gnutls-$(GNUTLS_VERSION).tar.bz2:
1850
	$(WGET) $(GNUTLS_URL)
1851 1852

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

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

CLEAN_FILE += .gnutls
CLEAN_PKG += gnutls
1870
DISTCLEAN_PKG += gnutls-$(GNUTLS_VERSION).tar.bz2
1871 1872 1873 1874 1875 1876

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

libopendaap-$(DAAP_VERSION).tar.bz2:
1877
	$(WGET) $(DAAP_URL)
1878 1879

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

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

1888
CLEAN_FILE += .opendaap
1889
CLEAN_PKG += libopendaap
1890
DISTCLEAN_PKG += libopendaap-$(DAAP_VERSION).tar.bz2
1891 1892 1893 1894 1895

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

1896
glib-$(GLIB_VERSION).tar.bz2:
1897
	$(WGET) $(GLIB_URL)
1898

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

.glib: glib
1907
	(cd $<; sh autogen.sh --prefix=$(PREFIX) --host=$(HOST) && make && make install)
1908
	touch $@
1909

1910
CLEAN_FILE += .glib
1911
CLEAN_PKG += glib
1912
DISTCLEAN_PKG += glib-$(GLIB_VERSION).tar.gz
1913 1914 1915 1916 1917

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

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

1921 1922
libIDL: libIDL-$(LIBIDL_VERSION).tar.bz2
	$(EXTRACT_BZ2)
1923

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

1928
CLEAN_FILE += .IDL
1929
CLEAN_PKG += libIDL
1930
DISTCLEAN_PKG += libIDL-$(LIBIDL_VERSION).tar.gz
1931

1932 1933 1934 1935
# ***************************************************************************
# Gecko SDK
# ***************************************************************************

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

1939 1940
gecko-sdk: gecko-sdk-ppc-macosx10.2-1.7.5.tar.gz
	$(EXTRACT_GZ)
1941 1942

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

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

1953 1954 1955 1956
# ***************************************************************************
# Gecko SDK win32
# ***************************************************************************

1957
gecko-sdk-i586-pc-msvc-1.8b1.zip:
1958
	$(WGET) $(GECKO_SDK_WIN32_URL)
1959 1960

libIDL-0.6.3-win32-bin.zip:
1961
	$(WGET) $(LIBIDL_WIN32_BIN_URL)
1962

1963
glib-19990228.zip:
1964
	$(WGET) $(GLIB_WIN32_BIN_URL)
1965

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

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

1979
# ***************************************************************************
1980
# mozilla-macosx
1981 1982 1983 1984
#
# 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!
1985 1986
# ***************************************************************************

1987
firefox-$(MOZILLA_VERSION)-source.tar.bz2:
1988
	$(WGET) $(MOZILLA_URL)
1989

1990
mozilla: firefox-$(MOZILLA_VERSION)-source.tar.bz2
1991
	$(EXTRACT_BZ2)
1992
	(cd $@; patch -p0 < ../Patches/firefox-darwin.patch)
1993

1994 1995 1996 1997 1998 1999
.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)
2000
	touch $@
2001

2002
CLEAN_FILE += .mozilla-macosx
2003 2004
CLEAN_PKG += mozilla
DISTCLEAN_PKG += firefox-source-$(MOZILLA_VERSION).tar.bz2
2005

2006 2007 2008 2009
# ***************************************************************************
# libjpeg
# ***************************************************************************

2010
jpegsrc.v$(JPEG_VERSION).tar.gz:
2011
	$(WGET) $(JPEG_URL)
2012

2013
jpeg-7: jpegsrc.v$(JPEG_VERSION).tar.gz
2014
	$(EXTRACT_GZ)
2015

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

CLEAN_FILE += .jpeg
2022 2023
CLEAN_PKG += jpeg-7
DISTCLEAN_PKG += jpegsrc.v$(JPEG_VERSION).tar.gz
2024 2025 2026 2027 2028 2029

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

tiff-$(TIFF_VERSION).tar.gz:
2030
	$(WGET) $(TIFF_URL)
2031

2032
tiff: tiff-$(TIFF_VERSION).tar.gz
2033
	$(EXTRACT_GZ)
2034 2035

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

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

# ***************************************************************************
2049
# LibSDL
2050 2051
# ***************************************************************************

2052
ifndef HAVE_DARWIN_OS
2053
SDL-$(SDL_VERSION).tar.gz:
2054
	$(WGET) $(SDL_URL)
2055

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

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

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

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

SDL_image-$(SDL_IMAGE_VERSION).tar.gz:
2078
	$(WGET) $(SDL_IMAGE_URL)
2079

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

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

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

2093 2094 2095 2096 2097
# ***************************************************************************
# Musepack decoder library (libmpcdec)
# ***************************************************************************

libmpcdec-$(MUSE_VERSION).tar.bz2:
2098
	$(WGET) $(MUSE_URL)
2099

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

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

2116 2117
CLEAN_FILE += .mpcdec
CLEAN_PKG += mpcdec
2118 2119
DISTCLEAN_PKG += libmpcdec-$(MUSE_VERSION).tar.bz2

2120
# ***************************************************************************
2121 2122
# Dirac
# ***************************************************************************
2123 2124

dirac-$(DIRAC_VERSION).tar.gz:
2125
	$(WGET) $(DIRAC_URL)
2126 2127

dirac: dirac-$(DIRAC_VERSION).tar.gz
2128
	$(EXTRACT_GZ)
2129
ifdef HAVE_CYGWIN
2130
	# incorrect compile warning with cygwin compiler 3.4.4
2131
	patch -p0 < Patches/dirac-cygwin.patch
2132
endif
2133
	patch -p0 < Patches/dirac-noutils.patch
2134
	(cd $@; ./bootstrap)
2135

2136 2137 2138 2139
DIRAC_SUBDIRS = libdirac_byteio libdirac_common libdirac_motionest libdirac_encoder libdirac_decoder

ifdef HAVE_WIN32
DIRAC_SUBDIRS += win32
2140
endif
2141

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

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

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

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

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

2170 2171 2172 2173
# *************************************************************************
# DirectShow headers
# *************************************************************************
dshow-headers.tgz:
2174
	$(WGET) $(DSHOW_HEADERS_URL)
2175 2176 2177 2178 2179

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

.dshow_headers: dshow-headers.tgz dxva2api.h
2180 2181
	tar xzf $< -C $(PREFIX)/include
	cp dxva2api.h $(PREFIX)/include
2182
	touch $@
2183

2184
CLEAN_FILE += .dshow_headers
2185
DISTCLEAN_PKG += dshow-headers.tgz dxva2api.h
2186 2187 2188 2189 2190 2191

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

expat-$(EXPAT_VERSION).tar.gz:
2192
	$(WGET) $(EXPAT_URL)
2193 2194

expat: expat-$(EXPAT_VERSION).tar.gz
2195
	$(EXTRACT_GZ)
2196 2197

.expat: expat
2198
ifdef HAVE_DARWIN_OS
2199
	(cd $< aclocal --force && libtoolize --force && autoconf --force && autoheader --force )
2200
endif
2201 2202
	(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
	touch $@
2203 2204 2205 2206 2207 2208 2209 2210 2211 2212

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

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

clinkcc$(CLINKCC_VERSION).tar.gz:
2213
	$(WGET) $(CLINKCC_URL)
2214 2215

clinkcc: clinkcc$(CLINKCC_VERSION).tar.gz
2216 2217 2218
	tar xzf $<
	mv $(patsubst %.tar.gz,Cyberlink,$(patsubst %.tgz,Cyberlink,$(notdir $<))) $@ || true
	touch $@
Rafaël Carré's avatar
Rafaël Carré committed
2219
	patch -p0 < Patches/clinkcc.patch
2220
ifdef HAVE_DARWIN_OS
Rafaël Carré's avatar
Rafaël Carré committed
2221
	patch -p0 < Patches/clinkcc_osx.patch
2222
endif
2223
	(cd $@; ./bootstrap)
2224 2225

.clinkcc: clinkcc
2226
	(cd $<;./configure --prefix=$(PREFIX) --enable-expat && make && chmod 755 config/install-sh && make install )
2227
	touch $@
2228 2229 2230

CLEAN_FILE += .clinkcc
CLEAN_PKG += clinkcc
2231
DISTCLEAN_PKG += clinkcc$(CLINKCC_VERSION).tar.gz
2232

2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243
# ***************************************************************************
# YASM assembler
# ***************************************************************************

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

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

.yasm: yasm
2244
	(cd $< && $(HOSTCC) ./configure --prefix=$(PREFIX) --host=$(HOST) && make && make install)
2245 2246 2247 2248
	touch $@

CLEAN_FILE += .yasm
CLEAN_PKG += yasm
2249
DISTCLEAN_PKG += yasm-$(YASM_VERSION).tar.gz
2250

2251
# ***************************************************************************
2252 2253 2254 2255 2256 2257 2258 2259 2260 2261
# kate
# ***************************************************************************

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

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

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

2289
# ***************************************************************************
2290 2291 2292 2293 2294 2295
# Copy aclocal files
# This is necessary for --missing aclocal to succeed after a
# configure.ac/Makefile.am change in the vlc root dir
# **************************************************************************

.aclocal:
2296
	cp -R $(PREFIX)/share/aclocal/* ../../../m4/
2297
	touch $@
2298

Felix Paul Kühne's avatar
Felix Paul Kühne committed
2299
CLEAN_FILE += .aclocal
2300

2301 2302 2303 2304 2305
# ***************************************************************************
# TagLib read and editing of tags of popular audio formats
# ***************************************************************************

taglib-$(TAGLIB_VERSION).tar.gz:
2306
	$(WGET) $(TAGLIB_URL)
2307 2308

taglib: taglib-$(TAGLIB_VERSION).tar.gz
2309
	$(EXTRACT_GZ)
2310
ifdef HAVE_WIN32
2311
	patch -p0 < Patches/taglib-static.patch
2312
endif
2313
ifdef HAVE_CYGWIN
2314
	patch -p0 < Patches/taglib-cygwin.patch
2315
endif
2316 2317

.tag: taglib
2318
	(cd $<; $(HOSTCC)  ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
2319 2320
	$(INSTALL_NAME)
	touch $@
2321

2322 2323 2324 2325 2326 2327 2328
CLEAN_FILE += .tag
CLEAN_PKG += taglib
DISTCLEAN_PKG += taglib-$(TAGLIB_VERSION).tar.gz

# ***************************************************************************
# pthreads for win32
# ***************************************************************************
Christophe Mutricy's avatar
Christophe Mutricy committed
2329 2330 2331 2332 2333 2334

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

.pthreads: pthreads
Christophe Mutricy's avatar
Christophe Mutricy committed
2338
	(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
2339 2340 2341
	$(INSTALL_NAME)
	touch $@

2342 2343 2344
CLEAN_FILE += .pthreads
CLEAN_PKG += pthreads
DISTCLEAN_PKG += pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
2345

2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356
# ***************************************************************************
# ncurses library (with wide chars support)
# ***************************************************************************

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

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

.ncurses: ncurses
Rafaël Carré's avatar
Rafaël Carré committed
2357 2358
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=/usr --without-debug --enable-widec --without-develop --without-shared && make -C ncurses && make -C include && make -C ncurses DESTDIR=$(PREFIX) install && make -C include DESTDIR=$(PREFIX) install)
	(cp -R $(PREFIX)/usr/* $(PREFIX) && rm -rf $(PREFIX)/usr)
2359 2360 2361 2362 2363
	touch $@

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

2365 2366 2367 2368 2369 2370 2371 2372 2373
# ***************************************************************************
# FluidSynth library (Midi)
# ***************************************************************************

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

fluidsynth: fluidsynth-$(FLUID_VERSION).tar.gz
	$(EXTRACT_GZ)
2374 2375
ifdef HAVE_WIN32
	patch -p0 < Patches/fluid-win32.patch
2376
	cd $@; ./autogen.sh || true
2377
endif
2378 2379 2380 2381 2382 2383 2384

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

CLEAN_FILE += .fluid
CLEAN_PKG += fluidsynth
2385
DISTCLEAN_PKG += fluidsynth-$(FLUID_VERSION).tar.gz
2386

2387 2388 2389 2390 2391 2392 2393 2394 2395
# ***************************************************************************
# liboil
# ***************************************************************************

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

liboil: liboil-$(OIL_VERSION).tar.gz
	$(EXTRACT_GZ)
2396
	patch -d liboil -p1 < Patches/liboil-noshared.patch
2397
	patch -d liboil -p1 < Patches/liboil-win64.patch
2398 2399 2400
	patch -d liboil -p1 < Patches/liboil-Xcompile.patch
	(cd $@; autoreconf)

2401
.liboil: liboil
2402
ifdef HAVE_DARWIN_OS
2403
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)")
2404 2405 2406 2407
else
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O2")
endif
	(cd $<; make && make install)
2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422
	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)
2423
	patch -p0 < Patches/schroedinger-notests.patch
2424

2425
.schroedinger: schroedinger .liboil
2426
	(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --with-thread=none --disable-gtk-doc --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make && make install)
2427 2428 2429 2430 2431
	touch $@

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

2433
# ***************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2434
# libass
2435 2436 2437 2438 2439
# ***************************************************************************

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

2440 2441
libass:
	$(GIT) clone $(ASS_GIT)
2442
	(cd $@; autoreconf -ivf)
2443

2444
.libass: libass .freetype
2445
	(cd $<; $(HOSTCC) ./configure --disable-png $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS) -O3" && make && make install)
2446 2447
	touch $@

2448 2449 2450
CLEAN_FILE += .libass
CLEAN_PKG += libass
DISTCLEAN_PKG += libass-$(ASS_VERSION).tar.bz2
2451

2452 2453 2454 2455
# ***************************************************************************
# Sparkle
# ***************************************************************************

Rafaël Carré's avatar
Rafaël Carré committed
2456
Sparkle-$(SPARKLE_VERSION).zip:
2457 2458
	$(WGET) $(SPARKLE_URL)

Rafaël Carré's avatar
Rafaël Carré committed
2459
.Sparkle: Sparkle-$(SPARKLE_VERSION).zip
2460 2461 2462 2463 2464 2465 2466 2467
	rm -rf $@ || true
	unzip $<
	rm -rf ../Sparkle
	mv Sparkle ..
	touch $@

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

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2488
# ***************************************************************************
2489
# GSM
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2490
# ***************************************************************************
2491 2492 2493 2494 2495 2496 2497 2498 2499 2500
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
2501 2502 2503
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
2504 2505 2506 2507 2508 2509 2510 2511 2512

.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

2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523
# ***************************************************************************
### GLEW 
# ***************************************************************************
glew-$(GLEW_VERSION)-src.tgz:
	$(WGET) $(GLEW_URL)

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

.glew: glew
2524 2525 2526 2527
	(cd $<; $(HOSTCC) CFLAGS="$(CFLAGS) -DGLEW_STATIC" make && $(HOSTCC) GLEW_DEST=$(PREFIX) make install)
ifdef HAVE_WIN32
	rm -rf $(PREFIX)/lib/libglew32.dll*
endif
2528 2529 2530 2531 2532 2533 2534
	touch $@

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


Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2535
# ***************************************************************************
2536
# projectM
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2537
# ***************************************************************************
2538
libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz:
2539 2540
	$(WGET) $(LIBPROJECTM_URL)

2541 2542 2543 2544
libprojectM: libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz
	rm -rf $@ || true
	gunzip -c $< | tar xf - --exclude='[*?:<>\|]'
	mv projectM-$(LIBPROJECTM_VERSION)-Source $@ || true
2545
	patch -p0 < Patches/libprojectM-win32.patch
2546
	cd $@; rm CMakeCache.txt
2547

2548
.libprojectM: libprojectM .glew
2549 2550 2551 2552
	(cd $<; $(HOSTCC) CPPFLAGS="$(CPPFLAGS)" cmake . -DCMAKE_TOOLCHAIN_FILE=../../toolchain.cmake -DINCLUDE-PROJECTM-LIBVISUAL:BOOL=OFF -DDISABLE_NATIVE_PRESETS:BOOL=ON -DUSE_FTGL:BOOL=OFF -DINCLUDE-PROJECTM-PULSEAUDIO:BOOL=OFF -DINCLUDE-PROJECTM-QT:BOOL=OFF -DBUILD_PROJECTM_STATIC:BOOL=ON -DCMAKE_INSTALL_PREFIX=$(PREFIX) && make install)
ifdef HAVE_WIN32
	(cd $<;cp Renderer/libRenderer.a MilkdropPresetFactory/libMilkdropPresetFactory.a $(PREFIX)/lib)
endif
2553 2554 2555 2556
	touch $@

CLEAN_FILE += .libprojectM
CLEAN_PKG += libprojectM
2557
DISTCLEAN_PKG += libprojectM-$(LIBPROJECTM_VERSION)-Source.tar.gz
2558

2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613
# ***************************************************************************
# 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 $@

2614
CLEAN_FILE += .xcb-util .xcb
2615 2616 2617
CLEAN_PKG += xcb-util xcb
DISTCLEAN_PKG += xcb-util-$(XCB_UTIL_VERSION).tar.bz2 libxcb-$(XCB_VERSION).tar.bz2

2618 2619 2620 2621
# ***************************************************************************
# Peflags utility (Windows only)
# ***************************************************************************

2622 2623 2624
peflags/peflags.c:
	mkdir -p peflags
	cd peflags && $(WGET) $(PEFLAGS_URL)/peflags.c
2625

2626
.peflags: peflags/peflags.c
2627 2628 2629
	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
2630 2631
	touch $@

2632
CLEAN_PKG += peflags
2633
CLEAN_FILE += .peflags
2634

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2635
# ***************************************************************************
2636
# Regex
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2637
# ***************************************************************************
2638 2639 2640 2641 2642 2643 2644 2645
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 )
2646
	touch $@
2647 2648 2649 2650 2651

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2652
# ***************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2653
# SQLite
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2654
# ***************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2655 2656 2657 2658 2659 2660 2661 2662
sqlite-amalgamation-$(SQLITE_VERSION).tar.gz:
	$(WGET) $(SQLITE_URL)

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

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

CLEAN_FILE += .sqlite3
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2666
CLEAN_PKG += sqlite-$(SQLITE_VERSION)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
2667 2668 2669
DISTCLEAN_PKG += sqlite-amalgamation-$(SQLITE_VERSION).tar.gz


2670
# ***************************************************************************
2671
# Some cleaning
2672 2673 2674
# ***************************************************************************

clean-dots: FORCE
2675
	rm -f $(CLEAN_FILE)
2676 2677

clean: clean-dots
2678
	rm -rf $(CLEAN_PKG)
2679 2680

clean-src: clean
2681
	rm -rf $(DISTCLEAN_PKG)
2682

2683
clean-svn:
2684
	rm -rf ffmpeg tremor x264 libdca pa_snapshot_v$(PORTAUDIO_VERSION).tar.gz portaudio live555-$(LIVEDOTCOM_VERSION).tar.gz live libass
2685

2686
distclean: clean-src
2687

2688 2689 2690 2691
# ***************************************************************************
# Download all the sources and package unversionned copies of subversion trees
# ***************************************************************************

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