Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 5272)
+++ trunk/configure.ac	(revision 5276)
@@ -257,6 +257,7 @@
     MWINDOWS="-mwindows"
 
-
-
+#--------#
+# MIN-GW #
+#--------#
 # checking for mingw32
     AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
@@ -264,4 +265,65 @@
         LIBS="$LIBS -lmingw32"
     fi
+
+#---------------#
+# open-GL (win) #
+#---------------#
+# 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_GL=yes; LIBS="$LIBS -lopengl32"])
+    if test x$FOUND_GL != xyes ; then
+         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_GLU=yes; LIBS="$LIBS -lGLU32"])
+    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 glew header
+   AC_CHECK_HEADERS(GL/glew.h ,,
+      [AC_MSG_ERROR([cannot find opengl extension wrangler headers]) ])
+#   checking for Windows glew library
+    AC_CHECK_LIB([glew32], [main], [FOUND_GLEW=yes; LIBS="$LIBS -lglew32"])
+    if test x$FOUND_GLEW != xyes ; then
+         echo "------------------"
+         echo "opengl extension wrangler not found."
+         echo "please install the glew package which can be found at http://glew.sourceforge.net"
+         echo "------------------"
+         exit -1
+    fi
+
+#--------#
+# openAL #
+#--------#
+# checking for openAL-headers
+  AC_CHECK_HEADERS([AL/al.h] ,,
+      [AC_MSG_ERROR([cannot find openAL header.])])
+# checking for openAL-lib
+  AC_CHECK_LIB([OpenAL32], [main], [FOUND_OPENAL=yes; LIBS="$LIBS -lOpenAL32"])
+  AC_CHECK_LIB([ALut], [main], [FOUND_ALUT=yes; LIBS="$LIBS -lALut"])
+     if test x$FOUND_OPENAL != xyes ; then
+        echo "------------------"
+        echo "openal library not found."
+        echo "please install the openal library, which can be found at http://www.openal.org"
+        echo "------------------"
+        exit -1
+     fi
+
 
 #-----------#
@@ -273,8 +335,6 @@
 
 #checking for libSDL
-    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
-    if test x$FOUND_sdlmain = xyes ; then
-       LIBS="$LIBS -lsdlmain"
-    else
+    AC_CHECK_LIB([sdlmain], [main], [FOUND_sdlmain=yes; LIBS="$LIBS -lsdlmain"])
+    if test x$FOUND_sdlmain != xyes ; then
         echo "------------------"
         echo "SDL library not found."
@@ -283,8 +343,6 @@
         exit 1
     fi
-    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
-    if test x$FOUND_sdl = xyes ; then
-       LIBS="$LIBS -lsdl"
-    else
+    AC_CHECK_LIB([sdl], [main], [FOUND_SDL=yes; LIBS="$LIBS -lsdl"])
+    if test x$FOUND_SDL != xyes ; then
         echo "------------------"
         echo "SDL library not found."
@@ -294,74 +352,5 @@
     fi
 
-#---------------#
-# open-GL (win) #
-#---------------#
-# 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 x$FOUND_opengl32 = xyes ; 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 x$FOUND_glu32 = xyes ; 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 glew header
-   AC_CHECK_HEADERS(GL/glew.h ,,
-      [AC_MSG_ERROR([cannot find opengl extension wrangler headers]) ])
-#   checking for Windows glew library
-    AC_CHECK_LIB([glew32], [main], [FOUND_glew32=yes])
-    if test x$FOUND_glew32 = xyes ; then
-        LIBS="$LIBS -lglew32"
-    else
-         echo "------------------"
-         echo "opengl extension wrangler not found."
-         echo "please install the glew package which can be found at http://glew.sourceforge.net"
-         echo "------------------"
-         exit -1
-    fi
-
-#--------#
-# openAL #
-#--------#
-# checking for openAL-headers
-  AC_CHECK_HEADERS([AL/al.h] ,,
-      [AC_MSG_ERROR([cannot find openAL header.])])
-# checking for openAL-lib
-  AC_CHECK_LIB([OpenAL32], [main], [FOUND_openal=yes])
-  AC_CHECK_LIB([ALut], [main], [FOUND_ALut=yes])
-     if test x$FOUND_openal = xyes ; then
-      if test x$FOUND_ALut = xyes ; then
-       LIBS="$LIBS -lALut -lOpenAL32"
-     else
-        echo "------------------"
-        echo "openal library not found."
-        echo "please install the openal library, which can be found at http://www.openal.org"
-        echo "------------------"
-        exit -1
-      fi
-     fi
-    ;;
+  ;;
 
 #########
