Index: /trunk/config.h.in
===================================================================
--- /trunk/config.h.in	(revision 5264)
+++ /trunk/config.h.in	(revision 5265)
@@ -21,4 +21,7 @@
 /* Define to 1 if you have the <curl/curl.h> header file. */
 #undef HAVE_CURL_CURL_H
+
+/* Define to 1 if you have the <GL/glew.h> header file. */
+#undef HAVE_GL_GLEW_H
 
 /* Define to 1 if you have the <GL/glu.h> header file. */
Index: /trunk/configure
===================================================================
--- /trunk/configure	(revision 5264)
+++ /trunk/configure	(revision 5265)
@@ -3962,5 +3962,5 @@
 fi;
 if test x$SHARED_LIB_PATH != xno; then
-	echo "set to $SHARED_LIB_PATH"
+        echo "set to $SHARED_LIB_PATH"
 else
         echo "no"
@@ -5540,6 +5540,6 @@
 ##LDFLAGS="-L/usr/lib $LDFLAGS"
 if test x$SHARED_LIB_PATH != xno; then
-	echo "setting new LDFLAGS with $SHARED_LIB_PATH"
-	LDFLAGS="-Wl,-rpath,$SHARED_LIB_PATH -L$SHARED_LIB_PATH $LDFLAGS"
+        echo "setting new LDFLAGS with $SHARED_LIB_PATH"
+        LDFLAGS="-Wl,-rpath,$SHARED_LIB_PATH -L$SHARED_LIB_PATH $LDFLAGS"
 fi
 
@@ -5939,4 +5939,232 @@
 #         exit -1
 #    fi
+
+# checking for GLEW-headers
+
+for ac_header in GL/glew.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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_objext'
+  { (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_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ---------------------------------------------- ##
+## Report this to orxonox-dev at mail.datacore.ch ##
+## ---------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: cannot find glew headers" >&5
+echo "$as_me: error: cannot find glew headers" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+# checking for GLEW-lib
+  echo "$as_me:$LINENO: checking for main in -lGLEW" >&5
+echo $ECHO_N "checking for main in -lGLEW... $ECHO_C" >&6
+if test "${ac_cv_lib_GLEW_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lGLEW  $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_GLEW_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_GLEW_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_GLEW_main" >&5
+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
+         echo "------------------"
+         echo "glew not found."
+         echo "please install the glew package which can be found at http://glew.sourceforge.net"
+         echo "------------------"
+         exit -1
+   fi
 
 #--------#
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 5264)
+++ /trunk/configure.ac	(revision 5265)
@@ -73,5 +73,5 @@
          SHARED_LIB_PATH=$withval)
 if test x$SHARED_LIB_PATH != xno; then
-	echo "set to $SHARED_LIB_PATH"
+        echo "set to $SHARED_LIB_PATH"
 else
         echo "no"
@@ -360,9 +360,9 @@
  Linux="yes"
 
-##CPPFLAGS="-I/usr/include $CPPFLAGS" 
+##CPPFLAGS="-I/usr/include $CPPFLAGS"
 ##LDFLAGS="-L/usr/lib $LDFLAGS"
 if test x$SHARED_LIB_PATH != xno; then
-	echo "setting new LDFLAGS with $SHARED_LIB_PATH"
-	LDFLAGS="-Wl,-rpath,$SHARED_LIB_PATH -L$SHARED_LIB_PATH $LDFLAGS"
+        echo "setting new LDFLAGS with $SHARED_LIB_PATH"
+        LDFLAGS="-Wl,-rpath,$SHARED_LIB_PATH -L$SHARED_LIB_PATH $LDFLAGS"
 fi
 
@@ -397,4 +397,19 @@
 #         exit -1
 #    fi
+
+# checking for GLEW-headers
+   AC_CHECK_HEADERS([GL/glew.h] ,,
+      [AC_MSG_ERROR([cannot find glew headers]) ])
+# checking for GLEW-lib
+  AC_CHECK_LIB([GLEW], [main], FOUND_GLEW=yes)
+   if test x$FOUND_GLEW = xyes ; then
+     LIBS="$LIBS -lGLEW"
+   else
+         echo "------------------"
+         echo "glew not found."
+         echo "please install the glew package which can be found at http://glew.sourceforge.net"
+         echo "------------------"
+         exit -1
+   fi
 
 #--------#
Index: /trunk/src/Makefile.am
===================================================================
--- /trunk/src/Makefile.am	(revision 5264)
+++ /trunk/src/Makefile.am	(revision 5265)
@@ -31,6 +31,5 @@
                 lib/tinyxml/libtinyxml.a \
 		lib/shell/libORXshell.a \
-                $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS) \
-                -lGLEW
+                $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
 
 orxonox_SOURCES = orxonox.cc \
Index: /trunk/src/Makefile.in
===================================================================
--- /trunk/src/Makefile.in	(revision 5264)
+++ /trunk/src/Makefile.in	(revision 5265)
@@ -292,6 +292,5 @@
                 lib/tinyxml/libtinyxml.a \
 		lib/shell/libORXshell.a \
-                $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS) \
-                -lGLEW
+                $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
 
 orxonox_SOURCES = orxonox.cc \
Index: /trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- /trunk/src/lib/graphics/graphics_engine.cc	(revision 5264)
+++ /trunk/src/lib/graphics/graphics_engine.cc	(revision 5265)
@@ -277,5 +277,5 @@
 //  delete shader;
   shader->activateShader();
-  exit(-1);
+//  exit(-1);
 
 }
