changeset 4026:28fa86d2cf21

ffmpeg: mods for native linux build of ffmpeg * src/ffmpeg.mk: add native build rule * src/libvpx-1-fixes.patch: update patch from mxe.cc * src/libvpx.mk: update to version 1.4.0, add native build rule * src/sdl-1-xdata.patch" new patch file * src/sdl.mk: add native build rule * src/xvidcore.mk: add native build rule
author John D
date Sat, 12 Sep 2015 20:35:11 -0400
parents 703b6f9eaea1
children c8c394328c54
files src/ffmpeg.mk src/libvpx-1-fixes.patch src/libvpx.mk src/sdl-1-xdata.patch src/sdl.mk src/xvidcore.mk
diffstat 6 files changed, 160 insertions(+), 133 deletions(-) [+]
line wrap: on
line diff
--- a/src/ffmpeg.mk	Sat Sep 12 01:56:42 2015 -0400
+++ b/src/ffmpeg.mk	Sat Sep 12 20:35:11 2015 -0400
@@ -13,28 +13,19 @@
 
 $(PKG)_CONFIG_OPTS :=
 
-ifeq ($(MXE_SYSTEM),mingw)
-    $(PKG)_CONFIG_OPTS += \
-        --target-os=mingw32
-endif
-
-ifneq ($(MXE_NATIVE_BUILD),yes)
-    $(PKG)_CONFIG_OPTS += \
-        --cross-prefix='$(MXE_TOOL_PREFIX)' \
-        --enable-cross-compile 
-endif
-
-
 define $(PKG)_UPDATE
     $(WGET) -q -O- 'http://www.ffmpeg.org/download.html' | \
     $(SED) -n 's,.*ffmpeg-\([0-9][^>]*\)\.tar.*,\1,p' | \
     head -1
 endef
 
+ifeq ($(MXE_NATIVE_BUILD),no)
 define $(PKG)_BUILD
     '$(SED)' -i "s^[-]lvpx^`'$(MXE_PKG_CONFIG)' --libs-only-l vpx`^g;" $(1)/configure
     cd '$(1)' && ./configure \
-        $($(PKG)_CONFIG_OPTS) \
+        --cross-prefix='$(MXE_TOOL_PREFIX)' \
+        --enable-cross-compile  \
+        --target-os=mingw32 \
         --arch=$(firstword $(subst -, ,$(TARGET))) \
         --prefix='$(HOST_PREFIX)' \
         $(ENABLE_SHARED_OR_STATIC) \
@@ -61,3 +52,32 @@
     $(MAKE) -C '$(1)' -j '$(JOBS)'
     $(MAKE) -C '$(1)' -j 1 install
 endef
+else
+define $(PKG)_BUILD
+    '$(SED)' -i "s^[-]lvpx^`'$(MXE_PKG_CONFIG)' --libs-only-l vpx`^g;" $(1)/configure
+    cd '$(1)' && CPPFLAGS=-I$(HOST_INCDIR) LDFLAGS=-L$(HOST_LIBDIR) ./configure \
+        --prefix='$(HOST_PREFIX)' \
+        $(ENABLE_SHARED_OR_STATIC) \
+        --disable-debug \
+        --disable-doc \
+        --enable-memalign-hack \
+        --enable-gpl \
+        --enable-version3 \
+        --disable-nonfree \
+        --enable-postproc \
+        --enable-avisynth \
+        --enable-libspeex \
+        --enable-libtheora \
+        --enable-libvorbis \
+        --enable-libmp3lame \
+        --enable-libxvid \
+        --disable-libfaac \
+        --enable-libopencore-amrnb \
+        --enable-libopencore-amrwb \
+        --enable-libx264 \
+        --enable-libvpx
+    $(MAKE) -C '$(1)' -j '$(JOBS)'
+    $(MAKE) -C '$(1)' -j 1 install
+endef
+
+endif
--- a/src/libvpx-1-fixes.patch	Sat Sep 12 01:56:42 2015 -0400
+++ b/src/libvpx-1-fixes.patch	Sat Sep 12 20:35:11 2015 -0400
@@ -3,39 +3,21 @@
 
 Contains ad hoc patches for cross building.
 
