Commit 85947393736522f927975ec2583c8b6146889ba7

marcelo 2003-01-14T16:13:53

Add a couple of extra libraries usually required by GLUT

diff --git a/unix/acinclude.m4 b/unix/acinclude.m4
index 6294731..1ab55ac 100644
--- a/unix/acinclude.m4
+++ b/unix/acinclude.m4
@@ -171,13 +171,18 @@ AC_CHECK_LIB(glut, [glutInit],
              [LIBGLUT=-lglut],
              [])
 
+# Work-arround for broken dynamic linkers and/or systems with non-broken
+# linkers but suffering from PEBKAC.  The list of libraries is a bit
+# over-generous, AFAIK -lXi is needed only on (some versions of?) SuSE
+
 if test -z "${LIBGLUT}" ; then
     echo "Couldn't find GLUT, trying again with extra linker flags"
     unset ac_cv_lib_glut_glutInit
     AC_CHECK_LIB(glut, [glutInit],
                 [LIBGLUT=-lglut],
                 AC_MSG_ERROR([libglut is required to compile this library]),
-                [-lX11])
+                [-lX11 -lXmu -lXi -lm])
+    LIBGLUT="$LIBGLUT -lX11 -lXmu -lXi -lm"
 fi
 AC_SUBST(LIBGLUT)
 ])
diff --git a/unix/aclocal.m4 b/unix/aclocal.m4
index 31f31c0..ab12d31 100644
--- a/unix/aclocal.m4
+++ b/unix/aclocal.m4
@@ -183,13 +183,18 @@ AC_CHECK_LIB(glut, [glutInit],
              [LIBGLUT=-lglut],
              [])
 
+# Work-arround for broken dynamic linkers and/or systems with non-broken
+# linkers but suffering from PEBKAC.  The list of libraries is a bit
+# over-generous, AFAIK -lXi is needed only on (some versions of?) SuSE
+
 if test -z "${LIBGLUT}" ; then
     echo "Couldn't find GLUT, trying again with extra linker flags"
     unset ac_cv_lib_glut_glutInit
     AC_CHECK_LIB(glut, [glutInit],
                 [LIBGLUT=-lglut],
                 AC_MSG_ERROR([libglut is required to compile this library]),
-                [-lX11])
+                [-lX11 -lXmu -lXi -lm])
+    LIBGLUT="$LIBGLUT -lX11 -lXmu -lXi -lm"
 fi
 AC_SUBST(LIBGLUT)
 ])
diff --git a/unix/configure b/unix/configure
index 857471d..96efe1c 100755
--- a/unix/configure
+++ b/unix/configure
@@ -8701,6 +8701,10 @@ if test $ac_cv_lib_glut_glutInit = yes; then
 fi
 
 
+# Work-arround for broken dynamic linkers and/or systems with non-broken
+# linkers but suffering from PEBKAC.  The list of libraries is a bit
+# over-generous, AFAIK -lXi is needed only on (some versions of?) SuSE
+
 if test -z "${LIBGLUT}" ; then
     echo "Couldn't find GLUT, trying again with extra linker flags"
     unset ac_cv_lib_glut_glutInit
@@ -8710,7 +8714,7 @@ if test "${ac_cv_lib_glut_glutInit+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lglut -lX11 $LIBS"
+LIBS="-lglut -lX11 -lXmu -lXi -lm $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
@@ -8766,6 +8770,7 @@ echo "$as_me: error: libglut is required to compile this library" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
+    LIBGLUT="$LIBGLUT -lX11 -lXmu -lXi -lm"
 fi
 
 
diff --git a/unix/m4/glut.m4 b/unix/m4/glut.m4
index 4c6c608..e300715 100644
--- a/unix/m4/glut.m4
+++ b/unix/m4/glut.m4
@@ -8,13 +8,18 @@ AC_CHECK_LIB(glut, [glutInit],
              [LIBGLUT=-lglut],
              [])
 
+# Work-arround for broken dynamic linkers and/or systems with non-broken
+# linkers but suffering from PEBKAC.  The list of libraries is a bit
+# over-generous, AFAIK -lXi is needed only on (some versions of?) SuSE
+
 if test -z "${LIBGLUT}" ; then
     echo "Couldn't find GLUT, trying again with extra linker flags"
     unset ac_cv_lib_glut_glutInit
     AC_CHECK_LIB(glut, [glutInit],
                 [LIBGLUT=-lglut],
                 AC_MSG_ERROR([libglut is required to compile this library]),
-                [-lX11])
+                [-lX11 -lXmu -lXi -lm])
+    LIBGLUT="$LIBGLUT -lX11 -lXmu -lXi -lm"
 fi
 AC_SUBST(LIBGLUT)
 ])