Index: trunk/configure
===================================================================
--- trunk/configure	(revision 5276)
+++ trunk/configure	(revision 5277)
@@ -5759,4 +5759,9 @@
 fi
 
+#--------#
+# openGL #
+#--------#
+ac_save_LDFLAGS="${LDFLAGS}"
+
 # checking gl header
 
@@ -5975,5 +5980,5 @@
 echo "${ECHO_T}$ac_cv_lib_GL_main" >&6
 if test $ac_cv_lib_GL_main = yes; then
-  FOUND_GL=yes; LIBS="$LIBS -lGL"
+  FOUND_GL=yes; LIBS="$LIBS -lGL"; LDFLAGS="${LDFLAGS} -lGL"
 fi
 
@@ -6141,16 +6146,73 @@
 done
 
-### FIXME ###
-#    AC_CHECK_LIB([GLU], [main], [FOUND_GLU=yes; LIBS="$LIBS -lGLU"])
-#    if test x$FOUND_GLU != xyes ; then
-      FOUND_GLU=yes
-      LIBS="$LIBS -lGLU"
-#    else
-#         echo "------------------"
-#         echo "GLU library not found."
-#         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
-#         echo "------------------"
-#         exit -1
-#    fi
+    echo "$as_me:$LINENO: checking for main in -lGLU" >&5
+echo $ECHO_N "checking for main in -lGLU... $ECHO_C" >&6
+if test "${ac_cv_lib_GLU_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lGLU  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_GLU_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_GLU_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_main" >&5
+echo "${ECHO_T}$ac_cv_lib_GLU_main" >&6
+if test $ac_cv_lib_GLU_main = yes; then
+  FOUND_GLU=yes; LIBS="$LIBS -lGLU"
+fi
+
+    if test x$FOUND_GLU != xyes ; then
+         echo "------------------"
+         echo "GLU library not found."
+         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
+         echo "------------------"
+         exit -1
+    fi
 
 # checking for GLEW-headers
@@ -6369,10 +6431,8 @@
 echo "${ECHO_T}$ac_cv_lib_GLEW_main" >&6
 if test $ac_cv_lib_GLEW_main = yes; then
-  FOUND_GLEW=yes
-fi
-
-   if test x$FOUND_GLEW = xyes ; then
-     LIBS="$LIBS -lGLEW"
-   else
+  FOUND_GLEW=yes; LIBS="$LIBS -lGLEW"
+fi
+
+   if test x$FOUND_GLEW != xyes ; then
          echo "------------------"
          echo "glew not found."
@@ -6381,4 +6441,6 @@
          exit -1
    fi
+## resetting LD-flags as before GL
+LDFLAGS="${ac_save_LDFLAGS}"
 
 #--------#
@@ -6600,10 +6662,8 @@
 echo "${ECHO_T}$ac_cv_lib_openal_main" >&6
 if test $ac_cv_lib_openal_main = yes; then
-  FOUND_OPENAL=yes
-fi
-
-     if test x$FOUND_OPENAL = xyes ; then
-       LIBS="$LIBS -lopenal"
-     else
+  FOUND_OPENAL=yes; LIBS="$LIBS -lopenal"
+fi
+
+     if test x$FOUND_OPENAL != xyes ; then
         echo "------------------"
         echo "openal library not found."
@@ -6826,10 +6886,8 @@
 echo "${ECHO_T}$ac_cv_lib_alut_main" >&6
 if test $ac_cv_lib_alut_main = yes; then
-  FOUND_ALUT=yes
-fi
-
-     if test x$FOUND_alut = xyes ; then
-       LIBS="-lalut $LIBS"
-     fi
+  FOUND_ALUT=yes; LIBS="-lalut $LIBS"
+fi
+
+
 #-----#
 # SDL #
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 5276)
+++ trunk/configure.ac	(revision 5277)
@@ -371,4 +371,9 @@
 fi
 
+#--------#
+# openGL #
+#--------#
+ac_save_LDFLAGS="${LDFLAGS}"
+
 # checking gl header
    AC_CHECK_HEADERS([GL/gl.h] ,,
@@ -376,5 +381,5 @@
 
 #  checking for Unix GL
-   AC_CHECK_LIB([GL], [main], [FOUND_GL=yes; LIBS="$LIBS -lGL"])
+   AC_CHECK_LIB([GL], [main], [FOUND_GL=yes; LIBS="$LIBS -lGL"; LDFLAGS="${LDFLAGS} -lGL"])
    if test x$FOUND_GL != xyes ; then
          echo "------------------"
@@ -388,16 +393,12 @@
     AC_CHECK_HEADERS([GL/glu.h] ,,
       [AC_MSG_ERROR([cannot find opengl headers]) ])
-### FIXME ### THIS CHECK SHOULD WORK EVERYWHERE !!
-#    AC_CHECK_LIB([GLU], [main], [FOUND_GLU=yes; LIBS="$LIBS -lGLU"])
-#    if test x$FOUND_GLU != xyes ; then
-      FOUND_GLU=yes
-      LIBS="$LIBS -lGLU"
-#    else
-#         echo "------------------"
-#         echo "GLU library not found."
-#         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
-#         echo "------------------"
-#         exit -1
-#    fi
+    AC_CHECK_LIB([GLU], [main], [FOUND_GLU=yes; LIBS="$LIBS -lGLU"])
+    if test x$FOUND_GLU != xyes ; then
+         echo "------------------"
+         echo "GLU library not found."
+         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
+         echo "------------------"
+         exit -1
+    fi
 
 # checking for GLEW-headers
@@ -413,4 +414,6 @@
          exit -1
    fi
+## resetting LD-flags as before GL
+LDFLAGS="${ac_save_LDFLAGS}"
 
 #--------#
