Index: branches/terrain/acinclude.m4
===================================================================
--- branches/terrain/acinclude.m4	(revision 9135)
+++ branches/terrain/acinclude.m4	(revision 9324)
@@ -105,4 +105,5 @@
       `ls -dr /usr/local/qt*/include   2>/dev/null`
       `ls -dr /opt/qt*/include         2>/dev/null`
+      `ls -dr /opt/local/include       2>/dev/null`
       `ls -dr /Developer/qt*/include   2>/dev/null`
       `ls -dr /c/Qt/*/include          2>/dev/null`
@@ -115,4 +116,5 @@
       `ls -dr /usr/local/qt*/lib       2>/dev/null`
       `ls -dr /opt/qt*/lib             2>/dev/null`
+      `ls -dr /opt/local/lib  		   2>/dev/null`
       `ls -dr /Developer/qt*/lib       2>/dev/null`
       `ls -dr /c/Qt/*/lib              2>/dev/null`
@@ -125,4 +127,5 @@
       `ls -dr /usr/local/qt*/bin       2>/dev/null`
       `ls -dr /opt/qt*/bin             2>/dev/null`
+      `ls -dr /opt/local/bin		      2>/dev/null`
       `ls -dr /Developer/qt*/bin       2>/dev/null`
       `ls -dr /c/Qt/*/bin              2>/dev/null`
@@ -143,4 +146,18 @@
     fi
 
+## Search in all IncludeDirectories for QT-includes
+    for _qt_include_directory in ${QT_COMMON_INCLUDE_DIRECTORIES}
+    do			
+     	if test -e ${_qt_include_directory}/QtCore/QCoreApplication ; then
+       	QT_INCLUDE_DIRECTORY="${_qt_include_directory}"
+       	break
+     	fi
+    done
+    if test -n ${QT_INCLUDE_DIRECTORY} ; then
+      echo "Qt-Include Directory is: ${QT_INCLUDE_DIRECTORY}"
+    else
+      AC_MSG_ERROR([Qt Headers not found])
+    fi
+
 ## Search in all LibraryDirectories for QT-includes
     for _lib_directory in ${QT_COMMON_LIB_DIRECTORIES}
@@ -172,73 +189,82 @@
     fi
 
