Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 5478)
+++ trunk/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
Index: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4	(revision 5478)
+++ trunk/aclocal.m4	(revision 5479)
@@ -1,3 +1,3 @@
-# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -29,5 +29,5 @@
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-	 [AM_AUTOMAKE_VERSION([1.9.5])])
+	 [AM_AUTOMAKE_VERSION([1.9.6])])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
Index: trunk/config.guess
===================================================================
--- trunk/config.guess	(revision 5478)
+++ trunk/config.guess	(revision 5479)
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-03-12'
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-05-27'
 
 # This file is free software; you can redistribute it and/or modify it
@@ -18,5 +18,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
@@ -24,4 +25,5 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
+
 
 # Originally written by Per Bothner <per@bothner.com>.
@@ -54,5 +56,5 @@
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
@@ -67,9 +69,9 @@
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
@@ -137,15 +139,19 @@
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-# Detect uclibc systems.
-
-LIBC="gnu"
-if [ -f /usr/include/bits/uClibc_config.h ]
-then
+if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
+	eval $set_cc_for_build
+	cat << EOF > $dummy.c
+	#include <features.h>
+	#ifdef __UCLIBC__
+	# ifdef __UCLIBC_CONFIG_VERSION__
+	LIBC=uclibc __UCLIBC_CONFIG_VERSION__
+	# else
 	LIBC=uclibc
-	if [[ -n `grep "#define __UCLIBC_CONFIG_VERSION__" /usr/include/bits/uClibc_config.h` ]]
-	then
-		UCLIBC_SUBVER=`sed -n "/#define __UCLIBC_CONFIG_VERSION__ /s///p" /usr/include/bits/uClibc_config.h`
-		LIBC=$LIBC$UCLIBC_SUBVER
-	fi
+	# endif
+	#else
+	LIBC=gnu
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
 fi
 
@@ -210,62 +216,53 @@
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
-	exit 0 ;;
+	exit ;;
     amd64:OpenBSD:*:*)
 	echo x86_64-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     amiga:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    arc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     cats:OpenBSD:*:*)
 	echo arm-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     hp300:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    luna88k:OpenBSD:*:*)
+    	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
     mac68k:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     macppc:OpenBSD:*:*)
 	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mvme68k:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mvme88k:OpenBSD:*:*)
 	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mvmeppc:OpenBSD:*:*)
 	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pegasos:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pmax:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sgi:OpenBSD:*:*)
-	echo mipseb-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	echo mips64-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
     sun3:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:OpenBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:ekkoBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     macppc:MirBSD:*:*)
 	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:MirBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
@@ -320,8 +317,5 @@
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit 0 ;;
-    Alpha*:OpenVMS:*:*)
-	echo alpha-hp-vms
-	exit 0 ;;
+	exit ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
@@ -329,29 +323,35 @@
 	# of the specific Alpha model?
 	echo alpha-pc-interix
-	exit 0 ;;
+	exit ;;
     21064:Windows_NT:50:3)
 	echo alpha-dec-winnt3.5
-	exit 0 ;;
+	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
-	exit 0;;
+	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit 0 ;;
+	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-morphos
-	exit 0 ;;
+	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
-	exit 0 ;;
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
     *:OS400:*:*)
         echo powerpc-ibm-os400
-	exit 0 ;;
+	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit 0;;
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
-	exit 0;;
+	exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
@@ -361,24 +361,24 @@
 		echo pyramid-pyramid-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
-	exit 0 ;;
+	exit ;;
     DRS?6000:unix:4.0:6*)
 	echo sparc-icl-nx6
-	exit 0 ;;
-    DRS?6000:UNIX_SV:4.2*:7*)
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
 	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     i86pc:SunOS:5.*:*)
 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
@@ -386,5 +386,5 @@
 	# it's likely to be more like Solaris than SunOS4.
 	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
@@ -395,8 +395,8 @@
 	# Japanese Language versions have a version number like `4.1.3-JL'.
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit 0 ;;
+	exit ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
@@ -410,8 +410,8 @@
 		;;
 	esac
-	exit 0 ;;
+	exit ;;
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -424,38 +424,38 @@
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
-	exit 0 ;;
+	exit ;;
     RISC*:ULTRIX:*:*)
 	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     VAX*:ULTRIX*:*:*)
 	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
 	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
 	eval $set_cc_for_build
@@ -481,30 +481,31 @@
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c \
-	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
 	echo mips-mips-riscos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
-	exit 0 ;;
+	exit ;;
     Motorola:*:4.3:PL8-*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
-	exit 0 ;;
+	exit ;;
     m88k:CX/UX:7*:*)
 	echo m88k-harris-cxux7
-	exit 0 ;;
+	exit ;;
     m88k:*:4*:R4*)
 	echo m88k-motorola-sysv4
-	exit 0 ;;
+	exit ;;
     m88k:*:3*:R3*)
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
@@ -522,27 +523,27 @@
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit 0 ;;
+ 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
-	exit 0 ;;
+	exit ;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
 	echo m88k-tektronix-sysv3
-	exit 0 ;;
+	exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
 	echo m68k-tektronix-bsd
-	exit 0 ;;
+	exit ;;
     *:IRIX*:*:*)
 	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit 0 ;;
+	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
 	echo i386-ibm-aix
-	exit 0 ;;
+	exit ;;
     ia64:AIX:*:*)
 	if [ -x /usr/bin/oslevel ] ; then
@@ -552,5 +553,5 @@
 	fi
 	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
@@ -567,6 +568,10 @@
 			}
 EOF
-		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-		echo rs6000-ibm-aix3.2.5
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
@@ -574,5 +579,5 @@
 		echo rs6000-ibm-aix3.2
 	fi
-	exit 0 ;;
+	exit ;;
     *:AIX:*:[45])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
@@ -588,26 +593,26 @@
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
-	exit 0 ;;
+	exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
-	exit 0 ;;
+	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit 0 ;;                           # report: romp-ibm BSD 4.3
+	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
-	exit 0 ;;
+	exit ;;
     DPX/2?00:B.O.S.:*:*)
 	echo m68k-bull-sysv3
-	exit 0 ;;
+	exit ;;
     9000/[34]??:4.3bsd:1.*:*)
 	echo m68k-hp-bsd
-	exit 0 ;;
+	exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 	echo m68k-hp-bsd4.4
-	exit 0 ;;
+	exit ;;
     9000/[34678]??:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
@@ -673,5 +678,16 @@
 	    # avoid double evaluation of $set_cc_for_build
 	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
 	    then
 		HP_ARCH="hppa2.0w"
@@ -681,9 +697,9 @@
 	fi
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     ia64:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ia64-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     3050*:HI-UX:*:*)
 	eval $set_cc_for_build
@@ -713,22 +729,23 @@
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
-	exit 0 ;;
+	exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 	echo hppa1.1-hp-bsd
-	exit 0 ;;
+	exit ;;
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
-	exit 0 ;;
+	exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
-	exit 0 ;;
+	exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 	echo hppa1.1-hp-osf
-	exit 0 ;;
+	exit ;;
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
-	exit 0 ;;
+	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
@@ -737,11 +754,11 @@
 	    echo ${UNAME_MACHINE}-unknown-osf1
 	fi
-	exit 0 ;;
+	exit ;;
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
-	exit 0 ;;
+	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit 0 ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
@@ -749,17 +766,17 @@
 	else echo c2-convex-bsd
 	fi
-        exit 0 ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit 0 ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit 0 ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit 0 ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
@@ -767,17 +784,17 @@
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*TS:*:*:*)
 	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*T3E:*:*:*)
 	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*SV1:*:*:*)
 	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     *:UNICOS/mp:*:*)
-	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
@@ -785,51 +802,41 @@
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
+        exit ;;
     5000:UNIX_System_V:4.*:*)
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit 0 ;;
+	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sparc*:BSD/OS:*:*)
 	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:BSD/OS:*:*)
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:FreeBSD:*:*)
-	# Determine whether the default compiler uses glibc.
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <features.h>
-	#if __GLIBC__ >= 2
-	LIBC=gnu
-	#else
-	LIBC=
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
-	# FreeBSD's kernel, but not the complete OS.
-	case ${LIBC} in gnu) kernel_only='k' ;; esac
-	echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
-	exit 0 ;;
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
-	exit 0 ;;
+	exit ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
-	exit 0 ;;
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
-	exit 0 ;;
+	exit ;;
     x86:Interix*:[34]*)
 	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-	exit 0 ;;
+	exit ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
-	exit 0 ;;
+	exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
@@ -837,40 +844,49 @@
 	# UNAME_MACHINE based on the output of uname instead of i386?
 	echo i586-pc-interix
-	exit 0 ;;
+	exit ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
-	exit 0 ;;
+	exit ;;
+    amd64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
     p*:CYGWIN*:*)
 	echo powerpcle-unknown-cygwin
-	exit 0 ;;
+	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     *:GNU:*:*)
 	# the GNU system
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit 0 ;;
+	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
 	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-	exit 0 ;;
+	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
-	exit 0 ;;
+	exit ;;
     arm*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     cris:Linux:*:*)
 	echo cris-axis-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-${LIBC}
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-${LIBC}
+	exit ;;
     ia64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     m32r*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     m68*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     mips:Linux:*:*)
 	eval $set_cc_for_build
@@ -890,5 +906,5 @@
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-${LIBC}" && exit 0
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
     mips64:Linux:*:*)
@@ -909,12 +925,12 @@
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-${LIBC}" && exit 0
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
     ppc:Linux:*:*)
 	echo powerpc-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     ppc64:Linux:*:*)
 	echo powerpc64-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -930,5 +946,5 @@
 	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
@@ -938,23 +954,23 @@
 	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
-	exit 0 ;;
+	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
 	echo hppa64-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
-	exit 0 ;;
+	exit ;;
     sh64*:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     x86_64:Linux:*:*)
 	echo x86_64-unknown-linux-${LIBC}
-	exit 0 ;;
+	exit ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
@@ -974,15 +990,15 @@
 	  a.out-i386-linux)
 		echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
-		exit 0 ;;
+		exit ;;
 	  coff-i386)
 		echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
-		exit 0 ;;
+		exit ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
 		echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
-		exit 0 ;;
+		exit ;;
 	esac
-	if [ $LIBC != "gnu" -o $LIBC != "gnulibc1" ];then echo "$TENTATIVE" && exit 0; fi
+	if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
 	# Determine whether the default compiler is a.out or elf
 	eval $set_cc_for_build
@@ -1011,6 +1027,9 @@
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
-	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
 	;;
     i*86:DYNIX/ptx:4*:*)
@@ -1019,5 +1038,5 @@
 	# sysname and nodename.
 	echo i386-sequent-sysv4
-	exit 0 ;;
+	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
@@ -1027,25 +1046,25 @@
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
 	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit 0 ;;
+	exit ;;
     i*86:XTS-300:*:STOP)
 	echo ${UNAME_MACHINE}-unknown-stop
-	exit 0 ;;
+	exit ;;
     i*86:atheos:*:*)
 	echo ${UNAME_MACHINE}-unknown-atheos
-	exit 0 ;;
-	i*86:syllable:*:*)
+	exit ;;
+    i*86:syllable:*:*)
 	echo ${UNAME_MACHINE}-pc-syllable
-	exit 0 ;;
+	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     i*86:*DOS:*:*)
 	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit 0 ;;
+	exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
@@ -1055,6 +1074,7 @@
 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
-	exit 0 ;;
-    i*86:*:5:[78]*)
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
@@ -1063,5 +1083,5 @@
 	esac
 	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
@@ -1081,5 +1101,5 @@
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
-	exit 0 ;;
+	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
@@ -1087,11 +1107,11 @@
         # the processor, so we play safe by assuming i386.
 	echo i386-pc-msdosdjgpp
-        exit 0 ;;
+        exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
-	exit 0 ;;
+	exit ;;
     paragon:*:*:*)
 	echo i860-intel-osf1
-	exit 0 ;;
+	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
@@ -1100,52 +1120,52 @@
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
-	exit 0 ;;
+	exit ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
 	echo m68010-convergent-sysv
-	exit 0 ;;
+	exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
 	echo m68k-convergent-sysv
-	exit 0 ;;
+	exit ;;
     M680?0:D-NIX:5.3:*)
 	echo m68k-diab-dnix
-	exit 0 ;;
-    M68*:*:R3V[567]*:*)
-	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
-	exit 0 ;;
+	exit ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     RM*:SINIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
@@ -1155,28 +1175,32 @@
 		echo ns32k-sni-sysv
 	fi
-	exit 0 ;;
+	exit ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit 0 ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes@openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
 	echo hppa1.1-stratus-sysv4
-	exit 0 ;;
+	exit ;;
     *:*:*:FTX*)
 	# From seanf@swdc.stratus.com.
 	echo i860-stratus-sysv4
-	exit 0 ;;
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
 	echo hppa1.1-stratus-vos
-	exit 0 ;;
+	exit ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
-	exit 0 ;;
+	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
@@ -1185,36 +1209,37 @@
 	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit 0 ;;
+        exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
-	exit 0 ;;
+	exit ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 	echo powerpc-apple-beos
-	exit 0 ;;
+	exit ;;
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
-	exit 0 ;;
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-5:SUPER-UX:*:*)
 	echo sx5-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-6:SUPER-UX:*:*)
 	echo sx6-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Rhapsody:*:*)
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Darwin:*:*)
-	case `uname -p` in
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
 	    *86) UNAME_PROCESSOR=i686 ;;
-	    powerpc) UNAME_PROCESSOR=powerpc ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
@@ -1224,20 +1249,23 @@
 	fi
 	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
-	exit 0 ;;
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
 	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
-	exit 0 ;;
+	exit ;;
     BS2000:POSIX*:*:*)
 	echo bs2000-siemens-sysv
