aboutsummaryrefslogtreecommitdiff
path: root/academic/octave/patches/qt4opengl.diff
blob: 4ed9f03d6b5ee76fe6c79de5a6c79092a3ea94dc (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

# HG changeset patch
# User John W. Eaton <jwe@octave.org>
# Date 1552335463 0
# Node ID 4af9840f9ce517ba4b591cfec0907731787a0bbc
# Parent  6c25c714bec436f70098355ab9d81d3b2fb083af
make building with Qt4 QGLWidget work again (bug #55735)

* acinclude.m4 (OCTAVE_CHECK_QT_VERSION): Also set and substitute
QT_OPENGL_CPPFLAGS and QT_OPENGL_LDFLAGS variables.
(OCTAVE_CHECK_QT_OPENGL_OK, OCTAVE_CHECK_QT_OPENGL_OFFSCREEN):
Add QT_OPENGL_CPPFLAGS to CPPFLAGS for tests, not QT_CPPFLAGS.

* libgui/graphics/module.mk %canon_reldir%___init_qt___la_CPPFLAGS):
Use QT_OPENGL_CPPFLAGS instead of QT_CPPFLAGS.
(%canon_reldir%___init_qt___la_LDFLAGS): Also include
$(QT_OPENGL_LDFLAGS) in the list.

diff --git a/libgui/graphics/module.mk b/libgui/graphics/module.mk
--- a/libgui/graphics/module.mk
+++ b/libgui/graphics/module.mk
@@ -138,7 +138,7 @@
   $(FONTCONFIG_CPPFLAGS) \
   $(HDF5_CPPFLAGS) \
   @OCTGUI_DLL_DEFS@ \
-  @QT_CPPFLAGS@ \
+  @QT_OPENGL_CPPFLAGS@ \
   -Ilibgui/graphics -I$(srcdir)/libgui/graphics \
   -Isrc -I$(srcdir)/libgui/src \
   -Iliboctave \
@@ -153,7 +153,9 @@
   -I$(srcdir)/libinterp/octave-value
 
 %canon_reldir%___init_qt___la_LDFLAGS = \
-  -avoid-version -module $(NO_UNDEFINED_LDFLAG) $(WARN_LDFLAGS)
+  -avoid-version -module $(NO_UNDEFINED_LDFLAG) \
+  $(QT_OPENGL_LDFLAGS) \
+  $(WARN_LDFLAGS)
 
 DLD_LIBOCTGUI_LIBADD = $(OCT_GUI_LINK_DEPS)
 
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -1820,7 +1820,7 @@
   AC_LANG_PUSH(C++)
   ac_octave_save_CPPFLAGS="$CPPFLAGS"
   ac_octave_save_CXXFLAGS="$CXXFLAGS"
-  CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
+  CPPFLAGS="$QT_OPENGL_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
   CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
   AC_CHECK_HEADERS([QOffscreenSurface])
   AC_CACHE_CHECK([whether Qt supports full offscreen OpenGL rendering],
@@ -1874,7 +1874,7 @@
   AC_LANG_PUSH(C++)
   ac_octave_save_CPPFLAGS="$CPPFLAGS"
   ac_octave_save_CXXFLAGS="$CXXFLAGS"
-  CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
+  CPPFLAGS="$QT_OPENGL_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
   CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
   AC_CHECK_HEADERS([QOpenGLWidget QGLWidget QGLFunctions_1_1])
   AC_CACHE_CHECK([whether Qt works with OpenGL and GLU],
@@ -2009,6 +2009,8 @@
     QT_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $QT_MODULES | $SED -e 's/^ *$//')"
     QT_LDFLAGS="$($PKG_CONFIG --libs-only-L $QT_MODULES | $SED -e 's/^ *$//')"
     QT_LIBS="$($PKG_CONFIG --libs-only-l $QT_MODULES | $SED -e 's/^ *$//')"
+    QT_OPENGL_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $QT_OPENGL_MODULE | $SED -e 's/^ *$//')"
+    QT_OPENGL_LDFLAGS="$($PKG_CONFIG --libs-only-L $QT_OPENGL_MODULE | $SED -e 's/^ *$//')"
     QT_OPENGL_LIBS="$($PKG_CONFIG --libs-only-l $QT_OPENGL_MODULE | $SED -e 's/^ *$//')"
 
     case $host_os in
@@ -2017,6 +2019,7 @@
         if test -z "$QT_LIBS"; then
           QT_LDFLAGS="`$PKG_CONFIG --libs-only-other $QT_MODULES | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`"
           QT_LIBS="`$PKG_CONFIG --libs-only-other $QT_MODULES | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`"
+          QT_OPENGL_LDFLAGS="`$PKG_CONFIG --libs-only-other $QT_OPENGL_MODULE | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`"
           QT_OPENGL_LIBS="`$PKG_CONFIG --libs-only-other $QT_OPENGL_MODULE | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`"
           ## Enabling link_all_deps works around libtool's imperfect handling
           ## of the -F flag
@@ -2173,6 +2176,8 @@
   AC_SUBST(QT_CPPFLAGS)
   AC_SUBST(QT_LDFLAGS)
   AC_SUBST(QT_LIBS)
+  AC_SUBST(QT_OPENGL_CPPFLAGS)
+  AC_SUBST(QT_OPENGL_LDFLAGS)
   AC_SUBST(QT_OPENGL_LIBS)
 ])
 dnl