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.4.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)],
95 # LIBS was set by AC_CHECK_LIB above
98 PKG_CHECK_MODULES(GLU, [glu], [],
99 [AC_CHECK_HEADER([GL/glu.h],
101 AC_MSG_ERROR([GLU not found]))
105 AC_MSG_ERROR([GLU required])) ])
107 DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
108 DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
111 [AS_HELP_STRING([--enable-egl],
112 [enable EGL library @<:@default=auto@:>@])],
113 [egl_enabled="$enableval"],
115 if test "x$egl_enabled" != "xno"; then
116 PKG_CHECK_MODULES(EGL, [egl], [egl_enabled=yes], [egl_enabled=no])
118 AC_ARG_ENABLE([gles1],
119 [AS_HELP_STRING([--enable-gles1],
120 [enable support for OpenGL ES 1.x API @<:@default=auto@:>@])],
121 [glesv1_enabled="$enableval"],
122 [glesv1_enabled=auto])
123 if test "x$glesv1_enabled" != "xno"; then
124 PKG_CHECK_MODULES(GLESV1, [glesv1_cm], [glesv1_enabled=yes], [glesv1_enabled=no])
126 AC_ARG_ENABLE([gles2],
127 [AS_HELP_STRING([--enable-gles2],
128 [enable support for OpenGL ES 2.x API @<:@default=auto@:>@])],
129 [glesv2_enabled="$enableval"],
130 [glesv2_enabled=auto])
131 if test "x$glesv2_enabled" != "xno"; then
132 PKG_CHECK_MODULES(GLESV2, [glesv2], [glesv2_enabled=yes], [glesv2_enabled=no])
135 [AS_HELP_STRING([--enable-vg],
136 [enable support for OpenVG API @<:@default=auto@:>@])],
137 [vg_enabled="$enableval"],
139 if test "x$vg_enabled" != "xno"; then
140 PKG_CHECK_MODULES(VG, [vg], [vg_enabled=yes], [vg_enabled=no])
142 AC_ARG_ENABLE([osmesa],
143 [AS_HELP_STRING([--enable-osmesa],
144 [enable OSMesa library @<:@default=auto@:>@])],
145 [osmesa_enabled="$enableval"],
146 [osmesa_enabled=auto])
147 if test "x$osmesa_enabled" != "xno"; then
148 PKG_CHECK_MODULES(OSMESA, [osmesa], [osmesa_enabled=yes], [osmesa_enabled=no])
150 AC_ARG_ENABLE([libdrm],
151 [AS_HELP_STRING([--enable-libdrm],
152 [enable support for libdrm @<:@default=auto@:>@])],
153 [drm_enabled="$enableval"],
155 if test "x$drm_enabled" != "xno"; then
156 PKG_CHECK_MODULES(DRM, [libdrm], [drm_enabled=yes], [drm_enabled=no])
158 dnl The OSMesa .pc uses OSMesa32, while we want to build with other versions
160 OSMESA32_LIBS=$OSMESA_LIBS
161 OSMESA16_LIBS=`echo $OSMESA_LIBS | sed 's|32|16|g'`
162 OSMESA_LIBS=`echo $OSMESA_LIBS | sed 's|32||g'`
167 DEMO_CFLAGS="$DEMO_CFLAGS -D_GNU_SOURCE -DPTHREADS"
170 DEMO_CFLAGS="$DEFINES -DPTHREADS -DSVR4"
173 DEMO_CFLAGS="$DEFINES -DPTHREADS"
177 dnl Set up C warning flags. Copy of XORG_CWARNFLAGS.
178 if test "x$GCC" = xyes ; then
179 CWARNFLAGS="-Wall -Wpointer-arith -Wmissing-prototypes \
180 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
182 case `$CC -dumpversion` in
184 CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
188 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
189 if test "x$SUNCC" = "xyes"; then
193 DEMO_CFLAGS="$DEMO_CFLAGS $CWARNFLAGS"
196 [AS_HELP_STRING([--enable-x11],
197 [enable support for X11 @<:@default=auto@:>@])],
198 [x11_enabled="$enableval"],
200 if test "x$x11_enabled" != "xno"; then
201 PKG_CHECK_MODULES(X11, [x11 xext], [x11_enabled=yes], [x11_enabled=no])
204 AC_ARG_ENABLE([wayland],
205 [AS_HELP_STRING([--enable-wayland],
206 [enable support for wayland @<:@default=auto@:>@])],
207 [wayland_enabled="$enableval"],
208 [wayland_enabled=auto])
210 if test "x$wayland_enabled" != "xno"; then
211 PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-egl], [wayland_enabled=yes], [wayland_enabled=no])
214 dnl GBM is needed for EGL on KMS
216 [AS_HELP_STRING([--enable-gbm],
217 [enable support for GBM @<:@default=auto@:>@])],
218 [gbm_enabled="$enableval"],
220 if test "x$gbm_enabled" != "xno"; then
221 PKG_CHECK_MODULES(GBM, [gbm], [gbm_enabled=yes], [gbm_enabled=no])
224 dnl FreeType2 is needed by an OpenVG demo
225 AC_ARG_ENABLE([freetype2],
226 [AS_HELP_STRING([--enable-freetype2],
227 [enable support for FreeType2 @<:@default=auto@:>@])],
228 [freetype2_enabled="$enableval"],
229 [freetype2_enabled=auto])
230 if test "x$freetype2_enabled" != "xno"; then
231 PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_enabled=yes], [freetype2_enabled=no])
234 mesa_source_enabled=no
235 AC_ARG_WITH([mesa-source],
236 [AS_HELP_STRING([--with-mesa-source=DIR],
237 [Mesa source directory for finding gl_API.xml])],
238 [mesa_source_enabled="yes"
239 mesa_source_dir="$withval"],
240 [mesa_source_enabled="no"])
241 MESA_GLAPI="$mesa_source_dir/src/mapi/glapi/gen"
243 AC_ARG_ENABLE([rbug],
244 [AS_HELP_STRING([--enable-rbug],
245 [enable support for rbug @<:@default=no@:>@])],
246 [rbug_enabled="yes"],
250 AC_ARG_WITH([system-data-files],
251 [AS_HELP_STRING([--with-system-data-files],
252 [Use system data files for demos (default: no)])],
253 [use_system_data=yes], [])
254 if test "x$use_system_data" = xyes; then
255 demos_data_dir="${datadir}/${PACKAGE}/"
257 demos_data_dir="../data/"
259 AC_DEFINE_DIR(DEMOS_DATA_DIR, demos_data_dir, [Data dir for demos])
260 AC_DEFINE_UNQUOTED([DEMOS_DATA_DIR], "$DEMOS_DATA_DIR",
261 [Directory for demos data files])
264 dnl Program library dependencies
265 dnl Only libm is added here if necessary as the libraries should
266 dnl be pulled in by the linker
270 DEMO_LIBS="$DEMO_LIBS -lX11 -lsocket -lnsl -lm"
273 DEMO_LIBS="$DEMO_LIBS -lX11"
276 DEMO_LIBS="$DEMO_LIBS -lm"
280 AC_SUBST([DEMO_CFLAGS])
281 AC_SUBST([DEMO_LIBS])
282 AC_SUBST([EGL_CFLAGS])
284 AC_SUBST([GLESV1_CFLAGS])
285 AC_SUBST([GLESV1_LIBS])
286 AC_SUBST([GLESV2_CFLAGS])
287 AC_SUBST([GLESV2_LIBS])
288 AC_SUBST([GLUT_CFLAGS])
289 AC_SUBST([GLUT_LIBS])
290 AC_SUBST([X11_CFLAGS])
292 AC_SUBST([OSMESA_CFLAGS])
293 AC_SUBST([OSMESA_LIBS])
294 AC_SUBST([OSMESA16_LIBS])
295 AC_SUBST([OSMESA32_LIBS])
296 AC_SUBST([MESA_GLAPI])
297 AC_SUBST([WAYLAND_CFLAGS])
298 AC_SUBST([WAYLAND_LIBS])
301 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
302 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
303 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
304 AM_CONDITIONAL(HAVE_VG, test "x$vg_enabled" = "xyes")
305 AM_CONDITIONAL(HAVE_GLUT, test "x$glut_enabled" = "xyes")
306 AM_CONDITIONAL(HAVE_X11, test "x$x11_enabled" = "xyes")
307 AM_CONDITIONAL(HAVE_GBM, test "x$gbm_enabled" = "xyes")
308 AM_CONDITIONAL(HAVE_FREETYPE2, test "x$freetype2_enabled" = "xyes")
309 AM_CONDITIONAL(HAVE_OSMESA, test "x$osmesa_enabled" = "xyes")
310 AM_CONDITIONAL(HAVE_DRM, test "x$drm_enabled" = "xyes")
311 AM_CONDITIONAL(HAVE_MESA_SOURCE, test "x$mesa_source_enabled" = "xyes")
312 AM_CONDITIONAL(HAVE_WAYLAND, test "x$wayland_enabled" = "xyes")
313 AM_CONDITIONAL(HAVE_RBUG, test "x$rbug_enabled" = "xyes")
320 src/egl/eglut/Makefile
321 src/egl/opengl/Makefile
322 src/egl/opengles1/Makefile
323 src/egl/opengles2/Makefile
324 src/egl/openvg/Makefile
325 src/egl/openvg/trivial/Makefile
326 src/egl/oes_vg/Makefile
333 src/objviewer/Makefile