[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#765818: simgear: FTBFS[kfreebsd]: wrong usage of GL/glxext.h



Package: simgear
Version: 3.0.0-5
Severity: serious
Control: block 754988 by -1

Hi,

Upgrading mesa-common-dev from upstream version 10.2.8 to 10.3.1,
unfortuntaely made simgear FTBFS:
https://buildd.debian.org/status/fetch.php?pkg=simgear&arch=kfreebsd-amd64&ver=3.0.0-5%2Bb1&stamp=1413603273

Normally one includes gl.h first, which in turn includes glext.h, but
specifically on kfreebsd, simgear was preventing that with the
GL_GLEXT_LEGACY flag:

simgear/canvas/ShivaVG/src/shDefs.h:
| #if defined(VG_API_LINUX)
|     #include <GL/gl.h>
|     #include <GL/glu.h>
|     #include <GL/glx.h>
| ...
| #else
|     #define GL_GLEXT_LEGACY /* don't include glext.h */
|     #include <GL/gl.h>
|     #include <GL/glu.h>
|     #include <GL/glx.h>
| #endif

>From Mesa 10.3 there are some glext.h types used in glxext.h;  it
would be necessary to use a new GLX_GLXEXT_LEGACY flag to avoid
inclusion of the latter as well.

But, there is no reason GNU/kFreeBSD can't use VG_API_LINUX, and use
the normal GL API without any _LEGACY flags.

Patch attached!  Thanks.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-2-amd64-xenhvm-ipsec
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
From: Steven Chamberlain <steven@pyro.eu.org>
Subject: GL usage for GNU/kFreeBSD
Date: Sat, 18 Oct 2014 13:12:53 +0100

Since mesa 10.3, glx.h fails to compile if GL_GLEXT_LEGACY
is used without also GLX_GLXEXT_LEGACY.

And GNU/kFreeBSD should better use the GNU/Linux VG_API_LINUX
rather than VG_API_FREEBSD anyway.

--- a/simgear/canvas/ShivaVG/src/shConfig.h
+++ b/simgear/canvas/ShivaVG/src/shConfig.h
@@ -16,7 +16,7 @@
         #define NOMINMAX
     #endif
 
-#elif defined(linux) || defined(__linux)
+#elif defined(linux) || defined(__linux) || defined(__GLIBC__)
 
     // Linux
     #define VG_API_LINUX
@@ -26,7 +26,7 @@
     // MacOS
     #define VG_API_MACOSX
 
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(__FreeBSD__)
 
     // FreeBSD
     #define VG_API_FREEBSD
--- a/simgear/canvas/ShivaVG/src/shDefs.h
+++ b/simgear/canvas/ShivaVG/src/shDefs.h
@@ -170,6 +170,7 @@
     #define GL_GLEXT_LEGACY /* don't include glext.h */
     #include <GL/gl.h>
     #include <GL/glu.h>
+    #define GLX_GLXEXT_LEGACY /* don't include glxext.h */
     #include <GL/glx.h>
 #endif
 

Reply to: