diff --git a/src/run_autoconfig b/src/run_autoconfig
index 9af9301548d5ec2fb1c6519fce66d8640bc0766b..cef7a411437e2296fc632bef20452bbfb383f853 100755
--- a/src/run_autoconfig
+++ b/src/run_autoconfig
@@ -4,6 +4,10 @@
 
 need_to_make_depend=no
 
+base=`echo $0 | sed 's@[^/]*$@@g'`
+if test "x$base" != "x" ; then
+  cd "$base"
+fi
 
 find . -type d -print|egrep -v '/(CVS)|(RCS)$'| while read dir; do