-	exit 0 ;;
+	exit ;;
     DS/*:UNIX_System_V:*:*)
 	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
@@ -1250,29 +1278,42 @@
 	fi
 	echo ${UNAME_MACHINE}-unknown-plan9
-	exit 0 ;;
+	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
-	exit 0 ;;
+	exit ;;
     *:TENEX:*:*)
 	echo pdp10-unknown-tenex
-	exit 0 ;;
+	exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
-	exit 0 ;;
+	exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 	echo pdp10-xkl-tops20
-	exit 0 ;;
+	exit ;;
     *:TOPS-20:*:*)
 	echo pdp10-unknown-tops20
-	exit 0 ;;
+	exit ;;
     *:ITS:*:*)
 	echo pdp10-unknown-its
-	exit 0 ;;
+	exit ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:DragonFly:*:*)
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit 0 ;;
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
 esac
 
@@ -1306,5 +1347,5 @@
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
@@ -1395,9 +1436,10 @@
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
@@ -1408,5 +1450,5 @@
     c1*)
 	echo c1-convex-bsd
-	exit 0 ;;
+	exit ;;
     c2*)
 	if getsysinfo -f scalar_acc
@@ -1414,14 +1456,14 @@
 	else echo c2-convex-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     c34*)
 	echo c34-convex-bsd
-	exit 0 ;;
+	exit ;;
     c38*)
 	echo c38-convex-bsd
-	exit 0 ;;
+	exit ;;
     c4*)
 	echo c4-convex-bsd
-	exit 0 ;;
+	exit ;;
     esac
 fi
@@ -1434,5 +1476,7 @@
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
Index: trunk/config.sub
===================================================================
--- trunk/config.sub	(revision 5478)
+++ trunk/config.sub	(revision 5479)
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-03-12'
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-06-02'
 
 # This file is (in principle) common to ALL GNU software.
@@ -22,11 +22,12 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
+
 
 # Please send patches to <config-patches@gnu.org>.  Submit a context
@@ -71,5 +72,5 @@
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
@@ -84,9 +85,9 @@
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
@@ -100,5 +101,5 @@
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
@@ -146,5 +147,5 @@
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis)
+	-apple | -axis | -knuth | -cray)
 		os=
 		basic_machine=$1
@@ -232,11 +233,12 @@
 	| am33_2.0 \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| bfin \
 	| c4x | clipper \
-	| d10v | d30v | dlx | dsp16xx \
+	| d10v | d30v | dlx | dsp16xx | dvp \
 	| fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| m32r | m32rle | m68000 | m68k | m88k | mcore \
+	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
@@ -247,4 +249,5 @@
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
+	| mips64r5900 | mips64r5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
@@ -255,4 +258,5 @@
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| ms1 \
 	| msp430 \
 	| ns16k | ns32k \
@@ -263,11 +267,15 @@
 	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b \
 	| strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
 	| v850 | v850e \
 	| we32k \
-	| x86 | xscale | xstormy16 | xtensa \
+	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
 	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m32c)
 		basic_machine=$basic_machine-unknown
 		;;
@@ -299,7 +307,7 @@
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* \
-	| bs2000-* \
+	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-	| clipper-* | cydra-* \
+	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
@@ -311,5 +319,5 @@
 	| m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | mcore-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
@@ -320,4 +328,5 @@
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64r5900-* | mips64r5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
@@ -327,6 +336,8 @@
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| ms1-* \
 	| msp430-* \
-	| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
@@ -336,5 +347,6 @@
 	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
 	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
@@ -343,8 +355,10 @@
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-	| xtensa-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
 	| ymp-* \
 	| z8k-*)
+		;;
+	m32c-*)
 		;;
 	# Recognize the various machine names and aliases which stand
@@ -446,4 +460,8 @@
 		os=-unicos
 		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
 	cr16c)
 		basic_machine=cr16c-unknown
@@ -453,4 +471,7 @@
 		basic_machine=m68k-crds
 		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
 	cris | cris-* | etrax*)
 		basic_machine=cris-axis
@@ -481,4 +502,8 @@
 		basic_machine=m88k-motorola
 		os=-sysv3
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
 		;;
 	dpx20 | dpx20-*)
@@ -654,4 +679,22 @@
 		os=-mint
 		;;
+	mipsEE* | ee | ps2)
+		basic_machine=mips64r5900el-scei
+		case $os in
+		    -linux*)
+			;;
+		    *)
+			os=-elf
+			;;
+		esac
+		;;
+	iop)
+		basic_machine=mipsel-scei
+		os=-irx
+		;;
+	dvp)
+		basic_machine=dvp-scei
+		os=-elf
+		;;
 	mips3*-*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@@ -659,8 +702,4 @@
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	mmix*)
-		basic_machine=mmix-knuth
-		os=-mmixware
 		;;
 	monitor)
@@ -744,8 +783,4 @@
 		basic_machine=np1-gould
 		;;
-	nv1)
-		basic_machine=nv1-cray
-		os=-unicosmp
-		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
@@ -1029,4 +1064,8 @@
 		basic_machine=hppa1.1-winbond
 		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
 		;;
 	xps | xps100)
@@ -1059,4 +1098,7 @@
 	romp)
 		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
 		;;
 	rs6000)
@@ -1168,5 +1210,6 @@
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* | -skyos* \
+	      | -irx* )
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
@@ -1295,4 +1338,7 @@
 		os=-kaos
 		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
 	-none)
 		;;
@@ -1374,4 +1420,7 @@
 	*-ibm)
 		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
 		;;
 	*-wec)
@@ -1540,5 +1589,5 @@
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
Index: trunk/configure
===================================================================
--- trunk/configure	(revision 5478)
+++ trunk/configure	(revision 5479)
@@ -867,6 +867,6 @@
   --enable-debug          compiles in debug mode. Lots of debug info about the
                           game.
-  --disable-modular-debug compiles in modular-debug mode, that logs
-                          differently on the many modules of orxonox.
+  --disable-modular-debug                            compiles in modular-debug
+that logs differently on the many modules of orxonox.mode
   --disable-gtk           Prevents GTK from being loaded
   --disable-curl          Prevents libcURL from being loaded
@@ -879,6 +879,5 @@
   --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-shared-lib-path               Tells the executable
   --with-sub-projects     also builds the subProjects while make from srcdir
   --with-tardis           sets all the necesary environment flags for
@@ -4173,4 +4172,5 @@
 #---------------------------#
 def_tardis=no
+GTKPATH=""
 echo "$as_me:$LINENO: checking convenience flag for working at the taris in the ETH zurich" >&5
 echo $ECHO_N "checking convenience flag for working at the taris in the ETH zurich... $ECHO_C" >&6
@@ -4189,4 +4189,5 @@
   ## GTK
   GTKPREFIX=/usr/pack/gtk-2.8.3-mo
+  GTKPATH=${GTKPREFIX}/${ARCH}/bin
   CPPFLAGS="${CPPFLAGS} -I${GTKPREFIX}/include"
   LDFLAGS="${LDFLAGS} -L${GTKPREFIX}/${ARCH}/lib -Wl,-rpath -Wl,${GTKPREFIX}/${ARCH}/lib"
@@ -4302,6 +4303,47 @@
 #-------------------------#
 if test x$def_gtk = xyes; then
- # Extract the first word of "pkg-config", so it can be a program name with args.
+ if test x${GTKPATH} != x; then
+   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $GTKPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ else
+   # Extract the first word of "pkg-config ", so it can be a program name with args.
+set dummy pkg-config ; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
@@ -4341,4 +4383,5 @@
 fi
 
+ fi
 fi
 
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 5478)
+++ trunk/configure.ac	(revision 5479)
@@ -24,6 +24,6 @@
 ## AUTOCONF INIT PHASE ##
 #########################
-AC_PREREQ(2.56)
-AC_INIT(orxonox, 0.3.1_alpha, [orxonox-dev at mail.datacore.ch])
+AC_PREREQ(2.59)
+AC_INIT([orxonox],[0.3.1_alpha],[orxonox-dev at mail.datacore.ch])
 
 ## Detect the canonical host and target build environment.
@@ -70,5 +70,5 @@
 AC_MSG_CHECKING([shared lib path])
 AC_ARG_WITH([shared-lib-path],
-        AC_HELP_STRING( [--with-shared-lib-path], [Tells the executable, where to look for the shared libraries.]),
+        AS_HELP_STRING(--with-shared-lib-path,Tells the executable, where to look for the shared libraries.),
          SHARED_LIB_PATH=$withval)
 if test x$SHARED_LIB_PATH != xno; then
@@ -85,5 +85,5 @@
 AC_MSG_CHECKING([if DEBUG-mode should be enabled])
 AC_ARG_ENABLE([debug],
-        AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]),
+        AS_HELP_STRING(--enable-debug,compiles in debug mode. Lots of debug info about the game.),
          DEBUG=$enableval)
 
@@ -108,5 +108,5 @@
 AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled])
 AC_ARG_ENABLE([modular-debug],
-        AC_HELP_STRING( [--disable-modular-debug], [compiles in modular-debug mode, that logs differently on the many modules of orxonox.]),
+        AS_HELP_STRING(--disable-modular-debug,compiles in modular-debug mode, that logs differently on the many modules of orxonox.),
          MODULAR_DEBUG=$enableval)
 
@@ -123,6 +123,5 @@
 AC_MSG_CHECKING([if gtk should be enabled])
 AC_ARG_ENABLE([gtk],
-        AC_HELP_STRING( [--disable-gtk],
-        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
+        AS_HELP_STRING(--disable-gtk,Prevents GTK from being loaded), [def_gtk=no], [def_gtk=yes])
 if test x$def_gtk = xyes; then
   echo "yes"
@@ -137,6 +136,5 @@
 AC_MSG_CHECKING([if libcURL should be enabled])
 AC_ARG_ENABLE([curl],
-        AC_HELP_STRING( [--disable-curl],
-        [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
+        AS_HELP_STRING(--disable-curl,Prevents libcURL from being loaded), [def_curl=no], [def_curl=yes])
 if test x$def_curl = xyes; then
   echo "yes"
@@ -152,6 +150,5 @@
 AC_MSG_CHECKING([if the SubProjects should be built])
 AC_ARG_WITH([sub-projects],
-        AC_HELP_STRING( [--with-sub-projects],
-        [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
+        AS_HELP_STRING(--with-sub-projects,also builds the subProjects while make from srcdir), [def_sub_projects=yes])
 if test x$def_sub_projects = xyes; then
   echo "yes"
@@ -168,6 +165,5 @@
 AC_MSG_CHECKING([if Profiling should be enabled])
 AC_ARG_ENABLE([profile],
-        AC_HELP_STRING( [--enable-profile],
-        [builds orxonox with profiling support]), [def_profiling=yes])
+        AS_HELP_STRING(--enable-profile,builds orxonox with profiling support), [def_profiling=yes])
 if test x$def_profiling = xyes; then
   echo "yes"
@@ -184,6 +180,5 @@
 AC_MSG_CHECKING([if efence should be enabled])
 AC_ARG_ENABLE([efence],
-        AC_HELP_STRING( [--enable-efence],
-        [builds orxonox with efence support]), [def_efence=yes])
+        AS_HELP_STRING(--enable-efence,builds orxonox with efence support), [def_efence=yes])
 if test x$def_efence = xyes; then
   echo "yes"
@@ -199,6 +194,5 @@
 AC_MSG_CHECKING([if the Documentation should be build by default])
 AC_ARG_ENABLE([documentation],
-        AC_HELP_STRING( [--enable-documentation],
-        [also builds the sDocumentation while make from srcdir]), [def_documentation=yes])
+        AS_HELP_STRING(--enable-documentation,also builds the sDocumentation while make from srcdir), [def_documentation=yes])
 if test x$def_documentation = xyes; then
   echo "yes"
@@ -218,6 +212,5 @@
 AC_MSG_CHECKING([convenience flag for working at the taris in the ETH zurich])
 AC_ARG_WITH([tardis],
-        AC_HELP_STRING( [--with-tardis],
-        [sets all the necesary environment flags for linux-TARDIS boxes at the ETH Zurich]), [def_tardis=yes])
+        AS_HELP_STRING(--with-tardis,sets all the necesary environment flags for linux-TARDIS boxes at the ETH Zurich), [def_tardis=yes])
 if test x$def_tardis = xyes; then
   ARCH=i686-debian-linux3.1
Index: trunk/depcomp
===================================================================
--- trunk/depcomp	(revision 5478)
+++ trunk/depcomp	(revision 5479)
@@ -1,6 +1,8 @@
 #! /bin/sh
-
 # depcomp - compile a program generating dependencies as side-effects
-# Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -16,6 +18,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
 
 # As a special exception to the GNU General Public License, if you
@@ -26,20 +28,43 @@
 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
 
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
 fi
-# `libtool' can also be set to `yes' or `no'.
-
-if test -z "$depfile"; then
-   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
-   dir=`echo "$object" | sed 's,/.*$,/,'`
-   if test "$dir" = "$object"; then
-      dir=
-   fi
-   # FIXME: should be _deps on DOS.
-   depfile="$dir.deps/$base"
-fi
-
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
@@ -263,10 +288,27 @@
 
    if test "$libtool" = yes; then
-      tmpdepfile1="$dir.libs/$base.lo.d"
-      tmpdepfile2="$dir.libs/$base.d"
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
       "$@" -Wc,-MD
    else
-      tmpdepfile1="$dir$base.o.d"
-      tmpdepfile2="$dir$base.d"
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
       "$@" -MD
    fi
@@ -275,13 +317,12 @@
    if test $stat -eq 0; then :
    else
-      rm -f "$tmpdepfile1" "$tmpdepfile2"
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
       exit $stat
    fi
 
-   if test -f "$tmpdepfile1"; then
-      tmpdepfile="$tmpdepfile1"
-   else
-      tmpdepfile="$tmpdepfile2"
-   fi
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
@@ -427,5 +468,6 @@
 
   "$@" -E |
-    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
     sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
@@ -478,2 +520,11 @@
 
 exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
Index: trunk/install-sh
===================================================================
--- trunk/install-sh	(revision 5478)
+++ trunk/install-sh	(revision 5479)
@@ -1,6 +1,7 @@
 #!/bin/sh
-#
 # install - install a program, script, or datafile
-#
+
+scriptversion=2005-05-14.22
+
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -42,10 +43,8 @@
 # shared with many OS's install programs.
 
-
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
 doit="${DOITPROG-}"
-
 
 # put in absolute paths if you don't have them in your path; or use env. vars.
@@ -60,235 +59,265 @@
 mkdirprog="${MKDIRPROG-mkdir}"
 
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
 chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
+chowncmd=
+chgrpcmd=
+stripcmd=
 rmcmd="$rmprog -f"
 mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-	-c) instcmd=$cpprog
-	    shift
-	    continue;;
-
-	-d) dir_arg=true
-	    shift
-	    continue;;
-
-	-m) chmodcmd="$chmodprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-o) chowncmd="$chownprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-g) chgrpcmd="$chgrpprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-s) stripcmd=$stripprog
-	    shift
-	    continue;;
-
-	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
-	    shift
-	    continue;;
-
-	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-	    shift
-	    continue;;
-
-	*)  if [ x"$src" = x ]
-	    then
-		src=$1
-	    else
-		# this colon is to work around a 386BSD /bin/sh bug
-		:
-		dst=$1
-	    fi
-	    shift
-	    continue;;
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) chmodcmd="$chmodprog $2"
+        shift
+        shift
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+	shift
+	shift
+	continue;;
+
+    -T) no_target_directory=true
+	shift
+	continue;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    *)  # When -d is used, all remaining arguments are directories to create.
+	# When -t is used, the destination is already specified.
+	test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+	for arg
+	do
+          if test -n "$dstarg"; then
+	    # $@ is not empty: it contains at least $arg.
+	    set fnord "$@" "$dstarg"
+	    shift # fnord
+	  fi
+	  shift # arg
+	  dstarg=$arg
+	done
+	break;;
+  esac
+done
+
+if test -z "$1"; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    src=
+
+    if test -d "$dst"; then
+      mkdircmd=:
+      chmodcmd=
+    else
+      mkdircmd=$mkdirprog
+    fi
+  else
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
     esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dstarg: Is a directory" >&2
+	exit 1
+      fi
+      dst=$dst/`basename "$src"`
+    fi
+  fi
+
+  # This sed command emulates the dirname command.
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+  # Make sure that the destination directory exists.
+
+  # Skip lots of stat calls in the usual case.
+  if test ! -d "$dstdir"; then
+    defaultIFS='
+	 '
+    IFS="${IFS-$defaultIFS}"
+
+    oIFS=$IFS
+    # Some sh's can't handle IFS=/ for some reason.
+    IFS='%'
+    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    shift
+    IFS=$oIFS
+
+    pathcomp=
+
+    while test $# -ne 0 ; do
+      pathcomp=$pathcomp$1
+      shift
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp"
+	# mkdir can fail with a `File exist' error in case several
+	# install-sh are creating the directory concurrently.  This
+	# is OK.
+	test -d "$pathcomp" || exit
+      fi
+      pathcomp=$pathcomp/
+    done
+  fi
+
+  if test -n "$dir_arg"; then
+    $doit $mkdircmd "$dst" \
+      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+  else
+    dstfile=`basename "$dst"`
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap '(exit $?); exit' 1 2 13 15
+
+    # Copy the file name to the temp name.
+    $doit $cpprog "$src" "$dsttmp" &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+      || {
+	   # The rename failed, perhaps because mv can't rename something else
+	   # to itself, or perhaps because mv is so ancient that it does not
+	   # support -f.
+
+	   # Now remove or move aside any old file at destination location.
+	   # We try this two ways since rm can't unlink itself on some
+	   # systems and the destination file might be busy for other
+	   # reasons.  In this case, the final cleanup might fail but the new
+	   # file should still install successfully.
+	   {
+	     if test -f "$dstdir/$dstfile"; then
+	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+	       || {
+		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+		 (exit 1); exit 1
+	       }
+	     else
+	       :
+	     fi
+	   } &&
+
+	   # Now rename the file to the real destination.
+	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+	 }
+    }
+  fi || { (exit 1); exit 1; }
 done
 
-if [ x"$src" = x ]
-then
-	echo "$0: no input file specified" >&2
-	exit 1
-else
-	:
-fi
-
-if [ x"$dir_arg" != x ]; then
-	dst=$src
-	src=""
-
-	if [ -d "$dst" ]; then
-		instcmd=:
-		chmodcmd=""
-	else
-		instcmd=$mkdirprog
-	fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
-	if [ -f "$src" ] || [ -d "$src" ]
-	then
-		:
-	else
-		echo "$0: $src does not exist" >&2
-		exit 1
-	fi
-
-	if [ x"$dst" = x ]
-	then
-		echo "$0: no destination specified" >&2
-		exit 1
-	else
-		:
-	fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-	if [ -d "$dst" ]
-	then
-		dst=$dst/`basename "$src"`
-	else
-		:
-	fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-	'
-IFS="${IFS-$defaultIFS}"
-
-oIFS=$IFS
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS=$oIFS
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-	pathcomp=$pathcomp$1
-	shift
-
-	if [ ! -d "$pathcomp" ] ;
-        then
-		$mkdirprog "$pathcomp"
-	else
-		:
-	fi
-
-	pathcomp=$pathcomp/
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-	$doit $instcmd "$dst" &&
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-	if [ x"$transformarg" = x ]
-	then
-		dstfile=`basename "$dst"`
-	else
-		dstfile=`basename "$dst" $transformbasename |
-			sed $transformarg`$transformbasename
-	fi
-
-# don't allow the sed command to completely eliminate the filename
-
-	if [ x"$dstfile" = x ]
-	then
-		dstfile=`basename "$dst"`
-	else
-		:
-	fi
-
-# Make a couple of temp file names in the proper directory.
-
-	dsttmp=$dstdir/_inst.$$_
-	rmtmp=$dstdir/_rm.$$_
-
-# Trap to clean up temp files at exit.
-
-	trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
-	trap '(exit $?); exit' 1 2 13 15
-
-# Move or copy the file name to the temp name
-
-	$doit $instcmd "$src" "$dsttmp" &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
-
-# Now remove or move aside any old file at destination location.  We try this
-# two ways since rm can't unlink itself on some systems and the destination
-# file might be busy for other reasons.  In this case, the final cleanup
-# might fail but the new file should still install successfully.
-
+# The final little trick to "correctly" pass the exit status to the exit trap.
 {
-	if [ -f "$dstdir/$dstfile" ]
-	then
-		$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
-		$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
-		{
-		  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		  (exit 1); exit
-		}
-	else
-		:
-	fi
-} &&
-
-# Now rename the file to the real destination.
-
-	$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-
-fi &&
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-
-{
-	(exit 0); exit
+  (exit 0); exit 0
 }
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
Index: trunk/missing
===================================================================
--- trunk/missing	(revision 5478)
+++ trunk/missing	(revision 5479)
@@ -1,5 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
@@ -16,6 +20,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
 
 # As a special exception to the GNU General Public License, if you
@@ -39,4 +43,6 @@
 fi
 
+msg="missing on your system"
+
 case "$1" in
 --run)
@@ -45,10 +51,14 @@
   shift
   "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
   ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
 
   -h|--h|--he|--hel|--help)
@@ -75,9 +85,13 @@
   makeinfo     touch the output file
   tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
     ;;
 
   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing 0.4 - GNU automake"
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
     ;;
 
@@ -88,12 +102,42 @@
     ;;
 
-  aclocal*)
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
        exit 1
-    fi
-
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
          to install the \`Automake' and \`Perl' packages.  Grab them from
@@ -103,11 +147,6 @@
 
   autoconf)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    fi
-
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`${configure_ac}'.  You might want to install the
          \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
@@ -117,11 +156,6 @@
 
   autoheader)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    fi
-
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`acconfig.h' or \`${configure_ac}'.  You might want
          to install the \`Autoconf' and \`GNU m4' packages.  Grab them
@@ -141,11 +175,6 @@
 
   automake*)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    fi
-
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
          You might want to install the \`Automake' and \`Perl' packages.
@@ -157,12 +186,7 @@
 
   autom4te)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    fi
-
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
-         system.  You might have modified some files without having the
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
          proper tools for further handling them.
          You can get \`$1' as part of \`Autoconf' from any GNU
@@ -186,5 +210,5 @@
   bison|yacc)
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' $msg.  You should only need it if
          you modified a \`.y' file.  You may need the \`Bison' package
          in order for those modifications to take effect.  You can get
@@ -216,5 +240,5 @@
   lex|flex)
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.l' file.  You may need the \`Flex' package
          in order for those modifications to take effect.  You can get
@@ -238,11 +262,6 @@
 
   help2man)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    fi
-
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
 	 you modified a dependency of a manual page.  You may need the
 	 \`Help2man' package in order for those modifications to take
@@ -263,11 +282,6 @@
 
   makeinfo)
-    if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
-       # We have makeinfo, but it failed.
-       exit 1
-    fi
-
-    echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.texi' or \`.texinfo' file, or any other file
          indirectly affecting the aspect of the manual.  The spurious
@@ -275,9 +289,16 @@
          DU, IRIX).  You might want to install the \`Texinfo' package or
          the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
     file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
     if test -z "$file"; then
-      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
-    fi
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
     touch $file
     ;;
@@ -285,8 +306,4 @@
   tar)
     shift
-    if test -n "$run"; then
-      echo 1>&2 "ERROR: \`tar' requires --run"
-      exit 1
-    fi
 
     # We have already tried tar in the generic part.
@@ -324,6 +341,6 @@
   *)
     echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
-         system.  You might have modified some files without having the
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
          proper tools for further handling them.  Check the \`README' file,
          it often tells you about the needed prerequisites for installing
@@ -335,2 +352,9 @@
 
 exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
Index: trunk/mkinstalldirs
===================================================================
--- trunk/mkinstalldirs	(revision 5478)
+++ trunk/mkinstalldirs	(revision 5479)
@@ -1,13 +1,25 @@
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
 # Created: 1993-05-16
-# Public domain
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
 
 errstatus=0
-dirmode=""
+dirmode=
 
 usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
 
 # process command line arguments
@@ -15,6 +27,6 @@
   case $1 in
     -h | --help | --h*)         # -h for help
-      echo "$usage" 1>&2
-      exit 0
+      echo "$usage"
+      exit $?
       ;;
     -m)                         # -m PERM arg
@@ -23,4 +35,8 @@
       dirmode=$1
       shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
       ;;
     --)                         # stop option processing
@@ -51,15 +67,35 @@
 esac
 
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
 case $dirmode in
   '')
-    if mkdir -p -- . 2>/dev/null; then
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
       echo "mkdir -p -- $*"
       exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
     fi
     ;;
   *)
-    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
       echo "mkdir -m $dirmode -p -- $*"
       exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
     fi
     ;;
@@ -68,11 +104,19 @@
 for file
 do
-  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
   shift
+  IFS=$oIFS
 
-  pathcomp=
   for d
   do
-    pathcomp="$pathcomp$d"
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
     case $pathcomp in
       -*) pathcomp=./$pathcomp ;;
@@ -85,19 +129,19 @@
 
       if test ! -d "$pathcomp"; then
-  	errstatus=$lasterr
+	errstatus=$lasterr
       else
-  	if test ! -z "$dirmode"; then
+	if test ! -z "$dirmode"; then
 	  echo "chmod $dirmode $pathcomp"
-    	  lasterr=""
-  	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+	  lasterr=
+	  chmod "$dirmode" "$pathcomp" || lasterr=$?
 
-  	  if test ! -z "$lasterr"; then
-  	    errstatus=$lasterr
-  	  fi
-  	fi
+	  if test ! -z "$lasterr"; then
+	    errstatus=$lasterr
+	  fi
+	fi
       fi
     fi
 
-    pathcomp="$pathcomp/"
+    pathcomp=$pathcomp/
   done
 done
@@ -108,4 +152,7 @@
 # mode: shell-script
 # sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
 # End:
-# mkinstalldirs ends here
Index: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in	(revision 5478)
+++ trunk/src/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(orxonox_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/Makefile.in
===================================================================
--- trunk/src/lib/Makefile.in	(revision 5478)
+++ trunk/src/lib/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXlibs_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/collision_detection/Makefile.in
===================================================================
--- trunk/src/lib/collision_detection/Makefile.in	(revision 5478)
+++ trunk/src/lib/collision_detection/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXcd_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/event/Makefile.in
===================================================================
--- trunk/src/lib/event/Makefile.in	(revision 5478)
+++ trunk/src/lib/event/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXevent_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/graphics/Makefile.in
===================================================================
--- trunk/src/lib/graphics/Makefile.in	(revision 5478)
+++ trunk/src/lib/graphics/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXgraphics_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/graphics/importer/Makefile.in
===================================================================
--- trunk/src/lib/graphics/importer/Makefile.in	(revision 5478)
+++ trunk/src/lib/graphics/importer/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXimporter_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/graphics/spatial_separation/Makefile.in
===================================================================
--- trunk/src/lib/graphics/spatial_separation/Makefile.in	(revision 5478)
+++ trunk/src/lib/graphics/spatial_separation/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXquadtree_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/gui/Makefile.in
===================================================================
--- trunk/src/lib/gui/Makefile.in	(revision 5478)
+++ trunk/src/lib/gui/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
Index: trunk/src/lib/gui/gl_gui/Makefile.in
===================================================================
--- trunk/src/lib/gui/gl_gui/Makefile.in	(revision 5478)
+++ trunk/src/lib/gui/gl_gui/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXglgui_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/gui/gtk_gui/Makefile.in
===================================================================
--- trunk/src/lib/gui/gtk_gui/Makefile.in	(revision 5478)
+++ trunk/src/lib/gui/gtk_gui/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXgui_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/particles/Makefile.in
===================================================================
--- trunk/src/lib/particles/Makefile.in	(revision 5478)
+++ trunk/src/lib/particles/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXparticles_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/physics/Makefile.in
===================================================================
--- trunk/src/lib/physics/Makefile.in	(revision 5478)
+++ trunk/src/lib/physics/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXphysics_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/shell/Makefile.in
===================================================================
--- trunk/src/lib/shell/Makefile.in	(revision 5478)
+++ trunk/src/lib/shell/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXshell_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/sound/Makefile.in
===================================================================
--- trunk/src/lib/sound/Makefile.in	(revision 5478)
+++ trunk/src/lib/sound/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXsound_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/lib/tinyxml/Makefile.in
===================================================================
--- trunk/src/lib/tinyxml/Makefile.in	(revision 5478)
+++ trunk/src/lib/tinyxml/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libtinyxml_a_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/orxonox.cc
===================================================================
--- trunk/src/orxonox.cc	(revision 5478)
+++ trunk/src/orxonox.cc	(revision 5479)
@@ -285,4 +285,7 @@
               CONFIG_SECTION_DATA,
               CONFIG_NAME_DATADIR);
+    Gui* gui = new Gui(argc, argv);
+    gui->startGui();
+    delete gui;
     exit(-1);
   }
Index: trunk/src/subprojects/Makefile.in
===================================================================
--- trunk/src/subprojects/Makefile.in	(revision 5478)
+++ trunk/src/subprojects/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
Index: trunk/src/subprojects/collision_detection/Makefile.in
===================================================================
--- trunk/src/subprojects/collision_detection/Makefile.in	(revision 5478)
+++ trunk/src/subprojects/collision_detection/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -14,6 +14,4 @@
 
 @SET_MAKE@
-
-SOURCES = $(collision_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/subprojects/importer/Makefile.in
===================================================================
--- trunk/src/subprojects/importer/Makefile.in	(revision 5478)
+++ trunk/src/subprojects/importer/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -14,6 +14,4 @@
 
 @SET_MAKE@
-
-SOURCES = $(importer_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/subprojects/particles/Makefile.in
===================================================================
--- trunk/src/subprojects/particles/Makefile.in	(revision 5478)
+++ trunk/src/subprojects/particles/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -14,6 +14,4 @@
 
 @SET_MAKE@
-
-SOURCES = $(particles_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/subprojects/testmain/Makefile.in
===================================================================
--- trunk/src/subprojects/testmain/Makefile.in	(revision 5478)
+++ trunk/src/subprojects/testmain/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(testmain_SOURCES)
 
 srcdir = @srcdir@
Index: trunk/src/util/Makefile.am
===================================================================
--- trunk/src/util/Makefile.am	(revision 5478)
+++ trunk/src/util/Makefile.am	(revision 5479)
@@ -6,5 +6,4 @@
 libORXutils_a_SOURCES = fast_factory.cc \
 			garbage_collector.cc \
-			resource_manager.cc \
 			state.cc \
 			user_control.cc \
@@ -12,4 +11,5 @@
 			animation/animation.cc \
 			animation/animation_player.cc \
+			loading/resource_manager.cc \
 			loading/factory.cc \
 			loading/game_loader.cc \
@@ -21,5 +21,4 @@
 noinst_HEADERS =        fast_factory.h \
 			garbage_collector.h \
-			resource_manager.h \
 			state.h \
 			user_control.h \
@@ -28,4 +27,5 @@
 			animation/animation_player.h \
 			animation/t_animation.h \
+			loading/resource_manager.h \
 			loading/factory.h \
 			loading/game_loader.h \
Index: trunk/src/util/Makefile.in
===================================================================
--- trunk/src/util/Makefile.in	(revision 5478)
+++ trunk/src/util/Makefile.in	(revision 5479)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXutils_a_SOURCES)
 
 srcdir = @srcdir@
@@ -57,8 +55,9 @@
 libORXutils_a_LIBADD =
 am_libORXutils_a_OBJECTS = fast_factory.$(OBJEXT) \
-	garbage_collector.$(OBJEXT) resource_manager.$(OBJEXT) \
-	state.$(OBJEXT) user_control.$(OBJEXT) animation3d.$(OBJEXT) \
+	garbage_collector.$(OBJEXT) state.$(OBJEXT) \
+	user_control.$(OBJEXT) animation3d.$(OBJEXT) \
 	animation.$(OBJEXT) animation_player.$(OBJEXT) \
-	factory.$(OBJEXT) game_loader.$(OBJEXT) load_param.$(OBJEXT) \
+	resource_manager.$(OBJEXT) factory.$(OBJEXT) \
+	game_loader.$(OBJEXT) load_param.$(OBJEXT) \
 	pilot_node.$(OBJEXT) track_manager.$(OBJEXT) \
 	track_node.$(OBJEXT)
@@ -192,5 +191,4 @@
 libORXutils_a_SOURCES = fast_factory.cc \
 			garbage_collector.cc \
-			resource_manager.cc \
 			state.cc \
 			user_control.cc \
@@ -198,4 +196,5 @@
 			animation/animation.cc \
 			animation/animation_player.cc \
+			loading/resource_manager.cc \
 			loading/factory.cc \
 			loading/game_loader.cc \
@@ -207,5 +206,4 @@
 noinst_HEADERS = fast_factory.h \
 			garbage_collector.h \
-			resource_manager.h \
 			state.h \
 			user_control.h \
@@ -214,4 +212,5 @@
 			animation/animation_player.h \
 			animation/t_animation.h \
+			loading/resource_manager.h \
 			loading/factory.h \
 			loading/game_loader.h \
@@ -338,4 +337,18 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation_player.obj `if test -f 'animation/animation_player.cc'; then $(CYGPATH_W) 'animation/animation_player.cc'; else $(CYGPATH_W) '$(srcdir)/animation/animation_player.cc'; fi`
+
+resource_manager.o: loading/resource_manager.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f 'loading/resource_manager.cc' || echo '$(srcdir)/'`loading/resource_manager.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='loading/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f 'loading/resource_manager.cc' || echo '$(srcdir)/'`loading/resource_manager.cc
+
+resource_manager.obj: loading/resource_manager.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f 'loading/resource_manager.cc'; then $(CYGPATH_W) 'loading/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/loading/resource_manager.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='loading/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f 'loading/resource_manager.cc'; then $(CYGPATH_W) 'loading/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/loading/resource_manager.cc'; fi`
 
 factory.o: loading/factory.cc
Index: trunk/src/util/loading/resource_manager.cc
===================================================================
--- trunk/src/util/loading/resource_manager.cc	(revision 5479)
+++ trunk/src/util/loading/resource_manager.cc	(revision 5479)
@@ -0,0 +1,980 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: Patrick Boenzli
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
+
+#include "resource_manager.h"
+
+#include "debug.h"
+
+// different resource Types
+#ifndef NO_MODEL
+#include "objModel.h"
+#include "primitive_model.h"
+#include "md2Model.h"
+#endif /* NO_MODEL */
+#ifndef NO_TEXTURES
+#include "texture.h"
+#endif /* NO_TEXTURES */
+#ifndef NO_TEXT
+#include "font.h"
+#endif /* NO_TEXT */
+#ifndef NO_AUDIO
+#include "sound_engine.h"
+#include "ogg_player.h"
+#endif /* NO_AUDIO */
+#ifndef NO_SHADERS
+#include "shader.h"
+#endif /* NO_SHADERS */
+
+#include "list.h"
+#include "sdlincl.h"
+
+// File Handling Includes
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+using namespace std;
+
+/**
+ *  standard constructor
+*/
+ResourceManager::ResourceManager ()
+{
+  this->setClassID(CL_RESOURCE_MANAGER, "ResourceManager");
+  this->setName("ResourceManager");
+
+  this->dataDir = new char[3];
+  strcpy(this->dataDir, "./");
+  this->setDataDir("./data");
+  this->imageDirs = new tList<char>;
+  this->resourceList = new tList<Resource>;
+}
+
+//! Singleton Reference to the ResourceManager
+ResourceManager* ResourceManager::singletonRef = NULL;
+
+/**
+ *  standard destructor
+*/
+ResourceManager::~ResourceManager ()
+{
+  // deleting the Resources-List
+  this->unloadAllByPriority(RP_GAME);
+
+  if (this->resourceList->getSize() > 0)
+    PRINTF(1)("Not removed all Resources, since there are still %d resources registered\n", this->resourceList->getSize());
+
+  delete this->resourceList;
+  // deleting the Directorie Lists
+  tIterator<char>* tmpIt = imageDirs->getIterator();
+  char* tmpDir = tmpIt->firstElement();
+  while(tmpDir)
+    {
+      delete[] tmpDir;
+      tmpDir = tmpIt->nextElement();
+    }
+  delete tmpIt;
+  delete this->imageDirs;
+
+  delete[] this->dataDir;
+
+  ResourceManager::singletonRef = NULL;
+}
+
+/**
+ *  sets the data main directory
+ * @param dataDir the DataDirectory.
+*/
+bool ResourceManager::setDataDir(const char* dataDir)
+{
+  char* realDir = ResourceManager::homeDirCheck(dataDir);
+  if (isDir(realDir))
+    {
+      delete[] this->dataDir;
+      if (dataDir[strlen(dataDir)-1] == '/' || dataDir[strlen(dataDir)-1] == '\\')
+      {
+        this->dataDir = new char[strlen(realDir)+1];
+        strcpy(this->dataDir, realDir);
+      }
+      else
+      {
+        this->dataDir = new char[strlen(realDir)+2];
+        strcpy(this->dataDir, realDir);
+        this->dataDir[strlen(realDir)] = '/';
+        this->dataDir[strlen(realDir)+1] = '\0';
+      }
+      delete[] realDir;
+      return true;
+    }
+  else
+    {
+      PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", realDir, this->dataDir);
+      delete[] realDir;
+      return false;
+    }
+}
+
+/**
+ *  checks for the DataDirectory, by looking if
+ * @param fileInside is inisde??
+*/
+bool ResourceManager::checkDataDir(const char* fileInside)
+{
+  bool retVal;
+  if (!isDir(this->dataDir))
+    {
+      PRINTF(1)("%s is not a directory\n", this->dataDir);
+      return false;
+    }
+
+  char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1];
+  sprintf(testFile, "%s%s", this->dataDir, fileInside);
+  retVal = isFile(testFile);
+  delete[] testFile;
+  return retVal;
+}
+
+#ifndef NO_TEXTURES
+/**
+ *  adds a new Path for Images
+ * @param imageDir The path to insert
+ * @returns true, if the Path was well and injected (or already existent within the list)
+   false otherwise
+*/
+bool ResourceManager::addImageDir(const char* imageDir)
+{
+  if (imageDir == NULL)
+    return false;
+
+  char* newDir;
+  if (imageDir[strlen(imageDir)-1] == '/' || imageDir[strlen(imageDir)-1] == '\\')
+  {
+    newDir = new char[strlen(imageDir)+1];
+    strcpy(newDir, imageDir);
+  }
+  else
+  {
+    newDir = new char[strlen(imageDir)+2];
+    strcpy(newDir, imageDir);
+    newDir[strlen(imageDir)] = '/';
+    newDir[strlen(imageDir)+1] = '\0';
+  }
+  // check if the param is a Directory
+  if (isDir(newDir))
+    {
+      // check if the Directory has been added before
+      tIterator<char>* tmpImageDirs = imageDirs->getIterator();
+      char* tmpDir = tmpImageDirs->firstElement();
+      while(tmpDir)
+        {
+          if (!strcmp(tmpDir, newDir))
+            {
+              PRINTF(3)("Path %s already loaded\n", newDir);
+              delete[] newDir;
+              delete tmpImageDirs;
+              return true;
+            }
+          tmpDir = tmpImageDirs->nextElement();
+        }
+      delete tmpImageDirs;
+
+      // adding the directory to the List
+      this->imageDirs->add(newDir);
+      return true;
+    }
+  else
+    {
+      PRINTF(1)("%s is not a Directory, and can not be added to the Paths of Images\n", newDir);
+      delete[] newDir;
+      return false;
+    }
+}
+#endif /* NO_TEXTURES */
+
+/**
+ *  loads resources
+ * @param fileName: The fileName of the resource to load
+ * @param prio: The ResourcePriority of this resource (will only be increased)
+ * @param param1: an additional option to parse (see the constuctors for more help)
+ * @param param2: an additional option to parse (see the constuctors for more help)
+ * @param param3: an additional option to parse (see the constuctors for more help)
+ * @returns a pointer to a desired Resource.
+*/
+BaseObject* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
+{
+  if (fileName == NULL)
+    return NULL;
+  ResourceType tmpType;
+#ifndef NO_MODEL
+#define __IF_OK
+  if (!strncasecmp(fileName+(strlen(fileName)-4), ".obj", 4))
+    tmpType = OBJ;
+  else if (!strncmp(fileName+(strlen(fileName)-4), ".md2", 4))
+    tmpType = MD2;
+  else if (!strcasecmp(fileName, "cube") ||
+           !strcasecmp(fileName, "sphere") ||
+           !strcasecmp(fileName, "plane") ||
+           !strcasecmp(fileName, "cylinder") ||
+           !strcasecmp(fileName, "cone"))
+    tmpType = PRIM;
+#endif /* NO_MODEL */
+#ifndef NO_AUDIO
+#ifdef __IF_OK
+  else
+#endif
+#define __IF_OK
+  if (!strncasecmp(fileName+(strlen(fileName)-4), ".wav", 4))
+    tmpType = WAV;
+  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".mp3", 4))
+    tmpType = MP3;
+  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".ogg", 4))
+    tmpType = OGG;
+#endif /* NO_AUDIO */
+#ifndef NO_TEXT
+#ifdef __IF_OK
+  else
+#endif
+#define __IF_OK
+ if (!strncasecmp(fileName+(strlen(fileName)-4), ".ttf", 4))
+    tmpType = TTF;
+#endif /* NO_TEXT */
+#ifndef NO_SHADERS
+#ifdef __IF_OK
+  else
+#endif
+#define __IF_OK
+ if (!strncasecmp(fileName+(strlen(fileName)-5), ".vert", 5))
+    tmpType = SHADER;
+#endif /* NO_SHADERS */
+#ifndef NO_TEXTURES
+#ifdef __IF_OK
+  else
+#else
+  if
+#endif
+   tmpType = IMAGE;
+#endif /* NO_TEXTURES */
+#undef __IF_OK
+  return this->load(fileName, tmpType, prio, param1, param2, param3);
+}
+
+/**
+ * loads resources
+ * @param fileName: The fileName of the resource to load
+ * @param type: The Type of Resource to load.
+ * @param prio: The ResourcePriority of this resource (will only be increased)
+ * @param param1: an additional option to parse (see the constuctors for more help)
+ * @param param2: an additional option to parse (see the constuctors for more help)
+ * @param param3: an additional option to parse (see the constuctors for more help)
+ * @returns a pointer to a desired Resource.
+*/
+BaseObject* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio,
+                            void* param1, void* param2, void* param3)
+{
+  if (fileName == NULL)
+    return NULL;
+
+  // searching if the resource was loaded before.
+  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3);
+  if (tmpResource != NULL) // if the resource was loaded before.
+    {
+      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
+      tmpResource->count++;
+      if(tmpResource->prio < prio)
+        tmpResource->prio = prio;
+    }
+  else
+    {
+      // Setting up the new Resource
+      tmpResource = new Resource;
+      tmpResource->count = 1;
+      tmpResource->type = type;
+      tmpResource->prio = prio;
+      tmpResource->pointer = NULL;
+      tmpResource->name = new char[strlen(fileName)+1];
+      strcpy(tmpResource->name, fileName);
+
+      // creating the full name. (directoryName + FileName)
+      char* fullName = ResourceManager::getFullName(fileName);
+      // Checking for the type of resource \see ResourceType
+      switch(type)
+        {
+#ifndef NO_MODEL
+        case OBJ:
+          if (param1)
+            tmpResource->modelSize = *(float*)param1;
+          else
+            tmpResource->modelSize = 1.0;
+
+          if(ResourceManager::isFile(fullName))
+            tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
+          else
+            {
+              PRINTF(2)("File %s in %s does not exist. Loading a cube-Model instead\n", fileName, dataDir);
+              tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
+            }
+          break;
+        case PRIM:
+          if (param1)
+            tmpResource->modelSize = *(float*)param1;
+          else
+            tmpResource->modelSize = 1.0;
+
+          if (!strcmp(tmpResource->name, "cube"))
+            tmpResource->pointer = new PrimitiveModel(PRIM_CUBE, tmpResource->modelSize);
+          else if (!strcmp(tmpResource->name, "sphere"))
+            tmpResource->pointer = new PrimitiveModel(PRIM_SPHERE, tmpResource->modelSize);
+          else if (!strcmp(tmpResource->name, "plane"))
+            tmpResource->pointer = new PrimitiveModel(PRIM_PLANE, tmpResource->modelSize);
+          else if (!strcmp(tmpResource->name, "cylinder"))
+            tmpResource->pointer = new PrimitiveModel(PRIM_CYLINDER, tmpResource->modelSize);
+          else if (!strcmp(tmpResource->name, "cone"))
+            tmpResource->pointer = new PrimitiveModel(PRIM_CONE, tmpResource->modelSize);
+          break;
+        case MD2:
+          if(ResourceManager::isFile(fullName))
+            {
+              if (param1 != NULL)
+                {
+                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
+                  strcpy(tmpResource->secFileName, (const char*) param1);
+                }
+              else
+                tmpResource->secFileName = NULL;
+              tmpResource->pointer = new MD2Data(fullName, tmpResource->secFileName);
+            }
+              break;
+#endif /* NO_MODEL */
+#ifndef NO_TEXT
+        case TTF:
+            if (param1 != NULL)
+              tmpResource->ttfSize = *(unsigned int*)param1;
+            else
+              tmpResource->ttfSize = FONT_DEFAULT_RENDER_SIZE;
+
+          if(isFile(fullName))
+            tmpResource->pointer = new Font(fullName, tmpResource->ttfSize);
+          else
+            PRINTF(2)("%s does not exist in %s. Not loading Font\n", fileName, this->dataDir);
+          break;
+#endif /* NO_TEXT */
+#ifndef NO_AUDIO
+        case WAV:
+          if(isFile(fullName))
+            tmpResource->pointer = new SoundBuffer(fullName);
+          break;
+        case OGG:
+          if (isFile(fullName))
+            tmpResource->pointer = new OggPlayer(fullName);
+          break;
+#endif /* NO_AUDIO */
+#ifndef NO_TEXTURES
+        case IMAGE:
+          if(isFile(fullName))
+            {
+              PRINTF(4)("Image %s resides to %s\n", fileName, fullName);
+              tmpResource->pointer = new Texture(fullName);
+            }
+          else
+            {
+              char* tmpDir;
+              tIterator<char>* iterator = imageDirs->getIterator();
+              tmpDir = iterator->firstElement();
+              while(tmpDir)
+                {
+                  char* imgName = new char[strlen(tmpDir)+strlen(fileName)+1];
+                  sprintf(imgName, "%s%s", tmpDir, fileName);
+                  if(isFile(imgName))
+                    {
+                      PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
+                      tmpResource->pointer = new Texture(imgName);
+                      delete[] imgName;
+                      break;
+                    }
+                  delete[] imgName;
+                  tmpDir = iterator->nextElement();
+                }
+              delete iterator;
+            }
+          if(!tmpResource)
+             PRINTF(2)("!!Image %s not Found!!\n", fileName);
+          break;
+#endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+          case SHADER:
+            if(ResourceManager::isFile(fullName))
+            {
+              if (param1 != NULL)
+              {
+                char* secFullName = ResourceManager::getFullName((const char*)param1);
+                if (ResourceManager::isFile(secFullName))
+                {
+                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
+                  strcpy(tmpResource->secFileName, (const char*) param1);
+                  tmpResource->pointer = new Shader(fullName, secFullName);
+                }
+                delete[] secFullName;
+              }
+              else
+              {
+                tmpResource->secFileName = NULL;
+                tmpResource->pointer = new Shader(fullName, NULL);
+              }
+            }
+            break;
+#endif /* NO_SHADERS */
+        default:
+          tmpResource->pointer = NULL;
+          PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet. JUST DO IT!!\n", tmpResource->name);
+          break;
+        }
+      if (tmpResource->pointer != NULL)
+        this->resourceList->add(tmpResource);
+      delete[] fullName;
+    }
+  if (tmpResource->pointer != NULL)
+    return tmpResource->pointer;
+  else
+    {
+      PRINTF(2)("Resource %s could not be loaded\n", fileName);
+      delete[] tmpResource->name;
+      delete tmpResource;
+      return NULL;
+    }
+}
+
+/**
+ * unloads a Resource
+ * @param pointer: The pointer to free
+ * @param prio: the PriorityLevel to unload this resource
+ * @returns true if successful (pointer found, and deleted), false otherwise
+*/
+bool ResourceManager::unload(void* pointer, ResourcePriority prio)
+{
+  if (pointer == NULL)
+    return false;
+  // if pointer is existent. and only one resource of this type exists.
+  Resource* tmpResource = this->locateResourceByPointer(pointer);
+  if (tmpResource != NULL)
+    return unload(tmpResource, prio);
+  else
+  {
+    PRINTF(2)("Resource not Found %p\n", pointer);
+    return false;
+  }
+}
+
+/**
+ * unloads a Resource
+ * @param resource: The resource to unloade
+ * @param prio the PriorityLevel to unload this resource
+ * @returns true on success, false otherwise.
+*/
+bool ResourceManager::unload(Resource* resource, ResourcePriority prio)
+{
+  if (resource == NULL)
+    return false;
+  if (resource->count > 0)
+    resource->count--;
+
+  if (resource->prio <= prio)
+    {
+      if (resource->count == 0)
+        {
+          // deleting the Resource
+          switch(resource->type)
+            {
+#ifndef NO_MODEL
+            case OBJ:
+            case PRIM:
+              delete (Model*)resource->pointer;
+              break;
+            case MD2:
+              delete (MD2Data*)resource->pointer;
+              break;
+#endif /* NO_MODEL */
+#ifndef NO_AUDIO
+            case WAV:
+              delete (SoundBuffer*)resource->pointer;
+              break;
+            case OGG:
+              delete (OggPlayer*)resource->pointer;
+              break;
+#endif /* NO_AUDIO */
+#ifndef NO_TEXT
+            case TTF:
+              delete (Font*)resource->pointer;
+              break;
+#endif /* NO_TEXT */
+#ifndef NO_TEXTURES
+            case IMAGE:
+              delete (Texture*)resource->pointer;
+              break;
+#endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+            case SHADER:
+              delete (Shader*)resource->pointer;
+              break;
+#endif /* NO_SHADERS */
+            default:
+              PRINTF(2)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
+              return false;
+              break;
+            }
+          // deleting the List Entry:
+          PRINTF(4)("Resource %s safely removed.\n", resource->name);
+          delete[] resource->name;
+          this->resourceList->remove(resource);
+          delete resource;
+        }
+      else
+        PRINTF(4)("Resource %s not removed, because there are still %d References to it.\n", resource->name, resource->count);
+    }
+  else
+    PRINTF(4)("not deleting resource %s because DeleteLevel to high\n", resource->name);
+  return true;
+}
+
+
+/**
+ * unloads all alocated Memory of Resources with a pririty lower than prio
+ * @param prio The priority to delete
+*/
+bool ResourceManager::unloadAllByPriority(ResourcePriority prio)
+{
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->lastElement();
+  while (enumRes)
+    {
+      if (enumRes->prio <= prio)
+        if (enumRes->count == 0)
+          unload(enumRes, prio);
+        else
+          PRINTF(2)("unable to unload %s because there are still %d references to it\n",
+                   enumRes->name, enumRes->count);
+      //enumRes = resourceList->nextElement();
+      enumRes = iterator->prevElement();
+    }
+  delete iterator;
+}
+
+/**
+ * Searches for a Resource by some information
+ * @param fileName: The name to look for
+ * @param type the Type of resource to locate.
+ * @param param1: an additional option to parse (see the constuctors for more help)
+ * @param param2: an additional option to parse (see the constuctors for more help)
+ * @param param3: an additional option to parse (see the constuctors for more help)
+ * @returns a Pointer to the Resource if found, NULL otherwise.
+*/
+Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type,
+                                                void* param1, void* param2, void* param3)
+{
+  //  Resource* enumRes = resourceList->enumerate();
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->firstElement();
+  while (enumRes)
+    {
+      if (enumRes->type == type && !strcmp(fileName, enumRes->name))
+        {
+          bool match = false;
+
+          switch (type)
+            {
+#ifndef NO_MODEL
+            case PRIM:
+            case OBJ:
+              if (!param1)
+                {
+                  if (enumRes->modelSize == 1.0)
+                    match = true;
+                }
+              else if (enumRes->modelSize == *(float*)param1)
+                match = true;
+              break;
+            case MD2:
+              if (!param1)
+                {
+                  if (enumRes->secFileName == NULL)
+                    match = true;
+                }
+              else if (!strcmp(enumRes->secFileName, (const char*)param1))
+                match = true;
+              break;
+#endif /* NO_MODEL */
+#ifndef NO_TEXT
+            case TTF:
+              if (param1 == NULL)
+                {
+                  if (enumRes->ttfSize == FONT_DEFAULT_RENDER_SIZE)
+                    match = true;
+                }
+              else if (enumRes->ttfSize == *(unsigned int*)param1)
+                match = true;
+              break;
+#endif /* NO_TEXT */
+#ifndef NO_SHADERS
+              case SHADER:
+                if (!param1)
+                {
+                  if (enumRes->secFileName == NULL)
+                    match = true;
+                }
+                else if (!strcmp(enumRes->secFileName, (const char*)param1))
+                  match = true;
+#endif /* NO_SHADERS */
+            default:
+              match = true;
+              break;
+            }
+          if (match)
+            {
+              delete iterator;
+              return enumRes;
+            }
+        }
+      enumRes = iterator->nextElement();
+    }
+  delete iterator;
+  return NULL;
+}
+
+/**
+ * Searches for a Resource by Pointer
+ * @param pointer the Pointer to search for
+ * @returns a Pointer to the Resource if found, NULL otherwise.
+*/
+Resource* ResourceManager::locateResourceByPointer(const void* pointer)
+{
+  //  Resource* enumRes = resourceList->enumerate();
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->firstElement();
+  while (enumRes)
+    {
+      if (pointer == enumRes->pointer)
+        {
+          delete iterator;
+          return enumRes;
+        }
+      enumRes = iterator->nextElement();
+    }
+  delete iterator;
+  return NULL;
+}
+
+/**
+ * Checks if it is a Directory
+ * @param directoryName the Directory to check for
+ * @returns true if it is a directory/symlink false otherwise
+*/
+bool ResourceManager::isDir(const char* directoryName)
+{
+  if (directoryName == NULL)
+    return false;
+
+  char* tmpDirName = NULL;
+  struct stat status;
+
+  // checking for the termination of the string given. If there is a "/" at the end cut it away
+  if (directoryName[strlen(directoryName)-1] == '/' ||
+      directoryName[strlen(directoryName)-1] == '\\')
+    {
+      tmpDirName = new char[strlen(directoryName)];
+      strncpy(tmpDirName, directoryName, strlen(directoryName)-1);
+      tmpDirName[strlen(directoryName)-1] = '\0';
+    }
+  else
+    {
+      tmpDirName = new char[strlen(directoryName)+1];
+      strcpy(tmpDirName, directoryName);
+    }
+
+  if(!stat(tmpDirName, &status))
+    {
+      if (status.st_mode & (S_IFDIR
+#ifndef __WIN32__
+                            | S_IFLNK
+#endif
+                            ))
+        {
+          delete[] tmpDirName;
+          return true;
+        }
+      else
+        {
+          delete[] tmpDirName;
+          return false;
+        }
+    }
+  else
+  {
+    delete[] tmpDirName;
+    return false;
+  }
+}
+
+/**
+ * Checks if the file is either a Regular file or a Symlink
+ * @param fileName the File to check for
+ * @returns true if it is a regular file/symlink, false otherwise
+*/
+bool ResourceManager::isFile(const char* fileName)
+{
+  if (fileName == NULL)
+    return false;
+  char* tmpFileName = ResourceManager::homeDirCheck(fileName);
+  // actually checks the File
+  struct stat status;
+  if (!stat(tmpFileName, &status))
+    {
+      if (status.st_mode & (S_IFREG
+#ifndef __WIN32__
+                            | S_IFLNK
+#endif
+                            ))
+        {
+          delete[] tmpFileName;
+          return true;
+        }
+      else
+        {
+          delete[] tmpFileName;
+          return false;
+        }
+    }
+  else
+    {
+      delete[] tmpFileName;
+      return false;
+    }
+}
+
+/**
+ * touches a File on the disk (thereby creating it)
+ * @param fileName The file to touch
+*/
+bool ResourceManager::touchFile(const char* fileName)
+{
+  char* tmpName = ResourceManager::homeDirCheck(fileName);
+  if (tmpName == NULL)
+    return false;
+  FILE* stream;
+  if( (stream = fopen (tmpName, "w")) == NULL)
+    {
+      PRINTF(1)("could not open %s fro writing\n", fileName);
+      delete[] tmpName;
+      return false;
+    }
+  fclose(stream);
+
+  delete[] tmpName;
+}
+
+/**
+ * deletes a File from disk
+ * @param fileName the File to delete
+*/
+bool ResourceManager::deleteFile(const char* fileName)
+{
+  if (fileName == NULL)
+    return false;
+  char* tmpName = ResourceManager::homeDirCheck(fileName);
+  unlink(tmpName);
+  delete[] tmpName;
+}
+
+/**
+ * @param name the Name of the file to check
+ * @returns The name of the file, including the HomeDir
+ * IMPORTANT: this has to be deleted from the outside
+ */
+char* ResourceManager::homeDirCheck(const char* name)
+{
+  if (name == NULL)
+    return NULL;
+  char* retName;
+  if (!strncmp(name, "~/", 2))
+    {
+      char tmpFileName[500];
+#ifdef __WIN32__
+      strcpy(tmpFileName, getenv("USERPROFILE"));
+#else
+      strcpy(tmpFileName, getenv("HOME"));
+#endif
+      retName = new char[strlen(tmpFileName)+strlen(name)];
+      sprintf(retName, "%s%s", tmpFileName, name+1);
+    }
+  else
+    {
+      retName = new char[strlen(name)+1];
+      strcpy(retName, name);
+    }
+  return retName;
+}
+
+/**
+ * @param fileName the Name of the File to check
+ * @returns The full name of the file, including the DataDir, and NULL if the file does not exist
+ * !!IMPORTANT: this has to be deleted from the outside!!
+*/
+char* ResourceManager::getFullName(const char* fileName)
+{
+  if (fileName == NULL || ResourceManager::getInstance()->getDataDir() == NULL)
+    return NULL;
+
+  char* retName = new char[strlen(ResourceManager::getInstance()->getDataDir())
+                           + strlen(fileName) + 1];
+  sprintf(retName, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
+  if (ResourceManager::isFile(retName) || ResourceManager::isDir(retName))
+    return retName;
+  else
+    {
+      delete[] retName;
+      return NULL;
+    }
+}
+
+
+/**
+ * checks wether a file is in the DataDir.
+ * @param fileName the File to check if it is in the Data-Dir structure.
+ * @returns true if the file exists, false otherwise
+ */
+bool ResourceManager::isInDataDir(const char* fileName)
+{
+  if (fileName == NULL || ResourceManager::getInstance()->getDataDir() == NULL)
+    return false;
+
+  bool retVal = false;
+  char* checkFile = new char[strlen(ResourceManager::getInstance()->getDataDir())
+      + strlen(fileName) + 1];
+  sprintf(checkFile, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
+
+  if (ResourceManager::isFile(checkFile) || ResourceManager::isDir(checkFile))
+    retVal = true;
+  else
+    retVal = false;
+  delete[] checkFile;
+  return retVal;
+}
+
+
+/**
+ * outputs debug information about the ResourceManager
+*/
+void ResourceManager::debug() const
+{
+  PRINT(0)("=RM===================================\n");
+  PRINT(0)("= RESOURCE-MANAGER DEBUG INFORMATION =\n");
+  PRINT(0)("======================================\n");
+  // if it is not initialized
+  PRINT(0)(" Reference is: %p\n", ResourceManager::singletonRef);
+  PRINT(0)(" Data-Directory is: %s\n", this->dataDir);
+  PRINT(0)(" List of Image-Directories: ");
+  tIterator<char>* tmpIt = imageDirs->getIterator();
+  char* tmpDir = tmpIt->firstElement();
+  while(tmpDir)
+    {
+      PRINT(0)("%s ",tmpDir);
+      tmpDir = tmpIt->nextElement();
+    }
+  delete tmpIt;
+  PRINT(0)("\n");
+
+  PRINT(0)("List of all stored Resources:\n");
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->firstElement();
+  while (enumRes)
+    {
+      PRINT(0)("-----------------------------------------\n");
+      PRINT(0)("Name: %s; References: %d; Type: %s ", enumRes->name, enumRes->count, ResourceManager::ResourceTypeToChar(enumRes->type));
+
+      PRINT(0)("gets deleted at ");
+      switch(enumRes->prio)
+        {
+        default:
+        case RP_NO:
+          PRINT(0)("first posibility (0)\n");
+          break;
+        case RP_LEVEL:
+          PRINT(0)("the end of the Level (1)\n");
+          break;
+        case RP_CAMPAIGN:
+          PRINT(0)("the end of the campaign (2)\n");
+          break;
+        case RP_GAME:
+          PRINT(0)("when leaving the game (3)\n");
+          break;
+        }
+      enumRes = iterator->nextElement();
+    }
+  delete iterator;
+
+
+
+  PRINT(0)("==================================RM==\n");
+}
+
+
+/**
+ * converts a ResourceType into the corresponding String
+ * @param type the ResourceType to translate
+ * @returns the converted String.
+ */
+const char* ResourceManager::ResourceTypeToChar(ResourceType type)
+{
+  switch (type)
+  {
+#ifndef NO_MODEL
+    case OBJ:
+      return "ObjectModel";
+      break;
+    case PRIM:
+      return "PrimitiveModel";
+      break;
+    case MD2:
+      return "MD2-Data";
+      break;
+#endif
+#ifndef NO_TEXTURES
+    case IMAGE:
+      return "ImageFile (Texture)";
+      break;
+#endif
+#ifndef NO_AUDIO
+    case WAV:
+      return "SoundFile";
+      break;
+    case OGG:
+      return "MusicFile";
+      break;
+#endif
+#ifndef NO_TEXT
+    case TTF:
+      return "Font (TTF)";
+      break;
+#endif
+#ifndef NO_SHADERS
+    case SHADER:
+      return "Shader";
+      break;
+#endif
+    default:
+      return "unknown Format";
+      break;
+  }
+}
Index: trunk/src/util/loading/resource_manager.h
===================================================================
--- trunk/src/util/loading/resource_manager.h	(revision 5479)
+++ trunk/src/util/loading/resource_manager.h	(revision 5479)
@@ -0,0 +1,148 @@
+/*!
+ * @file resource_manager.h
+  *  The Resource Manager checks if a file/resource is loaded.
+
+    If a file/resource was already loaded the resourceManager will
+    return a void pointer to the desired resource.
+    Otherwise it will instruct the coresponding resource-loader to load,
+    and receive a pointer to it.
+
+    it is possible to compile the resource Manager without some modules by
+    just adding the compile flag -D....
+    (NO_MODEL)
+    (NO_AUDIO)
+    (NO_TEXT)
+    (NO_TEXTURES)
+*/
+
+#ifndef _RESOURCE_MANAGER_H
+#define _RESOURCE_MANAGER_H
+
+#include "base_object.h"
+
+#include "stdlibincl.h"
+
+// FORWARD DECLARATION
+template<class T> class tList;
+
+//! An eumerator for different fileTypes the resourceManager supports
+typedef enum ResourceType
+{
+#ifndef NO_MODEL
+  OBJ,                  //!< loading .obj file
+  PRIM,                 //!< loading primitive model
+  MD2,                  //!< loading md2-file
+#endif /* NO_MODEL */
+#ifndef NO_TEXT
+  TTF,                  //!< loading a TrueTypeFont
+#endif /* NO_TEXT */
+#ifndef NO_AUDIO
+  WAV,                  //!< loading wav
+  MP3,                  //!< loading mp3
+  OGG,                  //!< loading ogg
+#endif /* NO_AUDIO */
+#ifndef NO_TEXTURES
+  IMAGE,                //!< loading an image
+#endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+  SHADER,               //!< openGL-shader program
+#endif /* NO_SHADERS */
+};
+
+//! An enumerator for different UNLOAD-types.
+/**
+   RP_NO:        will be unloaded on request
+   RP_LEVEL:     will be unloaded at the end of a Level
+   RP_CAMPAIGN:  will be unloaded at the end of a Campaign
+   RP_GAME:      will be unloaded at the end of the whole Game (when closing orxonox)
+*/
+typedef enum ResourcePriority
+{
+  RP_NO        =   0,
+  RP_LEVEL     =   1,
+  RP_CAMPAIGN  =   2,
+  RP_GAME      =   4
+};
+
+//! A Struct that keeps track about A resource its name its Type, and so on
+struct Resource
+{
+  BaseObject*       pointer;           //!< Pointer to the Resource.
+  unsigned int      count;             //!< How many times this Resource has been loaded.
+
+  char*             name;              //!< Name of the Resource.
+  ResourceType      type;              //!< ResourceType of this Resource.
+  ResourcePriority  prio;              //!< The Priority of this resource. (This will only be increased)
+
+  // more specific
+  float             modelSize;         //!< the size of the model (OBJ/PRIM)
+#ifndef NO_MODEL
+  char*             secFileName;       //!< a seconf fileName
+#endif /* NO_MODEL */
+#ifndef NO_TEXT
+  unsigned int      ttfSize;           //!< the size of the ttf-font (TTF)
+#endif /* NO_TEXT */
+};
+
+
+//! The ResourceManager is a class, that decides if a file/resource should be loaded
+/**
+ * If a file/resource was already loaded the resourceManager will
+ * return a pointer to the desired resource.
+ * Otherwise it will instruct the corresponding resource-loader to load,
+ * and receive the pointer to it.
+ *
+ * It does it by looking, if a desired file has already been loaded.
+ * There is also the possibility to check for some variables
+ */
+class ResourceManager : public BaseObject
+{
+ public:
+  virtual ~ResourceManager();
+  /** @returns a Pointer to the only object of this Class */
+  inline static ResourceManager* getInstance() { if (!singletonRef) singletonRef = new ResourceManager();  return singletonRef; };
+
+  bool setDataDir(const char* dataDir);
+  /** @returns the Name of the data directory */
+  inline const char* getDataDir() const { return this->dataDir; };
+
+  bool checkDataDir(const char* fileInside);
+ bool addImageDir(const char* imageDir);
+  BaseObject* load(const char* fileName, ResourcePriority prio = RP_NO,
+               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+  BaseObject* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
+               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+  bool unload(void* pointer, ResourcePriority prio = RP_NO);
+  bool unload(Resource* resource, ResourcePriority = RP_NO);
+  bool unloadAllByPriority(ResourcePriority prio);
+
+  void debug() const;
+
+
+  // utility functions of this class
+  static bool isDir(const char* directory);
+  static bool isFile(const char* fileName);
+  static bool touchFile(const char* fileName);
+  static bool deleteFile(const char* fileName);
+  static char* homeDirCheck(const char* fileName);
+  static char* getFullName(const char* fileName);
+  static bool isInDataDir(const char* fileName);
+
+  static const char* ResourceTypeToChar(ResourceType type);
+
+ private:
+  ResourceManager();
+
+  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
+  Resource* locateResourceByPointer(const void* pointer);
+
+ private:
+  static ResourceManager*  singletonRef;       //!< singleton Reference
+
+  char*                    dataDir;            //!< The Data Directory, where all relevant Data is stored.
+  tList<Resource>*         resourceList;       //!< The List of Resources, that has already been loaded.
+  tList<char>*             imageDirs;          //!< A list of directories in which images are stored.
+
+};
+
+#endif /* _RESOURCE_MANAGER_H */
Index: trunk/src/util/resource_manager.cc
===================================================================
--- trunk/src/util/resource_manager.cc	(revision 5478)
+++ 	(revision )
@@ -1,980 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: Patrick Boenzli
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
-
-#include "resource_manager.h"
-
-#include "debug.h"
-
-// different resource Types
-#ifndef NO_MODEL
-#include "objModel.h"
-#include "primitive_model.h"
-#include "md2Model.h"
-#endif /* NO_MODEL */
-#ifndef NO_TEXTURES
-#include "texture.h"
-#endif /* NO_TEXTURES */
-#ifndef NO_TEXT
-#include "font.h"
-#endif /* NO_TEXT */
-#ifndef NO_AUDIO
-#include "sound_engine.h"
-#include "ogg_player.h"
-#endif /* NO_AUDIO */
-#ifndef NO_SHADERS
-#include "shader.h"
-#endif /* NO_SHADERS */
-
-#include "list.h"
-#include "sdlincl.h"
-
-// File Handling Includes
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-using namespace std;
-
-/**
- *  standard constructor
-*/
-ResourceManager::ResourceManager ()
-{
-  this->setClassID(CL_RESOURCE_MANAGER, "ResourceManager");
-  this->setName("ResourceManager");
-
-  this->dataDir = new char[3];
-  strcpy(this->dataDir, "./");
-  this->setDataDir("./data");
-  this->imageDirs = new tList<char>;
-  this->resourceList = new tList<Resource>;
-}
-
-//! Singleton Reference to the ResourceManager
-ResourceManager* ResourceManager::singletonRef = NULL;
-
-/**
- *  standard destructor
-*/
-ResourceManager::~ResourceManager ()
-{
-  // deleting the Resources-List
-  this->unloadAllByPriority(RP_GAME);
-
-  if (this->resourceList->getSize() > 0)
-    PRINTF(1)("Not removed all Resources, since there are still %d resources registered\n", this->resourceList->getSize());
-
-  delete this->resourceList;
-  // deleting the Directorie Lists
-  tIterator<char>* tmpIt = imageDirs->getIterator();
-  char* tmpDir = tmpIt->firstElement();
-  while(tmpDir)
-    {
-      delete[] tmpDir;
-      tmpDir = tmpIt->nextElement();
-    }
-  delete tmpIt;
-  delete this->imageDirs;
-
-  delete[] this->dataDir;
-
-  ResourceManager::singletonRef = NULL;
-}
-
-/**
- *  sets the data main directory
- * @param dataDir the DataDirectory.
-*/
-bool ResourceManager::setDataDir(const char* dataDir)
-{
-  char* realDir = ResourceManager::homeDirCheck(dataDir);
-  if (isDir(realDir))
-    {
-      delete[] this->dataDir;
-      if (dataDir[strlen(dataDir)-1] == '/' || dataDir[strlen(dataDir)-1] == '\\')
-      {
-        this->dataDir = new char[strlen(realDir)+1];
-        strcpy(this->dataDir, realDir);
-      }
-      else
-      {
-        this->dataDir = new char[strlen(realDir)+2];
-        strcpy(this->dataDir, realDir);
-        this->dataDir[strlen(realDir)] = '/';
-        this->dataDir[strlen(realDir)+1] = '\0';
-      }
-      delete[] realDir;
-      return true;
-    }
-  else
-    {
-      PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", realDir, this->dataDir);
-      delete[] realDir;
-      return false;
-    }
-}
-
-/**
- *  checks for the DataDirectory, by looking if
- * @param fileInside is inisde??
-*/
-bool ResourceManager::checkDataDir(const char* fileInside)
-{
-  bool retVal;
-  if (!isDir(this->dataDir))
-    {
-      PRINTF(1)("%s is not a directory\n", this->dataDir);
-      return false;
-    }
-
-  char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1];
-  sprintf(testFile, "%s%s", this->dataDir, fileInside);
-  retVal = isFile(testFile);
-  delete[] testFile;
-  return retVal;
-}
-
-#ifndef NO_TEXTURES
-/**
- *  adds a new Path for Images
- * @param imageDir The path to insert
- * @returns true, if the Path was well and injected (or already existent within the list)
-   false otherwise
-*/
-bool ResourceManager::addImageDir(const char* imageDir)
-{
-  if (imageDir == NULL)
-    return false;
-
-  char* newDir;
-  if (imageDir[strlen(imageDir)-1] == '/' || imageDir[strlen(imageDir)-1] == '\\')
-  {
-    newDir = new char[strlen(imageDir)+1];
-    strcpy(newDir, imageDir);
-  }
-  else
-  {
-    newDir = new char[strlen(imageDir)+2];
-    strcpy(newDir, imageDir);
-    newDir[strlen(imageDir)] = '/';
-    newDir[strlen(imageDir)+1] = '\0';
-  }
-  // check if the param is a Directory
-  if (isDir(newDir))
-    {
-      // check if the Directory has been added before
-      tIterator<char>* tmpImageDirs = imageDirs->getIterator();
-      char* tmpDir = tmpImageDirs->firstElement();
-      while(tmpDir)
-        {
-          if (!strcmp(tmpDir, newDir))
-            {
-              PRINTF(3)("Path %s already loaded\n", newDir);
-              delete[] newDir;
-              delete tmpImageDirs;
-              return true;
-            }
-          tmpDir = tmpImageDirs->nextElement();
-        }
-      delete tmpImageDirs;
-
-      // adding the directory to the List
-      this->imageDirs->add(newDir);
-      return true;
-    }
-  else
-    {
-      PRINTF(1)("%s is not a Directory, and can not be added to the Paths of Images\n", newDir);
-      delete[] newDir;
-      return false;
-    }
-}
-#endif /* NO_TEXTURES */
-
-/**
- *  loads resources
- * @param fileName: The fileName of the resource to load
- * @param prio: The ResourcePriority of this resource (will only be increased)
- * @param param1: an additional option to parse (see the constuctors for more help)
- * @param param2: an additional option to parse (see the constuctors for more help)
- * @param param3: an additional option to parse (see the constuctors for more help)
- * @returns a pointer to a desired Resource.
-*/
-BaseObject* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
-{
-  if (fileName == NULL)
-    return NULL;
-  ResourceType tmpType;
-#ifndef NO_MODEL
-#define __IF_OK
-  if (!strncasecmp(fileName+(strlen(fileName)-4), ".obj", 4))
-    tmpType = OBJ;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".md2", 4))
-    tmpType = MD2;
-  else if (!strcasecmp(fileName, "cube") ||
-           !strcasecmp(fileName, "sphere") ||
-           !strcasecmp(fileName, "plane") ||
-           !strcasecmp(fileName, "cylinder") ||
-           !strcasecmp(fileName, "cone"))
-    tmpType = PRIM;
-#endif /* NO_MODEL */
-#ifndef NO_AUDIO
-#ifdef __IF_OK
-  else
-#endif
-#define __IF_OK
-  if (!strncasecmp(fileName+(strlen(fileName)-4), ".wav", 4))
-    tmpType = WAV;
-  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".mp3", 4))
-    tmpType = MP3;
-  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".ogg", 4))
-    tmpType = OGG;
-#endif /* NO_AUDIO */
-#ifndef NO_TEXT
-#ifdef __IF_OK
-  else
-#endif
-#define __IF_OK
- if (!strncasecmp(fileName+(strlen(fileName)-4), ".ttf", 4))
-    tmpType = TTF;
-#endif /* NO_TEXT */
-#ifndef NO_SHADERS
-#ifdef __IF_OK
-  else
-#endif
-#define __IF_OK
- if (!strncasecmp(fileName+(strlen(fileName)-5), ".vert", 5))
-    tmpType = SHADER;
-#endif /* NO_SHADERS */
-#ifndef NO_TEXTURES
-#ifdef __IF_OK
-  else
-#else
-  if
-#endif
-   tmpType = IMAGE;
-#endif /* NO_TEXTURES */
-#undef __IF_OK
-  return this->load(fileName, tmpType, prio, param1, param2, param3);
-}
-
-/**
- * loads resources
- * @param fileName: The fileName of the resource to load
- * @param type: The Type of Resource to load.
- * @param prio: The ResourcePriority of this resource (will only be increased)
- * @param param1: an additional option to parse (see the constuctors for more help)
- * @param param2: an additional option to parse (see the constuctors for more help)
- * @param param3: an additional option to parse (see the constuctors for more help)
- * @returns a pointer to a desired Resource.
-*/
-BaseObject* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio,
-                            void* param1, void* param2, void* param3)
-{
-  if (fileName == NULL)
-    return NULL;
-
-  // searching if the resource was loaded before.
-  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3);
-  if (tmpResource != NULL) // if the resource was loaded before.
-    {
-      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
-      tmpResource->count++;
-      if(tmpResource->prio < prio)
-        tmpResource->prio = prio;
-    }
-  else
-    {
-      // Setting up the new Resource
-      tmpResource = new Resource;
-      tmpResource->count = 1;
-      tmpResource->type = type;
-      tmpResource->prio = prio;
-      tmpResource->pointer = NULL;
-      tmpResource->name = new char[strlen(fileName)+1];
-      strcpy(tmpResource->name, fileName);
-
-      // creating the full name. (directoryName + FileName)
-      char* fullName = ResourceManager::getFullName(fileName);
-      // Checking for the type of resource \see ResourceType
-      switch(type)
-        {
-#ifndef NO_MODEL
-        case OBJ:
-          if (param1)
-            tmpResource->modelSize = *(float*)param1;
-          else
-            tmpResource->modelSize = 1.0;
-
-          if(ResourceManager::isFile(fullName))
-            tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
-          else
-            {
-              PRINTF(2)("File %s in %s does not exist. Loading a cube-Model instead\n", fileName, dataDir);
-              tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
-            }
-          break;
-        case PRIM:
-          if (param1)
-            tmpResource->modelSize = *(float*)param1;
-          else
-            tmpResource->modelSize = 1.0;
-
-          if (!strcmp(tmpResource->name, "cube"))
-            tmpResource->pointer = new PrimitiveModel(PRIM_CUBE, tmpResource->modelSize);
-          else if (!strcmp(tmpResource->name, "sphere"))
-            tmpResource->pointer = new PrimitiveModel(PRIM_SPHERE, tmpResource->modelSize);
-          else if (!strcmp(tmpResource->name, "plane"))
-            tmpResource->pointer = new PrimitiveModel(PRIM_PLANE, tmpResource->modelSize);
-          else if (!strcmp(tmpResource->name, "cylinder"))
-            tmpResource->pointer = new PrimitiveModel(PRIM_CYLINDER, tmpResource->modelSize);
-          else if (!strcmp(tmpResource->name, "cone"))
-            tmpResource->pointer = new PrimitiveModel(PRIM_CONE, tmpResource->modelSize);
-          break;
-        case MD2:
-          if(ResourceManager::isFile(fullName))
-            {
-              if (param1 != NULL)
-                {
-                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
-                  strcpy(tmpResource->secFileName, (const char*) param1);
-                }
-              else
-                tmpResource->secFileName = NULL;
-              tmpResource->pointer = new MD2Data(fullName, tmpResource->secFileName);
-            }
-              break;
-#endif /* NO_MODEL */
-#ifndef NO_TEXT
-        case TTF:
-            if (param1 != NULL)
-              tmpResource->ttfSize = *(unsigned int*)param1;
-            else
-              tmpResource->ttfSize = FONT_DEFAULT_RENDER_SIZE;
-
-          if(isFile(fullName))
-            tmpResource->pointer = new Font(fullName, tmpResource->ttfSize);
-          else
-            PRINTF(2)("%s does not exist in %s. Not loading Font\n", fileName, this->dataDir);
-          break;
-#endif /* NO_TEXT */
-#ifndef NO_AUDIO
-        case WAV:
-          if(isFile(fullName))
-            tmpResource->pointer = new SoundBuffer(fullName);
-          break;
-        case OGG:
-          if (isFile(fullName))
-            tmpResource->pointer = new OggPlayer(fullName);
-          break;
-#endif /* NO_AUDIO */
-#ifndef NO_TEXTURES
-        case IMAGE:
-          if(isFile(fullName))
-            {
-              PRINTF(4)("Image %s resides to %s\n", fileName, fullName);
-              tmpResource->pointer = new Texture(fullName);
-            }
-          else
-            {
-              char* tmpDir;
-              tIterator<char>* iterator = imageDirs->getIterator();
-              tmpDir = iterator->firstElement();
-              while(tmpDir)
-                {
-                  char* imgName = new char[strlen(tmpDir)+strlen(fileName)+1];
-                  sprintf(imgName, "%s%s", tmpDir, fileName);
-                  if(isFile(imgName))
-                    {
-                      PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
-                      tmpResource->pointer = new Texture(imgName);
-                      delete[] imgName;
-                      break;
-                    }
-                  delete[] imgName;
-                  tmpDir = iterator->nextElement();
-                }
-              delete iterator;
-            }
-          if(!tmpResource)
-             PRINTF(2)("!!Image %s not Found!!\n", fileName);
-          break;
-#endif /* NO_TEXTURES */
-#ifndef NO_SHADERS
-          case SHADER:
-            if(ResourceManager::isFile(fullName))
-            {
-              if (param1 != NULL)
-              {
-                char* secFullName = ResourceManager::getFullName((const char*)param1);
-                if (ResourceManager::isFile(secFullName))
-                {
-                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
-                  strcpy(tmpResource->secFileName, (const char*) param1);
-                  tmpResource->pointer = new Shader(fullName, secFullName);
-                }
-                delete[] secFullName;
-              }
-              else
-              {
-                tmpResource->secFileName = NULL;
-                tmpResource->pointer = new Shader(fullName, NULL);
-              }
-            }
-            break;
-#endif /* NO_SHADERS */
-        default:
-          tmpResource->pointer = NULL;
-          PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet. JUST DO IT!!\n", tmpResource->name);
-          break;
-        }
-      if (tmpResource->pointer != NULL)
-        this->resourceList->add(tmpResource);
-      delete[] fullName;
-    }
-  if (tmpResource->pointer != NULL)
-    return tmpResource->pointer;
-  else
-    {
-      PRINTF(2)("Resource %s could not be loaded\n", fileName);
-      delete[] tmpResource->name;
-      delete tmpResource;
-      return NULL;
-    }
-}
-
-/**
- * unloads a Resource
- * @param pointer: The pointer to free
- * @param prio: the PriorityLevel to unload this resource
- * @returns true if successful (pointer found, and deleted), false otherwise
-*/
-bool ResourceManager::unload(void* pointer, ResourcePriority prio)
-{
-  if (pointer == NULL)
-    return false;
-  // if pointer is existent. and only one resource of this type exists.
-  Resource* tmpResource = this->locateResourceByPointer(pointer);
-  if (tmpResource != NULL)
-    return unload(tmpResource, prio);
-  else
-  {
-    PRINTF(2)("Resource not Found %p\n", pointer);
-    return false;
-  }
-}
-
-/**
- * unloads a Resource
- * @param resource: The resource to unloade
- * @param prio the PriorityLevel to unload this resource
- * @returns true on success, false otherwise.
-*/
-bool ResourceManager::unload(Resource* resource, ResourcePriority prio)
-{
-  if (resource == NULL)
-    return false;
-  if (resource->count > 0)
-    resource->count--;
-
-  if (resource->prio <= prio)
-    {
-      if (resource->count == 0)
-        {
-          // deleting the Resource
-          switch(resource->type)
-            {
-#ifndef NO_MODEL
-            case OBJ:
-            case PRIM:
-              delete (Model*)resource->pointer;
-              break;
-            case MD2:
-              delete (MD2Data*)resource->pointer;
-              break;
-#endif /* NO_MODEL */
-#ifndef NO_AUDIO
-            case WAV:
-              delete (SoundBuffer*)resource->pointer;
-              break;
-            case OGG:
-              delete (OggPlayer*)resource->pointer;
-              break;
-#endif /* NO_AUDIO */
-#ifndef NO_TEXT
-            case TTF:
-              delete (Font*)resource->pointer;
-              break;
-#endif /* NO_TEXT */
-#ifndef NO_TEXTURES
-            case IMAGE:
-              delete (Texture*)resource->pointer;
-              break;
-#endif /* NO_TEXTURES */
-#ifndef NO_SHADERS
-            case SHADER:
-              delete (Shader*)resource->pointer;
-              break;
-#endif /* NO_SHADERS */
-            default:
-              PRINTF(2)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
-              return false;
-              break;
-            }
-          // deleting the List Entry:
-          PRINTF(4)("Resource %s safely removed.\n", resource->name);
-          delete[] resource->name;
-          this->resourceList->remove(resource);
-          delete resource;
-        }
-      else
-        PRINTF(4)("Resource %s not removed, because there are still %d References to it.\n", resource->name, resource->count);
-    }
-  else
-    PRINTF(4)("not deleting resource %s because DeleteLevel to high\n", resource->name);
-  return true;
-}
-
-
-/**
- * unloads all alocated Memory of Resources with a pririty lower than prio
- * @param prio The priority to delete
-*/
-bool ResourceManager::unloadAllByPriority(ResourcePriority prio)
-{
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->lastElement();
-  while (enumRes)
-    {
-      if (enumRes->prio <= prio)
-        if (enumRes->count == 0)
-          unload(enumRes, prio);
-        else
-          PRINTF(2)("unable to unload %s because there are still %d references to it\n",
-                   enumRes->name, enumRes->count);
-      //enumRes = resourceList->nextElement();
-      enumRes = iterator->prevElement();
-    }
-  delete iterator;
-}
-
-/**
- * Searches for a Resource by some information
- * @param fileName: The name to look for
- * @param type the Type of resource to locate.
- * @param param1: an additional option to parse (see the constuctors for more help)
- * @param param2: an additional option to parse (see the constuctors for more help)
- * @param param3: an additional option to parse (see the constuctors for more help)
- * @returns a Pointer to the Resource if found, NULL otherwise.
-*/
-Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type,
-                                                void* param1, void* param2, void* param3)
-{
-  //  Resource* enumRes = resourceList->enumerate();
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->firstElement();
-  while (enumRes)
-    {
-      if (enumRes->type == type && !strcmp(fileName, enumRes->name))
-        {
-          bool match = false;
-
-          switch (type)
-            {
-#ifndef NO_MODEL
-            case PRIM:
-            case OBJ:
-              if (!param1)
-                {
-                  if (enumRes->modelSize == 1.0)
-                    match = true;
-                }
-              else if (enumRes->modelSize == *(float*)param1)
-                match = true;
-              break;
-            case MD2:
-              if (!param1)
-                {
-                  if (enumRes->secFileName == NULL)
-                    match = true;
-                }
-              else if (!strcmp(enumRes->secFileName, (const char*)param1))
-                match = true;
-              break;
-#endif /* NO_MODEL */
-#ifndef NO_TEXT
-            case TTF:
-              if (param1 == NULL)
-                {
-                  if (enumRes->ttfSize == FONT_DEFAULT_RENDER_SIZE)
-                    match = true;
-                }
-              else if (enumRes->ttfSize == *(unsigned int*)param1)
-                match = true;
-              break;
-#endif /* NO_TEXT */
-#ifndef NO_SHADERS
-              case SHADER:
-                if (!param1)
-                {
-                  if (enumRes->secFileName == NULL)
-                    match = true;
-                }
-                else if (!strcmp(enumRes->secFileName, (const char*)param1))
-                  match = true;
-#endif /* NO_SHADERS */
-            default:
-              match = true;
-              break;
-            }
-          if (match)
-            {
-              delete iterator;
-              return enumRes;
-            }
-        }
-      enumRes = iterator->nextElement();
-    }
-  delete iterator;
-  return NULL;
-}
-
-/**
- * Searches for a Resource by Pointer
- * @param pointer the Pointer to search for
- * @returns a Pointer to the Resource if found, NULL otherwise.
-*/
-Resource* ResourceManager::locateResourceByPointer(const void* pointer)
-{
-  //  Resource* enumRes = resourceList->enumerate();
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->firstElement();
-  while (enumRes)
-    {
-      if (pointer == enumRes->pointer)
-        {
-          delete iterator;
-          return enumRes;
-        }
-      enumRes = iterator->nextElement();
-    }
-  delete iterator;
-  return NULL;
-}
-
-/**
- * Checks if it is a Directory
- * @param directoryName the Directory to check for
- * @returns true if it is a directory/symlink false otherwise
-*/
-bool ResourceManager::isDir(const char* directoryName)
-{
-  if (directoryName == NULL)
-    return false;
-
-  char* tmpDirName = NULL;
-  struct stat status;
-
-  // checking for the termination of the string given. If there is a "/" at the end cut it away
-  if (directoryName[strlen(directoryName)-1] == '/' ||
-      directoryName[strlen(directoryName)-1] == '\\')
-    {
-      tmpDirName = new char[strlen(directoryName)];
-      strncpy(tmpDirName, directoryName, strlen(directoryName)-1);
-      tmpDirName[strlen(directoryName)-1] = '\0';
-    }
-  else
-    {
-      tmpDirName = new char[strlen(directoryName)+1];
-      strcpy(tmpDirName, directoryName);
-    }
-
-  if(!stat(tmpDirName, &status))
-    {
-      if (status.st_mode & (S_IFDIR
-#ifndef __WIN32__
-                            | S_IFLNK
-#endif
-                            ))
-        {
-          delete[] tmpDirName;
-          return true;
-        }
-      else
-        {
-          delete[] tmpDirName;
-          return false;
-        }
-    }
-  else
-  {
-    delete[] tmpDirName;
-    return false;
-  }
-}
-
-/**
- * Checks if the file is either a Regular file or a Symlink
- * @param fileName the File to check for
- * @returns true if it is a regular file/symlink, false otherwise
-*/
-bool ResourceManager::isFile(const char* fileName)
-{
-  if (fileName == NULL)
-    return false;
-  char* tmpFileName = ResourceManager::homeDirCheck(fileName);
-  // actually checks the File
-  struct stat status;
-  if (!stat(tmpFileName, &status))
-    {
-      if (status.st_mode & (S_IFREG
-#ifndef __WIN32__
-                            | S_IFLNK
-#endif
-                            ))
-        {
-          delete[] tmpFileName;
-          return true;
-        }
-      else
-        {
-          delete[] tmpFileName;
-          return false;
-        }
-    }
-  else
-    {
-      delete[] tmpFileName;
-      return false;
-    }
-}
-
-/**
- * touches a File on the disk (thereby creating it)
- * @param fileName The file to touch
-*/
-bool ResourceManager::touchFile(const char* fileName)
-{
-  char* tmpName = ResourceManager::homeDirCheck(fileName);
-  if (tmpName == NULL)
-    return false;
-  FILE* stream;
-  if( (stream = fopen (tmpName, "w")) == NULL)
-    {
-      PRINTF(1)("could not open %s fro writing\n", fileName);
-      delete[] tmpName;
-      return false;
-    }
-  fclose(stream);
-
-  delete[] tmpName;
-}
-
-/**
- * deletes a File from disk
- * @param fileName the File to delete
-*/
-bool ResourceManager::deleteFile(const char* fileName)
-{
-  if (fileName == NULL)
-    return false;
-  char* tmpName = ResourceManager::homeDirCheck(fileName);
-  unlink(tmpName);
-  delete[] tmpName;
-}
-
-/**
- * @param name the Name of the file to check
- * @returns The name of the file, including the HomeDir
- * IMPORTANT: this has to be deleted from the outside
- */
-char* ResourceManager::homeDirCheck(const char* name)
-{
-  if (name == NULL)
-    return NULL;
-  char* retName;
-  if (!strncmp(name, "~/", 2))
-    {
-      char tmpFileName[500];
-#ifdef __WIN32__
-      strcpy(tmpFileName, getenv("USERPROFILE"));
-#else
-      strcpy(tmpFileName, getenv("HOME"));
-#endif
-      retName = new char[strlen(tmpFileName)+strlen(name)];
-      sprintf(retName, "%s%s", tmpFileName, name+1);
-    }
-  else
-    {
-      retName = new char[strlen(name)+1];
-      strcpy(retName, name);
-    }
-  return retName;
-}
-
-/**
- * @param fileName the Name of the File to check
- * @returns The full name of the file, including the DataDir, and NULL if the file does not exist
- * !!IMPORTANT: this has to be deleted from the outside!!
-*/
-char* ResourceManager::getFullName(const char* fileName)
-{
-  if (fileName == NULL || ResourceManager::getInstance()->getDataDir() == NULL)
-    return NULL;
-
-  char* retName = new char[strlen(ResourceManager::getInstance()->getDataDir())
-                           + strlen(fileName) + 1];
-  sprintf(retName, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
-  if (ResourceManager::isFile(retName) || ResourceManager::isDir(retName))
-    return retName;
-  else
-    {
-      delete[] retName;
-      return NULL;
-    }
-}
-
-
-/**
- * checks wether a file is in the DataDir.
- * @param fileName the File to check if it is in the Data-Dir structure.
- * @returns true if the file exists, false otherwise
- */
-bool ResourceManager::isInDataDir(const char* fileName)
-{
-  if (fileName == NULL || ResourceManager::getInstance()->getDataDir() == NULL)
-    return false;
-
-  bool retVal = false;
-  char* checkFile = new char[strlen(ResourceManager::getInstance()->getDataDir())
-      + strlen(fileName) + 1];
-  sprintf(checkFile, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
-
-  if (ResourceManager::isFile(checkFile) || ResourceManager::isDir(checkFile))
-    retVal = true;
-  else
-    retVal = false;
-  delete[] checkFile;
-  return retVal;
-}
-
-
-/**
- * outputs debug information about the ResourceManager
-*/
-void ResourceManager::debug() const
-{
-  PRINT(0)("=RM===================================\n");
-  PRINT(0)("= RESOURCE-MANAGER DEBUG INFORMATION =\n");
-  PRINT(0)("======================================\n");
-  // if it is not initialized
-  PRINT(0)(" Reference is: %p\n", ResourceManager::singletonRef);
-  PRINT(0)(" Data-Directory is: %s\n", this->dataDir);
-  PRINT(0)(" List of Image-Directories: ");
-  tIterator<char>* tmpIt = imageDirs->getIterator();
-  char* tmpDir = tmpIt->firstElement();
-  while(tmpDir)
-    {
-      PRINT(0)("%s ",tmpDir);
-      tmpDir = tmpIt->nextElement();
-    }
-  delete tmpIt;
-  PRINT(0)("\n");
-
-  PRINT(0)("List of all stored Resources:\n");
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->firstElement();
-  while (enumRes)
-    {
-      PRINT(0)("-----------------------------------------\n");
-      PRINT(0)("Name: %s; References: %d; Type: %s ", enumRes->name, enumRes->count, ResourceManager::ResourceTypeToChar(enumRes->type));
-
-      PRINT(0)("gets deleted at ");
-      switch(enumRes->prio)
-        {
-        default:
-        case RP_NO:
-          PRINT(0)("first posibility (0)\n");
-          break;
-        case RP_LEVEL:
-          PRINT(0)("the end of the Level (1)\n");
-          break;
-        case RP_CAMPAIGN:
-          PRINT(0)("the end of the campaign (2)\n");
-          break;
-        case RP_GAME:
-          PRINT(0)("when leaving the game (3)\n");
-          break;
-        }
-      enumRes = iterator->nextElement();
-    }
-  delete iterator;
-
-
-
-  PRINT(0)("==================================RM==\n");
-}
-
-
-/**
- * converts a ResourceType into the corresponding String
- * @param type the ResourceType to translate
- * @returns the converted String.
- */
-const char* ResourceManager::ResourceTypeToChar(ResourceType type)
-{
-  switch (type)
-  {
-#ifndef NO_MODEL
-    case OBJ:
-      return "ObjectModel";
-      break;
-    case PRIM:
-      return "PrimitiveModel";
-      break;
-    case MD2:
-      return "MD2-Data";
-      break;
-#endif
-#ifndef NO_TEXTURES
-    case IMAGE:
-      return "ImageFile (Texture)";
-      break;
-#endif
-#ifndef NO_AUDIO
-    case WAV:
-      return "SoundFile";
-      break;
-    case OGG:
-      return "MusicFile";
-      break;
-#endif
-#ifndef NO_TEXT
-    case TTF:
-      return "Font (TTF)";
-      break;
-#endif
-#ifndef NO_SHADERS
-    case SHADER:
-      return "Shader";
-      break;
-#endif
-    default:
-      return "unknown Format";
-      break;
-  }
-}
Index: trunk/src/util/resource_manager.h
===================================================================
--- trunk/src/util/resource_manager.h	(revision 5478)
+++ 	(revision )
@@ -1,148 +1,0 @@
-/*!
- * @file resource_manager.h
-  *  The Resource Manager checks if a file/resource is loaded.
-
-    If a file/resource was already loaded the resourceManager will
-    return a void pointer to the desired resource.
-    Otherwise it will instruct the coresponding resource-loader to load,
-    and receive a pointer to it.
-
-    it is possible to compile the resource Manager without some modules by
-    just adding the compile flag -D....
-    (NO_MODEL)
-    (NO_AUDIO)
-    (NO_TEXT)
-    (NO_TEXTURES)
-*/
-
-#ifndef _RESOURCE_MANAGER_H
-#define _RESOURCE_MANAGER_H
-
-#include "base_object.h"
-
-#include "stdlibincl.h"
-
-// FORWARD DECLARATION
-template<class T> class tList;
-
-//! An eumerator for different fileTypes the resourceManager supports
-typedef enum ResourceType
-{
-#ifndef NO_MODEL
-  OBJ,                  //!< loading .obj file
-  PRIM,                 //!< loading primitive model
-  MD2,                  //!< loading md2-file
-#endif /* NO_MODEL */
-#ifndef NO_TEXT
-  TTF,                  //!< loading a TrueTypeFont
-#endif /* NO_TEXT */
-#ifndef NO_AUDIO
-  WAV,                  //!< loading wav
-  MP3,                  //!< loading mp3
-  OGG,                  //!< loading ogg
-#endif /* NO_AUDIO */
-#ifndef NO_TEXTURES
-  IMAGE,                //!< loading an image
-#endif /* NO_TEXTURES */
-#ifndef NO_SHADERS
-  SHADER,               //!< openGL-shader program
-#endif /* NO_SHADERS */
-};
-
-//! An enumerator for different UNLOAD-types.
-/**
-   RP_NO:        will be unloaded on request
-   RP_LEVEL:     will be unloaded at the end of a Level
-   RP_CAMPAIGN:  will be unloaded at the end of a Campaign
-   RP_GAME:      will be unloaded at the end of the whole Game (when closing orxonox)
-*/
-typedef enum ResourcePriority
-{
-  RP_NO        =   0,
-  RP_LEVEL     =   1,
-  RP_CAMPAIGN  =   2,
-  RP_GAME      =   4
-};
-
-//! A Struct that keeps track about A resource its name its Type, and so on
-struct Resource
-{
-  BaseObject*       pointer;           //!< Pointer to the Resource.
-  unsigned int      count;             //!< How many times this Resource has been loaded.
-
-  char*             name;              //!< Name of the Resource.
-  ResourceType      type;              //!< ResourceType of this Resource.
-  ResourcePriority  prio;              //!< The Priority of this resource. (This will only be increased)
-
-  // more specific
-  float             modelSize;         //!< the size of the model (OBJ/PRIM)
-#ifndef NO_MODEL
-  char*             secFileName;       //!< a seconf fileName
-#endif /* NO_MODEL */
-#ifndef NO_TEXT
-  unsigned int      ttfSize;           //!< the size of the ttf-font (TTF)
-#endif /* NO_TEXT */
-};
-
-
-//! The ResourceManager is a class, that decides if a file/resource should be loaded
-/**
- * If a file/resource was already loaded the resourceManager will
- * return a pointer to the desired resource.
- * Otherwise it will instruct the corresponding resource-loader to load,
- * and receive the pointer to it.
- *
- * It does it by looking, if a desired file has already been loaded.
- * There is also the possibility to check for some variables
- */
-class ResourceManager : public BaseObject
-{
- public:
-  virtual ~ResourceManager();
-  /** @returns a Pointer to the only object of this Class */
-  inline static ResourceManager* getInstance() { if (!singletonRef) singletonRef = new ResourceManager();  return singletonRef; };
-
-  bool setDataDir(const char* dataDir);
-  /** @returns the Name of the data directory */
-  inline const char* getDataDir() const { return this->dataDir; };
-
-  bool checkDataDir(const char* fileInside);
- bool addImageDir(const char* imageDir);
-  BaseObject* load(const char* fileName, ResourcePriority prio = RP_NO,
-               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
-  BaseObject* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
-               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
-  bool unload(void* pointer, ResourcePriority prio = RP_NO);
-  bool unload(Resource* resource, ResourcePriority = RP_NO);
-  bool unloadAllByPriority(ResourcePriority prio);
-
-  void debug() const;
-
-
-  // utility functions of this class
-  static bool isDir(const char* directory);
-  static bool isFile(const char* fileName);
-  static bool touchFile(const char* fileName);
-  static bool deleteFile(const char* fileName);
-  static char* homeDirCheck(const char* fileName);
-  static char* getFullName(const char* fileName);
-  static bool isInDataDir(const char* fileName);
-
-  static const char* ResourceTypeToChar(ResourceType type);
-
- private:
-  ResourceManager();
-
-  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
-  Resource* locateResourceByPointer(const void* pointer);
-
- private:
-  static ResourceManager*  singletonRef;       //!< singleton Reference
-
-  char*                    dataDir;            //!< The Data Directory, where all relevant Data is stored.
-  tList<Resource>*         resourceList;       //!< The List of Resources, that has already been loaded.
-  tList<char>*             imageDirs;          //!< A list of directories in which images are stored.
-
-};
-
-#endif /* _RESOURCE_MANAGER_H */
Index: trunk/src/world_entities/weapons/rocket.cc
===================================================================
--- trunk/src/world_entities/weapons/rocket.cc	(revision 5478)
+++ trunk/src/world_entities/weapons/rocket.cc	(revision 5479)
@@ -115,4 +115,5 @@
   ParticleEngine::getInstance()->addConnection(this->emitter, Rocket::trailParticles);
 
+  this->update(0);
   this->emitter->setEmissionRate(45.0);
   this->emitter->setEmissionVelocity(0.0);
