-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgl.m4
More file actions
66 lines (60 loc) · 1.75 KB
/
Copy pathgl.m4
File metadata and controls
66 lines (60 loc) · 1.75 KB
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
AC_DEFUN([MOONLIGHT_CHECK_GL],
[
with_gl=no
with_opengl=no
dnl GLX
AC_ARG_WITH(glx, AC_HELP_STRING([--with-glx=yes|no],
[If you want to enable support for glx]),
[], [with_glx=yes])
if test x$with_glx = xyes; then
if pkg-config --exists gl x11; then
AC_DEFINE(USE_GLX, 1, [Include glx support])
PKG_CHECK_MODULES(GLX, gl x11)
with_gl=yes
with_opengl=yes
# MOONLIGHT_CHECK_GLCHAR([GL/gl.h])
else
with_glx=no
fi
fi
AM_CONDITIONAL(HAVE_GLX, [test x$with_glx != xno])
dnl CGL
AC_ARG_WITH(cgl, AC_HELP_STRING([--with-cgl=yes|no],
[If you want to enable support for cgl]),
[], [with_cgl=no])
if test x$with_cgl = xyes; then
AC_DEFINE(USE_CGL, 1, [Include cgl support])
with_gl=yes
with_opengl=yes
# MOONLIGHT_CHECK_GLCHAR([OpenGL/OpenGL.h])
fi
AM_CONDITIONAL(HAVE_CGL, [test x$with_cgl != xno])
dnl EGL
AC_ARG_WITH(egl, AC_HELP_STRING([--with-egl=yes|no],
[If you want to enable support for egl]),
[], [with_egl=no])
if test x$with_egl = xyes; then
AC_DEFINE(USE_EGL, 1, [Include egl support])
with_gl=yes
# MOONLIGHT_CHECK_GLCHAR([GLES/gl.h])
fi
AM_CONDITIONAL(HAVE_EGL, [test x$with_egl != xno])
AM_CONDITIONAL(HAVE_GL, [test x$with_gl != xno])
AM_CONDITIONAL(HAVE_OPENGL, [test x$with_opengl != xno])
])
AC_DEFUN([MOONLIGHT_CHECK_GLCHAR],
[AC_CACHE_CHECK([for GLchar], ac_cv_type_GLchar,
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT
# include <$1>],
[GLchar x; return sizeof x;])],
[ac_cv_type_glchar=yes],
[ac_cv_type_glchar=no])])
if test x$type_glchar = xyes; then
AC_DEFINE([HAVE_GLCHAR], 1,
[Define to 1 if GL header declares GLchar.])
else
AC_DEFINE([GLchar], char,
[Define to a type if GL header does not define.])
fi])