Fix problem with configure failing to find GL libraries because they are installed in the X11 tree
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/unix/configure.ac b/unix/configure.ac
index 8a39d0d..76dba93 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -19,9 +19,13 @@ AC_CHECK_HEADER([stdlib.h])
# Checks for libraries.
+AC_PATH_X
+
AC_CHECK_FT2([9.0.3],[],
[AC_MSG_ERROR([FreeType2 is required to compile this library])])
+AC_PATH_XTRA
+
FTGL_CHECK_GL
FTGL_CHECK_GLUT
diff --git a/unix/m4/gl.m4 b/unix/m4/gl.m4
index 802a0e9..062837c 100644
--- a/unix/m4/gl.m4
+++ b/unix/m4/gl.m4
@@ -4,8 +4,14 @@ dnl
AC_DEFUN([FTGL_CHECK_GL],
[dnl
AC_CHECK_HEADER([GL/gl.h])
-AC_CHECK_LIB(GL, [glBegin],
- [], [AC_MSG_ERROR([libGL is required to compile this library])])
+AC_CHECK_LIB(GL, [glBegin], [],
+ [AC_MSG_NOTICE([GL not found in the compiler's path, looking in the X11 tree])
+ unset ac_cv_lib_GL_glBegin
+ LDFLAGS="-L${x_libraries} $LDFLAGS"
+ AC_CHECK_LIB(GL, [glBegin], [],
+ [AC_MSG_ERROR([libGL is required to compile this library])])
+ ])
+
AC_CHECK_HEADER([GL/glu.h])
AC_MSG_CHECKING([for GLU version >= 1.2])
AC_TRY_COMPILE([#include <GL/glu.h>], [