@@ -387,8 +376,6 @@
 
 #  checking for Unix GL
-   AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
-   if test x$FOUND_GL = xyes ; then
-     LIBS="$LIBS -lGL"
-   else
+   AC_CHECK_LIB([GL], [main], [FOUND_GL=yes; LIBS="$LIBS -lGL"])
+   if test x$FOUND_GL != xyes ; then
          echo "------------------"
          echo "opengl not found."
@@ -401,7 +388,8 @@
     AC_CHECK_HEADERS([GL/glu.h] ,,
       [AC_MSG_ERROR([cannot find opengl headers]) ])
-
-#    AC_CHECK_LIB([GLU], [main], FOUND_GLU=yes)
-#    if test x$FOUND_GLU = xyes ; then
+### 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
@@ -417,8 +405,6 @@
       [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
+  AC_CHECK_LIB([GLEW], [main], [FOUND_GLEW=yes; LIBS="$LIBS -lGLEW"])
+   if test x$FOUND_GLEW != xyes ; then
          echo "------------------"
          echo "glew not found."
@@ -435,8 +421,6 @@
       [AC_MSG_ERROR([cannot find openAL header.])])
 # checking for openAL-lib
-  AC_CHECK_LIB([openal], [main], [FOUND_openal=yes])
-     if test x$FOUND_openal = xyes ; then
-       LIBS="$LIBS -lopenal"
-     else
+  AC_CHECK_LIB([openal], [main], [FOUND_OPENAL=yes; LIBS="$LIBS -lopenal"])
+     if test x$FOUND_OPENAL != xyes ; then
         echo "------------------"
         echo "openal library not found."
@@ -448,9 +432,9 @@
   AC_CHECK_HEADERS([AL/alut.h] ,,
       [AC_MSG_ERROR([cannot find openAL Utility Toolkit (alut) header.])])
-  AC_CHECK_LIB([alut], [main], [FOUND_alut=yes])
-     if test x$FOUND_alut = xyes ; then
-       LIBS="-lalut $LIBS"
-     fi
-
+  AC_CHECK_LIB([alut], [main], [FOUND_ALUT=yes; LIBS="-lalut $LIBS"])
+
+#-----#
+# SDL #
+#-----#
 # checking for SDL
   AC_MSG_CHECKING([for SDL-version])
@@ -463,7 +447,5 @@
    LIBS="`sdl-config --libs` $LIBS"
    AC_CHECK_LIB([SDL], [main], [FOUND_SDL=yes])
-    if test x$FOUND_SDL = xyes ; then
-     echo `sdl-config --libs`
-    else
+    if test x$FOUND_SDL != xyes ; then
         echo "------------------"
         echo "SDL library not found."
@@ -534,8 +516,6 @@
       [AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])]))
 # checking for SDL_ttf-lib
-  AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes])
-     if test x$FOUND_SDL_ttf = xyes ; then
-       LIBS="$LIBS -lSDL_ttf"
-     else
+  AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes; LIBS="$LIBS -lSDL_ttf"])
+     if test x$FOUND_SDL_ttf != xyes ; then
         echo "------------------"
         echo "SDL_ttf library not found."
