Add a couple of extra libraries usually required by GLUT
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
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)
])