X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=extras%2Fcontrib%2Fsrc%2FMakefile;h=faa05e634f3ba005b277d85cbf49e0b00305f1cb;hb=8f77cb70b92aa2ffc78d21aafcf0d8022b6ebac4;hp=e4ae4c884e07f76299d69546026407b66ffa7377;hpb=a57f81be76098c94e9f684c6a7cc5dde12704568;p=vlc diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile index e4ae4c884e..faa05e634f 100644 --- a/extras/contrib/src/Makefile +++ b/extras/contrib/src/Makefile @@ -1,7 +1,7 @@ -# *************************************************************************** +#*************************************************************************** # src/Makefile : Dearchive and compile all files necessary # *************************************************************************** -# Copyright (C) 2003 - 2006 the VideoLAN team +# Copyright (C) 2003 - 2007 the VideoLAN team # $Id$ # # Authors: Christophe Massiot @@ -10,6 +10,7 @@ # Felix Kühne # Christophe Mutricy # Gildas Bazin +# Damien Fouilleul # # 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 @@ -35,6 +36,7 @@ include ./packages.mak export PATH := $(PREFIX)/bin:$(EXTRA_PATH):$(PATH) export PKG_CONFIG_PATH +export PKG_CONFIG_LIBDIR = $(PREFIX)/lib/pkgconfig export DYLD_LIBRARY_PATH = $(PREFIX)/lib # following is required for configure scripts that check dyld libraries # by building and running a test app @@ -81,15 +83,30 @@ else HOSTCC2=$(HOSTCC) endif +# For ffmpeg if not cross compiling +ifneq ($(CC),) + FFMPEGCONF=--cc="$(CC)" +endif + +# +# cross compiling +# +#This should be inside the if block but some config scripts are buggy +HOSTCONF=--target=$(HOST) --host=$(HOST) --build=$(BUILD) --program-prefix="" ifneq ($(BUILD),$(HOST)) -# We are cross compiling -HOSTCONF=--host=$(HOST) --build=$(BUILD) -FFMPEGCONF=--cross-prefix=$(HOST)- -X264CONF=--crosscompile=$(HOST) -else - ifneq ($(CC),) - FFMPEGCONF=--cc="$(CC)" - endif + # + # Compiling for MinGW under Cygwin could be deemed as cross compiling + # unfortunately there isn't a complete separate GCC toolchain for MinGW under Cygwin + # + ifeq ($(findstring cygwin,$(BUILD)),) + # We are REALLY cross compiling + FFMPEGCONF=--cross-prefix=$(HOST)- + X264CONF=--crosscompile=$(HOST) + PTHREADSCONF="CROSS=$(HOST)-" + else + # We are compiling for MinGW on Cygwin + PTHREADSCONF=$(HOSTCC) + endif endif # @@ -116,7 +133,7 @@ FFMPEGCONF += --enable-memalign-hack endif ifdef HAVE_DARWIN_OS -X264CONF += --enable-pic +X264CONF += --enable-pic --enable-debug ifneq ($(HOST),i686-apple-darwin8) FFMPEG_CFLAGS += -DHAVE_LRINTF endif @@ -128,18 +145,15 @@ endif ifdef HAVE_DARWIN_OS all: .autoconf .automake .libtool .intl .pkgcfg .freetype .fribidi \ - .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \ - .FLAC .speex .shout .faad .faac .lame .twolame .ebml .matroska .ffmpeg \ - .dvdcss .dvdnav .dvdread .dvbpsi .live .x264 .caca .mod \ - .png .gpg-error .gcrypt .gnutls .opendaap .cddb .cdio .vcdimager .SDL_image \ - .glib .libidl .gecko .mpcdec .dirac_encoder .dirac_decoder .aclocal \ - .libdca + .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \ + .FLAC .speex .shout .faad .faac .lame .twolame .ebml .matroska .ffmpeg \ + .dvdcss .dvdnav .dvdread .dvbpsi .live .caca .mod \ + .png .gpg-error .gcrypt .gnutls .opendaap .cddb .cdio .vcdimager \ + .SDL_image .glib .libidl .gecko .mpcdec .dirac_encoder .dirac_decoder \ + .libdca .tag .x264 .goom2k4 .aclocal # .expat .clinkcc don't work with SDK yet # .glib .libidl .gecko are required to build the mozilla plugin # .mozilla will build an entire mozilla. it can be used if we need to create a new .gecko package -ifneq ($(HOST),i686-apple-darwin8) -all: .goom2k4 -endif else ifdef HAVE_BEOS @@ -149,14 +163,16 @@ else .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \ .FLAC .speex .faad .faac .lame .ebml .matroska .ffmpeg .dvdcss \ .dvdnav .dvbpsi .aclocal .libdca + #.speex seems else # Cross compiling: we already have the Linux tools, only build the # libraries now all: .iconv .intl .freetype .fribidi \ .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \ - .FLAC .speex .faad .faac .lame .twolame .ebml .matroska .ffmpeg .dvdcss \ + .FLAC .faad .faac .lame .twolame .ebml .matroska .ffmpeg .dvdcss \ .dvdnav .dvbpsi .aclocal .libdca endif + #.speex else ifdef HAVE_WIN32 @@ -167,7 +183,8 @@ else .live .goom2k4 .caca .mod .x264 .xml .twolame \ .png .gpg-error .gcrypt .gnutls .mpcdec \ .dvdnav .dvbpsi .wxwidgets .qt4 .dirac \ - .dx_headers .dshow_headers .aclocal .gecko-win32 .unicows .libdca + .dx_headers .dshow_headers .aclocal .gecko-win32 .unicows .libdca \ + .SDL_image # .SDL_image .daap .cddb .cdio .vcdimager .portaudio else @@ -180,10 +197,10 @@ else all: .iconv .intl .freetype .fribidi .zlib \ .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \ .FLAC .speex .faad .faac .lame .ebml .matroska .ffmpeg .dvdcss \ - .live .goom2k4 .caca .mod .x264 .xml .twolame\ - .png .gpg-error .gcrypt .gnutls .mpcdec\ + .live .goom2k4 .caca .mod .x264 .xml .twolame \ + .png .gpg-error .gcrypt .gnutls .mpcdec \ .dvdnav .dvbpsi .wxwidgets .dirac \ - .aclocal .libdca + .aclocal .libdca .libraw1394 .libdc1394 # .png .gpg-error .gcrypt .gnutls .mpcdec\ # .SDL_image .daap .cddb .cdio .vcdimager endif @@ -198,17 +215,26 @@ FORCE: # *************************************************************************** define EXTRACT_GZ - tar xzf $< + rm -rf $@ || true + tar xzf $< --exclude='[*?:<>\|]' mv $(patsubst %.tar.gz,%,$(patsubst %.tgz,%,$(notdir $<))) $@ || true touch $@ endef define EXTRACT_BZ2 - bunzip2 -c $< | tar xf - + rm -rf $@ || true + bunzip2 -c $< | tar xf - --exclude='[*?:<>\|]' mv $(patsubst %.tar.bz2,%,$(notdir $<)) $@ || true touch $@ endef +define EXTRACT_ZIP + rm -rf $@ || true + unzip $< + mv $(patsubst %.zip,%,$(notdir $<)) $@ || true + touch $@ +endef + ### 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, @@ -290,11 +316,11 @@ endif # autoconf # *************************************************************************** -autoconf-$(AUTOCONF_VERSION).tar.gz: +autoconf-$(AUTOCONF_VERSION).tar.bz2: $(WGET) $(AUTOCONF_URL) -autoconf: autoconf-$(AUTOCONF_VERSION).tar.gz - $(EXTRACT_GZ) +autoconf: autoconf-$(AUTOCONF_VERSION).tar.bz2 + $(EXTRACT_BZ2) .autoconf: autoconf (cd $<; ./configure --prefix=$(PREFIX) && make && make install) @@ -302,7 +328,7 @@ autoconf: autoconf-$(AUTOCONF_VERSION).tar.gz CLEAN_FILE += .autoconf CLEAN_PKG += autoconf -DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.gz +DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.bz2 # *************************************************************************** # libtool @@ -360,15 +386,16 @@ DISTCLEAN_PKG += automake-$(AUTOMAKE_VERSION).tar.gz # pkgconfig # *************************************************************************** -pkgconfig-$(PKGCFG_VERSION).tar.gz: +pkg-config-$(PKGCFG_VERSION).tar.gz: $(WGET) $(PKGCFG_URL) -pkgconfig: pkgconfig-$(PKGCFG_VERSION).tar.gz +pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz $(EXTRACT_GZ) patch -d pkgconfig/glib-1.2.8 -p 1 < Patches/glib.patch + patch -d pkgconfig -p0 < Patches/pkgcfg.patch .pkgcfg: pkgconfig - (cd pkgconfig; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install) + (cd pkgconfig; autoconf && ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install) touch $@ CLEAN_FILE += .pkgcfg @@ -385,15 +412,17 @@ gettext-$(GETTEXT_VERSION).tar.gz: gettext: gettext-$(GETTEXT_VERSION).tar.gz $(EXTRACT_GZ) ifdef HAVE_DARWIN_OS - patch -p 0 < Patches/gettext-macosx.patch - (cd $@; ./autogen.sh) + patch -p0 < Patches/gettext-macosx.patch +endif +ifdef HAVE_WIN32 + patch -p0 < Patches/gettext-win32.patch endif .intl: gettext .iconv ifdef HAVE_WIN32 - ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-relocatable --with-iconv-prefix=$(PREFIX)) + ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-relocatable --with-iconv-prefix=$(PREFIX) --disable-java --disable-native-java) else - ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) ) + ( cd $< && $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-java --disable-native-java) endif ifeq ($(BUILD),i586-pc-beos) # The ugliest kludge ever - so libtool correctly links shared libraries @@ -409,7 +438,7 @@ else endif # Work around another non-sense of autoconf. ifdef HAVE_WIN32 - (cd ../include; sed -i.orig '283 c #if !1' libintl.h) + (cd ../include; sed -i.orig '311 c #if !1' libintl.h) endif $(INSTALL_NAME) touch $@ @@ -428,7 +457,7 @@ libiconv-$(LIBICONV_VERSION).tar.gz: libiconv: libiconv-$(LIBICONV_VERSION).tar.gz $(EXTRACT_GZ) ifdef HAVE_DARWIN_OS - patch -p 0 < Patches/libiconv.patch + patch -p0 < Patches/libiconv.patch endif ifdef HAVE_DARWIN_OS @@ -473,9 +502,9 @@ fribidi-$(FRIBIDI_VERSION).tar.gz: fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz $(EXTRACT_GZ) - patch -p 0 < Patches/fribidi.patch.real + patch -p0 < Patches/fribidi.patch.real ifdef HAVE_WIN32 - patch -p 0