Index: /orxonox/branches/chris/configure
===================================================================
--- /orxonox/branches/chris/configure	(revision 2188)
+++ /orxonox/branches/chris/configure	(revision 2189)
@@ -1730,10 +1730,10 @@
 case `uname` in
   *MINGW*)
-    mingw=yes
+    mingw="yes"
     MSBITFIELDS="-mms-bitfields"
     MWINDOWS="-mwindows"
     ;;
   *)
-    mingw=no
+    mingw="no"
     ;;
 esac
@@ -4902,4 +4902,73 @@
 fi
 
+## mingw CHECK
+if test $mingw = yes ; then
+	echo "$as_me:$LINENO: checking for main in -lmingw32" >&5
+echo $ECHO_N "checking for main in -lmingw32... $ECHO_C" >&6
+if test "${ac_cv_lib_mingw32_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmingw32  $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_mingw32_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mingw32_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_mingw32_main" >&5
+echo "${ECHO_T}$ac_cv_lib_mingw32_main" >&6
+if test $ac_cv_lib_mingw32_main = yes; then
+  FOUND_mingw32=yes
+fi
+
+	if test $FOUND_mingw32 = "yes"; then
+		LIBS="$LIBS -lmingw32"
+	fi
+fi
+
 ## SDL CHECK
 
@@ -5059,6 +5128,6 @@
 done
 
-
-echo "$as_me:$LINENO: checking for main in -lSDL" >&5
+if test $mingw = no ; then
+	echo "$as_me:$LINENO: checking for main in -lSDL" >&5
 echo $ECHO_N "checking for main in -lSDL... $ECHO_C" >&6
 if test "${ac_cv_lib_SDL_main+set}" = set; then
@@ -5122,9 +5191,9 @@
 fi
 
-if test "$FOUND_SDL" = "yes" ; then
-    LIBS="$LIBS -lSDL"
-    #   checking for Windows sdl library
-else
-    echo "We did not find the Linux sdl Library. Checking for Windows Library"
+	if test "$FOUND_SDL" = "yes" ; then
+    		LIBS="$LIBS -lSDL"
+	fi
+#   checking for Windows sdl library
+else
     echo "$as_me:$LINENO: checking for main in -lsdlmain" >&5
 echo $ECHO_N "checking for main in -lsdlmain... $ECHO_C" >&6
@@ -5190,22 +5259,13 @@
 
     if test "$FOUND_sdlmain" = "yes" ; then
-	LIBS="$LIBS -lsdlmain -lsdl"
-    else
-	 echo "------------------"
-	 echo "sdl library not found."
-	 echo "please install the libsdl, which can be found at http://www.libsdl.org"
-	 echo "------------------"
-	 exit -1
+	LIBS="$LIBS -lsdlmain"
     fi
-fi
-
-#checking for pthread libs
-echo "$as_me:$LINENO: checking for main in -lpthread" >&5
-echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
-if test "${ac_cv_lib_pthread_main+set}" = set; then
+	echo "$as_me:$LINENO: checking for main in -lsdl" >&5
+echo $ECHO_N "checking for main in -lsdl... $ECHO_C" >&6
+if test "${ac_cv_lib_sdl_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="-lsdl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5246,10 +5306,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_pthread_main=yes
+  ac_cv_lib_sdl_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pthread_main=no
+ac_cv_lib_sdl_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -5257,15 +5317,16 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
-if test $ac_cv_lib_pthread_main = yes; then
-  FOUND_pthread=yes
-fi
-
-if test "$FOUND_pthread" = "yes" ; then
-    LIBS="$LIBS -lpthread"
-fi
-
-#checking for  libs
+echo "$as_me:$LINENO: result: $ac_cv_lib_sdl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_sdl_main" >&6
+if test $ac_cv_lib_sdl_main = yes; then
+  FOUND_sdl=yes
+fi
+
+	if test "$FOUND_sdl" = "yes" ; then
+    		LIBS="$LIBS -lsdl"
+	fi
+fi
+
+#checking for pthread libs
 echo "$as_me:$LINENO: checking for main in -lpthread" >&5
 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
