Commit eabdeeba94d0aac5c82e29281a7fff85de82ec24

marcelo 2003-03-12T18:49:16

Fix problem with configure failing to find GL libraries because they are installed in the X11 tree

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>], [