Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac (revision 44)
+++ /trunk/configure.ac (revision 195)
@@ -13,7 +13,11 @@
 ## Process this file with autoconf to produce a configure script.
 
+# TODO: create m4 directory and put the checks there, because this file got realy poluted ( by Derex )
+
 ## Prelude, basic settings for Autoconf
+#  PACKAGE:            trinity
+#  VERSION:            0.0.1 (trunk)
+#  BUG-REPORT-ADDRESS: devs@trinitycore.org
 AC_INIT( [trinitycore], [0.0.1], [devs@trinitycore.org])
-
 AC_CONFIG_SRCDIR([src/shared/Base.cpp])
 
@@ -26,5 +30,5 @@
 ## Prevent the configure script from continuing any further if
 # configuration is being performed in the top-level directory.
-# The idea is to prevent this ,because some maintainers tend 
+# The idea is to prevent this ,because some maintainers tend
 # to break parallel build trees (a.k.a. VPATH builds).
 if test "$srcdir" = "." && test "$enable_maintainer_mode" != "yes"; then
@@ -33,6 +37,6 @@
       Please configure and build in a directory other than the
       top-level source directory. This is needed because a lot
-      of maintainers tend to break parallel build trees 
-      (a.k.a. VPATH builds). This is kinda real ensurance they 
+      of maintainers tend to break parallel build trees
+      (a.k.a. VPATH builds). This is kinda real ensurance they
       will not do it (by enforcing everybody to do VPATH builds).
 
@@ -65,7 +69,8 @@
 AC_PROG_CC
 AC_PROG_CXX
+AM_PROG_CC_C_O
 AC_PROG_LIBTOOL
 AC_PROG_INSTALL
-AM_PROG_CC_C_O
+
 
 # Check if enable scripts
@@ -102,5 +107,5 @@
 
 ## Check for required libraries.
-AC_CHECK_LIB( pthread, pthread_create, [], 
+AC_CHECK_LIB( pthread, pthread_create, [],
     [LDFLAGS="-pthread $LDFLAGS"
      AC_TRY_LINK([char pthread_create();],
@@ -121,5 +126,5 @@
     esac],
 [DO_POSTGRESQL=no])
-				 
+
 AC_ARG_WITH(mysql,
 [  --with-mysql            Use MySQL as a backend (default: yes)],
@@ -141,5 +146,5 @@
 fi
 AC_MSG_RESULT($DO_POSTGRESQL)
-	
+
 # here mysql
 AC_MSG_CHECKING(whether to build/link MYSQL)
@@ -255,6 +260,4 @@
 then
   tri_need_to_build_ace=no
-  ACE_LIBS="-lACE"
-  ACE_INCLUDES=""
   AC_MSG_RESULT([no])
 else
@@ -280,4 +283,10 @@
 
 AM_CONDITIONAL([TRI_BUILD_ACE], [test X$tri_need_to_build_ace = Xyes])
+
+
+## Unify all additional includes/libs in one variable.
+# TODO this looks kinda ugly, but when we add m4 folder I will make it look very pritey ( by Derex ).
+TRINI_INCLUDES="$POSTGRE_INCLUDES $MYSQL_INCLUDES $TRINI_INCLUDES"
+TRINI_LIBS="$POSTGRE_LIBS $MYSQL_LIBS $ZLIB $COMPATLIB $SSLLIB $TRINI_LIBS"
 
 ## Export defined variables
@@ -293,4 +302,6 @@
 AC_SUBST(TRINITYD_ENABLE_CLI)
 AC_SUBST(TRINITYD_ENABLE_RA)
+
+## Additional CPPFLAGS and LDFLAGS.
 AC_SUBST(TRINI_INCLUDES)
 AC_SUBST(TRINI_LIBS)
@@ -313,5 +324,9 @@
    src/framework/Makefile
    src/shared/Makefile
+   src/shared/Auth/Makefile
+   src/shared/Config/Makefile
+   src/shared/Database/Makefile
    src/shared/vmap/Makefile
+   src/shared/SystemConfig.h
    src/game/Makefile
    src/trinityrealm/Makefile
@@ -321,15 +336,13 @@
 ])
 
+## Configure ACE, if needed
+if test X$tri_need_to_build_ace = Xyes; then
+  AC_CONFIG_SUBDIRS([dep/ACE_wrappers])
+fi
+
+## Configure ACE
 if test X$tri_build_scripts = Xyes; then
 AC_CONFIG_FILES([src/bindings/scripts/Makefile])
 fi
-
-## Configure ACE
-if test X$tri_need_to_build_ace = Xyes; then
-  AC_CONFIG_SUBDIRS([dep/ACE_wrappers])
-fi
-
-## Disabled Makefiles, until they are ready for a successful make and
-#  make dist run.
 
 AC_CONFIG_COMMANDS([default],[
@@ -339,4 +352,7 @@
  ],[PACKAGE_VERSION=$PACKAGE_VERSION])
 
+## Disabled Makefiles, until they are ready for a successful make and
+#  make dist run.
+
 ## Output files.
 AC_OUTPUT
