diff --git a/.gitignore b/.gitignore
index 4dc4c1e6cecda5b9ccf9c2bfbf69551e53954cfe..144db31e35110821edf7ad7f978c266cd308c292 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,11 @@
-# A simulation of Subversion default ignores, generated by reposurgeon.
-*.o
-*.lo
-*.la
-*.al
-.libs
-*.so
-*.so.[0-9]*
-*.a
-*.pyc
-*.pyo
-*.rej
-*~
-.#*
-.*.swp
-.DS_store
+Makefile
+Makefile.in
+config.*
+configure
+aclocal.m4
+autom4te.cache
+depcomp
+install-sh
+missing
+mkinstalldirs
+dune.pc
\ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..c2eef3691748e5537f910667602e5d381a449623
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,10 @@
+# $Id$
+
+# don't follow the full GNU-standard
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = common fem grid solver doc m4
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dune.pc
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000000000000000000000000000000000000..a749fcfaa985e7c1c09be0a5ee668728fc57829b
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# $Id$
+
+# barf on errors
+set -e
+
+# prepare everything
+echo "--> aclocal..."
+aclocal
+echo "--> autoheader..."
+autoheader
+echo "--> automake..."
+automake --add-missing
+echo "--> autoconf..."
+autoconf
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000000000000000000000000000000000000..c5c184d65241a4b60a377304d5ae8dae460527c1
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,67 @@
+# $Id$
+# Process this file with autoconf to produce a configure script.
+AC_INIT(Dune, 0.0, dune@hal.iwr.uni-heidelberg.de)
+AM_INIT_AUTOMAKE(Dune, 0.0, dune@hal.iwr.uni-heidelberg.de)
+AC_CONFIG_SRCDIR([grid/common/grid.hh])
+AM_CONFIG_HEADER(common/config.hh)
+
+## extra options
+
+AC_ARG_WITH(dim,
+            AC_HELP_STRING([--with-dim=[2|3]],[which dimension to use in Albert/UG-libs]),,
+            with_dim=2)
+AC_SUBST(LIBDIM, $with_dim)
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+
+# Checks for the right compiler
+if test x$GCC = xyes ; then
+  if "$CC" --version | grep '^2\.' 1>/dev/null 2>&1; then
+    AC_MSG_ERROR([you are using g++ 2.x, please upgrade to g++ 3.x
+		  if you have installed different compilers you can specify one
+		  by setting the environment variables CXX und CC.
+    ])
+  fi
+fi
+
+# stuff we need for the dune-headers
+# !!! add warnings if something can't be found
+
+# Checks for libraries.
+AC_CHECK_LIB([m], [pow])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([malloc.h stdlib.h string.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([pow sqrt])
+
+# write output
+AC_CONFIG_FILES([Makefile
+	         common/Makefile
+                 fem/Makefile
+                 fem/localbase/Makefile
+                 fem/operator/Makefile
+                 grid/Makefile
+                 grid/albertgrid/Makefile
+                 grid/common/Makefile
+                 grid/sgrid/Makefile
+                 grid/spgrid/Makefile
+                 solver/Makefile
+                 solver/common/Makefile
+                 solver/pmgsolver/Makefile
+		 doc/Makefile
+		 m4/Makefile
+                 dune.pc])
+AC_OUTPUT
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..c038ed7864f54f954b4b86b6d173bb1066eb1bc9
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
\ No newline at end of file
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..be0c627637766036b3d01da4b52881f5352198c3
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,3 @@
+# $Id$
+
+# nothing yet..
diff --git a/dune.pc.in b/dune.pc.in
new file mode 100644
index 0000000000000000000000000000000000000000..a57c5333a4667f9039c8ebd378db1ca0d3b1688e
--- /dev/null
+++ b/dune.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Dune
+Version: @VERSION@
+Description: the Dune numerics library
+Requires:
+Libs: @LIBS@
+Cflags: