diff --git a/configure b/configure
index f8c7f0ca72cdad8cb4af779c00d0b2bc7db47c43..6ac580789259fedeffe9b36a6e5944fb8e99b693 100755
--- a/configure
+++ b/configure
@@ -416,7 +416,7 @@ TARGET_OS=`( uname -s ) 2>&1`
   esac
 
 # find source path
-source_path="`echo $0 | sed -e 's#/configure##'`"
+source_path="`dirname $0`"
 source_path_used="yes"
 if test -z "$source_path" -o "$source_path" = "." ; then
     source_path=`pwd`