e1c53ac
To: vim-dev@vim.org
e1c53ac
Subject: Patch 7.2.372 (extra)
e1c53ac
Fcc: outbox
e1c53ac
From: Bram Moolenaar <Bram@moolenaar.net>
e1c53ac
Mime-Version: 1.0
e1c53ac
Content-Type: text/plain; charset=UTF-8
e1c53ac
Content-Transfer-Encoding: 8bit
e1c53ac
------------
e1c53ac
e1c53ac
Patch 7.2.372 (extra)
e1c53ac
Problem:    Cross-compiling GvimExt and xxd doesn't work.
e1c53ac
Solution:   Change the build files. (Markus Heidelberg)
e1c53ac
Files:	    src/INSTALLpc.txt, src/GvimExt/Make_ming.mak, src/Make_cyg.mak,
e1c53ac
	    src/Make_ming.mak, src/xxd/Make_cyg.mak
e1c53ac
e1c53ac
e1c53ac
*** ../vim-7.2.371/src/INSTALLpc.txt	2008-07-13 19:20:53.000000000 +0200
e1c53ac
--- src/INSTALLpc.txt	2010-01-19 12:37:03.000000000 +0100
e1c53ac
***************
e1c53ac
*** 215,222 ****
e1c53ac
  
e1c53ac
  You should not need to do *any* editing of any files to get vim compiled this
e1c53ac
  way.  If, for some reason, you want the console-mode-only version of vim (this
e1c53ac
! is NOT recommended on Win32, especially on '95/'98!!!), you need only change
e1c53ac
! the 'gvim.exe' to 'vim.exe' in the 'make' commands given above.
e1c53ac
  
e1c53ac
  If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
e1c53ac
  (also free!) and compress the file (typical compression is 50%). UPX can be
e1c53ac
--- 215,223 ----
e1c53ac
  
e1c53ac
  You should not need to do *any* editing of any files to get vim compiled this
e1c53ac
  way.  If, for some reason, you want the console-mode-only version of vim (this
e1c53ac
! is NOT recommended on Win32, especially on '95/'98!!!), you can use:
e1c53ac
! 
e1c53ac
!     make -f Make_ming.mak GUI=no vim.exe
e1c53ac
  
e1c53ac
  If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
e1c53ac
  (also free!) and compress the file (typical compression is 50%). UPX can be
e1c53ac
***************
e1c53ac
*** 240,246 ****
e1c53ac
  The Cygnus one many not fully work yet.
e1c53ac
  With Cygnus gcc you can use the Unix Makefile instead (you need to get the
e1c53ac
  Unix archive then).  Then you get a Cygwin application (feels like Vim is
e1c53ac
! runnin on Unix), while with Make_cyg.mak you get a Windows application (like
e1c53ac
  with the other makefiles).
e1c53ac
  
e1c53ac
  
e1c53ac
--- 241,247 ----
e1c53ac
  The Cygnus one many not fully work yet.
e1c53ac
  With Cygnus gcc you can use the Unix Makefile instead (you need to get the
e1c53ac
  Unix archive then).  Then you get a Cygwin application (feels like Vim is
e1c53ac
! running on Unix), while with Make_cyg.mak you get a Windows application (like
e1c53ac
  with the other makefiles).
e1c53ac
  
e1c53ac
  
e1c53ac
***************
e1c53ac
*** 259,268 ****
e1c53ac
--- 260,272 ----
e1c53ac
  If you like, you can compile the 'mingw' Win32 version from the comfort of
e1c53ac
  your Linux (or other unix) box.  To do this, you need to follow a few steps:
e1c53ac
      1) Install the mingw32 cross-compiler. See
e1c53ac
+ 	http://www.mingw.org/wiki/LinuxCrossMinGW
e1c53ac
  	http://www.libsdl.org/extras/win32/cross/README.txt
e1c53ac
      2) Get and unpack both the Unix sources and the extra archive
e1c53ac
      3) in 'Make_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
e1c53ac
         Make further changes to 'Make_ming.mak' as you wish.
e1c53ac
+        If your cross-compiler prefix differs from the predefined value,
e1c53ac
+        set 'CROSS_COMPILE' corresponding.
e1c53ac
      4) make -f Make_ming.mak gvim.exe
