Index: /trunk/config.h.in
===================================================================
--- /trunk/config.h.in	(revision 5223)
+++ /trunk/config.h.in	(revision 5224)
@@ -6,4 +6,7 @@
 /* in which debug mode we are */
 #undef DEBUG
+
+/* Define to 1 if you have the <AL/alut.h> header file. */
+#undef HAVE_AL_ALUT_H
 
 /* Define to 1 if you have the <AL/al.h> header file. */
Index: /trunk/configure
===================================================================
--- /trunk/configure	(revision 5223)
+++ /trunk/configure	(revision 5224)
@@ -3959,11 +3959,10 @@
 if test "${with_shared_lib_path+set}" = set; then
   withval="$with_shared_lib_path"
-  SHARED_LIB_PATH=$enableval
+  SHARED_LIB_PATH=$withval
 fi;
-
-if test x$SHARED_LIB_PATH = xno; then
+if test x$SHARED_LIB_PATH != xno; then
+	echo "set to $SHARED_LIB_PATH"
+else
         echo "no"
-else
-	echo $SHARED_LIB_PATH
 fi
 
@@ -3996,5 +3995,4 @@
 #define DEBUG $DEBUG
 _ACEOF
-
 
 
@@ -4321,5 +4319,5 @@
 echo "mingw-WINDOWS detected"
 
-CPPFLAGS="-I/usr/include -I/mingw/include"
+CPPFLAGS="-I/usr/include -I/mingw/include $CPPFLAGS"
 
     mingw="yes"
@@ -5539,11 +5537,10 @@
  Linux="yes"
 
-CPPFLAGS="-I/usr/include"
+##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 $LDFLAGS"
-fi
-LDFLAGS="-L/usr/lib"
-## LDFLAGS="-L/usr/lib -L$HOME/tmp/lib $LDFLAGS"
+	echo "setting new LDFLAGS with $SHARED_LIB_PATH"
+	LDFLAGS="-Wl,-rpath,$SHARED_LIB_PATH -L$SHARED_LIB_PATH $LDFLAGS"
+fi
 
 # checking gl header
@@ -5932,75 +5929,14 @@
 
 
-    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
-fi
-
-    if test x$FOUND_GLU = xyes ; then
+#    AC_CHECK_LIB([GLU], [main], FOUND_GLU=yes)
+#    if test x$FOUND_GLU = xyes ; then
       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
+#    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
 
 #--------#
@@ -6235,17 +6171,6 @@
      fi
 # checking for alut
-#  AC_CHECK_LIB([alut], [main], [FOUND_openal=yes])
-#     if test x$FOUND_openal = xyes ; then
-#       LIBS="$LIBS -lalut"
-#     fi
-
-# checking for SDL
-  echo "$as_me:$LINENO: checking for SDL-version" >&5
-echo $ECHO_N "checking for SDL-version... $ECHO_C" >&6
-  SDL_VERSION=`sdl-config --version`
-  echo $SDL_VERSION
-
-
-for ac_header in SDL.h
+
+for ac_header in AL/alut.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -6393,6 +6318,86 @@
 
 else
-
-for ac_header in SDL/SDL.h
+  { { echo "$as_me:$LINENO: error: cannot find openAL Utility Toolkit (alut) header." >&5
+echo "$as_me: error: cannot find openAL Utility Toolkit (alut) header." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+  echo "$as_me:$LINENO: checking for main in -lalut" >&5
+echo $ECHO_N "checking for main in -lalut... $ECHO_C" >&6
+if test "${ac_cv_lib_alut_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lalut  $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_alut_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_alut_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_alut_main" >&5
+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
+
+# checking for SDL
+  echo "$as_me:$LINENO: checking for SDL-version" >&5
+echo $ECHO_N "checking for SDL-version... $ECHO_C" >&6
+  SDL_VERSION=`sdl-config --version`
+  echo $SDL_VERSION
+
+   CPPFLAGS="$CPPFLAGS `sdl-config --cflags`"
+
+for ac_header in SDL.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -6540,4 +6545,151 @@
 
 else
+
+for ac_header in SDL/SDL.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 SDL header. please download from libsdl.org" >&5
 echo "$as_me: error: cannot find SDL header. please download from libsdl.org" >&2;}
@@ -6551,5 +6703,5 @@
 done
 
-   CPPFLAGS="`sdl-config --cflags` $CPPFLAGS"
+   LIBS="`sdl-config --libs` $LIBS"
    echo "$as_me:$LINENO: checking for main in -lSDL" >&5
 echo $ECHO_N "checking for main in -lSDL... $ECHO_C" >&6
@@ -6615,5 +6767,5 @@
 
     if test x$FOUND_SDL = xyes ; then
-	LIBS="`sdl-config --libs` $LIBS"
+     echo `sdl-config --libs`
     else
         echo "------------------"
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 5223)
+++ /trunk/configure.ac	(revision 5224)
@@ -360,10 +360,10 @@
  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"
 fi
-LDFLAGS="-L/usr/lib $LDFLAGS"
 
 # checking gl header
@@ -418,7 +418,7 @@
   AC_CHECK_HEADERS([AL/alut.h] ,,
       [AC_MSG_ERROR([cannot find openAL Utility Toolkit (alut) header.])])
-  AC_CHECK_LIB([alut], [main], [FOUND_openal=yes])
-     if test x$FOUND_openal = xyes ; then
-       LIBS="$LIBS -lalut"
+  AC_CHECK_LIB([alut], [main], [FOUND_alut=yes])
+     if test x$FOUND_alut = xyes ; then
+       LIBS="-lalut $LIBS"
      fi
 
@@ -428,5 +428,5 @@
   echo $SDL_VERSION
 
-   CPPFLAGS="`sdl-config --cflags` $CPPFLAGS"
+   CPPFLAGS="$CPPFLAGS `sdl-config --cflags`"
    AC_CHECK_HEADERS([SDL.h] ,,
       [AC_CHECK_HEADERS([SDL/SDL.h] ,,AC_MSG_ERROR([cannot find SDL header. please download from libsdl.org])]))