-From 01c0e284b4d458fade9f8b2288863f3dd4dbc81a Mon Sep 17 00:00:00 2001
-From: MXE
-Date: Fri, 25 May 2012 23:36:41 +0200
-Subject: [PATCH 1/4] add Libs.private to vpx.pc
-
+From 1408d07fb86254ae1aded0e8cf38e7e0c2550550 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Thu, 5 Sep 2013 14:25:31 -0700
+Subject: [PATCH 1/2] Linking as test is not good for cross compiling
 
-diff --git a/libs.mk b/libs.mk
-index e2ba737..209f77e 100644
---- a/libs.mk
-+++ b/libs.mk
-@@ -242,6 +242,7 @@ vpx.pc: config.mk libs.mk
- 	$(qexec)echo 'Requires:' >> $@
- 	$(qexec)echo 'Conflicts:' >> $@
- 	$(qexec)echo 'Libs: -L$${libdir} -lvpx' >> $@
-+	$(qexec)echo 'Libs.private: -lpthread' >> $@
- 	$(qexec)echo 'Cflags: -I$${includedir}' >> $@
- INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
- INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
--- 
-1.7.11.5
-
-
-From 73c1c32c41b75a432fbe092fb621474a760d0f51 Mon Sep 17 00:00:00 2001
-From: MXE
-Date: Fri, 25 May 2012 23:40:00 +0200
-Subject: [PATCH 2/4] linking as test is not good for cross compiling
-
+Signed-off-by: Timothy Gu <timothygu99@gmail.com>
+---
+ configure | 3 ---
+ 1 file changed, 3 deletions(-)
 
 diff --git a/configure b/configure
-index 62e1ffb..0c4faf9 100755
+index be36e56..987b2e9 100755
 --- a/configure
 +++ b/configure