e1c53ac
  
e1c53ac
  Now you have created the Windows binary from your Linux box!  Have fun...
e1c53ac
*** ../vim-7.2.371/src/GvimExt/Make_ming.mak	2005-01-09 22:15:44.000000000 +0100
e1c53ac
--- src/GvimExt/Make_ming.mak	2010-02-24 14:56:37.000000000 +0100
e1c53ac
***************
e1c53ac
*** 20,36 ****
e1c53ac
  ifeq ($(CROSS),yes)
e1c53ac
  DEL = rm
e1c53ac
  ifeq ($(MINGWOLD),yes)
e1c53ac
- CXX = i586-mingw32msvc-g++
e1c53ac
  CXXFLAGS := -O2 -mno-cygwin -fvtable-thunks
e1c53ac
- WINDRES = i586-mingw32msvc-windres
e1c53ac
  else
e1c53ac
- CXX = i386-mingw32msvc-g++
e1c53ac
  CXXFLAGS := -O2 -mno-cygwin
e1c53ac
- WINDRES = i386-mingw32msvc-windres
e1c53ac
  endif
e1c53ac
  else
e1c53ac
- CXX := g++
e1c53ac
- WINDRES := windres
e1c53ac
  CXXFLAGS := -O2 -mno-cygwin
e1c53ac
  ifneq (sh.exe, $(SHELL))
e1c53ac
  DEL = rm
e1c53ac
--- 20,30 ----
e1c53ac
***************
e1c53ac
*** 38,43 ****
e1c53ac
--- 32,39 ----
e1c53ac
  DEL = del
e1c53ac
  endif
e1c53ac
  endif
e1c53ac
+ CXX := $(CROSS_COMPILE)g++
e1c53ac
+ WINDRES := $(CROSS_COMPILE)windres
e1c53ac
  LIBS :=  -luuid
e1c53ac
  RES  := gvimext.res
e1c53ac
  DEFFILE = gvimext_ming.def
e1c53ac
*** ../vim-7.2.371/src/Make_cyg.mak	2009-09-11 12:48:56.000000000 +0200
e1c53ac
--- src/Make_cyg.mak	2010-02-24 14:59:02.000000000 +0100
e1c53ac
***************
e1c53ac
*** 1,6 ****
e1c53ac
  #
e1c53ac
  # Makefile for VIM on Win32, using Cygnus gcc
e1c53ac
! # Last updated by Dan Sharp.  Last Change: 2007 Sep 29
e1c53ac
  #
e1c53ac
  # Also read INSTALLpc.txt!
e1c53ac
  #
e1c53ac
--- 1,6 ----
e1c53ac
  #
e1c53ac
  # Makefile for VIM on Win32, using Cygnus gcc
e1c53ac
! # Last updated by Dan Sharp.  Last Change: 2010 Feb 24
e1c53ac
  #
e1c53ac
  # Also read INSTALLpc.txt!
e1c53ac
  #
e1c53ac
***************
e1c53ac
*** 32,40 ****
e1c53ac
  # OLE		no or yes: set to yes to make OLE gvim (no)
e1c53ac
  # DEBUG		no or yes: set to yes if you wish a DEBUGging build (no)
e1c53ac
  # CPUNR		No longer supported, use ARCH.
e1c53ac
! # ARCH		i386 through pentium4: select -march argument to compile with (i386)
e1c53ac
  # USEDLL	no or yes: set to yes to use the Runtime library DLL (no)
e1c53ac
  #		For USEDLL=yes the cygwin1.dll is required to run Vim.
e1c53ac
  # POSTSCRIPT	no or yes: set to yes for PostScript printing (no)
e1c53ac
  # FEATURES	TINY, SMALL, NORMAL, BIG or HUGE (BIG)
e1c53ac
  # WINVER	Lowest Win32 version to support.  (0x0400)
e1c53ac
--- 32,43 ----
e1c53ac
  # OLE		no or yes: set to yes to make OLE gvim (no)
e1c53ac
  # DEBUG		no or yes: set to yes if you wish a DEBUGging build (no)
e1c53ac
  # CPUNR		No longer supported, use ARCH.
