Index: orxonox/branches/sound/configure.ac
===================================================================
--- orxonox/branches/sound/configure.ac	(revision 2854)
+++ orxonox/branches/sound/configure.ac	(revision 2964)
@@ -9,10 +9,179 @@
 AC_CONFIG_HEADER([config.h])
 
-AC_MSG_CHECKING([for mingw])
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+
+
+
+AC_HEADER_STDC
+
+### CHECKING FOR SYSTEM ###
+
+AC_MSG_CHECKING([for System])
 case `uname` in
+### WINDOWS ###
   *MINGW*)
+echo "mingw-WINDOWS detected"
+
     mingw="yes"
     MSBITFIELDS="-mms-bitfields"
     MWINDOWS="-mwindows"
+
+# checking gl header
+	#done before loop
+
+# checking gl header
+   AC_CHECK_HEADERS(GL/gl.h ,,
+      [AC_MSG_ERROR([cannot find opengl headers]) ])
+#   checking for Windows openGl library
+    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
+    if test "$FOUND_opengl32" = "yes" ; then
+	LIBS="$LIBS -lopengl32"
+    else
+	 echo "------------------"
+	 echo "opengl not found."
+	 echo "please install the opengl package which can be found at http://www.opengl.org"
+	 echo "------------------"
+	 exit -1
+    fi
+
+# cheking for GLU-header
+    AC_CHECK_HEADERS(GL/glu.h ,,
+      [AC_MSG_ERROR([cannot find opengl headers]) ])
+
+# checking for libGLU
+    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
+    if test "$FOUND_glu32" = "yes" ; then
+	LIBS="$LIBS -lGLU32"
+    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
+
+
+# checking for mingw32
+    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
+    if test $FOUND_mingw32 = "yes"; then 
+	LIBS="$LIBS -lmingw32"
+    fi
+# checking for SDL-headers
+    AC_CHECK_HEADERS(SDL/SDL.h ,,
+      [AC_MSG_ERROR([cannot find SDL headers]) ])
+
+#checking for libSDL
+    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
+    if test "$FOUND_sdlmain" = "yes" ; then
+	LIBS="$LIBS -lsdlmain"
+    else
+	 echo "------------------"
+	 echo "SDL library not found."
+	 echo "please install the SDL library, which can be found at http://www.libsdl.org"
+	 echo "------------------"
+	 exit 1
+    fi
+    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
+    if test "$FOUND_sdl" = "yes" ; then
+    	LIBS="$LIBS -lsdl"
+    else
+	 echo "------------------"
+	 echo "SDL library not found."
+	 echo "please install the SDL library, which can be found at http://www.libsdl.org"
+	 echo "------------------"
+	 exit -1
+    fi
+
+# checking for SDL-Mixer-headers
+    AC_CHECK_HEADERS(SDL/SDL_mixer.h ,,
+      [AC_MSG_ERROR([cannot find SDL headers]) ])
+
+#checking for libSDL_mixer
+    AC_CHECK_LIB([SDL_mixer], [main], FOUND_SDL_mixer=yes)
+    if test "$FOUND_SDL_mixer" = "yes" ; then
+	LIBS="$LIBS -lSDL_mixer"
+    else
+	 echo "------------------"
+	 echo "SDL Mixer library not found."
+	 echo "please install the SDL Mixer library, which can be found at http://www.libsdl.org"
+	 echo "------------------"
+	 exit 1
+    fi
+
+
+    ;;
+
+### LINUX ###
+ *Linux*)
+echo "Linux detected"
+
+ Linux="yes"
+
+# checking gl header
+   AC_CHECK_HEADERS(GL/gl.h ,,
+      [AC_MSG_ERROR([cannot find opengl headers]) ])
+
+#  checking for Unix GL
+   AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
+   if test "$FOUND_GL" = "yes" ; then
+     LIBS="$LIBS -lGL"
+   else
+	 echo "------------------"
+	 echo "opengl not found."
+	 echo "please install the opengl package which can be found at http://www.opengl.org"
+	 echo "------------------"
+	 exit -1
+   fi
+
+# cheking for GLU-header
+    AC_CHECK_HEADERS(GL/glu.h ,,
+      [AC_MSG_ERROR([cannot find opengl headers]) ])
+
+    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
+    if test "$FOUND_GLU" = "yes" ; 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   
+
+# checking for SDL-headers
+    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"
+     else
+	 echo "------------------"
+	 echo "SDL library not found."
+	 echo "please install the SDL library, which can be found at http://www.libsdl.org"
+	 echo "------------------"
+	 exit -1
+     fi   
+	
+# checking for SDL-Mixer-headers
+    AC_CHECK_HEADERS(SDL/SDL_mixer.h ,,
+      [AC_MSG_ERROR([cannot find SDL headers]) ])
+
+
+#checking for libSDL_mixer
+    AC_CHECK_LIB([SDL_mixer], [main], FOUND_SDL_mixer=yes)
+    if test "$FOUND_SDL_mixer" = "yes" ; then
+	LIBS="$LIBS -lSDL_mixer"
+    else
+	 echo "------------------"
+	 echo "SDL Mixer library not found."
+	 echo "please install the SDL Mixer library, which can be found at http://www.libsdl.org"
+	 echo "------------------"
+	 exit 1
+    fi
+
     ;;
   *)