-@@ -481,9 +481,6 @@ process_detect() {
+@@ -490,9 +490,6 @@ process_detect() {
          }
      fi
      check_header stdio.h || die "Unable to invoke compiler: ${CC} ${CFLAGS}"
@@ -46,45 +28,16 @@
      check_header stdint.h
      check_header pthread.h
 -- 
-1.7.11.5
-
-
-From 88bedac576559c599f3084b4eaa61a2ef85cfd06 Mon Sep 17 00:00:00 2001
-From: MXE
-Date: Fri, 25 May 2012 23:40:55 +0200
-Subject: [PATCH 3/4] fix bin/bash
+1.8.1.2
 
 
-diff --git a/build/make/armlink_adapter.sh b/build/make/armlink_adapter.sh
-index b53669c..71cf7e9 100755
---- a/build/make/armlink_adapter.sh
-+++ b/build/make/armlink_adapter.sh
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/usr/bin/env bash
- ##
- ##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- ##
-diff --git a/build/make/configure.sh b/build/make/configure.sh
-index 3c772e5..032b5e8 100755
---- a/build/make/configure.sh
-+++ b/build/make/configure.sh
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/usr/bin/env bash
- ##
- ##  configure.sh
- ##
-diff --git a/build/make/gen_asm_deps.sh b/build/make/gen_asm_deps.sh
-index 717f870..81b7095 100755
---- a/build/make/gen_asm_deps.sh
-+++ b/build/make/gen_asm_deps.sh
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/usr/bin/env bash
- ##
- ##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- ##
+From bada4be247273378809a30bf9a0ca7d9c9d2b936 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Thu, 5 Sep 2013 14:28:28 -0700
+Subject: [PATCH 2/2] Fix /bin/bash
+
+Signed-off-by: Timothy Gu <timothygu99@gmail.com>
+
 diff --git a/build/make/gen_msvs_def.sh b/build/make/gen_msvs_def.sh
 index 4defcc2..12e3573 100755
 --- a/build/make/gen_msvs_def.sh
@@ -115,51 +68,5 @@
  ##
  ##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  ##
-diff --git a/build/make/version.sh b/build/make/version.sh
-index 3efb956..b3a9c23 100755
---- a/build/make/version.sh
-+++ b/build/make/version.sh
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/usr/bin/env bash
- ##
- ##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- ##
-diff --git a/configure b/configure
-index 0c4faf9..5d1db69 100755
---- a/configure
-+++ b/configure
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/usr/bin/env bash
- ##
- ##  configure
- ##
 -- 
-1.7.11.5
-
-
-From 3d905203699e813027233bd0f19b05d44b98470d Mon Sep 17 00:00:00 2001
-From: MXE
-Date: Mon, 17 Sep 2012 20:23:14 +1000
-Subject: [PATCH 4/4] Fix for building on OSX
-
-Taken from:
-https://gerrit.chromium.org/gerrit/#/c/26027/
-
-diff --git a/build/make/gen_asm_deps.sh b/build/make/gen_asm_deps.sh
-index 81b7095..158ec34 100755
---- a/build/make/gen_asm_deps.sh
-+++ b/build/make/gen_asm_deps.sh
-@@ -42,7 +42,7 @@ done
- 
- [ -n "$srcfile" ] || show_help
- sfx=${sfx:-asm}
--includes=$(LC_ALL=C egrep -i "include +\"?+[a-z0-9_/]+\.${sfx}" $srcfile |
-+includes=$(LC_ALL=C egrep -i "include +\"?[a-z0-9_/]+\.${sfx}" $srcfile |
-            perl -p -e "s;.*?([a-z0-9_/]+.${sfx}).*;\1;")
- #" restore editor state
- for inc in ${includes}; do
--- 
-1.7.11.5
-
+1.8.1.2
--- a/src/libvpx.mk	Sat Sep 12 01:56:42 2015 -0400
+++ b/src/libvpx.mk	Sat Sep 12 20:35:11 2015 -0400
@@ -3,14 +3,15 @@
 
 PKG             := libvpx
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 1.1.0
-$(PKG)_CHECKSUM := 356af5f770c50cd021c60863203d8f30164f6021
-$(PKG)_SUBDIR   := $(PKG)-v$($(PKG)_VERSION)
-$(PKG)_FILE     := $(PKG)-v$($(PKG)_VERSION).tar.bz2
-$(PKG)_URL      := http://webm.googlecode.com/files/$($(PKG)_FILE)
+$(PKG)_VERSION  := 1.4.0
+$(PKG)_CHECKSUM := d05f4e9a9878886282ac9c9246f8fac080c94c8f
+$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
+$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.bz2
+$(PKG)_URL      := http://storage.googleapis.com/downloads.webmproject.org/releases/webm/$($(PKG)_FILE)
 $(PKG)_DEPS     := pthreads
 
 $(PKG)_TARGET_OPTS := 
+$(PKG)_ENV := 
 
 ifeq ($(MXE_NATIVE_BUILD),no)
   ifeq ($(ENABLE_WINDOWS_64),yes)
@@ -22,11 +23,13 @@
 
 
 define $(PKG)_UPDATE
-    $(WGET) -q -O- 'http://code.google.com/p/webm/downloads/list?sort=-uploaded' | \
-    $(SED) -n 's,.*libvpx-v\([0-9][^<]*\)\.tar.*,\1,p' | \
+    $(WGET) -q -O- 'http://downloads.webmproject.org/releases/webm/index.html' | \
+    $(SED) -n 's,.*libvpx-\([0-9][^>]*\)\.tar.*,\1,p' | \
+    $(SORT) -Vr | \
     head -1
 endef
 
+ifeq ($(MXE_NATIVE_BUILD),no)
 define $(PKG)_BUILD
     cd '$(1)' && \
         CROSS='$(MXE_TOOL_PREFIX)' \
@@ -41,5 +44,17 @@
     if [ $(BUILD_SHARED) = yes ]; then \
       $(MAKE_SHARED_FROM_STATIC) --ar '$(MXE_AR)' --ld '$(MXE_CC)' '$(HOST_LIBDIR)/libvpx.a' --install '$(INSTALL)' --libdir '$(HOST_LIBDIR)' --bindir '$(HOST_BINDIR)' -lpthread; \
     fi
- 
 endef
+else
+define $(PKG)_BUILD
+    cd '$(1)' && \
+        $($(PKG)_ENV) \
+        ./configure \
+        --prefix='$(HOST_PREFIX)' \
+        $(ENABLE_SHARED_OR_STATIC) \
+        --disable-examples \
+        --disable-install-docs
+    $(MAKE) -C '$(1)' -j '$(JOBS)'
+    $(MAKE) -C '$(1)' -j 1 install
+endef
+endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sdl-1-xdata.patch	Sat Sep 12 20:35:11 2015 -0400
@@ -0,0 +1,58 @@
+# HG changeset patch
+# User Azamat H. Hackimov <azamat.hackimov@gmail.com>
+# Date 1370184533 -21600
+# Branch SDL-1.2
+# Node ID 91ad7b43317a6387e115ecdf63a49137f47e42c8
+# Parent  f7fd5c3951b9ed922fdf696f7182e71b58a13268
+Fix compilation with libX11 >= 1.5.99.902.
+
+These changes fixes bug #1769 for SDL 1.2
+(http://bugzilla.libsdl.org/show_bug.cgi?id=1769).
+
+diff -r f7fd5c3951b9 -r 91ad7b43317a configure.in
+--- a/configure.in	Wed Apr 17 00:56:53 2013 -0700
++++ b/configure.in	Sun Jun 02 20:48:53 2013 +0600
+@@ -1169,6 +1169,17 @@
+             if test x$definitely_enable_video_x11_xrandr = xyes; then
+                 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
+             fi
++            AC_MSG_CHECKING(for const parameter to _XData32)
++            have_const_param_xdata32=no
++            AC_TRY_COMPILE([
++              #include <X11/Xlibint.h>
++              extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
++            ],[
++            ],[
++            have_const_param_xdata32=yes
++            AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
++            ])
++            AC_MSG_RESULT($have_const_param_xdata32)
+         fi
+     fi
+ }
+diff -r f7fd5c3951b9 -r 91ad7b43317a include/SDL_config.h.in
+--- a/include/SDL_config.h.in	Wed Apr 17 00:56:53 2013 -0700
++++ b/include/SDL_config.h.in	Sun Jun 02 20:48:53 2013 +0600
+@@ -283,6 +283,7 @@
+ #undef SDL_VIDEO_DRIVER_WINDIB
+ #undef SDL_VIDEO_DRIVER_WSCONS
+ #undef SDL_VIDEO_DRIVER_X11
++#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
+ #undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
+ #undef SDL_VIDEO_DRIVER_X11_DYNAMIC
+ #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
+diff -r f7fd5c3951b9 -r 91ad7b43317a src/video/x11/SDL_x11sym.h
+--- a/src/video/x11/SDL_x11sym.h	Wed Apr 17 00:56:53 2013 -0700
++++ b/src/video/x11/SDL_x11sym.h	Sun Jun 02 20:48:53 2013 +0600
+@@ -165,7 +165,11 @@
+  */
+ #ifdef LONG64
+ SDL_X11_MODULE(IO_32BIT)
++#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
++SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
++#else
+ SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
++#endif
+ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
+ #endif
+ 
--- a/src/sdl.mk	Sat Sep 12 01:56:42 2015 -0400
+++ b/src/sdl.mk	Sat Sep 12 20:35:11 2015 -0400
@@ -16,6 +16,7 @@
     head -1
 endef
 
+ifeq ($(MXE_NATIVE_BUILD),no)
 define $(PKG)_BUILD
     $(SED) -i 's,-mwindows,-lwinmm -mwindows,' '$(1)/configure'
     cd '$(1)' && ./configure \
@@ -37,3 +38,16 @@
     #    '$(2).c' -o '$(HOST_BINDIR)/test-sdl.exe' \
     #    `'$(MXE_PKG_CONFIG)' sdl --cflags --libs`
 endef
+else
+define $(PKG)_BUILD
+    cd '$(1)' && ./autogen.sh && ./configure \
+        $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
+        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
+        $(ENABLE_SHARED_OR_STATIC) \
+        --prefix='$(HOST_PREFIX)' \
+        --enable-threads \
+        --disable-stdio-redirect
+    $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+    $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+endef
+endif
--- a/src/xvidcore.mk	Sat Sep 12 01:56:42 2015 -0400
+++ b/src/xvidcore.mk	Sat Sep 12 20:35:11 2015 -0400
@@ -15,6 +15,7 @@
     echo $($(PKG)_VERSION)
 endef
 
+ifeq ($(MXE_NATIVE_BUILD),no)
 define $(PKG)_BUILD
     cd '$(1)' && autoconf
     cd '$(1)' && ./configure \
@@ -32,3 +33,15 @@
       $(INSTALL) -m644 '$(1)/build/xvidcore.dll' '$(HOST_BINDIR)/libxvidcore.dll'; \
     fi
 endef
+else
+define $(PKG)_BUILD
+    cd '$(1)' && autoconf
+    cd '$(1)' && ./configure \
+        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
+        --prefix='$(HOST_PREFIX)' \
+        $(ENABLE_SHARED_OR_STATIC) \
+        --prefix='$(HOST_PREFIX)'
+    $(MAKE) -C '$(1)' -j '$(JOBS)' BUILD_DIR='build'
+    $(MAKE) -C '$(1)' -j 1 BUILD_DIR='build' install
+endef
+endif