e1c53ac
! # ARCH		i386 through pentium4: select -march argument to compile with
e1c53ac
! #               (i386)
e1c53ac
  # USEDLL	no or yes: set to yes to use the Runtime library DLL (no)
e1c53ac
  #		For USEDLL=yes the cygwin1.dll is required to run Vim.
e1c53ac
+ #		"no" does not work with latest version of Cygwin, use
e1c53ac
+ #		Make_ming.mak instead.  Or set CC to gcc-3.
e1c53ac
  # POSTSCRIPT	no or yes: set to yes for PostScript printing (no)
e1c53ac
  # FEATURES	TINY, SMALL, NORMAL, BIG or HUGE (BIG)
e1c53ac
  # WINVER	Lowest Win32 version to support.  (0x0400)
e1c53ac
***************
e1c53ac
*** 99,104 ****
e1c53ac
--- 102,108 ----
e1c53ac
  INCLUDES = -march=$(ARCH) -Iproto
e1c53ac
  
e1c53ac
  #>>>>> name of the compiler and linker, name of lib directory
e1c53ac
+ CROSS_COMPILE =
e1c53ac
  CC = gcc
e1c53ac
  RC = windres
e1c53ac
  
e1c53ac
***************
e1c53ac
*** 467,476 ****
e1c53ac
  	$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
e1c53ac
  
e1c53ac
  xxd/xxd.exe: xxd/xxd.c
e1c53ac
! 	$(MAKE) -C xxd -f Make_cyg.mak USEDLL=$(USEDLL)
e1c53ac
  
e1c53ac
  GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
e1c53ac
! 	$(MAKE) -C GvimExt -f Make_ming.mak
e1c53ac
  
e1c53ac
  vimrun.exe: vimrun.c
e1c53ac
  	$(CC) $(CFLAGS) -o vimrun.exe vimrun.c  $(LIBS)
e1c53ac
--- 471,480 ----
e1c53ac
  	$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
e1c53ac
  
e1c53ac
  xxd/xxd.exe: xxd/xxd.c
e1c53ac
! 	$(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL)
e1c53ac
  
e1c53ac
  GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
e1c53ac
! 	$(MAKE) -C GvimExt -f Make_ming.mak CROSS_COMPILE=$(CROSS_COMPILE)
e1c53ac
  
e1c53ac
  vimrun.exe: vimrun.c
e1c53ac
  	$(CC) $(CFLAGS) -o vimrun.exe vimrun.c  $(LIBS)
e1c53ac
*** ../vim-7.2.371/src/Make_ming.mak	2009-09-11 12:48:56.000000000 +0200
e1c53ac
--- src/Make_ming.mak	2010-02-24 15:01:31.000000000 +0100
e1c53ac
***************
e1c53ac
*** 241,255 ****
e1c53ac
  DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
e1c53ac
  	-DHAVE_PATHDEF -DFEAT_$(FEATURES)
e1c53ac
  ifeq ($(CROSS),yes)
e1c53ac
! # cross-compiler:
e1c53ac
! CC = i586-pc-mingw32msvc-gcc
e1c53ac
  DEL = rm
e1c53ac
  MKDIR = mkdir -p
e1c53ac
! WINDRES = i586-pc-mingw32msvc-windres
e1c53ac
  else
e1c53ac
  # normal (Windows) compilation:
e1c53ac
- CC = gcc
e1c53ac
  ifneq (sh.exe, $(SHELL))
e1c53ac
  DEL = rm
e1c53ac
  MKDIR = mkdir -p
e1c53ac
  DIRSLASH = /
e1c53ac
--- 241,255 ----
e1c53ac
  DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
e1c53ac
  	-DHAVE_PATHDEF -DFEAT_$(FEATURES)
e1c53ac
  ifeq ($(CROSS),yes)
e1c53ac
! # cross-compiler prefix:
e1c53ac
! CROSS_COMPILE = i586-pc-mingw32msvc-
e1c53ac
  DEL = rm
e1c53ac
  MKDIR = mkdir -p
e1c53ac
! DIRSLASH = /
e1c53ac
  else
e1c53ac
  # normal (Windows) compilation:
e1c53ac
  ifneq (sh.exe, $(SHELL))
