diff --git a/src/configure.ac b/src/configure.ac
index e59f86be1..04ea08e6c 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -4330,6 +4330,15 @@ if test "$zOSUnix" = "yes"; then
 	CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll"
 fi
 
+dnl If AC_PROG_MKDIR_P has chosen the fallback './install-sh -d', then
+dnl AC_OUTPUT will convert './' into '.././' to make the path GNU-compliant.
+dnl That's not useful for us.  Correct it using the absolute path instead.
+if echo "$MKDIR_P" | grep -e '^[[ \t]]*\.\/install-sh' >/dev/null 2>/dev/null; then
+  mkdir_p_dir=`pwd`
+  mkdir_p_cmd=`echo $MKDIR_P | sed -e 's/^[[ \t]]*\.\///'`
+  MKDIR_P="/bin/sh $mkdir_p_dir/$mkdir_p_cmd"
+fi
+
 dnl write output files
 AC_OUTPUT(auto/config.mk:config.mk.in)
 
