From 4f38d4782fd9d192cc3c5d3cce691990877ca64d Mon Sep 17 00:00:00 2001
From: Bradley Sepos <bradley@bradleysepos.com>
Date: Mon, 7 Jan 2019 21:01:30 -0500
Subject: contrib: Update x265 cross compilation directives.

Necessary for cross compiling with gcc 8.
---
 contrib/x265_10bit/module.defs | 8 ++++++++
 contrib/x265_12bit/module.defs | 8 ++++++++
 contrib/x265_8bit/module.defs  | 8 ++++++++
 3 files changed, 24 insertions(+)

(limited to 'contrib')

diff --git a/contrib/x265_10bit/module.defs b/contrib/x265_10bit/module.defs
index 12bbdedaa..b7fa93d35 100644
--- a/contrib/x265_10bit/module.defs
+++ b/contrib/x265_10bit/module.defs
@@ -28,6 +28,14 @@ endif
 ifeq (1,$(BUILD.cross))
     ifeq (mingw,$(BUILD.system))
         X265_10.CONFIGURE.extra += -DWIN32=ON
+        X265_10.CONFIGURE.extra += -DCMAKE_SYSTEM_NAME=Windows
+        X265_10.CONFIGURE.extra += -DCMAKE_C_COMPILER=$(X265_10.GCC.gcc)
+        X265_10.CONFIGURE.extra += -DCMAKE_C_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_10.CONFIGURE.extra += -DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_10.CONFIGURE.extra += -DCMAKE_CXX_COMPILER=$(X265_10.GCC.gxx)
+        X265_10.CONFIGURE.extra += -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_10.CONFIGURE.extra += -DCMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_10.CONFIGURE.extra += -DCMAKE_RC_COMPILER=$(BUILD.cross.prefix)windres
     endif
     X265_10.CONFIGURE.args.host  = -DCMAKE_SYSTEM_NAME="$(X265_10.CONFIGURE.host)"
     X265_10.CONFIGURE.args.build = -DCMAKE_HOST_SYSTEM="$(X265_10.CONFIGURE.build)"
diff --git a/contrib/x265_12bit/module.defs b/contrib/x265_12bit/module.defs
index 17083172f..b141c4ca4 100644
--- a/contrib/x265_12bit/module.defs
+++ b/contrib/x265_12bit/module.defs
@@ -28,6 +28,14 @@ endif
 ifeq (1,$(BUILD.cross))
     ifeq (mingw,$(BUILD.system))
         X265_12.CONFIGURE.extra += -DWIN32=ON
+        X265_12.CONFIGURE.extra += -DCMAKE_SYSTEM_NAME=Windows
+        X265_12.CONFIGURE.extra += -DCMAKE_C_COMPILER=$(X265_12.GCC.gcc)
+        X265_12.CONFIGURE.extra += -DCMAKE_C_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_12.CONFIGURE.extra += -DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_12.CONFIGURE.extra += -DCMAKE_CXX_COMPILER=$(X265_12.GCC.gxx)
+        X265_12.CONFIGURE.extra += -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_12.CONFIGURE.extra += -DCMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_12.CONFIGURE.extra += -DCMAKE_RC_COMPILER=$(BUILD.cross.prefix)windres
     endif
     X265_12.CONFIGURE.args.host  = -DCMAKE_SYSTEM_NAME="$(X265_12.CONFIGURE.host)"
     X265_12.CONFIGURE.args.build = -DCMAKE_HOST_SYSTEM="$(X265_12.CONFIGURE.build)"
diff --git a/contrib/x265_8bit/module.defs b/contrib/x265_8bit/module.defs
index 158ba700c..3733574e4 100644
--- a/contrib/x265_8bit/module.defs
+++ b/contrib/x265_8bit/module.defs
@@ -25,6 +25,14 @@ endif
 ifeq (1,$(BUILD.cross))
     ifeq (mingw,$(BUILD.system))
         X265_8.CONFIGURE.extra += -DWIN32=ON
+        X265_8.CONFIGURE.extra += -DCMAKE_SYSTEM_NAME=Windows
+        X265_8.CONFIGURE.extra += -DCMAKE_C_COMPILER=$(X265_8.GCC.gcc)
+        X265_8.CONFIGURE.extra += -DCMAKE_C_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_8.CONFIGURE.extra += -DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_8.CONFIGURE.extra += -DCMAKE_CXX_COMPILER=$(X265_8.GCC.gxx)
+        X265_8.CONFIGURE.extra += -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_8.CONFIGURE.extra += -DCMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS="-static-libgcc -static-libstdc++ -static"
+        X265_8.CONFIGURE.extra += -DCMAKE_RC_COMPILER=$(BUILD.cross.prefix)windres
     endif
     X265_8.CONFIGURE.args.host  = -DCMAKE_SYSTEM_NAME="$(X265_8.CONFIGURE.host)"
     X265_8.CONFIGURE.args.build = -DCMAKE_HOST_SYSTEM="$(X265_8.CONFIGURE.build)"
-- 
cgit v1.2.3