Bug 126805

Summary: Krita compilation fails if Qt not built with opengl
Product: [Applications] krita Reporter: Caleb Tennis <caleb>
Component: GeneralAssignee: Adrian Page <adrian>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Caleb Tennis 2006-05-05 16:06:19 UTC
Version:           Koffice 1.5.0 (using KDE KDE 3.5.2)
Installed from:    Compiled From Sources
Compiler:          gcc 4.0 
OS:                Linux

Some krita files (kis_canvas.cc, kis_opengl_canvas.cc, etc) use QGLWidget, but don't properly check that Qt was built with opengl support.

There is a HAVE_GL define that comes in from configure.in.in from autoconf's GL check, but this doesn't check Qt's GL support.  

So, if Qt isn't built with opengl support, then krita building fails.
Comment 1 Adrian Page 2006-05-07 13:56:04 UTC
I'll have a look at this.
Comment 2 Adrian Page 2006-05-07 18:13:30 UTC
SVN commit 538361 by page:

Check that Qt has been built with OpenGL support, rather than just checking for its existence on the system.

BUG:126805


 M  +2 -1      configure.in.bot  
 M  +9 -1      configure.in.in  


--- branches/koffice/1.5/koffice/krita/configure.in.bot #538360:538361
@@ -19,7 +19,8 @@
   fi
   if test -z "$GLLIB"; then
     echo ""
-    echo "You're missing OpenGL libraries. krita will"
+    echo "You're missing OpenGL libraries or Qt has been"
+    echo "built without OpenGL support. krita will"
     echo "not be able to use OpenGL for hardware"
     echo "accelerated rendering."
     echo ""
--- branches/koffice/1.5/koffice/krita/configure.in.in #538360:538361
@@ -95,8 +95,16 @@
 
 # --- OpenGL check ---
 
-AC_HAVE_GL( [], [] )
+AC_MSG_CHECKING([for Qt OpenGL support])
 
+# check if Qt is linked against GL
+KDE_CHECK_LIB(qt-mt,glBegin,[have_qt_opengl=yes],[have_qt_opengl=no])
+
+if test "$have_qt_opengl" = 'yes'; then
+	# Get the libs, include path etc.
+	AC_HAVE_GL( [], [] )
+fi
+
 # --- End of OpenGL check ---
 
 # Check for powf.
Comment 3 Adrian Page 2006-05-14 14:10:05 UTC
Reopening as the fix gave false negatives and has been reverted.

Comment 4 Caleb Tennis 2006-05-29 15:12:42 UTC
yep, this is still persistant in koffice 1.5.1
Comment 5 Halla Rempt 2007-12-06 14:13:59 UTC
Fixed in trunk, where we use cmake's QT_QTOPENGL_FOUND check.