]> git.sesse.net Git - vlc/blobdiff - extras/contrib/src/Makefile
Fix libtwolame contrib:
[vlc] / extras / contrib / src / Makefile
index 8809d558abda89498e3a460ab4eb445a462a7236..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,7 +91,8 @@ 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))
     #
     # Compiling for MinGW under Cygwin could be deemed as cross compiling
@@ -101,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
 
@@ -140,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
@@ -1212,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
@@ -1438,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 $@
 
@@ -1607,7 +1623,7 @@ libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2
 
 .gcrypt: libgcrypt .gpg-error
 ifdef HAVE_WIN32
-       (cd $<; ./autogen.sh && $(HOSTCC) ./configure $(HOSTCONF) --target=i586-mingw32msvc --prefix=$(PREFIX) --program-prefix="" CFLAGS="$(CFLAGS)" && sed -i 46s@sys/times.h@sys/time.h@ cipher/random.c && make && make install)
+       (cd $<; ./autogen.sh && $(HOSTCC) ./configure $(HOSTCONF) --target=i586-mingw32msvc --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && sed -i 46s@sys/times.h@sys/time.h@ cipher/random.c && make && make install)
 else
 ifeq ($(HOST),i686-apple-darwin8)
        (cd $<; $(HOSTCC) ./configure --host=$(HOST) --build=$(BUILD) --prefix=$(PREFIX) --disable-asm CFLAGS="$(CFLAGS)" && make && make install)
@@ -1636,7 +1652,7 @@ endif
 
 .gnutls: gnutls .gcrypt .gpg-error
 ifdef HAVE_WIN32
-       (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --target=i586-mingw32msvc --program-prefix="" && cd gl && make &&  cd ../lib &&make && make install && cd ../includes && make install)
+       (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" --target=i586-mingw32msvc && cd gl && make &&  cd ../lib &&make && make install && cd ../includes && make install)
 else
        (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && cd gl && make &&  cd ../lib &&make && make install && cd ../includes && make install)
 endif
@@ -1801,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
@@ -2045,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
 # ***************************************************************************