* configure.in (NULLCMD): check in loop.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-12-15 01:39:49 +00:00
parent 67c599a5d2
commit 2ed40d3b57

View File

@ -2957,22 +2957,20 @@ AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
AS_IF([test "$gnumake" = yes], [ NULLCMD=: ], [
AC_MSG_CHECKING([for safe null command for ${MAKE-make}])
mkdir conftest.dir
echo 'A=1' > conftest.dir/Makefile
echo 'B=$(A:1=@:)' >> conftest.dir/Makefile
echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
if (cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null); then
NULLCMD=:
else
NULLCMD=
for cmd in : true; do
echo 'A=1' > conftest.dir/Makefile
echo 'B=$(A:1=@true)' >> conftest.dir/Makefile
echo 'B=$(A:1=@'$cmd')' >> conftest.dir/Makefile
echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
if (cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null); then
NULLCMD=true
else
AC_MSG_ERROR(no candidate for safe null command)
NULLCMD=$cmd
break
fi
fi
done
rm -fr conftest.dir
if test -z "$NULLCMD"; then
AC_MSG_ERROR(no candidate for safe null command)
fi
AC_MSG_RESULT($NULLCMD)
])
AC_SUBST(NULLCMD)