1 # Copyright © 2009 Intel Corporation
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23 # Eric Anholt <eric@anholt.net>
25 dnl Process this file with autoconf to create configure.
28 AC_INIT([mesa-demos], [8.0.1],
29 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=Demos])
32 AM_INIT_AUTOMAKE([dist-bzip2])
41 AC_CONFIG_MACRO_DIR([m4])
43 # Enable quiet compiles on automake 1.11.
44 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
46 dnl Make sure the pkg-config macros are defined
47 m4_ifndef([PKG_PROG_PKG_CONFIG],
48 [m4_fatal([Could not locate the pkg-config autoconf macros.
49 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
50 are in a different location, try setting the environment variable
51 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
55 [AS_HELP_STRING([--enable-gl],
56 [enable EGL library @<:@default=auto@:>@])],
57 [gl_enabled="$enableval"],
59 if test "x$gl_enabled" != "xno"; then
60 dnl Get the pkg-config definitions for libGL. We include a fallback
61 dnl path for GL implementation that don't provide a .pc file
62 PKG_CHECK_MODULES(GL, [gl], [], [
63 AC_CHECK_HEADER([GL/gl.h],
72 DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
73 DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
80 [AS_HELP_STRING([--with-glut=DIR],
81 [glut install directory])],
82 [GLUT_CFLAGS="-I$withval/include"
83 GLUT_LIBS="-L$withval/lib -lglut"])
84 AC_CHECK_HEADER([GL/glut.h],
93 PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4],[],[gl_enabled=no])
94 DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
95 DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
97 # LIBS was set by AC_CHECK_LIB above
100 PKG_CHECK_MODULES(GLU, [glu], [],
101 [AC_CHECK_HEADER([GL/glu.h],
109 DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
110 DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
112 if test "x$gl_enabled" = "xno"; then
113 AC_MSG_WARN([Some GL libraries were not found. Most demos will not build.])
118 [AS_HELP_STRING([--enable-egl],
119 [enable EGL library @<:@default=auto@:>@])],
120 [egl_enabled="$enableval"],
122 if test "x$egl_enabled" != "xno"; then
123 PKG_CHECK_MODULES(EGL, [egl], [egl_enabled=yes], [egl_enabled=no])
125 if test "x$egl_enabled" = "xyes"; then
126 save_CFLAGS="$CFLAGS"
127 CFLAGS="$CFLAGS $EGL_CFLAGS"
128 AC_CHECK_TYPES([struct mali_native_window], [EGL_CFLAGS="$EGL_CFLAGS -DEGL_MALI"],[],[[#include <EGL/egl.h>]])
129 CFLAGS="$save_CFLAGS"
131 AC_ARG_ENABLE([gles1],
132 [AS_HELP_STRING([--enable-gles1],
133 [enable support for OpenGL ES 1.x API @<:@default=auto@:>@])],
134 [glesv1_enabled="$enableval"],
135 [glesv1_enabled=auto])
136 if test "x$glesv1_enabled" != "xno"; then
137 PKG_CHECK_MODULES(GLESV1, [glesv1_cm], [glesv1_enabled=yes], [glesv1_enabled=no])
139 AC_ARG_ENABLE([gles2],
140 [AS_HELP_STRING([--enable-gles2],
141 [enable support for OpenGL ES 2.x API @<:@default=auto@:>@])],
142 [glesv2_enabled="$enableval"],
143 [glesv2_enabled=auto])
144 if test "x$glesv2_enabled" != "xno"; then
145 PKG_CHECK_MODULES(GLESV2, [glesv2], [glesv2_enabled=yes], [glesv2_enabled=no])
148 [AS_HELP_STRING([--enable-vg],
149 [enable support for OpenVG API @<:@default=auto@:>@])],
150 [vg_enabled="$enableval"],
152 if test "x$vg_enabled" != "xno"; then
153 PKG_CHECK_MODULES(VG, [vg], [vg_enabled=yes], [vg_enabled=no])
155 AC_ARG_ENABLE([osmesa],
156 [AS_HELP_STRING([--enable-osmesa],
157 [enable OSMesa library @<:@default=auto@:>@])],
158 [osmesa_enabled="$enableval"],
159 [osmesa_enabled=auto])
160 if test "x$osmesa_enabled" != "xno"; then
161 PKG_CHECK_MODULES(OSMESA, [osmesa], [osmesa_enabled=yes], [osmesa_enabled=no])
163 AC_ARG_ENABLE([libdrm],
164 [AS_HELP_STRING([--enable-libdrm],
165 [enable support for libdrm @<:@default=auto@:>@])],
166 [drm_enabled="$enableval"],
168 if test "x$drm_enabled" != "xno"; then
169 PKG_CHECK_MODULES(DRM, [libdrm], [drm_enabled=yes], [drm_enabled=no])
171 dnl The OSMesa .pc uses OSMesa32, while we want to build with other versions
173 OSMESA32_LIBS=$OSMESA_LIBS
174 OSMESA16_LIBS=`echo $OSMESA_LIBS | sed 's|32|16|g'`
175 OSMESA_LIBS=`echo $OSMESA_LIBS | sed 's|32||g'`
180 DEMO_CFLAGS="$DEMO_CFLAGS -D_GNU_SOURCE -DPTHREADS"
183 DEMO_CFLAGS="$DEFINES -DPTHREADS -DSVR4"
186 DEMO_CFLAGS="$DEFINES -DPTHREADS"
190 dnl Set up C warning flags. Copy of XORG_CWARNFLAGS.
191 if test "x$GCC" = xyes ; then
192 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
193 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
195 case `$CC -dumpversion` in
197 CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
201 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
202 if test "x$SUNCC" = "xyes"; then
206 DEMO_CFLAGS="$DEMO_CFLAGS $CWARNFLAGS"
209 [AS_HELP_STRING([--enable-x11],
210 [enable support for X11 @<:@default=auto@:>@])],
211 [x11_enabled="$enableval"],
213 if test "x$x11_enabled" != "xno"; then
214 PKG_CHECK_MODULES(X11, [x11 xext], [x11_enabled=yes], [x11_enabled=no])
217 AC_ARG_ENABLE([wayland],
218 [AS_HELP_STRING([--enable-wayland],
219 [enable support for wayland @<:@default=no@:>@])],
220 [wayland_enabled="$enableval"],
221 [wayland_enabled=no])
223 if test "x$wayland_enabled" != "xno"; then
224 PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-egl], [wayland_enabled=yes], [wayland_enabled=no])
227 dnl GBM is needed for EGL on KMS
229 [AS_HELP_STRING([--enable-gbm],
230 [enable support for GBM @<:@default=auto@:>@])],
231 [gbm_enabled="$enableval"],
233 if test "x$gbm_enabled" != "xno"; then
234 PKG_CHECK_MODULES(GBM, [gbm], [gbm_enabled=yes], [gbm_enabled=no])
237 dnl FreeType2 is needed by an OpenVG demo
238 AC_ARG_ENABLE([freetype2],
239 [AS_HELP_STRING([--enable-freetype2],
240 [enable support for FreeType2 @<:@default=auto@:>@])],
241 [freetype2_enabled="$enableval"],
242 [freetype2_enabled=auto])
243 if test "x$freetype2_enabled" != "xno"; then
244 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_enabled=yes], [freetype2_enabled=no])
247 mesa_source_enabled=no
248 AC_ARG_WITH([mesa-source],
249 [AS_HELP_STRING([--with-mesa-source=DIR],
250 [Mesa source directory for finding gl_API.xml])],
251 [mesa_source_enabled="yes"
252 mesa_source_dir="$withval"],
253 [mesa_source_enabled="no"])
254 MESA_GLAPI="$mesa_source_dir/src/mesa/glapi"
257 AC_ARG_WITH([system-data-files],
258 [AS_HELP_STRING([--with-system-data-files],
259 [Use system data files for demos (default: no)])],
260 [use_system_data=yes], [])
261 if test "x$use_system_data" = xyes; then
262 demos_data_dir="${datadir}/${PACKAGE}/"
264 demos_data_dir="../data/"
266 AC_DEFINE_DIR(DEMOS_DATA_DIR, demos_data_dir, [Data dir for demos])
267 AC_DEFINE_UNQUOTED([DEMOS_DATA_DIR], "$DEMOS_DATA_DIR",
268 [Directory for demos data files])
271 dnl Program library dependencies
272 dnl Only libm is added here if necessary as the libraries should
273 dnl be pulled in by the linker
277 DEMO_LIBS="$DEMO_LIBS -lX11 -lsocket -lnsl -lm"
280 DEMO_LIBS="$DEMO_LIBS -lX11"
283 DEMO_LIBS="$DEMO_LIBS -lm"
287 AC_SUBST([DEMO_CFLAGS])
288 AC_SUBST([DEMO_LIBS])
289 AC_SUBST([EGL_CFLAGS])
291 AC_SUBST([GLESV1_CFLAGS])
292 AC_SUBST([GLESV1_LIBS])
293 AC_SUBST([GLESV2_CFLAGS])
294 AC_SUBST([GLESV2_LIBS])
295 AC_SUBST([GLUT_CFLAGS])
296 AC_SUBST([GLUT_LIBS])
297 AC_SUBST([X11_CFLAGS])
299 AC_SUBST([OSMESA_CFLAGS])
300 AC_SUBST([OSMESA_LIBS])
301 AC_SUBST([OSMESA16_LIBS])
302 AC_SUBST([OSMESA32_LIBS])
303 AC_SUBST([MESA_GLAPI])
304 AC_SUBST([WAYLAND_CFLAGS])
305 AC_SUBST([WAYLAND_LIBS])
308 AM_CONDITIONAL(HAVE_GL, test "x$gl_enabled" = "xyes")
309 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
310 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
311 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
312 AM_CONDITIONAL(HAVE_VG, test "x$vg_enabled" = "xyes")
313 AM_CONDITIONAL(HAVE_GLUT, test "x$glut_enabled" = "xyes")
314 AM_CONDITIONAL(HAVE_X11, test "x$x11_enabled" = "xyes")
315 AM_CONDITIONAL(HAVE_GBM, test "x$gbm_enabled" = "xyes")
316 AM_CONDITIONAL(HAVE_FREETYPE2, test "x$freetype2_enabled" = "xyes")
317 AM_CONDITIONAL(HAVE_OSMESA, test "x$osmesa_enabled" = "xyes")
318 AM_CONDITIONAL(HAVE_DRM, test "x$drm_enabled" = "xyes")
319 AM_CONDITIONAL(BUILD_GLTRACE, false)
320 AM_CONDITIONAL(HAVE_MESA_SOURCE, test "x$mesa_source_enabled" = "xyes")
321 AM_CONDITIONAL(HAVE_WAYLAND, test "x$wayland_enabled" = "xyes")
328 src/egl/eglut/Makefile
329 src/egl/opengl/Makefile
330 src/egl/opengles1/Makefile
331 src/egl/opengles2/Makefile
332 src/egl/openvg/Makefile
333 src/egl/openvg/trivial/Makefile
334 src/egl/oes_vg/Makefile
340 src/objviewer/Makefile
349 src/tools/trace/Makefile