From 2e3be7378781568e3302add18baa5ba45b8b4463 Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 31 Jul 2011 11:27:30 +0000 Subject: * common.mk (ECHO1): ":" in a make variable replacement cause a syntax error with /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead. * configure.in (NULLCMD): new check. * Makefile.in (NULLCMD): Reflects checking in configure. * win32/Makefile.sub (NULLCMD): new assignment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 11 +++++++++++ Makefile.in | 2 +- common.mk | 3 ++- configure.in | 22 ++++++++++++++++++++++ win32/Makefile.sub | 1 + 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 100f22083e..173aa2d6a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Sun Jul 31 20:21:36 2011 "Yuki Sonoda (Yugui)" + + * common.mk (ECHO1): ":" in a make variable replacement cause a syntax + error with /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead. + + * configure.in (NULLCMD): new check. + + * Makefile.in (NULLCMD): Reflects checking in configure. + + * win32/Makefile.sub (NULLCMD): new assignment. + Sun Jul 31 11:31:07 2011 Kazuki Tsujimoto * backport r32768 from trunk. diff --git a/Makefile.in b/Makefile.in index b1864e68e3..912547860e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ SHELL = /bin/sh -NULLCMD = : +NULLCMD = @NULLCMD@ RUNCMD = $(SHELL) CHDIR = @CHDIR@ exec = exec diff --git a/common.mk b/common.mk index 573b64a662..21d6caf669 100644 --- a/common.mk +++ b/common.mk @@ -8,7 +8,7 @@ dll: $(LIBRUBY_SO) V = 0 Q1 = $(V:1=) Q = $(Q1:0=@) -ECHO1 = $(V:1=@:) +ECHO1 = $(V:1=@$(NULLCMD)) ECHO = $(ECHO1:0=@echo) RUBYLIB = - @@ -146,6 +146,7 @@ main: showflags encs exts .PHONY: showflags exts enc trans: showflags showflags: + $(ECHO) test $(MESSAGE_BEGIN) \ " CC = $(CC)" \ " LD = $(LD)" \ diff --git a/configure.in b/configure.in index 6888087964..7844bc68c0 100644 --- a/configure.in +++ b/configure.in @@ -2609,6 +2609,28 @@ AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [ gnumake=no]) AC_MSG_RESULT($gnumake) ]) +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 + echo 'A=1' > conftest.dir/Makefile + echo 'B=$(A:1=@true)' >> 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) + fi + fi + rm -fr conftest.dir + AC_MSG_RESULT($NULLCMD) +]) +AC_SUBST(NULLCMD) if test "${universal_binary-no}" = yes ; then AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [ diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 808966a4e0..4167f6a95b 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -1,6 +1,7 @@ # -*- makefile -*- SHELL = $(COMSPEC) +NULLCMD = : RUNCMD = $(COMSPEC) /c MKFILES = Makefile NULL = nul -- cgit v1.2.3