From d0a92955856e012c1fffb321d651e1a47852c288 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Sun, 14 Apr 2013 21:34:48 +0000 Subject: [PATCH] 0.9.x: backport some fixes from trunk to allow building 0.9.8 with recent mingw-w64 toolchains. git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.9.x@5401 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- contrib/libmkv/module.defs | 4 +++ contrib/mpeg2dec/A02-gwluserdata.patch | 39 ++++++++++++++++++++++++++ libhb/module.defs | 2 +- make/include/contrib.defs | 16 +++++------ test/module.defs | 2 +- 5 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 contrib/mpeg2dec/A02-gwluserdata.patch diff --git a/contrib/libmkv/module.defs b/contrib/libmkv/module.defs index f16f7d5ef..9aa4ba1da 100644 --- a/contrib/libmkv/module.defs +++ b/contrib/libmkv/module.defs @@ -4,3 +4,7 @@ $(eval $(call import.CONTRIB.defs,LIBMKV)) LIBMKV.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libmkv-0.6.5-0-g82075ae.tar.gz LIBMKV.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache; mkdir m4; autoreconf -fiv; + +ifeq (mingw,$(BUILD.system)) + LIBMKV.GCC.D += random=rand srandom=srand +endif diff --git a/contrib/mpeg2dec/A02-gwluserdata.patch b/contrib/mpeg2dec/A02-gwluserdata.patch new file mode 100644 index 000000000..fdd1fc1d3 --- /dev/null +++ b/contrib/mpeg2dec/A02-gwluserdata.patch @@ -0,0 +1,39 @@ +diff -ru mpeg2dec.orig/libvo/video_out_dx.c mpeg2dec/libvo/video_out_dx.c +--- mpeg2dec.orig/libvo/video_out_dx.c 2008-07-09 11:28:24.000000000 -0700 ++++ mpeg2dec/libvo/video_out_dx.c 2012-09-08 05:31:39.304849824 -0700 +@@ -92,9 +92,9 @@ + switch (message) { + + case WM_WINDOWPOSCHANGED: +- instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA); ++ /*instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA); + +- /* update the window position and size */ ++ // update the window position and size + point_window.x = 0; + point_window.y = 0; + ClientToScreen (hwnd, &point_window); +@@ -104,9 +104,9 @@ + instance->window_coords.right = rect_window.right + point_window.x; + instance->window_coords.bottom = rect_window.bottom + point_window.y; + +- /* update the overlay */ ++ // update the overlay + if (instance->overlay && instance->display) +- update_overlay (instance); ++ update_overlay (instance);*/ + + return 0; + +@@ -173,7 +173,10 @@ + /* store a directx_instance pointer into the window local storage + * (for later use in event_handler). + * We need to use SetWindowLongPtr when it is available in mingw */ +- SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance); ++ ++ // Current version of MINGW-W64 does not have this! ++ // Since we are not outputting to a display, this is not a problem. ++ //SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance); + + ShowWindow (instance->window, SW_SHOW); + \ No newline at end of file diff --git a/libhb/module.defs b/libhb/module.defs index 3fefae82d..4371c5888 100644 --- a/libhb/module.defs +++ b/libhb/module.defs @@ -127,7 +127,7 @@ else endif LIBHB.GCC.args.extra.dylib++ += -Wl,--out-implib,$(LIBHB.lib) -LIBHB.GCC.l += iberty ws2_32 +LIBHB.GCC.l += ws2_32 ifeq ($(HAS.dlfcn),1) LIBHB.GCC.l += dl endif diff --git a/make/include/contrib.defs b/make/include/contrib.defs index 1a1d05c71..e05d21b1d 100644 --- a/make/include/contrib.defs +++ b/make/include/contrib.defs @@ -90,18 +90,18 @@ define import.CONTRIB.defs ## debug=max or optimizations=none. Otherwise, use the contribs defaults ifeq (max,$$($(1).GCC.g)) ifeq (none,$$($(1).GCC.O)) - $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g .O)" - $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g .O)" + $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g .O *D)" + $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g .O *D)" else - $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g)" - $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g)" + $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g *D)" + $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra .g *D)" endif else - $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)" - $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)" + $(1).CONFIGURE.env.CFLAGS = CFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra *D)" + $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra *D)" endif - $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra)" - $(1).CONFIGURE.env.LDFLAGS = LDFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra.exe)" + $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra *D)" + $(1).CONFIGURE.env.LDFLAGS = LDFLAGS="$$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra.exe *D)" $(1).CONFIGURE.env.PKG_CONFIG_PATH = PKG_CONFIG_PATH="$$(call fn.ABSOLUTE,$$(CONTRIB.build/))lib/pkgconfig" $(1).CONFIGURE.env.args = !CC !CFLAGS !CXX !CXXFLAGS !CPPFLAGS !LDFLAGS !PKG_CONFIG_PATH !LOCAL_PATH diff --git a/test/module.defs b/test/module.defs index 5030e6f29..f0832224e 100644 --- a/test/module.defs +++ b/test/module.defs @@ -68,6 +68,6 @@ ifeq ($(HAS.dlfcn),1) TEST.GCC.l += dl endif TEST.GCC.D += PTW32_STATIC_LIB - TEST.GCC.l += iberty ws2_32 + TEST.GCC.l += ws2_32 TEST.GCC.args.extra.exe++ += -static endif -- 2.40.0