diff --git a/config/Makefile.def.in b/config/Makefile.def.in
index 49a3f1c..3d7b988 100644
--- a/config/Makefile.def.in
+++ b/config/Makefile.def.in
@@ -38,7 +38,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 # Definition of dependencies file
 #
 
-DEP = Makefile.dep
+DEP = $(srcdir)/Makefile.dep
 
 # Toolkit wide definitions for DEBUGGING
 #
diff --git a/config/confmod b/config/confmod
index ae769c3..456972c 100755
--- a/config/confmod
+++ b/config/confmod
@@ -566,6 +566,7 @@ enable_option_checking=no
 ac_default_prefix=/usr/local
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+src_configdir
 configdir
 common_makefile
 SET_MAKE
@@ -1650,26 +1651,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-parentdir=`pwd`
-relparentdir=.
-configdir="configdir"
-
-while test "$parentdir" != "/" -a "$configdir" = "configdir"; do
-	if test -d "$parentdir/config" ; then
-		configdir=`echo $relparentdir | sed 's/^\.\///'`/config
-	else
-		parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'`
-		relparentdir=$relparentdir/..
-	fi
-done
-
-if test "$configdir" = "configdir" ; then
-	echo "Cannot find configure directory"
-	exit 1
-fi
+configdir="../config"
+src_configdir="$srcdir/../config"
 
 ac_aux_dir=
-for ac_dir in $configdir "$srcdir"/$configdir; do
+for ac_dir in $src_configdir "$srcdir"/$src_configdir; do
   if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -1685,7 +1671,7 @@ for ac_dir in $configdir "$srcdir"/$configdir; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in $configdir \"$srcdir\"/$configdir" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in $src_configdir \"$srcdir\"/$src_configdir" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -1736,7 +1722,8 @@ common_makefile=Makefile.def
 
 
 
-files=`find . -name "*.in" -print | grep -v "/config" | sed -e 's/.in$/ /g'`
+
+files=`find $srcdir -name "*.in" -print | sed -e "s:$srcdir/::g" | grep -v "/config" | sed -e 's/.in$/ /g'`
 
 ac_config_files="$ac_config_files $files"
 
diff --git a/config/confmod.in b/config/confmod.in
index 1257f14..0cd3153 100644
--- a/config/confmod.in
+++ b/config/confmod.in
@@ -3,34 +3,18 @@ dnl Process this file with autoconf to produce a configure script.
 AC_INIT(Makefile.in)
 AC_DISABLE_OPTION_CHECKING
 
-parentdir=`pwd`
-relparentdir=.
-configdir="configdir"
-
-while test "$parentdir" != "/" -a "$configdir" = "configdir"; do
-	if test -d "$parentdir/config" ; then
-		configdir=`echo $relparentdir | sed 's/^\.\///'`/config
-	else
-changequote(, )dnl
-		parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'`
-changequote([, ])dnl
-		relparentdir=$relparentdir/..
-	fi
-done
-
-if test "$configdir" = "configdir" ; then
-	echo "Cannot find configure directory"
-	exit 1
-fi
+configdir="../config"
+src_configdir="$srcdir/../config"
 
 dnl Configuration Utilities
-AC_CONFIG_AUX_DIR($configdir)
+AC_CONFIG_AUX_DIR($src_configdir)
 
 dnl Include general file
 sinclude(general.m4)dnl
 
 AC_SUBST(configdir)
+AC_SUBST(src_configdir)
 
-files=`find . -name "*.in" -print | grep -v "/config" | sed -e 's/.in$/ /g'`
+files=`find $srcdir -name "*.in" -print | sed -e "s:$srcdir/::g" | grep -v "/config" | sed -e 's/.in$/ /g'`
 
 AC_OUTPUT($files)
diff --git a/configure b/configure
index 838f2b0..cc253c4 100755
--- a/configure
+++ b/configure
@@ -1,32 +1,45 @@
 #! /bin/sh
