]> git.sesse.net Git - vlc/blobdiff - extras/contrib/src/Makefile
Fix libtwolame contrib:
[vlc] / extras / contrib / src / Makefile
index eada5a0780867cb59b89864a2709720a9d24ea8e..faa05e634f3ba005b277d85cbf49e0b00305f1cb 100644 (file)
@@ -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 <massiot@via.ecp.fr>
@@ -91,9 +91,9 @@ endif
 #
 # cross compiling
 #
-HOSTCONF=--target=$(HOST) --host=$(HOST) --build=$(BUILD)
+#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))
-    HOSTCONF+=--program-prefix=""
     #
     # 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,6 +102,10 @@ ifneq ($(BUILD),$(HOST))
         # 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
 
@@ -141,12 +145,12 @@ 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 .caca .mod \
-       .png .gpg-error .gcrypt .gnutls .opendaap .cddb .cdio .vcdimager .SDL_image \
-       .glib .libidl .gecko .mpcdec .dirac_encoder .dirac_decoder .aclocal \
-        .libdca .tag .x264 .goom2k4
+    .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
@@ -1213,8 +1217,13 @@ else
 endif
 endif
 
+ifdef HAVE_WIN32
+.x264: x264 .pthreads
+       (cd $<; ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
+else
 .x264: x264
        (cd $<; ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
+endif
        touch $@
 
 CLEAN_FILE += .x264
@@ -1439,9 +1448,15 @@ twolame: twolame-$(TWOLAME_VERSION).tar.gz
 ifdef HAVE_BEOS
        patch -p0 < Patches/twolame-BeOS.patch
 endif
+ifdef HAVE_DARWIN_OS
+       patch -p0 < Patches/twolame-osx.patch
+endif
 
 .twolame: twolame
-       (cd twolame; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make && make install)
+ifdef HAVE_WIN32
+       (cd twolame/win32; wget "http://twolame.svn.sourceforge.net/viewvc/*checkout*/twolame/trunk/win32/winutil.h")
+endif  
+       (cd twolame; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && cd libtwolame &&  make && make install)
        $(INSTALL_NAME)
        touch $@
 
@@ -1802,6 +1817,7 @@ ifdef HAVE_WIN32
 else
        (cd $<; ./configure --with-CFLAGS="$(CFLAGS)" --with-JPEG=no --with-ZIP=no --prefix=$(PREFIX) && make -C port &&make -C libtiff && make -C libtiff install)
 endif
+       $(INSTALL_NAME)
        touch $@
 
 CLEAN_FILE += .tiff
@@ -2046,6 +2062,19 @@ taglib: taglib-$(TAGLIB_VERSION).tar.gz
        $(INSTALL_NAME)
        touch $@
 
+
+pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz:
+       $(WGET) $(PTHREADS_URL)
+
+pthreads: pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
+       $(EXTRACT_GZ)
+
+.pthreads: pthreads
+       (cd $<; $(HOSTCC) make $(PTHREADSCONF) GC-inlined; cp pthread.h ../../include/; cp *.dll *.a ../../lib/)
+       $(INSTALL_NAME)
+       touch $@
+
+
 # ***************************************************************************
 # Some cleansing
 # ***************************************************************************