From fe5d65f1579aed0aac09329b185b25b61c13cd51 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 20 Feb 2018 02:37:28 +0000 Subject: [PATCH] common.mk: moved macros to mjit_config.h * Makefile.in, common.mk, win32/Makefile.sub: moved MJIT macros to mjit_config.h from XCFLAGS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- Makefile.in | 5 ++++- common.mk | 2 -- mjit.c | 5 ++--- win32/Makefile.sub | 8 +++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2b308f49ee..24ae13bac6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -69,7 +69,7 @@ optflags = @optflags@ debugflags = @debugflags@ warnflags = @warnflags@ @strict_warnflags@ cppflags = @cppflags@ -XCFLAGS = @XCFLAGS@ $(MJIT_CPPFLAGS) +XCFLAGS = @XCFLAGS@ CPPFLAGS = @CPPFLAGS@ $(INCFLAGS) MJIT_HEADER_FLAGS = @MJIT_HEADER_FLAGS@ MJIT_HEADER_SUFFIX = @@ -553,6 +553,8 @@ mjit_config.h: echo '#ifndef RUBY_MJIT_CONFIG_H'; \ echo '#define RUBY_MJIT_CONFIG_H 1'; \ echo; \ + sep=; \ + quote MJIT_HEADER_INSTALL_DIR "$(MJIT_HEADER_INSTALL_DIR)"; \ sep=,; \ quote "MJIT_CC_COMMON " $(CC); \ quote "MJIT_CFLAGS " -w $(ARCH_FLAG); \ @@ -560,6 +562,7 @@ mjit_config.h: quote "MJIT_DEBUGFLAGS " $(debugflags); \ quote "MJIT_LDSHARED " @LDSHARED@; \ quote "MJIT_DLDFLAGS " @DLDFLAGS@; \ + quote "MJIT_LIBS " $(LIBRUBYARG_SHARED); \ echo; \ echo '#endif /* RUBY_MJIT_CONFIG_H */'; \ } > $@ diff --git a/common.mk b/common.mk index 9deb8cb3dd..69ab1a0733 100644 --- a/common.mk +++ b/common.mk @@ -61,8 +61,6 @@ HTMLOUT = $(EXTOUT)/html CAPIOUT = doc/capi MJIT_HEADER = rb_mjit_header.h MJIT_MIN_HEADER = $(MJIT_HEADER_BUILD_DIR)/rb_mjit_min_header-$(RUBY_PROGRAM_VERSION).h -MJIT_CPPFLAGS = -DMJIT_HEADER_INSTALL_DIR=\""$(MJIT_HEADER_INSTALL_DIR)"\" \ - -DLIBRUBYARG_SHARED=\""$(LIBRUBYARG_SHARED)"\" MJIT_HEADER_BUILD_DIR = $(EXTOUT)/include/$(arch) INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT) diff --git a/mjit.c b/mjit.c index 117e72f750..acd4ea3d27 100644 --- a/mjit.c +++ b/mjit.c @@ -647,7 +647,7 @@ compile_c_to_so(const char *c_file, const char *so_file) const char *libs[] = { #ifdef _WIN32 # ifdef _MSC_VER - LIBRUBYARG_SHARED, + MJIT_LIBS "-link", libruby_installed, libruby_build, @@ -655,8 +655,7 @@ compile_c_to_so(const char *c_file, const char *so_file) /* Look for ruby.dll.a in build and install directories. */ libruby_installed, libruby_build, - /* Link to ruby.dll.a, because Windows DLLs don't allow unresolved symbols. */ - LIBRUBYARG_SHARED, + MJIT_LIBS "-lmsvcrt", "-lgcc", # endif diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 6cfb917acb..0cb1b6ba21 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -1010,7 +1010,6 @@ s,@top_srcdir@,$(srcdir),;t t s,@try_header@,try_compile,;t t s,@ruby_pc@,$(ruby_pc),;t t <> $@ @echo /* MJIT_DLDFLAGS */>> $@ @ + @(set sep=#define MJIT_LIBS ) & \ + for %I in ($(LIBRUBYARG_SHARED)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ + @echo /* MJIT_LIBS */>> $@ + @ + @echo.>> $@ @echo #endif /* RUBY_MJIT_CONFIG_H */>> $@ @$(Q:@=: :) type $@