-if test -d config ; then
-	if test -f config/modules ; then
-		tmp=`cat config/modules`
-		modules=`ls -d $tmp`
+
+# Figure out the absolute path to the source code
+srcdir=`dirname $0`
+case $srcdir in 
+        /*)
+                abs_srcdir=$srcdir
+                ;;
+        *)
+                abs_srcdir=`pwd`/$srcdir
+                ;;
+esac
+
+if test -d $abs_srcdir/config ; then
+	if test -f $abs_srcdir/config/modules ; then
+		for dir in `cat $abs_srcdir/config/modules`; do
+                        modules="$modules `ls -d $abs_srcdir/$dir`"
+                done
 	else
-		for dir in `ls`; do
+		for dir in `ls $abs_srcdir`; do
 			if test -d $dir ; then
 				modules="$modules $dir"
 			fi
 		done
 	fi
-	modules=`echo $modules | sed -e "s/config//g" | sed -e "s/CVS//g"`
+	modules=`echo $modules | sed -e "s:$abs_srcdir/::g" | sed -e "s/config//g" | sed -e "s/CVS//g"`
 	modules="config $modules doxygen"
 else
 	echo "Cannot find configure directory (config or ../config)"
 	exit 1
 fi
 if test "x--help" = "x$*"; then
-	config/configure --help
+	$abs_srcdir/config/configure --help
 elif test "x--help=short" = "x$*"; then
-	config/configure --help=short
+	$abs_srcdir/config/configure --help=short
 elif test "x--help=recursive" = "x$*"; then
-	config/configure --help=recursive
+	$abs_srcdir/config/configure --help=recursive
 elif test "x--version" = "x$*"; then
-	config/configure --version
+	$abs_srcdir/config/configure --version
 else
 	for module in $modules ; do
 		echo "Running configure for module $module."
-		(cd $module && ./configure $* ) || exit 1
+		(mkdir -p $module && cd $module && $abs_srcdir/$module/configure $* ) || exit 1
 	done
 fi
diff --git a/ofstd/Makefile.in b/ofstd/Makefile.in
index d1779e4..d9e3d41 100644
--- a/ofstd/Makefile.in
+++ b/ofstd/Makefile.in
@@ -8,7 +8,7 @@ SHELL = /bin/sh
 VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-configdir = @top_srcdir@/@configdir@
+configdir = @abs_top_builddir@/@configdir@
 
 include $(configdir)/@common_makefile@
 
diff --git a/ofstd/configure b/ofstd/configure
index 396668e..714d4aa 100755
--- a/ofstd/configure
+++ b/ofstd/configure
@@ -1,27 +1,22 @@
 #! /bin/sh
 
-parentdir=`pwd`
-thisdir=$parentdir
-
-# The following test constructs relative path from the module
-# directory to the configuration directory. If you know this path
-# you can substitute this with
-# configdir=<relative_path>
-# It is very important that the configdir path is relative.
-
-configdir="configdir"
-
-while test "$parentdir" != "/" -a "$configdir" = "configdir"; do
-	if test -d "$parentdir/config" ; then
-		configdir=$parentdir/config
-	else
-		parentdir=`echo $parentdir | sed 's/\/[^\/]*$//'`
-	fi
-done
-
-if test "$configdir" = "configdir" ; then
-	echo "Cannot find configure directory"
-	exit 1
+# Figure out the absolute path to the source code
+srcdir=`dirname $0`
+case $srcdir in 
+        /*)
+                abs_srcdir=$srcdir
+                ;;
+        *)
+                abs_srcdir=`pwd`/$srcdir
+                ;;
+esac
+
+configdir="$abs_srcdir/../config"
+thisdir=`pwd`
+
+if ! test -d "$configdir"; then
+        echo "Cannot find configure directory"
+        exit 1
 fi
 
 if test $# != 0;  then
@@ -33,7 +28,7 @@ if test $# != 0;  then
 		./configure $*
 		cd $thisdir
 		echo "running configure for this module"
-		sh "$configdir/confmod" --srcdir=. $*
+		sh "$configdir/confmod" "--srcdir=$srcdir" $*
 		;;
 	-c)
 		shift
@@ -43,12 +38,12 @@ if test $# != 0;  then
 		;;
 	*)
 		echo "running configure for this module"
-		sh "$configdir/confmod" --srcdir=. $*
+		sh "$configdir/confmod" "--srcdir=$srcdir" $*
 		;;
 	esac
 else
 	echo "running configure for this module"
-	sh "$configdir/confmod" --srcdir=. $*
+	sh "$configdir/confmod" "--srcdir=$srcdir" $*
 fi	
 
 
diff --git a/ofstd/include/Makefile.in b/ofstd/include/Makefile.in
index 6befc1a..aa9ebb5 100644
--- a/ofstd/include/Makefile.in
+++ b/ofstd/include/Makefile.in
@@ -7,7 +7,7 @@
 SHELL = /bin/sh
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-configdir = @top_srcdir@/@configdir@
+configdir = @abs_top_builddir@/@configdir@
 
 include $(configdir)/@common_makefile@
 
diff --git a/ofstd/libsrc/Makefile.in b/ofstd/libsrc/Makefile.in
index e158194..d7977d8 100644
--- a/ofstd/libsrc/Makefile.in
+++ b/ofstd/libsrc/Makefile.in
@@ -8,7 +8,7 @@ SHELL = /bin/sh
 VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-configdir = @top_srcdir@/@configdir@
+configdir = @abs_top_builddir@/@configdir@
 
 include $(configdir)/@common_makefile@
 
diff --git a/ofstd/tests/Makefile.in b/ofstd/tests/Makefile.in
index 843793c..e2512d5 100644
--- a/ofstd/tests/Makefile.in
+++ b/ofstd/tests/Makefile.in
@@ -8,12 +8,13 @@ SHELL = /bin/sh
 VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
-configdir = @top_srcdir@/@configdir@
+top_builddir = @top_builddir@
+configdir = @abs_top_builddir@/@configdir@
 
 include $(configdir)/@common_makefile@
 
 LOCALINCLUDES = -I$(top_srcdir)/include
-LIBDIRS = -L$(top_srcdir)/libsrc
+LIBDIRS = -L$(top_builddir)/libsrc
 LOCALLIBS = -lofstd
 LOCALTRASH = *.out
 
