configure: support absolete out-of-tree builds
authorAkim Demaille <akim@lrde.epita.fr>
Fri, 21 Dec 2012 12:55:26 +0000 (21 13:55 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Fri, 21 Dec 2012 12:57:22 +0000 (21 13:57 +0100)
configure: handle the case of absolute paths.
Reported by grishka.

README
configure

diff --git a/README b/README
index eedc71c..43e6c3b 100644 (file)
--- a/README
+++ b/README
@@ -35,8 +35,8 @@ Documentation:
    make test
    make install
 
-Alternatively, VPATH builds are supported: you may use different
-directories to old build objects, kept separate from your source tree:
+Alternatively, out-of-tree builds are supported: you may use different
+directories to hold build objects, kept separate from your source tree:
 
    mkdir _build
    cd _build
index 1c1497a..e4321b7 100755 (executable)
--- a/configure
+++ b/configure
@@ -502,9 +502,14 @@ if test "$source_path_used" = "yes" ; then
     for f in $FILES ; do
         dir=`fn_dirname "$f"`
         test -d "$dir" || mkdir -p "$dir"
-        back=`echo "$source_path/$dir/" | sed 's,/\./,/,g;s,[^/]*/,../,g'`
-        back=$back$f
-        ln -sf $back $f
+        # Build a symlink $f that points to $dest, its $source_path
+        # counterpart.
+        case $source_path in
+          /*) dest=$source_path/$f;;
+           *) dest=`echo "$source_path/$dir/" | sed 's,/\./,/,g;s,[^/]*/,../,g'`
+              dest=$dest$f;;
+        esac
+        ln -sf $dest $f
     done
 fi
 cat >>config.mak <<EOF