@@ -552,8 +532,6 @@
     [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([SDL_image header not found.]))])
 # checking for SDL_image-lib
-AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes])
-   if test x$FOUND_SDL_image = xyes ; then
-     LIBS="$LIBS -lSDL_image"
-   else
+AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes; LIBS="$LIBS -lSDL_image"])
+   if test x$FOUND_SDL_image != xyes ; then
       echo "------------------"
       echo "SDL_image library not found."
@@ -570,8 +548,6 @@
       [AC_MSG_ERROR([cannot find ogg header.])])
 # checking for ogg-lib
-  AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes])
-     if test x$FOUND_ogg = xyes ; then
-       LIBS="$LIBS -logg"
-     else
+  AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes; LIBS="$LIBS -logg"])
+     if test x$FOUND_ogg != xyes ; then
         echo "------------------"
         echo "ogg library not found."
@@ -585,8 +561,6 @@
 #--------#
 # checking for vorbis-lib
-  AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes])
-     if test x$FOUND_vorbis = xyes ; then
-       LIBS="$LIBS -lvorbis"
-     else
+  AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes; LIBS="$LIBS -lvorbis"])
+     if test x$FOUND_vorbis != xyes ; then
         echo "------------------"
         echo "vorbis library not found."
@@ -603,8 +577,6 @@
       [AC_MSG_ERROR([cannot find vorbisfile header.])])
 # checking for vorbisfile-lib
-  AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes])
-     if test x$FOUND_vorbisfile = xyes ; then
-       LIBS="$LIBS -lvorbisfile"
-     else
+  AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes; LIBS="$LIBS -lvorbisfile"])
+     if test x$FOUND_vorbisfile != xyes ; then
         echo "------------------"
         echo "vorbisfile library not found."
@@ -613,4 +585,36 @@
         exit -1
      fi
+
+
+#---------#
+# libcURL #
+#---------#
+if test x$def_curl = xyes; then
+ AC_CHECK_HEADERS([curl/curl.h], [curlHeader=yes], [curlHeader=no])
+ AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
+ if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
+  have_curl=yes
+  CURL_LIBS=`curl-config --libs`
+  CURLCFLAGS=`curl-config --cflags`
+  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
+ else
+  have_curl=no
+ fi
+
+fi
+AC_SUBST(CURL_LIBS)
+AC_SUBST(CURL_CFLAGS)
+AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
+
+#--------#
+# efence #
+#--------#
+if test x$def_efence = xyes ; then
+  AC_CHECK_LIB([efence], [main], [FOUND_efence=yes; LIBS="$LIBS -lefence"])
+   if test x$FOUND_efence != xyes ; then
+     echo "efence was requested, but is not installed!! going on"
+   fi
+
+fi
 
 #-----#
@@ -618,5 +622,5 @@
 #-----#
 if test x$def_gtk = xyes; then
-        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
+#PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
         AC_MSG_CHECKING([for gtk2.0])
         if `$PKG_CONFIG --exists gtk+-2.0`; then
@@ -639,35 +643,4 @@
 AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
 
-#---------#
-# libcURL #
-#---------#
-if test x$def_curl = xyes; then
-
- AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"])
- AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
- if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
-  have_curl=yes
-  CURL_LIBS=`curl-config --libs`
-  CURLCFLAGS=`curl-config --cflags`
-  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
- else
-  have_curl=no
- fi
-
-fi
-AC_SUBST(CURL_LIBS)
-AC_SUBST(CURL_CFLAGS)
-AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
-
-#--------#
-# efence #
-#--------#
-if test x$def_efence = xyes ; then
-  AC_CHECK_LIB([efence], [main], [FOUND_efence=yes])
-   if test x$FOUND_efence = xyes ; then
-      LIBS="$LIBS -lefence"
-   fi
-
-fi
 
 # FIXME: Replace `main' with a function in `-lm':