@@ -23,62 +192,5 @@
 AC_SUBST(MSBITFIELDS)
 
-
-# Checks for programs.
-AC_PROG_CXX
-AC_PROG_CC
-
-# Checks for libraries.
-
-#  cheking for libGL
-AC_CHECK_HEADERS(GL/gl.h ,,
-      [AC_MSG_ERROR([cannot find opengl headers]) ])
-
-#   checking for Unix GL
-AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
-if test "$FOUND_GL" = "yes" ; then
-    LIBS="$LIBS -lGL"
-    #   checking for Windows openGl library
-else
-    echo "We did not find the Linux opengl Library. Checking for Windows Library"
-    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
-    if test "$FOUND_opengl32" = "yes" ; then
-	LIBS="$LIBS -lopengl32"
-	
-    else
-	 echo "------------------"
-	 echo "opengl not found."
-	 echo "please install the opengl package which can be found at http://www.opengl.org"
-	 echo "------------------"
-	 exit -1
-    fi
-fi
-
-#  cheking for libGLU
-AC_CHECK_HEADERS(GL/glu.h ,,
-      [AC_MSG_ERROR([cannot find opengl headers]) ])
-
-AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
-if test "$FOUND_GLU" = "yes" ; then
-    LIBS="$LIBS -lGLU"
-    #   checking for Windows GLU32 library
-else
-    echo "We did not find the Linux GLU Library. Checking for Windows Library"
-    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
-    if test "$FOUND_glu32" = "yes" ; then
-	LIBS="$LIBS -lGLU32"
-	
-	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
-fi
-
-AC_CHECK_HEADERS(SDL/SDL_mixer.h ,,
-      [AC_MSG_ERROR([cannot find sdlmixer headers]) ])
-
-LIBS="$LIBS -lSDL_mixer"
+#### Checking for LIBraries.
 
 # FIXME: Replace `main' with a function in `-lOSMesa':
@@ -89,33 +201,4 @@
 AC_CHECK_LIB([Xt], [main])
 
-## 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
-
-#checking for SDL libs
-AC_CHECK_HEADERS(SDL/SDL.h ,,
-      [AC_MSG_ERROR([cannot find SDL headers]) ])
-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
-    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
-    if test "$FOUND_sdlmain" = "yes" ; then
-	LIBS="$LIBS -lsdlmain"
-    fi
-	AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
-	if test "$FOUND_sdl" = "yes" ; then
-    		LIBS="$LIBS -lsdl"
-	fi
-fi
 
 #checking for pthread libs
@@ -148,4 +231,5 @@
 		 console/Makefile
                  gui/Makefile
-                 src/Makefile])
+                 src/Makefile
+		 importer/Makefile])
 AC_OUTPUT
