Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.3.093
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.093
Problem:    New DLL dependencies in MingW with gcc 4.5.0.
Solution:   Add STATIC_STDCPLUS, LDFLAGS and split up WINDRES. (Guopeng Wen)
Files:      src/GvimExt/Make_ming.mak, src/Make_ming.mak


*** ../vim-7.3.092/src/GvimExt/Make_ming.mak	2010-09-29 18:42:25.000000000 +0200
--- src/GvimExt/Make_ming.mak	2010-12-30 14:42:51.000000000 +0100
***************
*** 17,22 ****
--- 17,33 ----
  # check also the executables
  MINGWOLD = no
  
+ # Link against the shared versions of libgcc/libstdc++ by default.  Set
+ # STATIC_STDCPLUS to "yes" to link against static versions instead.
+ STATIC_STDCPLUS=no
+ #STATIC_STDCPLUS=yes
+ 
+ # Note: -static-libstdc++ is not available until gcc 4.5.x.
+ LDFLAGS += -shared
+ ifeq (yes, $(STATIC_STDCPLUS))
+ LDFLAGS += -static-libgcc -static-libstdc++
+ endif
+ 
  ifeq ($(CROSS),yes)
  DEL = rm
  ifeq ($(MINGWOLD),yes)
***************
*** 33,39 ****
  endif
  endif
  CXX := $(CROSS_COMPILE)g++
! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CXX) -E -xc" -DRC_INVOKED
  LIBS :=  -luuid
  RES  := gvimext.res
  DEFFILE = gvimext_ming.def
--- 44,52 ----
  endif
  endif
  CXX := $(CROSS_COMPILE)g++
! WINDRES := $(CROSS_COMPILE)windres
! WINDRES_CXX = $(CXX)
! WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED
  LIBS :=  -luuid
  RES  := gvimext.res
  DEFFILE = gvimext_ming.def
***************
*** 46,52 ****
  all: all-before $(DLL) all-after
  
  $(DLL): $(OBJ) $(RES) $(DEFFILE)
! 	$(CXX) -shared $(CXXFLAGS) -s -o $@ \
  		-Wl,--enable-auto-image-base \
  		-Wl,--enable-auto-import \
  		-Wl,--whole-archive \
--- 59,65 ----
  all: all-before $(DLL) all-after
  
  $(DLL): $(OBJ) $(RES) $(DEFFILE)
! 	$(CXX) $(LDFLAGS) $(CXXFLAGS) -s -o $@ \
  		-Wl,--enable-auto-image-base \
  		-Wl,--enable-auto-import \
  		-Wl,--whole-archive \
***************
*** 58,64 ****
  	$(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -c $? -o $@
  
  $(RES): gvimext_ming.rc
! 	$(WINDRES) --input-format=rc --output-format=coff -DMING $? -o $@
  
  clean: clean-custom
  	-$(DEL)  $(OBJ) $(RES) $(DLL)
--- 71,77 ----
  	$(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -c $? -o $@
  
  $(RES): gvimext_ming.rc
! 	$(WINDRES) $(WINDRES_FLAGS) --input-format=rc --output-format=coff -DMING $? -o $@
  
  clean: clean-custom
  	-$(DEL)  $(OBJ) $(RES) $(DLL)
*** ../vim-7.3.092/src/Make_ming.mak	2010-11-03 21:59:23.000000000 +0100
--- src/Make_ming.mak	2010-12-30 14:42:51.000000000 +0100
***************
*** 56,61 ****
--- 56,67 ----
  NETBEANS=$(GUI)
  
  
+ # 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
+ 
  # If the user doesn't want gettext, undefine it.
  ifeq (no, $(GETTEXT))
  GETTEXT=
***************
*** 309,320 ****
  endif
  endif
  CC := $(CROSS_COMPILE)gcc
! WINDRES := $(CROSS_COMPILE)windres --preprocessor="$(CC) -E -xc" -DRC_INVOKED
  
  #>>>>> end of choices
  ###########################################################################
  
  CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
  
  ifdef GETTEXT
  DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
--- 315,328 ----
  endif
  endif
  CC := $(CROSS_COMPILE)gcc
! WINDRES := $(CROSS_COMPILE)windres
! WINDRES_CC = $(CC)
  
  #>>>>> end of choices
  ###########################################################################
  
  CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
+ WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
  
  ifdef GETTEXT
  DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
***************
*** 577,584 ****
  endif
  
  ifeq (yes, $(OLE))
! LIB += -loleaut32 -lstdc++
  OBJ += $(OUTDIR)/if_ole.o
  endif
  
  ifeq (yes, $(MBYTE))
--- 585,597 ----
  endif
  
  ifeq (yes, $(OLE))
! LIB += -loleaut32
  OBJ += $(OUTDIR)/if_ole.o
+ ifeq (yes, $(STATIC_STDCPLUS))
+ LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+ else
+ LIB += -lstdc++
+ endif
  endif
  
  ifeq (yes, $(MBYTE))
***************
*** 656,665 ****
  	$(CC) -c $(CFLAGS) $< -o $@
  
  $(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
! 	$(WINDRES) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
  
  $(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
! 	$(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
  
  $(OUTDIR):
  	$(MKDIR) $(OUTDIR)
--- 669,678 ----
  	$(CC) -c $(CFLAGS) $< -o $@
  
  $(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
! 	$(WINDRES) $(WINDRES_FLAGS) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
  
  $(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
! 	$(WINDRES) $(WINDRES_FLAGS) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
  
  $(OUTDIR):
  	$(MKDIR) $(OUTDIR)
*** ../vim-7.3.092/src/version.c	2010-12-30 14:47:32.000000000 +0100
--- src/version.c	2010-12-30 14:48:34.000000000 +0100
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     93,
  /**/

-- 
Creating the world with Emacs:   M-x let-there-be-light
Creating the world with Vim:     :make world

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///