diff --git a/Makefile.in b/Makefile.in index 9f01868e79..2451846eeb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -542,29 +542,28 @@ mjit_config.h: echo '#ifndef RUBY_MJIT_CONFIG_H'; \ echo '#define RUBY_MJIT_CONFIG_H 1'; \ \ - set x $(CC) && shift && echo '#define MJIT_CC_COMMON "'$$1'"' \\; \ - shift && for w do echo ' , "'$$w'"' \\; done; \ + set x $(CC) && shift && echo '#define MJIT_CC_COMMON \\' && \ + for w do echo ' "'$$w'", \\'; done; \ echo ' /* MJIT_CC_COMMON */'; \ \ - \ - set x -w $(ARCH_FLAG) && shift && echo '#define MJIT_CFLAGS "'$$1'"' \\; \ - shift && for w do echo ' , "'$$w'"' \\; done; \ + set x -w $(ARCH_FLAG) && shift && echo '#define MJIT_CFLAGS \\' && \ + for w do echo ' "'$$w'", \\'; done; \ echo ' /* MJIT_CFLAGS */'; \ \ - set x $(optflags) && shift && echo '#define MJIT_OPTFLAGS "'$$1'"' \\; \ - shift && for w do echo ' , "'$$w'"' \\; done; \ + set x $(optflags) && shift && echo '#define MJIT_OPTFLAGS \\' && \ + for w do echo ' "'$$w'", \\'; done; \ echo ' /* MJIT_OPTFLAGS */'; \ \ - set x $(debugflags) && shift && echo '#define MJIT_DEBUGFLAGS "'$$1'"' \\; \ - shift && for w do echo ' , "'$$w'"' \\; done; \ + set x $(debugflags) && shift && echo '#define MJIT_DEBUGFLAGS \\' && \ + for w do echo ' "'$$w'", \\'; done; \ echo ' /* MJIT_DEBUGFLAGS */'; \ \ - set x @LDSHARED@ && shift && echo '#define MJIT_LDSHARED "'$$1'"' \\; \ - shift && for w do echo ' , "'$$w'"' \\; done; \ + set x @LDSHARED@ && shift && echo '#define MJIT_LDSHARED \\' && \ + for w do echo ' "'$$w'", \\'; done; \ echo ' /* MJIT_LDSHARED */'; \ \ - set x @DLDFLAGS@ && shift && echo '#define MJIT_DLDFLAGS "'$$1'"' \\; \ - shift && for w do echo ' , "'$$w'"' \\; done; \ + set x @DLDFLAGS@ && shift && echo '#define MJIT_DLDFLAGS \\' && \ + for w do echo ' "'$$w'", \\'; done; \ echo ' /* MJIT_DLDFLAGS */'; \ \ echo '#endif /* RUBY_MJIT_CONFIG_H */'; \ diff --git a/mjit.c b/mjit.c index cb1cad0e9e..3152a427b0 100644 --- a/mjit.c +++ b/mjit.c @@ -561,9 +561,6 @@ free_list(struct rb_mjit_unit_list *list) } #include "mjit_config.h" -#ifndef MJIT_CC -#define MJIT_CC "cc" -#endif /* XXX_COMMONN_ARGS define the command line arguments of XXX C compiler used by MJIT. @@ -573,11 +570,11 @@ free_list(struct rb_mjit_unit_list *list) XXX_USE_PCH_ARAGS define additional options to use the precomiled header. */ -static const char *const CC_DEBUG_ARGS[] = {MJIT_DEBUGFLAGS, NULL}; -static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS, NULL}; +static const char *const CC_DEBUG_ARGS[] = {MJIT_DEBUGFLAGS NULL}; +static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS NULL}; static const char *const CC_COMMON_ARGS[] = { - MJIT_CC_COMMON, MJIT_CFLAGS, + MJIT_CC_COMMON MJIT_CFLAGS #if defined __GNUC__ && !defined __clang__ "-Wfatal-errors", "-fPIC", "-shared", "-w", "-pipe", "-nostartfiles", "-nodefaultlibs", "-nostdlib", @@ -585,11 +582,8 @@ static const char *const CC_COMMON_ARGS[] = { NULL }; -static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED, NULL}; -static const char *const CC_DLDFLAGS_ARGS[] = { - MJIT_DLDFLAGS, - NULL -}; +static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED NULL}; +static const char *const CC_DLDFLAGS_ARGS[] = {MJIT_DLDFLAGS NULL}; #ifdef __clang__ static const char GCC_USE_PCH_ARGS[] = "-include-pch"; diff --git a/win32/Makefile.sub b/win32/Makefile.sub index b707500f32..9500ca83cc 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -1250,27 +1250,27 @@ mjit_config.h: <> $@ + for %I in ($(CC)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_CC_COMMON */>> $@ @ @(set sep=#define MJIT_CFLAGS ) & \ - for %I in ($(RUNTIMEFLAG) $(ARCH_FLAG)) do @(call echo.%%sep%%"%%~I" \& set sep= ,) >> $@ + for %I in ($(RUNTIMEFLAG) $(ARCH_FLAG)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_CFLAGS */>> $@ @ @(set sep=#define MJIT_OPTFLAGS ) & \ - for %I in ($(OPTFLAGS)) do @(call echo.%%sep%%"%%~I" \& set sep= ,) >> $@ + for %I in ($(OPTFLAGS)) do @(call echo.%%sep%%"%%~I" \& set sep= ) >> $@ @echo /* MJIT_OPTFLAGS */>> $@ @ @(set sep=#define MJIT_DEBUGFLAGS ) & \ - for %I in ($(DEBUGFLAGS)) do @(call echo.%%sep%%"%%~I" \& set sep= ,) >> $@ + for %I in ($(DEBUGFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_DEBUGFLAGS */>> $@ @ @(set sep=#define MJIT_LDSHARED ) & \ - for %I in ($(LDSHARED)) do @(call echo.%%sep%%"%%~I" \& set sep= ,) >> $@ + for %I in ($(LDSHARED)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_LDSHARED */>> $@ @ @(set sep=#define MJIT_DLDFLAGS ) & \ - for %I in ($(DLDFLAGS)) do @(call echo.%%sep%%"%%~I" \& set sep= ,) >> $@ + for %I in ($(DLDFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_DLDFLAGS */>> $@ @ @echo #endif /* RUBY_MJIT_CONFIG_H */>> $@