aboutsummarylogtreecommitdiffstats
path: root/0005-Support-ANGLE-switches-via-configure-shell-script.patch
blob: 7bb3c6b144eb7c0129fed6470aaf5964531aaaa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From a40c4d89a09af39c8a9b6e07f99aab277139da28 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 13:36:53 +0200
Subject: [PATCH 05/26] Support ANGLE switches via configure shell script

Required when cross-compiling with mingw-w64 because in
this case executing configure.bat is not appropriate
---
 configure                         | 26 ++++++++++++++++++++++++--
 src/gui/opengl/qopenglfunctions.h |  2 --
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 50e6dfbce6..af275de52c 100755
--- a/configure
+++ b/configure
@@ -1287,6 +1287,7 @@ while [ "$#" -gt 0 ]; do
         ;;
     opengl)
         if  [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
+            [ "$VAL" = "angle" ] || [ "$VAL" = "dynamic" ] ||
             [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
             [ "$VAL" = "es2" ]; then
             CFG_OPENGL="$VAL"
@@ -5320,7 +5321,7 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
     fi
     if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
         if compileTest x11/opengl "OpenGL"; then
-            CFG_OPENGL=desktop
+            CFG_OPENGL=angle
         elif compileTest unix/opengles2 "OpenGL ES 2.0"; then
             CFG_OPENGL=es2
         else
@@ -5356,6 +5357,17 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
             echo " ${XQMAKESPEC}."
             exit 1
         fi
+    elif [ "$CFG_OPENGL" = "angle" ]; then
+        compileTest x11/opengl "OpenGL"
+        if [ $? != "0" ]; then
+            echo "The OpenGL functionality test failed!"
+            echo " You might need to modify the include and library search paths by editing"
+            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
+            echo " ${XQMAKESPEC}."
+            exit 1
+        fi
+    elif [ "$CFG_OPENGL" = "dynamic" ]; then
+        true # FIXME: not sure whether/which test required
     elif [ "$CFG_OPENGL" = "desktop" ]; then
         # Desktop OpenGL support
         compileTest x11/opengl "OpenGL"
@@ -6431,6 +6443,16 @@ if [ "$CFG_OPENGL" = "es2" ]; then
     QT_CONFIG="$QT_CONFIG opengles2"
 fi
 
+if [ "$CFG_OPENGL" = "angle" ]; then
+    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES QT_OPENGL_ES_2"
+    QT_CONFIG="$QT_CONFIG opengles2 egl angle"
+fi
+
+if [ "$CFG_OPENGL" = "dynamic" ]; then
+    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_DYNAMIC"
+    QT_CONFIG="$QT_CONFIG dynamicgl"
+fi
+
 if [ "$CFG_SHARED" = "yes" ]; then
     QT_CONFIG="$QT_CONFIG shared"
     QTCONFIG_CONFIG="$QTCONFIG_CONFIG shared"
@@ -7479,7 +7501,7 @@ report_support "    OpenSSL .............." "$CFG_OPENSSL" yes "loading librarie
     report_support "    SecureTransport ......" "$CFG_SECURETRANSPORT"
 report_support "  OpenGL / OpenVG:"
 report_support "    EGL .................." "$CFG_EGL"
-report_support "    OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.0+"
+report_support "    OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.0+" angle "ANGLE" dynamic "Dynamic OpenGL"
 report_support "    OpenVG ..............." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
 report_support "  PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
 if [ -n "$PKG_CONFIG" ]; then
diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h
index f6cd0e553e..17214a0545 100644
--- a/src/gui/opengl/qopenglfunctions.h
+++ b/src/gui/opengl/qopenglfunctions.h
@@ -56,9 +56,7 @@
 
 //#define Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
 
-#ifdef QT_OPENGL_ES
 typedef double GLdouble;
-#endif
 
 #ifdef Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
 #include <stdio.h>
-- 
2.11.0