1 # Copyright © 2011 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
25 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=GLU])
26 AC_CONFIG_SRCDIR([Makefile.am])
29 AM_INIT_AUTOMAKE([dist-bzip2 foreign subdir-objects])
39 dnl Enable quiet compiles on automake 1.11.
40 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
43 AS_HELP_STRING([--enable-debug],
44 [Enable debugging information]),
45 [CFLAGS="$CFLAGS -g -O0"
46 CXXFLAGS="$CXXFLAGS -g -O0"],
49 dnl Make sure the pkg-config macros are defined
50 m4_ifndef([PKG_PROG_PKG_CONFIG],
51 [m4_fatal([Could not locate the pkg-config autoconf macros.
52 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
53 are in a different location, try setting the environment variable
54 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
58 AS_HELP_STRING([--enable-osmesa],
59 [Enable use of OSMesa instead of libGL]),
60 [OSMESA="$enableval"],
63 dnl Get the pkg-config definitions for libGL/OSMesa. We include a fallback
64 dnl path for implementations that don't provide a .pc file
65 if test "x$OSMESA" = "xyes"; then
67 PKG_CHECK_MODULES(OSMESA, [osmesa], [], [
68 AC_CHECK_LIB([OSMesa],
70 [OSMESA_LIBS=-lOSMesa],
71 AC_MSG_ERROR([OSMesa required]))
75 PKG_CHECK_MODULES(GL, [gl], [], [
76 AC_CHECK_HEADER([GL/gl.h],
78 AC_MSG_ERROR([GL not found]))
82 AC_MSG_ERROR([GL required]))
85 AC_SUBST([GLU_REQUIRES])
87 dnl Set up C warning and visibility flags.
88 if test "x$GCC" = xyes; then
91 # Enable -fvisibility=hidden if using a gcc that supports it
93 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
94 VISIBILITY_CFLAGS="-fvisibility=hidden"
95 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
96 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
97 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
99 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
102 if test "x$GXX" = xyes; then
105 # Enable -fvisibility=hidden if using a gcc that supports it
106 save_CXXFLAGS="$CXXFLAGS"
107 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
108 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
109 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
111 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
112 [VISIBILITY_CXXFLAGS=""; AC_MSG_RESULT([no])]);
115 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
116 CXXFLAGS=$save_CXXFLAGS
119 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
120 if test "x$SUNCC" = "xyes"; then
125 AC_SUBST([WARNCFLAGS])
126 AC_SUBST([WARNCXXFLAGS])
127 AC_SUBST([VISIBILITY_CFLAGS])
128 AC_SUBST([VISIBILITY_CXXFLAGS])