diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in index 04f16cd201..a9aa33fac8 100644 --- a/cygwin/GNUmakefile.in +++ b/cygwin/GNUmakefile.in @@ -2,7 +2,12 @@ gnumake = yes include Makefile +ifeq ($(target_os),cygwin) +MUNICODE_FLAG = +else override EXE_LDFLAGS += -municode +MUNICODE_FLAG = -municode +endif DLLWRAP = @DLLWRAP@ --target=$(target_os) --driver-name="$(CC)" ifeq (@USE_LLVM_WINDRES@,yes) # USE_LLVM_WINDRES @@ -71,7 +76,7 @@ $(PROGRAM): $(RUBY_INSTALL_NAME).res.$(OBJEXT) $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.$(OBJEXT) @rm -f $@ $(ECHO) linking $@ - $(Q) $(PURIFY) $(CC) -municode -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \ + $(Q) $(PURIFY) $(CC) $(MUNICODE_FLAG) -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \ $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@ $(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.$(OBJEXT)