From b63e40603b709767084657fef75aab00fb9a26e4 Mon Sep 17 00:00:00 2001
From: Roger Leigh <[EMAIL REDACTED]>
Date: Sun, 29 May 2022 12:05:27 +0100
Subject: [PATCH] autoconf: Add --disable-opengl option
---
configure.ac | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index 23e834a2..7706011b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -927,22 +927,28 @@ dnl ---------------------------------------------------------------------------
HAVE_OPENGL=no
+AC_ARG_ENABLE(opengl,
+ AS_HELP_STRING([--disable-opengl],
+ [disable OpenGL usage (required by tiffgt, enabled by default)]),,)
-AC_PATH_XTRA
+if test "x$enable_opengl" != "xno" ; then
-dnl AX_CHECK_GL sets GL_CFLAGS & GL_LIBS. Also PTHREAD_LIBS,
-dnl PTHREAD_CFLAGS, & PTHREAD_CC as a side-effect
-AX_CHECK_GL
+ AC_PATH_XTRA
-dnl AX_CHECK_GLU sets GLU_CFLAGS & GLU_LIBS
-AX_CHECK_GLU
+ dnl AX_CHECK_GL sets GL_CFLAGS & GL_LIBS. Also PTHREAD_LIBS,
+ dnl PTHREAD_CFLAGS, & PTHREAD_CC as a side-effect
+ AX_CHECK_GL
-dnl AX_CHECK_GLUT sets GLUT_CFLAGS & GLUT_LIBS
-AX_CHECK_GLUT
+ dnl AX_CHECK_GLU sets GLU_CFLAGS & GLU_LIBS
+ AX_CHECK_GLU
-if test "$no_x" != "yes" -a "$no_gl" != "yes" \
- -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then
- HAVE_OPENGL=yes
+ dnl AX_CHECK_GLUT sets GLUT_CFLAGS & GLUT_LIBS
+ AX_CHECK_GLUT
+
+ if test "$no_x" != "yes" -a "$no_gl" != "yes" \
+ -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then
+ HAVE_OPENGL=yes
+ fi
fi
AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes")