Index: trunk/configure
===================================================================
--- trunk/configure	(revision 5160)
+++ trunk/configure	(revision 5221)
@@ -879,4 +879,6 @@
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-shared-lib-path  Tells the executable, where to look for the shared
+                          libraries.
   --with-sub-projects     also builds the subProjects while make from srcdir
 
@@ -3948,4 +3950,24 @@
 
 #-----------------#
+# shared-lib-path #
+#-----------------#
+SHARED_LIB_PATH=no
+echo "$as_me:$LINENO: checking shared lib path" >&5
+echo $ECHO_N "checking shared lib path... $ECHO_C" >&6
+
+# Check whether --with-shared-lib-path or --without-shared-lib-path was given.
+if test "${with_shared_lib_path+set}" = set; then
+  withval="$with_shared_lib_path"
+  SHARED_LIB_PATH=$enableval
+fi;
+
+if test x$SHARED_LIB_PATH = xno; then
+        echo "no"
+else
+	echo $SHARED_LIB_PATH
+fi
+
+
+#-----------------#
 # DEBUG-statement #
 #-----------------#
@@ -4375,5 +4397,5 @@
 
 #-----------#
-# SDL (win) #
+# SDL(win) #
 #-----------#
 # checking for SDL-headers
@@ -5517,6 +5539,12 @@
  Linux="yes"
 
-CPPFLAGS="-I/usr/X11R6/include -I/usr/include"
-##LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
+CPPFLAGS="-I/usr/include"
+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"
+
 # checking gl header
 
@@ -5676,7 +5704,7 @@
 
 #  checking for Unix GL
-   echo "$as_me:$LINENO: checking for glLoadIdentity in -lGL" >&5
-echo $ECHO_N "checking for glLoadIdentity in -lGL... $ECHO_C" >&6
-if test "${ac_cv_lib_GL_glLoadIdentity+set}" = set; then
+   echo "$as_me:$LINENO: checking for main in -lGL" >&5
+echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6
+if test "${ac_cv_lib_GL_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5690,15 +5718,9 @@
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char glLoadIdentity ();
+
 int
 main ()
 {
-glLoadIdentity ();
+main ();
   ;
   return 0;
@@ -5727,10 +5749,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_GL_glLoadIdentity=yes
+  ac_cv_lib_GL_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_GL_glLoadIdentity=no
+ac_cv_lib_GL_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -5738,7 +5760,7 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glLoadIdentity" >&5
-echo "${ECHO_T}$ac_cv_lib_GL_glLoadIdentity" >&6
-if test $ac_cv_lib_GL_glLoadIdentity = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5
+echo "${ECHO_T}$ac_cv_lib_GL_main" >&6
+if test $ac_cv_lib_GL_main = yes; then
   FOUND_GL=yes
 fi
@@ -5910,7 +5932,7 @@
 
 
-    echo "$as_me:$LINENO: checking for gluProject in -lGLU" >&5
-echo $ECHO_N "checking for gluProject in -lGLU... $ECHO_C" >&6
-if test "${ac_cv_lib_GLU_gluProject+set}" = set; then
+    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
@@ -5924,15 +5946,9 @@
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char gluProject ();
+
 int
 main ()
 {
-gluProject ();
+main ();
   ;
   return 0;
@@ -5961,10 +5977,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_GLU_gluProject=yes
+  ac_cv_lib_GLU_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_GLU_gluProject=no
+ac_cv_lib_GLU_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -5972,7 +5988,7 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluProject" >&5
-echo "${ECHO_T}$ac_cv_lib_GLU_gluProject" >&6
-if test $ac_cv_lib_GLU_gluProject = yes; then
+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
@@ -6218,4 +6234,9 @@
         exit -1
      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
@@ -6225,5 +6246,4 @@
   echo $SDL_VERSION
 
-   CPPFLAGS="`sdl-config --cflags` $CPPFLAGS"
 
 for ac_header in SDL.h
@@ -6531,6 +6551,77 @@
 done
 
-
-   LIBS="`sdl-config --libs` $LIBS"
+   CPPFLAGS="`sdl-config --cflags` $CPPFLAGS"
+   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="-lSDL  $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_SDL_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_SDL_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_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 x$FOUND_SDL = xyes ; then
+	LIBS="`sdl-config --libs` $LIBS"
+    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
+
     ;;
 
@@ -7278,5 +7369,4 @@
         exit -1
      fi
-
 
 #-----------#
