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.3.0],
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.])])
54 dnl Get the pkg-config definitions for libGL. We include a fallback
55 dnl path for GL implementation that don't provide a .pc file
56 PKG_CHECK_MODULES(GL, [gl], [], [
57 AC_CHECK_HEADER([GL/gl.h],
59 AC_MSG_ERROR([GL not found]))
63 AC_MSG_ERROR([GL required]))
66 DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
67 DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
72 [AS_HELP_STRING([--with-glut=DIR],
73 [glut install directory])],
74 [GLUT_CFLAGS="-I$withval/include"
75 GLUT_LIBS="-L$withval/lib -lglut"],
79 AS_IF([test "x$with_glut" != xno],
80 [AC_CHECK_HEADER([GL/glut.h],
89 dnl Check for FreeGLUT 2.6 or later
90 AC_EGREP_HEADER([glutInitContextProfile],
92 [AC_DEFINE(HAVE_FREEGLUT)],
96 PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
97 DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
98 DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
100 # LIBS was set by AC_CHECK_LIB above
103 PKG_CHECK_MODULES(GLU, [glu], [],
104 [AC_CHECK_HEADER([GL/glu.h],
106 AC_MSG_ERROR([GLU not found]))
110 AC_MSG_ERROR([GLU required])) ])
112 DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
113 DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
116 [AS_HELP_STRING([--enable-egl],
117 [enable EGL library @<:@default=auto@:>@])],
118 [egl_enabled="$enableval"],
120 if test "x$egl_enabled" != "xno"; then
121 PKG_CHECK_MODULES(EGL, [egl], [egl_enabled=yes], [egl_enabled=no])
123 AC_ARG_ENABLE([gles1],
124 [AS_HELP_STRING([--enable-gles1],
125 [enable support for OpenGL ES 1.x API @<:@default=auto@:>@])],
126 [glesv1_enabled="$enableval"],
127 [glesv1_enabled=auto])
128 if test "x$glesv1_enabled" != "xno"; then
129 PKG_CHECK_MODULES(GLESV1, [glesv1_cm], [glesv1_enabled=yes], [glesv1_enabled=no])
131 AC_ARG_ENABLE([gles2],
132 [AS_HELP_STRING([--enable-gles2],
133 [enable support for OpenGL ES 2.x API @<:@default=auto@:>@])],
134 [glesv2_enabled="$enableval"],
135 [glesv2_enabled=auto])
136 if test "x$glesv2_enabled" != "xno"; then
137 PKG_CHECK_MODULES(GLESV2, [glesv2], [glesv2_enabled=yes], [glesv2_enabled=no])
140 [AS_HELP_STRING([--enable-vg],
141 [enable support for OpenVG API @<:@default=auto@:>@])],
142 [vg_enabled="$enableval"],
144 if test "x$vg_enabled" != "xno"; then
145 PKG_CHECK_MODULES(VG, [vg], [vg_enabled=yes], [vg_enabled=no])
147 AC_ARG_ENABLE([osmesa],
148 [AS_HELP_STRING([--enable-osmesa],
149 [enable OSMesa library @<:@default=auto@:>@])],
150 [osmesa_enabled="$enableval"],
151 [osmesa_enabled=auto])
152 if test "x$osmesa_enabled" != "xno"; then
153 PKG_CHECK_MODULES(OSMESA, [osmesa], [osmesa_enabled=yes], [osmesa_enabled=no])
155 AC_ARG_ENABLE([libdrm],
156 [AS_HELP_STRING([--enable-libdrm],
157 [enable support for libdrm @<:@default=auto@:>@])],
158 [drm_enabled="$enableval"],
160 if test "x$drm_enabled" != "xno"; then
161 PKG_CHECK_MODULES(DRM, [libdrm], [drm_enabled=yes], [drm_enabled=no])
163 dnl The OSMesa .pc uses OSMesa32, while we want to build with other versions
165 OSMESA32_LIBS=$OSMESA_LIBS
166 OSMESA16_LIBS=`echo $OSMESA_LIBS | sed 's|32|16|g'`
167 OSMESA_LIBS=`echo $OSMESA_LIBS | sed 's|32||g'`
172 DEMO_CFLAGS="$DEMO_CFLAGS -D_GNU_SOURCE -DPTHREADS"
175 DEMO_CFLAGS="$DEFINES -DPTHREADS -DSVR4"
178 DEMO_CFLAGS="$DEFINES -DPTHREADS"
182 dnl Set up C warning flags. Copy of XORG_CWARNFLAGS.
183 if test "x$GCC" = xyes ; then
184 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
185 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
187 case `$CC -dumpversion` in
189 CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
193 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
194 if test "x$SUNCC" = "xyes"; then
198 DEMO_CFLAGS="$DEMO_CFLAGS $CWARNFLAGS"
201 [AS_HELP_STRING([--enable-x11],
202 [enable support for X11 @<:@default=auto@:>@])],
203 [x11_enabled="$enableval"],
205 if test "x$x11_enabled" != "xno"; then
206 PKG_CHECK_MODULES(X11, [x11 xext], [x11_enabled=yes], [x11_enabled=no])
209 AC_ARG_ENABLE([wayland],
210 [AS_HELP_STRING([--enable-wayland],
211 [enable support for wayland @<:@default=no@:>@])],
212 [wayland_enabled="$enableval"],
213 [wayland_enabled=no])
215 if test "x$wayland_enabled" != "xno"; then
216 PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-egl], [wayland_enabled=yes], [wayland_enabled=no])
219 dnl GBM is needed for EGL on KMS
221 [AS_HELP_STRING([--enable-gbm],
222 [enable support for GBM @<:@default=auto@:>@])],
223 [gbm_enabled="$enableval"],
225 if test "x$gbm_enabled" != "xno"; then
226 PKG_CHECK_MODULES(GBM, [gbm], [gbm_enabled=yes], [gbm_enabled=no])
229 dnl FreeType2 is needed by an OpenVG demo
230 AC_ARG_ENABLE([freetype2],
231 [AS_HELP_STRING([--enable-freetype2],
232 [enable support for FreeType2 @<:@default=auto@:>@])],
233 [freetype2_enabled="$enableval"],
234 [freetype2_enabled=auto])
235 if test "x$freetype2_enabled" != "xno"; then
236 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_enabled=yes], [freetype2_enabled=no])
239 mesa_source_enabled=no
240 AC_ARG_WITH([mesa-source],
241 [AS_HELP_STRING([--with-mesa-source=DIR],
242 [Mesa source directory for finding gl_API.xml])],
243 [mesa_source_enabled="yes"
244 mesa_source_dir="$withval"],
245 [mesa_source_enabled="no"])
246 MESA_GLAPI="$mesa_source_dir/src/mapi/glapi/gen"
248 AC_ARG_ENABLE([rbug],
249 [AS_HELP_STRING([--enable-rbug],
250 [enable support for rbug @<:@default=no@:>@])],
251 [rbug_enabled="yes"],
255 AC_ARG_WITH([system-data-files],
256 [AS_HELP_STRING([--with-system-data-files],
257 [Use system data files for demos (default: no)])],
258 [use_system_data=yes], [])
259 if test "x$use_system_data" = xyes; then
260 demos_data_dir="${datadir}/${PACKAGE}/"
262 demos_data_dir="../data/"
264 AC_DEFINE_DIR(DEMOS_DATA_DIR, demos_data_dir, [Data dir for demos])
265 AC_DEFINE_UNQUOTED([DEMOS_DATA_DIR], "$DEMOS_DATA_DIR",
266 [Directory for demos data files])
269 dnl Program library dependencies
270 dnl Only libm is added here if necessary as the libraries should
271 dnl be pulled in by the linker
275 DEMO_LIBS="$DEMO_LIBS -lX11 -lsocket -lnsl -lm"
278 DEMO_LIBS="$DEMO_LIBS -lX11"
281 DEMO_LIBS="$DEMO_LIBS -lm"
285 AC_SUBST([DEMO_CFLAGS])
286 AC_SUBST([DEMO_LIBS])
287 AC_SUBST([EGL_CFLAGS])
289 AC_SUBST([GLESV1_CFLAGS])
290 AC_SUBST([GLESV1_LIBS])
291 AC_SUBST([GLESV2_CFLAGS])
292 AC_SUBST([GLESV2_LIBS])
293 AC_SUBST([GLUT_CFLAGS])
294 AC_SUBST([GLUT_LIBS])
295 AC_SUBST([X11_CFLAGS])
297 AC_SUBST([OSMESA_CFLAGS])
298 AC_SUBST([OSMESA_LIBS])
299 AC_SUBST([OSMESA16_LIBS])
300 AC_SUBST([OSMESA32_LIBS])
301 AC_SUBST([MESA_GLAPI])
302 AC_SUBST([WAYLAND_CFLAGS])
303 AC_SUBST([WAYLAND_LIBS])
306 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
307 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
308 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
309 AM_CONDITIONAL(HAVE_VG, test "x$vg_enabled" = "xyes")
310 AM_CONDITIONAL(HAVE_GLUT, test "x$glut_enabled" = "xyes")
311 AM_CONDITIONAL(HAVE_X11, test "x$x11_enabled" = "xyes")
312 AM_CONDITIONAL(HAVE_GBM, test "x$gbm_enabled" = "xyes")
313 AM_CONDITIONAL(HAVE_FREETYPE2, test "x$freetype2_enabled" = "xyes")
314 AM_CONDITIONAL(HAVE_OSMESA, test "x$osmesa_enabled" = "xyes")
315 AM_CONDITIONAL(HAVE_DRM, test "x$drm_enabled" = "xyes")
316 AM_CONDITIONAL(HAVE_MESA_SOURCE, test "x$mesa_source_enabled" = "xyes")
317 AM_CONDITIONAL(HAVE_WAYLAND, test "x$wayland_enabled" = "xyes")
318 AM_CONDITIONAL(HAVE_RBUG, test "x$rbug_enabled" = "xyes")
325 src/egl/eglut/Makefile
326 src/egl/opengl/Makefile
327 src/egl/opengles1/Makefile
328 src/egl/opengles2/Makefile
329 src/egl/openvg/Makefile
330 src/egl/openvg/trivial/Makefile
331 src/egl/oes_vg/Makefile
337 src/objviewer/Makefile