Skip to content

Instantly share code, notes, and snippets.

@k-takata
Created January 21, 2013 13:56
Show Gist options
  • Select an option

  • Save k-takata/4586227 to your computer and use it in GitHub Desktop.

Select an option

Save k-takata/4586227 to your computer and use it in GitHub Desktop.
additional patch No.7 for vim-kaoriya-vim-mq-ex / patch-direct_write.diff (Do not use CXX in Make_ming.mak/Make_cyg.mak)
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -117,6 +117,13 @@
OPTIMIZE = MAXSPEED
endif
+
+# Link against the shared version of libstdc++ by default. Set
+# STATIC_STDCPLUS to "yes" to link against static version instead.
+ifndef STATIC_STDCPLUS
+STATIC_STDCPLUS=no
+endif
+
### See feature.h for a list of optionals.
### Any other defines can be included here.
@@ -127,7 +134,6 @@
#>>>>> name of the compiler and linker, name of lib directory
CROSS_COMPILE =
CC = gcc
-CXX = g++
RC = windres
##############################
@@ -452,7 +458,8 @@
# Only allow DIRECTX for a GUI build.
DEFINES += -DUSE_DIRECT_X
EXTRA_OBJS += $(OUTDIR)/gui_dwrite.o
-EXTRA_LIBS += -ld2d1 -ldwrite -static-libgcc -static
+EXTRA_LIBS += -ld2d1 -ldwrite
+USE_STDCPLUS = yes
endif
##############################
@@ -480,7 +487,8 @@
ifeq (yes, $(OLE))
DEFINES += -DFEAT_OLE
EXTRA_OBJS += $(OUTDIR)/if_ole.o
-EXTRA_LIBS += -loleaut32 -lstdc++
+EXTRA_LIBS += -loleaut32
+USE_STDCPLUS = yes
endif
##############################
@@ -494,6 +502,15 @@
DIRSLASH = \\
endif
+##############################
+ifeq (yes, $(USE_STDCPLUS))
+ifeq (yes, $(STATIC_STDCPLUS))
+EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+else
+EXTRA_LIBS += -lstdc++
+endif
+endif
+
#>>>>> end of choices
###########################################################################
@@ -560,13 +577,8 @@
# According to the Cygwin doc 1.2 FAQ, kernel32 should not be specified for
# linking unless calling ld directly.
# See /usr/doc/cygwin-doc-1.2/html/faq_toc.html#TOC93 for more information.
-ifeq ($(DIRECTX),yes)
-$(EXE): $(OUTDIR) $(OBJ)
- $(CXX) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
-else
$(EXE): $(OUTDIR) $(OBJ)
$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
-endif
xxd/xxd.exe: xxd/xxd.c
$(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL)
@@ -626,7 +638,7 @@
$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
- $(CXX) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
+ $(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -348,7 +348,6 @@
endif
endif
CC := $(CROSS_COMPILE)gcc
-CXX := $(CROSS_COMPILE)g++
WINDRES := $(CROSS_COMPILE)windres
WINDRES_CC = $(CC)
@@ -598,7 +597,7 @@
ifeq (yes, $(GUI))
OBJ += $(OUTDIR)/gui_dwrite.o
LIB += -ld2d1 -ldwrite
-LFLAGS += -static-libgcc -static
+USE_STDCPLUS = yes
endif
endif
ifdef XPM
@@ -658,11 +657,7 @@
ifeq (yes, $(OLE))
LIB += -loleaut32
OBJ += $(OUTDIR)/if_ole.o
-ifeq (yes, $(STATIC_STDCPLUS))
-LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-else
-LIB += -lstdc++
-endif
+USE_STDCPLUS = yes
endif
ifeq (yes, $(MBYTE))
@@ -686,6 +681,14 @@
DEFINES+=-DDYNAMIC_ICONV
endif
+ifeq (yes, $(USE_STDCPLUS))
+ifeq (yes, $(STATIC_STDCPLUS))
+LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+else
+LIB += -lstdc++
+endif
+endif
+
all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
vimrun.exe: vimrun.c
@@ -697,13 +700,8 @@
uninstal.exe: uninstal.c
$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
-ifeq ($(DIRECTX),yes)
-$(TARGET): $(OUTDIR) $(OBJ)
- $(CXX) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
-else
$(TARGET): $(OUTDIR) $(OBJ)
$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
-endif
upx: exes
upx gvim.exe
@@ -762,7 +760,7 @@
$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
- $(CXX) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
+ $(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment