diff --git a/configure.in b/configure.ac
similarity index 93%
rename from configure.in
rename to configure.ac
index 3cfcb1ab8f9524ac26cf68048d654aa67a6512e3..5100e5d98eda7e134d8c3b7ae37580dcdf97c44f 100644
--- a/configure.in
+++ b/configure.ac
@@ -16,10 +16,10 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # init the project
-AC_INIT(src/space.c)
-VERSION="0.1.0"
-AC_SUBST(VERSION)
-AM_INIT_AUTOMAKE(SWIFT,VERSION)
+AC_INIT([SWIFT],[0.1.0])
+AC_CONFIG_SRCDIR([src/space.c])
+AM_INIT_AUTOMAKE
+
 AC_GNU_SOURCE
 AC_PROG_LIBTOOL
 
@@ -128,13 +128,11 @@ AC_TRY_LINK([#ifdef HAVE_INTRINSICS_H
 #endif], [_rtc()], [AC_DEFINE(HAVE__RTC,1,[Define if you have the UNICOS _rtc() intrinsic.])], [rtc_ok=no])
 AC_MSG_RESULT($rtc_ok)
 
-
 # make the documentation
-DX_INIT_DOXYGEN(libchebfun,doc/Doxyfile,doc/)
-
-# generate the Makefiles
-AC_OUTPUT(Makefile src/Makefile examples/Makefile doc/Makefile)
+DX_INIT_DOXYGEN(libswift,doc/Doxyfile,doc/)
 
-# do the same magic in other directories
-# AC_CONFIG_SUBDIRS(src examples)
+# .in files.
+AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile doc/Makefile doc/Doxyfile])
 
+# generate output.
+AC_OUTPUT
diff --git a/doc/Doxyfile b/doc/Doxyfile.in
similarity index 99%
rename from doc/Doxyfile
rename to doc/Doxyfile.in
index 9b6ed7f49da422f0f4d1ee5b02087f414175bac4..1a015e8d9bfd441312a76c7493871c3361560fec 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile.in
@@ -25,13 +25,13 @@ DOXYFILE_ENCODING      = UTF-8
 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
 # by quotes) that should identify the project.
 
-PROJECT_NAME           = SWIFT
+PROJECT_NAME           = @PACKAGE_NAME@
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. 
 # This could be handy for archiving the generated documentation or 
 # if some version control system is used.
 
-PROJECT_NUMBER         = 0.0.1
+PROJECT_NUMBER         = @PACKAGE_VERSION@
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
 # base path where the generated documentation will be put. 
@@ -580,7 +580,7 @@ WARN_LOGFILE           =
 # directories like "/usr/src/myproject". Separate the files or directories 
 # with spaces.
 
-INPUT                  = ../src
+INPUT                  = @top_srcdir@ @top_srcdir@/src
 
 # This tag can be used to specify the character encoding of the source files 
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..cb645898f57ba8c29d96870ba5eeca6cc73228d9
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,12 @@
+doxyfile.stamp: 
+	@DX_ENV@ @DX_DOXYGEN@ Doxyfile
+	echo `date` > doxyfile.stamp
+
+CLEANFILES = doxyfile.stamp
+
+all-local: doxyfile.stamp
+
+clean-local:
+	rm -rf html/ latex/ man/
+
+distclean: clean
diff --git a/doc/Makefile.in b/doc/Makefile.in
deleted file mode 100644
index 33acd64c6798174929e21b45dbd13ea1eac93e2e..0000000000000000000000000000000000000000
--- a/doc/Makefile.in
+++ /dev/null
@@ -1,23 +0,0 @@
-# This file is part of libchebfun.
-# Coypright (c) 2010 The Chebfun Team.
-# 
-# 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 3 of the License, or
-# (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-all: Doxyfile
-	@DX_ENV@ @DX_DOXYGEN@ Doxyfile
-
-clean:
-	rm -rf html/ latex/ man/
-    
-distclean: clean