-## Setting up the Environment Variables.
-    QT_LIBS=""
-    QT_CXXFLAGS="-I${QT_INCLUDE_DIRECTORY}"
-    LDFLAGS="${LDFLAGS} -L${QT_LIB_DIRECTORY} -Wl,-rpath -Wl,${QT_LIB_DIRECTORY}"
-
-    CACHED_CPPFLAG=${CPPFLAGS}
-    CACHED_LDFLAGS=${LDFLAGS}
-
-    LDFLAGS="${LDFLAGS} ${QT_LDFLAGS}"
-    for _lib in $2
-    do
-      AC_CHECK_LIB([$_lib], [main], [_lib_check="yes"], [_lib_check="no"])
-      if test "x$_lib_check" = "xyes" ; then
-        _found_lib=$_lib
-        break
-      fi
-    done
-
-    if [test "x$_lib_check" = "xyes"] ; then
-         QT_LIBS="${QT_LIBS} -l$_found_lib"
-         AX_CHECK_REQUIRED_LIB([QtCore QtCore4], [main],,,[http://www.trolltech.com] )
-         AX_CHECK_REQUIRED_LIB([QtGui QtGui4], [main],,,[http://www.trolltech.com] )
-         AX_CHECK_REQUIRED_LIB([QtOpenGL QtOpenGL4], [main],,,[http://www.trolltech.com] )
-
-         $3
-    else
-         echo "------------------"
-         echo "LIBRARY $2 not found.in $1"
-         echo "please install the $1-LIBRARY-package which can be found at $5"
-         echo "------------------"
-         $4
-         exit -1
-    fi
-
-    echo "QT_LIBS          = ${QT_LIBS}"
-    echo "QT_CXXFLAGS      = ${QT_CXXFLAGS}"
-    echo "QT_LD_FLAGS      = ${QT_LDFLAGS}"
-    echo "QT_BIN_DIRECTORY = ${QT_BIN_DIRECTORY}"
-
-    AC_SUBST([QT_LIBS])
-    AC_SUBST([QT_CXXFLAGS])
-    AC_SUBST([QT_LDFLAGS])
-
-    #----------#
-    # QT - MOC #
-    #----------#
-    AC_PATH_PROGS([QT_MOC], [moc-qt4 moc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
-      if test x${QT_MOC} = xno ; then
-         AC_MSG_ERROR([QT MOC not found])
-      fi
-    AC_SUBST([QT_MOC])
-
-    AC_PATH_PROG([QT_UIC], [uic], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
- #     if test x${QT_UIC} = xno ; then
- #       AC_MSG_WARN([QT UIC not found])
- #     fi
-    AC_SUBST([QT_UIC])
-
-    AC_PATH_PROG([QT_RCC], [rcc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
-#      if test x${QT_RCC} = xno ; then
-#        AC_MSG_WARN([QT RCC not found])
-#      fi
-    AC_SUBST([QT_RCC])
-
-
-
-    # Restore Values of CPPFLAGS and LDFLAGS
-    CPPFLAGS=${CACHED_CPPFLAG}
-    LDFLAGS=${CACHED_LDFLAGS}
+		## Setting up the Environment Variables.
+		    QT_LIBS=""
+		    QT_CXXFLAGS="-I${QT_INCLUDE_DIRECTORY}"
+			 if test x$osX = xyes ; then
+				LDFLAGS="${LDFLAGS} -L${QT_LIB_DIRECTORY}"
+			 else
+		    	LDFLAGS="${LDFLAGS} -L${QT_LIB_DIRECTORY} -Wl,-rpath -Wl,${QT_LIB_DIRECTORY}"
+			 fi
+		    CACHED_CPPFLAG=${CPPFLAGS}
+		    CACHED_LDFLAGS=${LDFLAGS}
+
+		    LDFLAGS="${LDFLAGS} ${QT_LDFLAGS}"
+		    for _lib in $2
+		    do
+		      AC_CHECK_LIB([$_lib], [main], [_lib_check="yes"], [_lib_check="no"])
+		      if test "x$_lib_check" = "xyes" ; then
+		        _found_lib=$_lib
+		        break
+		      fi
+		    done
+
+		    if [test "x$_lib_check" = "xyes" || test "x$osX" = "xyes"] ; then
+					if [test x$osX = xyes] ; then
+		# kraus: Need to add a check here. For the moment this just works fine...
+						QT_LIBS="${QT_LIBS} -framework QtCore -framework QtGui -framework QtOpenGL"
+						QT_LD_FLAGS="${QT_LD_FLAGS} -L${QT_LIB_DIRECTORY}"
+					else
+		         	QT_LIBS="${QT_LIBS} -l$_found_lib"
+		         	AX_CHECK_REQUIRED_LIB([QtCore QtCore4], [main],,,[http://www.trolltech.com] )
+		         	AX_CHECK_REQUIRED_LIB([QtGui QtGui4], [main],,,[http://www.trolltech.com] )
+		         	AX_CHECK_REQUIRED_LIB([QtOpenGL QtOpenGL4], [main],,,[http://www.trolltech.com] )
+
+		         	$3
+					fi
+		    else
+		         echo "------------------"
+		         echo "LIBRARY $2 not found.in $1"
+		         echo "please install the $1-LIBRARY-package which can be found at $5"
+		         echo "------------------"
+		         $4
+		         exit -1
+		    fi
+			 echo "configuration for qt: "
+		    echo "QT_LIBS          = ${QT_LIBS}"
+		    echo "QT_CXXFLAGS      = ${QT_CXXFLAGS}"
+		    echo "QT_LD_FLAGS      = ${QT_LDFLAGS}"
+		    echo "QT_BIN_DIRECTORY = ${QT_BIN_DIRECTORY}"
+
+		    AC_SUBST([QT_LIBS])
+		    AC_SUBST([QT_CXXFLAGS])
+		    AC_SUBST([QT_LDFLAGS])
+
+		    #----------#
+		    # QT - MOC #
+		    #----------#
+		    AC_PATH_PROGS([QT_MOC], [moc-qt4 moc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
+		      if test x${QT_MOC} = xno ; then
+		         AC_MSG_ERROR([QT MOC not found])
+		      fi
+		    AC_SUBST([QT_MOC])
+
+		    AC_PATH_PROG([QT_UIC], [uic], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
+		 #     if test x${QT_UIC} = xno ; then
+		 #       AC_MSG_WARN([QT UIC not found])
+		 #     fi
+		    AC_SUBST([QT_UIC])
+
+		    AC_PATH_PROG([QT_RCC], [rcc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"])
+		#      if test x${QT_RCC} = xno ; then
+		#        AC_MSG_WARN([QT RCC not found])
+		#      fi
+		    AC_SUBST([QT_RCC])
+
+
+
+		    # Restore Values of CPPFLAGS and LDFLAGS
+		    CPPFLAGS=${CACHED_CPPFLAG}
+		    LDFLAGS=${CACHED_LDFLAGS}
 ])
 
