common/autoconf/basics.m4
changeset 17593 de6741d8a142
parent 17592 06b7538d17ef
child 17661 55c5e0f7b9cc
--- a/common/autoconf/basics.m4	Wed May 22 17:26:31 2013 +0200
+++ b/common/autoconf/basics.m4	Tue May 28 08:50:52 2013 +0200
@@ -60,16 +60,19 @@
   else
     # We're on a posix platform. Hooray! :)
     path="[$]$1"
-    
-    if test ! -f "$path" && test ! -d "$path"; then
-      AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
-    fi
-
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
       AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
       AC_MSG_ERROR([Spaces are not allowed in this path.])
     fi
+
+    # Use eval to expand a potential ~
+    eval path="$path"
+    if test ! -f "$path" && test ! -d "$path"; then
+      AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
+    fi
+
+    $1="`cd "$path"; $THEPWDCMD`" 
   fi
 ])