[前][次][番号順一覧][スレッド一覧]

ruby-changes:50370

From: nobu <ko1@a...>
Date: Tue, 20 Feb 2018 10:23:30 +0900 (JST)
Subject: [ruby-changes:50370] nobu:r62486 (trunk): Makefile.in: function to quote for mjit_config.h

nobu	2018-02-20 10:23:23 +0900 (Tue, 20 Feb 2018)

  New Revision: 62486

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62486

  Log:
    Makefile.in: function to quote for mjit_config.h

  Modified files:
    trunk/Makefile.in
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 62485)
+++ Makefile.in	(revision 62486)
@@ -544,33 +544,22 @@ un-runnable: https://github.com/ruby/ruby/blob/trunk/Makefile.in#L544
 mjit_config.h:
 	$(ECHO) making $@
 	@{ \
+	quote() { \
+	    printf "#define $$1"; shift; \
+	    $${1+printf ' "%s"'$$sep "$$@"}; \
+	    echo; \
+	}; \
 	test "$(Q)" = @ || set -x; \
 	echo '#ifndef RUBY_MJIT_CONFIG_H'; \
 	echo '#define RUBY_MJIT_CONFIG_H 1'; \
-	\
-	printf '#define MJIT_CC_COMMON ' && \
-	if test -n "$(CC)"; then printf ' "%s",' $(CC); fi && \
 	echo; \
-	\
-	printf '#define MJIT_CFLAGS ' && \
-	printf ' "%s",' -w $(ARCH_FLAG) && \
+	sep=,; \
+	quote "MJIT_CC_COMMON  " $(CC); \
+	quote "MJIT_CFLAGS     " -w $(ARCH_FLAG); \
+	quote "MJIT_OPTFLAGS   " $(optflags); \
+	quote "MJIT_DEBUGFLAGS " $(debugflags); \
+	quote "MJIT_LDSHARED   " @LDSHARED@; \
+	quote "MJIT_DLDFLAGS   " @DLDFLAGS@; \
 	echo; \
-	\
-	printf '#define MJIT_OPTFLAGS ' && \
-	if test -n "$(optflags)"; then printf ' "%s",' $(optflags); fi && \
-	echo; \
-	\
-	printf '#define MJIT_DEBUGFLAGS ' && \
-	if test -n "$(debugflags)"; then printf ' "%s",' $(debugflags); fi && \
-	echo; \
-	\
-	printf '#define MJIT_LDSHARED ' && \
-	if test -n "@LDSHARED@"; then printf ' "%s",' @LDSHARED@; fi && \
-	echo; \
-	\
-	printf '#define MJIT_DLDFLAGS ' && \
-	if test -n "@DLDFLAGS@"; then printf ' "%s",' @DLDFLAGS@; fi && \
-	echo; \
-	\
 	echo '#endif /* RUBY_MJIT_CONFIG_H */'; \
 	} > $@

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]