From 6689f9ebcb586333d059ace12ccff950bb6411b1 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 5 Dec 2007 21:04:15 -0800 Subject: autoconf: Configure the osmesa channel size for OSMesa16 and OSMesa32 Allow the user to specify channel bits of 16 or 32 to enable OSMesa16 or OSMesa32 instead of the default OSMesa. This option is controlled through the option --with-osmesa-bits=BITS and is only honored when the driver is osmesa. The osdemos are not enabled in the 16 or 32 bit case because the Makefile is currently hardcoded to link to -lOSMesa. --- configs/autoconf.in | 2 +- configure.ac | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/configs/autoconf.in b/configs/autoconf.in index 8cb1ba75b8..a1896a6440 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -46,7 +46,7 @@ GL_LIB = GL GLU_LIB = GLU GLUT_LIB = glut GLW_LIB = GLw -OSMESA_LIB = OSMesa +OSMESA_LIB = @OSMESA_LIB@ # Library names (actual file names) GL_LIB_NAME = @GL_LIB_NAME@ diff --git a/configure.ac b/configure.ac index 9272b01dc5..db6a7850a4 100644 --- a/configure.ac +++ b/configure.ac @@ -328,6 +328,30 @@ if test "x$x11_osmesa" = xyes; then fi fi +dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...) +AC_ARG_WITH(osmesa-bits, + [AS_HELP_STRING([--with-osmesa-bits=BITS], + [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])], + osmesa_bits="$withval", + osmesa_bits=8) +if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then + AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver]) + osmesa_bits=8 +fi +case "x$osmesa_bits" in +x8) + OSMESA_LIB=OSMesa + ;; +x16|x32) + OSMESA_LIB="OSMesa$osmesa_bits" + DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31" + ;; +*) + AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option]) + ;; +esac +AC_SUBST(OSMESA_LIB) + case "$mesa_driver" in osmesa) OSMESA_LIB_DEPS="-lm -lpthread" @@ -355,8 +379,11 @@ if test "x$enable_glu" = xyes; then case "$mesa_driver" in osmesa) - # If GLU is available, we can build the osdemos - PROGRAM_DIRS="$PROGRAM_DIRS osdemos" + # If GLU is available and we have libOSMesa (not 16 or 32), + # we can build the osdemos + if test "$osmesa_bits" = 8; then + PROGRAM_DIRS="$PROGRAM_DIRS osdemos" + fi # Link libGLU to libOSMesa instead of libGL GLU_LIB_DEPS="" -- cgit v1.2.3