@@ -5333,5 +5394,4 @@
     LIBS="$LIBS -lpthread"
 fi
-
 
 
Index: /orxonox/branches/chris/configure.ac
===================================================================
--- /orxonox/branches/chris/configure.ac	(revision 2188)
+++ /orxonox/branches/chris/configure.ac	(revision 2189)
@@ -11,10 +11,10 @@
 case `uname` in
   *MINGW*)
-    mingw=yes
+    mingw="yes"
     MSBITFIELDS="-mms-bitfields"
     MWINDOWS="-mwindows"
     ;;
   *)
-    mingw=no
+    mingw="no"
     ;;
 esac
@@ -104,4 +104,12 @@
 fi
 
+## mingw CHECK
+if test $mingw = yes ; then
+	AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
+	if test $FOUND_mingw32 = "yes"; then 
+		LIBS="$LIBS -lmingw32"
+	fi
+fi
+
 ## SDL CHECK
 
@@ -109,21 +117,19 @@
 AC_CHECK_HEADERS(SDL/SDL.h ,,
       [AC_MSG_ERROR([cannot find SDL headers]) ])
-
-AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
-if test "$FOUND_SDL" = "yes" ; then
-    LIBS="$LIBS -lSDL"
-    #   checking for Windows sdl library
+if test $mingw = no ; then
+	AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
+	if test "$FOUND_SDL" = "yes" ; then
+    		LIBS="$LIBS -lSDL"
+	fi
+#   checking for Windows sdl library
 else
-    echo "We did not find the Linux sdl Library. Checking for Windows Library"
     AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
     if test "$FOUND_sdlmain" = "yes" ; then
-	LIBS="$LIBS -lsdlmain -lsdl"
-    else
-	 echo "------------------"
-	 echo "sdl library not found."
-	 echo "please install the libsdl, which can be found at http://www.libsdl.org"
-	 echo "------------------"
-	 exit -1
+	LIBS="$LIBS -lsdlmain"
     fi
+	AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
+	if test "$FOUND_sdl" = "yes" ; then
+    		LIBS="$LIBS -lsdl"
+	fi
 fi
 
@@ -133,11 +139,4 @@
     LIBS="$LIBS -lpthread"
 fi
-
-#checking for  libs
-AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
-if test "$FOUND_pthread" = "yes" ; then
-    LIBS="$LIBS -lpthread"
-fi
-
 
 
Index: /orxonox/branches/chris/src/Makefile.am
===================================================================
--- /orxonox/branches/chris/src/Makefile.am	(revision 2188)
+++ /orxonox/branches/chris/src/Makefile.am	(revision 2189)
@@ -9,5 +9,5 @@
 
 #  uncomment the following if bencoder requires the math library
-orxonox_LDADD=-lm
+#orxonox_LDADD=-lm
 
 #EXTRA_DIST=orxonox.lsm.in orxonox.spec.in orxonox.texinfo
Index: /orxonox/branches/chris/src/Makefile.in
===================================================================
--- /orxonox/branches/chris/src/Makefile.in	(revision 2188)
+++ /orxonox/branches/chris/src/Makefile.in	(revision 2189)
@@ -118,7 +118,4 @@
 bin_PROGRAMS = orxonox
 orxonox_SOURCES = orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc 
-
-#  uncomment the following if bencoder requires the math library
-orxonox_LDADD = -lm
 subdir = src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -134,4 +131,5 @@
 	ini_parser.$(OBJEXT) keynames.$(OBJEXT) track.$(OBJEXT)
 orxonox_OBJECTS = $(am_orxonox_OBJECTS)
+orxonox_LDADD = $(LDADD)
 orxonox_DEPENDENCIES =
 orxonox_LDFLAGS =
@@ -409,4 +407,7 @@
 
 
+#  uncomment the following if bencoder requires the math library
+#orxonox_LDADD=-lm
+
 #EXTRA_DIST=orxonox.lsm.in orxonox.spec.in orxonox.texinfo
 
