-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.ac
293 lines (256 loc) · 9.79 KB
/
configure.ac
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
AC_PREREQ([2.68])
AC_INIT([glslsandbox-player],[1.0],[[email protected]])
AM_INIT_AUTOMAKE([-Wall -Wno-portability subdir-objects foreign])
AC_CONFIG_TESTDIR([tests], [src])
AC_PROG_AWK
AM_PROG_AR
AC_PROG_CC
AC_PROG_OBJC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MKDIR_P
AC_PROG_SED
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
scripts/Makefile
src/Makefile
tests/Makefile
tests/atlocal
])
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
AC_TYPE_SIZE_T
AC_CHECK_FUNCS([clock_gettime malloc memset strerror strtol uname])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
[], [enable_debug=no])
AS_IF([test "x$enable_debug" = "xyes"], [
AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
])
AC_PATH_PROG([GLSLANGVALIDATOR], [glslangValidator])
AC_ARG_ENABLE([shader-validation],
AS_HELP_STRING([--enable-shader-validation], [enable shader validation @<:@default=disabled@:>@]),
[
if test -z "$ac_cv_path_GLSLANGVALIDATOR" ; then
AC_MSG_ERROR([glslangValidator is needed for shader validation])
fi
], [
if test -z "$ac_cv_path_GLSLANGVALIDATOR" ; then
enable_shader_validation=no
else
enable_shader_validation=yes
fi
])
AM_CONDITIONAL([ENABLE_SHADER_VALIDATION], [test "x$enable_shader_validation" = "xyes"])
AC_ARG_WITH([shader-list],
AS_HELP_STRING([--with-shader-list=LIST], [Define the shader list file @<:@default=shader.list@:>@]),
[], [with_shader_list=shader.list]
)
AC_SUBST([shader_list], [$with_shader_list])
AC_ARG_ENABLE([testing],
AS_HELP_STRING([--enable-testing], [Enable testing programs]),
[], [enable_testing=no])
AM_CONDITIONAL([ENABLE_TESTING], [test "x$enable_testing" == "xyes"])
AC_ARG_ENABLE([install-testsuite],
AS_HELP_STRING([--enable-install-testsuite], [Install testsuite]),
[], [enable_install_testsuite=no])
AM_CONDITIONAL([ENABLE_INSTALL_TESTSUITE], [test "x$enable_install_testsuite" == "xyes"])
AC_ARG_ENABLE([install-scripts],
AS_HELP_STRING([--enable-install-scripts], [Install additional scripts]),
[], [enable_install_scripts=no])
AM_CONDITIONAL([ENABLE_INSTALL_SCRIPTS], [test "x$enable_install_scripts" == "xyes"])
AC_ARG_ENABLE([strict-egl],
AS_HELP_STRING([--disable-strict-egl], [disable eglGetError() checks at each EGL call @<:@default=enabled@:>@]),
[], [enable_strict_egl=yes])
AS_IF([test "x$enable_strict_egl" = "xyes"], [
AC_DEFINE(XEGL_STRICT, [1], [Enable strict XEGL wrapper.])
])
AC_ARG_ENABLE([strict-gles],
AS_HELP_STRING([--disable-strict-gles], [disable glGetError() checks at each GLES call @<:@default=enabled@:>@]),
[], [enable_strict_gles=yes])
AS_IF([test "x$enable_strict_gles" = "xyes"], [
AC_DEFINE(XGLES_STRICT, [1], [Enable strict XGLES wrapper.])
])
PKG_CHECK_MODULES([egl], [egl >= 1])
PKG_CHECK_MODULES([glesv2], [glesv2 >= 1])
AC_CHECK_HEADERS([EGL/eglext.h], [], [],
[[#include <EGL/egl.h>
]])
# Automake part is defining libs using values returned by pkg-config
# So we temporarily add those values to LIBS to let AC_CHECK_FUNCS()
# do its detection.
OLD_LIBS="$LIBS"
LIBS="$egl_LIBS $LIBS"
AC_CHECK_FUNCS([eglGetPlatformDisplay])
LIBS="$OLD_LIBS"
AC_MSG_CHECKING([whether GL_GLEXT_PROTOTYPES is needed for core ES2 functions])
AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([[
#include <GLES2/gl2.h>
#ifndef GL_GLES_PROTOTYPES
# error "GL_GLES_PROTOTYPES is not defined"
#endif
]])],
[AC_MSG_RESULT([no])],
[
AC_MSG_RESULT([yes])
AC_DEFINE(GL_GLEXT_PROTOTYPES, [1], [GLES prototypes are needed])
])
AC_ARG_WITH([libpng],
AS_HELP_STRING([--with-libpng], [Enable libpng support @<:@default=enabled@:>@]),
[], [with_libpng=yes]
)
AS_IF([test "x$with_libpng" = "xyes"], [
PKG_CHECK_MODULES([libpng], [libpng], [
have_libpng=yes
AC_DEFINE(HAVE_LIBPNG, [1], [Have libpng.])
],[
have_libpng=no
AC_MSG_NOTICE([libpng not found. Disabling support.])
])
], [
have_libpng=no
])
AM_CONDITIONAL([HAVE_LIBPNG], [test "x$have_libpng" = "xyes"])
AC_ARG_WITH([native-gfx],
AS_HELP_STRING([--with-native-gfx=GFX],[Define the native gfx backend: x11(default),vivfb,rpi,wl,sdl2,kms,nullws,mali,wgl,em,osx]),
[], [with_native_gfx=x11])
AS_IF([test "x$with_native_gfx" = "xx11"], [
native_gfx=x11
PKG_CHECK_MODULES([x11], [x11 >= 1.4])
AC_DEFINE([ENABLE_X11], [1], [Enable X11.])
AC_MSG_NOTICE([X11 support enabled])
])
AM_CONDITIONAL([ENABLE_X11], [test "x$with_native_gfx" = "xx11"])
AS_IF([test "x$with_native_gfx" = "xvivfb"], [
native_gfx=vivfb
AC_DEFINE([ENABLE_VIVFB], [1], [Enable (i.MX6 / Vivante) fb.])
AC_DEFINE([EGL_API_FB], [1], [Enable Vivante EGL FB])
AC_DEFINE([LINUX], [1], [Vivante EGL FB needs LINUX to be defined])
AC_MSG_NOTICE([VivanteFB support enabled])
])
AM_CONDITIONAL([ENABLE_VIVFB], [test "x$with_native_gfx" = "xvivfb"])
AS_IF([test "x$with_native_gfx" = "xrpi"], [
native_gfx=rpi
AC_DEFINE([ENABLE_RPI], [1], [Enable Raspberry Pi])
AC_MSG_NOTICE([Raspberry Pi support enabled])
])
AM_CONDITIONAL([ENABLE_RPI], [test "x$with_native_gfx" = "xrpi"])
AS_IF([test "x$with_native_gfx" = "xwl"], [
native_gfx=wl
PKG_CHECK_MODULES([wayland_client], [wayland-client >= 1], [
have_wayland_client=yes
])
PKG_CHECK_MODULES([wayland_egl], [wayland-egl >= 1], [
have_wayland_egl=yes
])
AC_DEFINE([ENABLE_WL], [1], [Enable Wayland EGL])
AC_MSG_NOTICE([Wayland EGL support enabled])
])
AM_CONDITIONAL([ENABLE_WL], [test "x$with_native_gfx" = "xwl"])
AC_ARG_ENABLE([ivi],
AS_HELP_STRING([--enable-ivi], [enable IVI support for Wayland]),
[], [enable_ivi=no])
AS_IF([test "x$enable_ivi" = "xyes"], [
AC_DEFINE(ENABLE_WL_IVI, [1], [Enable Wayland IVI.])
])
AM_CONDITIONAL([ENABLE_WL_IVI], [test "x$enable_ivi" = "xyes"])
AC_ARG_ENABLE([wlxdg],
AS_HELP_STRING([--disable-wlxdg], [disable Wayland XDG shell protocol @<:@default=enabled@:>@]),
[], [enable_wlxdg=yes])
AS_IF([test "x$enable_wlxdg" = "xyes"], [
AC_DEFINE(ENABLE_WL_XDG, [1], [Enable Wayland XDG shell.])
])
AM_CONDITIONAL([ENABLE_WL_XDG], [test "x$enable_wlxdg" = "xyes"])
# Wayland xdg-shell protocol became stable in wayland-protocols v1.12
AS_IF([test "x$with_native_gfx" = "xwl" -a "x$enable_wlxdg" = "xyes"], [
PKG_CHECK_MODULES([wayland_protocols], [wayland-protocols >= 1.12],
[ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
AC_PATH_PROG([wayland_scanner], [wayland-scanner])
if test "x$wayland_scanner" = "x"; then
PKG_CHECK_MODULES([wayland_scanner], [wayland-scanner])
wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
fi
])
AS_IF([test "x$with_native_gfx" = "xkms"], [
native_gfx=kms
AC_DEFINE([ENABLE_KMS], [1], [Enable KMS/GBM/DRM])
AC_MSG_NOTICE([KMS/GBM/DRM support enabled])
PKG_CHECK_MODULES([drm], [libdrm])
PKG_CHECK_MODULES([gbm], [gbm])
# Automake part is defining libs using values returned by
# pkg-config So we temporarily add those values to LIBS to let
# AC_CHECK_FUNCS() do its detection.
OLD_LIBS="$LIBS"
LIBS="$drm_LIBS $LIBS"
AC_CHECK_FUNCS([drmGetDevices2])
LIBS="$OLD_LIBS"
])
AM_CONDITIONAL([ENABLE_KMS], [test "x$with_native_gfx" = "xkms"])
AS_IF([test "x$with_native_gfx" = "xsdl2"], [
native_gfx=sdl2
PKG_CHECK_MODULES([sdl2], [sdl2 >= 2], [
have_sdl2=yes
])
AC_DEFINE([ENABLE_SDL2], [1], [Enable SDL2])
AC_MSG_NOTICE([SDL2 EGL support enabled])
])
AM_CONDITIONAL([ENABLE_SDL2], [test "x$with_native_gfx" = "xsdl2"])
AS_IF([test "x$with_native_gfx" = "xwgl"], [
native_gfx=wgl
AC_DEFINE([ENABLE_WGL], [1], [Enable Native Windows WGL])
AC_MSG_NOTICE([Windows WGL support enabled])
])
AM_CONDITIONAL([ENABLE_WGL], [test "x$with_native_gfx" = "xwgl"])
AS_IF([test "x$with_native_gfx" = "xtisgx" ], [
with_native_gfx="nullws"
AC_MSG_NOTICE([info: tisgx is deprecated. using nullws.])
])
AS_IF([test "x$with_native_gfx" = "xamdimx" ], [
with_native_gfx="nullws"
AC_MSG_NOTICE([info: amdimx is deprecated. using nullws.])
])
AS_IF([test "x$with_native_gfx" = "xnullws" ], [
native_gfx=nullws
AC_DEFINE([ENABLE_NULLWS], [1], [Enable Null Windowing System])
AC_MSG_NOTICE([Null Windowing System support enabled])
])
AM_CONDITIONAL([ENABLE_NULLWS], [test "x$with_native_gfx" = "xnullws"])
AS_IF([test "x$with_native_gfx" = "xmali"], [
native_gfx=mali
AC_DEFINE([ENABLE_MALI], [1], [Enable Native Mali])
AC_MSG_NOTICE([Arm Mali support enabled])
])
AM_CONDITIONAL([ENABLE_MALI], [test "x$with_native_gfx" = "xmali"])
AS_IF([test "x$with_native_gfx" = "xem"], [
native_gfx=em
AC_DEFINE([ENABLE_EM], [1], [Enable Native Emscripten/Wasm])
AC_MSG_NOTICE([Emscripten/Wasm support enabled])
])
AM_CONDITIONAL([ENABLE_EM], [test "x$with_native_gfx" = "xem"])
AS_IF([test "x$with_native_gfx" = "xosx"], [
native_gfx=osx
AC_DEFINE([ENABLE_OSX], [1], [Enable Native OS X])
AC_MSG_NOTICE([OS X support enabled])
])
AM_CONDITIONAL([ENABLE_OSX], [test "x$with_native_gfx" = "xosx"])
AS_IF([test "x$native_gfx" = "x"], [
AC_MSG_ERROR([unknown native gfx selected: $with_native_gfx])
], [])
AC_OUTPUT
AC_MSG_RESULT([
---------------------
Configuration summary
---------------------
debug : ${enable_debug}
strict EGL : ${enable_strict_egl}
strict GLES2 : ${enable_strict_gles}
native-gfx : ${with_native_gfx}
libpng support : ${have_libpng}
shader list : ${with_shader_list}
testing : ${enable_testing}
install testsuite : ${enable_install_testsuite}
install scripts : ${enable_install_scripts}
shader validation : ${enable_shader_validation}
])