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.0],
29 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
32 AM_INIT_AUTOMAKE([dist-bzip2])
41 # Enable quiet compiles on automake 1.11.
42 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
44 dnl Make sure the pkg-config macros are defined
45 m4_ifndef([PKG_PROG_PKG_CONFIG],
46 [m4_fatal([Could not locate the pkg-config autoconf macros.
47 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
48 are in a different location, try setting the environment variable
49 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
52 dnl Get the pkg-config definitions for libGL. We include a fallback
53 dnl path for GL implementation that don't provide a .pc file
54 PKG_CHECK_MODULES(GL, [gl], [], [
55 AC_CHECK_HEADER([GL/gl.h],
57 AC_MSG_ERROR([GL not found]))
61 AC_MSG_ERROR([GL required]))
64 DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
65 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"])
76 AC_CHECK_HEADER([GL/glut.h],
86 dnl Include a fallback path for GLEW for the moment while not all distros
87 dnl have picked up the .pc file.
88 PKG_CHECK_MODULES(GLEW, [glew], [], [
89 AC_CHECK_HEADER([GL/glew.h],
91 AC_MSG_ERROR([GLEW required]))
95 AC_MSG_ERROR([GLEW required]))
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"
115 PKG_CHECK_MODULES(EGL, [egl], [egl_enabled=yes], [egl_enabled=no])
116 PKG_CHECK_MODULES(GLESV1, [glesv1_cm], [glesv1_enabled=yes], [glesv1_enabled=no])
117 PKG_CHECK_MODULES(GLESV2, [glesv2], [glesv2_enabled=yes], [glesv2_enabled=no])
118 PKG_CHECK_MODULES(VG, [vg], [vg_enabled=yes], [vg_enabled=no])
119 PKG_CHECK_MODULES(OSMESA, [osmesa], [osmesa_enabled=yes], [osmesa_enabled=no])
120 dnl The OSMesa .pc uses OSMesa32, while we want to build with other versions
122 OSMESA32_LIBS=$OSMESA_LIBS
123 OSMESA16_LIBS=`echo $OSMESA_LIBS | sed 's|32|16|g'`
124 OSMESA_LIBS=`echo $OSMESA_LIBS | sed 's|32||g'`
129 DEMO_CFLAGS="$DEMO_CFLAGS -D_GNU_SOURCE -DPTHREADS"
132 DEMO_CFLAGS="$DEFINES -DPTHREADS -DSVR4"
135 DEMO_CFLAGS="$DEFINES -DPTHREADS"
139 dnl Set up C warning flags. Copy of XORG_CWARNFLAGS.
140 if test "x$GCC" = xyes ; then
141 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
142 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
144 case `$CC -dumpversion` in
146 CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
150 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
151 if test "x$SUNCC" = "xyes"; then
155 DEMO_CFLAGS="$DEMO_CFLAGS $CWARNFLAGS"
157 PKG_CHECK_MODULES(X11, [x11 xext], [x11_enabled=yes], [enable_x11=no])
159 mesa_source_enabled=no
160 AC_ARG_WITH([mesa-source],
161 [AS_HELP_STRING([--with-mesa-source=DIR],
162 [Mesa source directory for finding gl_API.xml])],
163 [mesa_source_enabled="yes"
164 mesa_source_dir="$withval"],
165 [mesa_source_enabled="no"])
166 MESA_GLAPI="$mesa_source_dir/src/mesa/glapi"
169 dnl Program library dependencies
170 dnl Only libm is added here if necessary as the libraries should
171 dnl be pulled in by the linker
175 DEMO_LIBS="$DEMO_LIBS -lX11 -lsocket -lnsl -lm"
178 DEMO_LIBS="$DEMO_LIBS -lX11"
181 DEMO_LIBS="$DEMO_LIBS -lm"
185 AC_SUBST([DEMO_CFLAGS])
186 AC_SUBST([DEMO_LIBS])
187 AC_SUBST([EGL_CFLAGS])
189 AC_SUBST([GLESV1_CFLAGS])
190 AC_SUBST([GLESV1_LIBS])
191 AC_SUBST([GLESV2_CFLAGS])
192 AC_SUBST([GLESV2_LIBS])
193 AC_SUBST([GLUT_CFLAGS])
194 AC_SUBST([GLUT_LIBS])
195 AC_SUBST([X11_CFLAGS])
197 AC_SUBST([OSMESA_CFLAGS])
198 AC_SUBST([OSMESA_LIBS])
199 AC_SUBST([OSMESA16_LIBS])
200 AC_SUBST([OSMESA32_LIBS])
201 AC_SUBST([MESA_GLAPI])
203 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
204 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
205 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
206 AM_CONDITIONAL(HAVE_VG, test "x$vg_enabled" = "xyes")
207 AM_CONDITIONAL(HAVE_GLUT, test "x$glut_enabled" = "xyes")
208 AM_CONDITIONAL(HAVE_X11, test "x$x11_enabled" = "xyes")
209 AM_CONDITIONAL(HAVE_OSMESA, test "x$osmesa_enabled" = "xyes")
210 AM_CONDITIONAL(BUILD_GLTRACE, false)
211 AM_CONDITIONAL(HAVE_MESA_SOURCE, test "x$mesa_source_enabled" = "xyes")
218 src/egl/eglut/Makefile
219 src/egl/opengl/Makefile
220 src/egl/opengles1/Makefile
221 src/egl/opengles2/Makefile
222 src/egl/openvg/Makefile
223 src/egl/openvg/trivial/Makefile
228 src/objviewer/Makefile
237 src/tools/trace/Makefile