Skip to content

Commit 303a7b6

Browse files
committed
Plugins: Improve portability of GL and GLU detection
.. and use macOS' own OpenGL rather than Mesa's. Related documentation: https://www.gnu.org/software/autoconf-archive/ax_check_gl.html https://www.gnu.org/software/autoconf-archive/ax_check_glu.html
1 parent 90535d9 commit 303a7b6

File tree

13 files changed

+133
-23
lines changed

13 files changed

+133
-23
lines changed

.github/workflows/linux_and_macos.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ jobs:
106106
jack \
107107
libpng \
108108
luajit \
109-
mesa \
110-
mesa-glu \
111109
orc \
112110
pkg-config \
113111
portaudio \

libvisual-plugins/configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,16 @@ if test "$ENABLE_GSTREAMER_PLUGIN" = "yes"; then
181181
fi
182182
fi
183183

184-
dnl OpenGL + GLX
184+
dnl OpenGL + GLU
185185
AC_ARG_ENABLE([opengl],
186186
AS_HELP_STRING([--disable-opengl],
187187
[Do not build actor plugins based using OpenGL/GLU @<:@default=enabled@:>@]),
188188
[ENABLE_OPENGL_ACTORS=$enableval],
189189
[ENABLE_OPENGL_ACTORS=yes])
190190

191191
AS_IF([test "$ENABLE_OPENGL_ACTORS" = "yes"], [
192-
PKG_CHECK_MODULES([GL], [gl], [HAVE_OPENGL="yes"], [HAVE_OPENGL="no"])
193-
PKG_CHECK_MODULES([GLU], [glu], [HAVE_GLU="yes"], [HAVE_GLU="no"; HAVE_OPENGL="no"])
192+
AX_CHECK_GL([HAVE_OPENGL="yes"], [HAVE_OPENGL="no"])
193+
AX_CHECK_GLU([HAVE_GLU="yes"], [HAVE_GLU="no"; HAVE_OPENGL="no"])
194194
AS_IF([test "$HAVE_OPENGL" != "yes"], [
195195
AC_MSG_WARN([*** OpenGL and/or GLU have not been found, see above.
196196
Actor plugins using OpenGL will not be built.])

libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,21 @@
3131
#include <math.h>
3232
#include <gettext.h>
3333

34-
#include <GL/gl.h>
35-
#include <GL/glu.h>
34+
#ifdef HAVE_GL_GL_H
35+
# include <GL/gl.h>
36+
#elif defined(HAVE_OPENGL_GL_H)
37+
# include <OpenGL/gl.h>
38+
#else
39+
# error neither GL/gl.h nor OpenGL/gl.h available
40+
#endif
41+
42+
#if defined(HAVE_GL_GLU_H)
43+
# include <GL/glu.h>
44+
#elif defined(HAVE_OPENGL_GLU_H)
45+
# include <OpenGL/glu.h>
46+
#else
47+
# error neither GL/glu.h nor OpenGL/glu.h available
48+
#endif
3649

3750
#include "gl.h"
3851
#include "fastmath.h"

libvisual-plugins/plugins/actor/dancingparticles/etoile.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#include <cmath>
2-
#include <GL/glu.h>
2+
3+
#if defined(HAVE_GL_GLU_H)
4+
# include <GL/glu.h>
5+
#elif defined(HAVE_OPENGL_GLU_H)
6+
# include <OpenGL/glu.h>
7+
#else
8+
# error neither GL/glu.h nor OpenGL/glu.h available
9+
#endif
10+
311
#include <cstring>
412
#include <iostream>
513

libvisual-plugins/plugins/actor/dancingparticles/floatpoint.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
#define FLOATPOINT_HH
33

44
#include <iostream>
5-
#include <GL/gl.h>
5+
6+
#ifdef HAVE_GL_GL_H
7+
# include <GL/gl.h>
8+
#elif defined(HAVE_OPENGL_GL_H)
9+
# include <OpenGL/gl.h>
10+
#else
11+
# error neither GL/gl.h nor OpenGL/gl.h available
12+
#endif
13+
614
using namespace std;
715

816
#define myfloat GLfloat

libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,21 @@
3333
#include <math.h>
3434
#include <gettext.h>
3535

36-
#include <GL/gl.h>
37-
#include <GL/glu.h>
36+
#ifdef HAVE_GL_GL_H
37+
# include <GL/gl.h>
38+
#elif defined(HAVE_OPENGL_GL_H)
39+
# include <OpenGL/gl.h>
40+
#else
41+
# error neither GL/gl.h nor OpenGL/gl.h available
42+
#endif
43+
44+
#if defined(HAVE_GL_GLU_H)
45+
# include <GL/glu.h>
46+
#elif defined(HAVE_OPENGL_GLU_H)
47+
# include <OpenGL/glu.h>
48+
#else
49+
# error neither GL/glu.h nor OpenGL/glu.h available
50+
#endif
3851

3952
#include <libvisual/libvisual.h>
4053

libvisual-plugins/plugins/actor/madspin/madspin.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434

3535
#include <time.h>
3636

37-
#include <GL/gl.h>
38-
/*#include <GL/glu.h>*/
37+
#ifdef HAVE_GL_GL_H
38+
# include <GL/gl.h>
39+
#elif defined(HAVE_OPENGL_GL_H)
40+
# include <OpenGL/gl.h>
41+
#else
42+
# error neither GL/gl.h nor OpenGL/gl.h available
43+
#endif
3944

4045
#include <libvisual/libvisual.h>
4146

libvisual-plugins/plugins/actor/nastyfft/actor_nastyfft.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,21 @@
2727
#include <string.h>
2828
#include <math.h>
2929

30-
#include <GL/gl.h>
31-
#include <GL/glu.h>
30+
#ifdef HAVE_GL_GL_H
31+
# include <GL/gl.h>
32+
#elif defined(HAVE_OPENGL_GL_H)
33+
# include <OpenGL/gl.h>
34+
#else
35+
# error neither GL/gl.h nor OpenGL/gl.h available
36+
#endif
37+
38+
#if defined(HAVE_GL_GLU_H)
39+
# include <GL/glu.h>
40+
#elif defined(HAVE_OPENGL_GLU_H)
41+
# include <OpenGL/glu.h>
42+
#else
43+
# error neither GL/glu.h nor OpenGL/glu.h available
44+
#endif
3245

3346
#include <gettext.h>
3447

libvisual-plugins/plugins/actor/nebulus/child_data.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
#include <GL/gl.h>
1+
#ifdef HAVE_GL_GL_H
2+
# include <GL/gl.h>
3+
#elif defined(HAVE_OPENGL_GL_H)
4+
# include <OpenGL/gl.h>
5+
#else
6+
# error neither GL/gl.h nor OpenGL/gl.h available
7+
#endif
28

39
GLuint childNormals = 6153;
410

libvisual-plugins/plugins/actor/nebulus/face_data.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
#include <GL/gl.h>
1+
#ifdef HAVE_GL_GL_H
2+
# include <GL/gl.h>
3+
#elif defined(HAVE_OPENGL_GL_H)
4+
# include <OpenGL/gl.h>
5+
#else
6+
# error neither GL/gl.h nor OpenGL/gl.h available
7+
#endif
28

39
GLuint numVertices = 473;
410
GLuint numNormals = 537;

0 commit comments

Comments
 (0)