e1c53ac
+ CROSS_COMPILE =
e1c53ac
  DEL = rm
e1c53ac
  MKDIR = mkdir -p
e1c53ac
  DIRSLASH = /
e1c53ac
***************
e1c53ac
*** 258,265 ****
e1c53ac
  MKDIR = mkdir
e1c53ac
  DIRSLASH = \\
e1c53ac
  endif
e1c53ac
- WINDRES = windres
e1c53ac
  endif
e1c53ac
  
e1c53ac
  #>>>>> end of choices
e1c53ac
  ###########################################################################
e1c53ac
--- 258,266 ----
e1c53ac
  MKDIR = mkdir
e1c53ac
  DIRSLASH = \\
e1c53ac
  endif
e1c53ac
  endif
e1c53ac
+ CC := $(CROSS_COMPILE)gcc
e1c53ac
+ WINDRES := $(CROSS_COMPILE)windres
e1c53ac
  
e1c53ac
  #>>>>> end of choices
e1c53ac
  ###########################################################################
e1c53ac
***************
e1c53ac
*** 549,558 ****
e1c53ac
  	upx vim.exe
e1c53ac
  
e1c53ac
  xxd/xxd.exe: xxd/xxd.c
e1c53ac
! 	$(MAKE) -C xxd -f Make_cyg.mak
e1c53ac
  
e1c53ac
  GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
e1c53ac
  	$(MAKE) -C GvimExt -f Make_ming.mak
e1c53ac
  
e1c53ac
  clean:
e1c53ac
  	-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
e1c53ac
--- 550,560 ----
e1c53ac
  	upx vim.exe
e1c53ac
  
e1c53ac
  xxd/xxd.exe: xxd/xxd.c
e1c53ac
! 	$(MAKE) -C xxd -f Make_cyg.mak CC=$(CC)
e1c53ac
  
e1c53ac
  GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
e1c53ac
  	$(MAKE) -C GvimExt -f Make_ming.mak
e1c53ac
+ 	$(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE)
e1c53ac
  
e1c53ac
  clean:
e1c53ac
  	-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
e1c53ac
*** ../vim-7.2.371/src/xxd/Make_cyg.mak	2004-06-13 17:48:52.000000000 +0200
e1c53ac
--- src/xxd/Make_cyg.mak	2010-02-24 15:05:24.000000000 +0100
e1c53ac
***************
e1c53ac
*** 12,17 ****
e1c53ac
--- 12,18 ----
e1c53ac
  LIBS    =
e1c53ac
  endif
e1c53ac
  
e1c53ac
+ CC = gcc
e1c53ac
  CFLAGS = -O2 -Wall -DWIN32 $(DEFINES)
e1c53ac
  
e1c53ac
  ifneq (sh.exe, $(SHELL))
e1c53ac
***************
e1c53ac
*** 21,27 ****
e1c53ac
  endif
e1c53ac
  
e1c53ac
  xxd.exe: xxd.c
e1c53ac
! 	gcc $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS)
e1c53ac
  
e1c53ac
  clean:
e1c53ac
  	-$(DEL) xxd.exe
e1c53ac
--- 22,28 ----
e1c53ac
  endif
e1c53ac
  
e1c53ac
  xxd.exe: xxd.c
e1c53ac
! 	$(CC) $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS)
e1c53ac
  
e1c53ac
  clean:
e1c53ac
  	-$(DEL) xxd.exe
e1c53ac
*** ../vim-7.2.371/src/version.c	2010-02-24 14:46:58.000000000 +0100
e1c53ac
--- src/version.c	2010-02-24 15:05:48.000000000 +0100
e1c53ac
***************
e1c53ac
*** 683,684 ****
e1c53ac
--- 683,686 ----
e1c53ac
  {   /* Add new patch number below this line */
e1c53ac
+ /**/
e1c53ac
+     372,
e1c53ac
  /**/
e1c53ac
e1c53ac
-- 
e1c53ac
Ten bugs in the hand is better than one as yet undetected.
e1c53ac
e1c53ac
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
e1c53ac
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
e1c53ac
\\\        download, build and distribute -- http://www.A-A-P.org        ///
e1c53ac
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///