Ticket #58275: 4af9840f9ce5

File 4af9840f9ce5, 3.6 KB (added by chrisjohgorman (Chris Gorman), 6 years ago)

git patches

Line 
1
2# HG changeset patch
3# User John W. Eaton <jwe@octave.org>
4# Date 1552335463 0
5# Node ID 4af9840f9ce517ba4b591cfec0907731787a0bbc
6# Parent  6c25c714bec436f70098355ab9d81d3b2fb083af
7make building with Qt4 QGLWidget work again (bug #55735)
8
9* acinclude.m4 (OCTAVE_CHECK_QT_VERSION): Also set and substitute
10QT_OPENGL_CPPFLAGS and QT_OPENGL_LDFLAGS variables.
11(OCTAVE_CHECK_QT_OPENGL_OK, OCTAVE_CHECK_QT_OPENGL_OFFSCREEN):
12Add QT_OPENGL_CPPFLAGS to CPPFLAGS for tests, not QT_CPPFLAGS.
13
14* libgui/graphics/module.mk %canon_reldir%___init_qt___la_CPPFLAGS):
15Use QT_OPENGL_CPPFLAGS instead of QT_CPPFLAGS.
16(%canon_reldir%___init_qt___la_LDFLAGS): Also include
17$(QT_OPENGL_LDFLAGS) in the list.
18
19diff --git a/libgui/graphics/module.mk b/libgui/graphics/module.mk
20--- a/libgui/graphics/module.mk
21+++ b/libgui/graphics/module.mk
22@@ -138,7 +138,7 @@
23   $(FONTCONFIG_CPPFLAGS) \
24   $(HDF5_CPPFLAGS) \
25   @OCTGUI_DLL_DEFS@ \
26-  @QT_CPPFLAGS@ \
27+  @QT_OPENGL_CPPFLAGS@ \
28   -Ilibgui/graphics -I$(srcdir)/libgui/graphics \
29   -Isrc -I$(srcdir)/libgui/src \
30   -Iliboctave \
31@@ -153,7 +153,9 @@
32   -I$(srcdir)/libinterp/octave-value
33 
34 %canon_reldir%___init_qt___la_LDFLAGS = \
35-  -avoid-version -module $(NO_UNDEFINED_LDFLAG) $(WARN_LDFLAGS)
36+  -avoid-version -module $(NO_UNDEFINED_LDFLAG) \
37+  $(QT_OPENGL_LDFLAGS) \
38+  $(WARN_LDFLAGS)
39 
40 DLD_LIBOCTGUI_LIBADD = $(OCT_GUI_LINK_DEPS)
41 
42diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
43--- a/m4/acinclude.m4
44+++ b/m4/acinclude.m4
45@@ -1820,7 +1820,7 @@
46   AC_LANG_PUSH(C++)
47   ac_octave_save_CPPFLAGS="$CPPFLAGS"
48   ac_octave_save_CXXFLAGS="$CXXFLAGS"
49-  CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
50+  CPPFLAGS="$QT_OPENGL_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
51   CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
52   AC_CHECK_HEADERS([QOffscreenSurface])
53   AC_CACHE_CHECK([whether Qt supports full offscreen OpenGL rendering],
54@@ -1874,7 +1874,7 @@
55   AC_LANG_PUSH(C++)
56   ac_octave_save_CPPFLAGS="$CPPFLAGS"
57   ac_octave_save_CXXFLAGS="$CXXFLAGS"
58-  CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
59+  CPPFLAGS="$QT_OPENGL_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
60   CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
61   AC_CHECK_HEADERS([QOpenGLWidget QGLWidget QGLFunctions_1_1])
62   AC_CACHE_CHECK([whether Qt works with OpenGL and GLU],
63@@ -2009,6 +2009,8 @@
64     QT_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $QT_MODULES | $SED -e 's/^ *$//')"
65     QT_LDFLAGS="$($PKG_CONFIG --libs-only-L $QT_MODULES | $SED -e 's/^ *$//')"
66     QT_LIBS="$($PKG_CONFIG --libs-only-l $QT_MODULES | $SED -e 's/^ *$//')"
67+    QT_OPENGL_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $QT_OPENGL_MODULE | $SED -e 's/^ *$//')"
68+    QT_OPENGL_LDFLAGS="$($PKG_CONFIG --libs-only-L $QT_OPENGL_MODULE | $SED -e 's/^ *$//')"
69     QT_OPENGL_LIBS="$($PKG_CONFIG --libs-only-l $QT_OPENGL_MODULE | $SED -e 's/^ *$//')"
70 
71     case $host_os in
72@@ -2017,6 +2019,7 @@
73         if test -z "$QT_LIBS"; then
74           QT_LDFLAGS="`$PKG_CONFIG --libs-only-other $QT_MODULES | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`"
75           QT_LIBS="`$PKG_CONFIG --libs-only-other $QT_MODULES | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`"
76+          QT_OPENGL_LDFLAGS="`$PKG_CONFIG --libs-only-other $QT_OPENGL_MODULE | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`"
77           QT_OPENGL_LIBS="`$PKG_CONFIG --libs-only-other $QT_OPENGL_MODULE | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`"
78           ## Enabling link_all_deps works around libtool's imperfect handling
79           ## of the -F flag
80@@ -2173,6 +2176,8 @@
81   AC_SUBST(QT_CPPFLAGS)
82   AC_SUBST(QT_LDFLAGS)
83   AC_SUBST(QT_LIBS)
84+  AC_SUBST(QT_OPENGL_CPPFLAGS)
85+  AC_SUBST(QT_OPENGL_LDFLAGS)
86   AC_SUBST(QT_OPENGL_LIBS)
87 ])
88 dnl
89