Also introduce the CROSS_COMPILE variable for the cross-compiler prefix,
now you don't have to set CC, CXX and WINDRES separately any more, if it
differs from the default values.
---
src/GvimExt/Make_ming.mak | 8 ++------
src/Make_cyg.mak | 5 +++--
src/Make_ming.mak | 15 ++++++++-------
src/xxd/Make_cyg.mak | 2 +-
4 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/src/GvimExt/Make_ming.mak b/src/GvimExt/Make_ming.mak
index f10f730..5997e7e 100644
--- a/src/GvimExt/Make_ming.mak
+++ b/src/GvimExt/Make_ming.mak
@@ -20,17 +20,11 @@ MINGWOLD = no
ifeq ($(CROSS),yes)
DEL = rm
ifeq ($(MINGWOLD),yes)
-CXX = i586-mingw32msvc-g++
CXXFLAGS := -O2 -mno-cygwin -fvtable-thunks
-WINDRES = i586-mingw32msvc-windres
else
-CXX = i386-mingw32msvc-g++
CXXFLAGS := -O2 -mno-cygwin
-WINDRES = i386-mingw32msvc-windres
endif
else
-CXX := g++
-WINDRES := windres
CXXFLAGS := -O2 -mno-cygwin
ifneq (sh.exe, $(SHELL))
DEL = rm
@@ -38,6 +32,8 @@ else
DEL = del
endif
endif
+CXX := $(CROSS_COMPILE)g++
+WINDRES := $(CROSS_COMPILE)windres
LIBS := -luuid
RES := gvimext.res
DEFFILE = gvimext_ming.def
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index eaf7309..3eaf423 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -99,6 +99,7 @@ DEFINES = -DWIN32 -DHAVE_PATHDEF -DFEAT_$(FEATURES) \
INCLUDES = -march=$(ARCH) -Iproto
#>>>>> name of the compiler and linker, name of lib directory
+CROSS_COMPILE =
CC = gcc
RC = windres
@@ -446,10 +447,10 @@ $(EXE): $(OUTDIR) $(OBJ)
$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
xxd/xxd.exe: xxd/xxd.c
- $(MAKE) -C xxd -f Make_cyg.mak USEDLL=$(USEDLL)
+ $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL)
GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
- $(MAKE) -C GvimExt -f Make_ming.mak
+ $(MAKE) -C GvimExt -f Make_ming.mak CROSS_COMPILE=$(CROSS_COMPILE)
vimrun.exe: vimrun.c
$(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS)
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index 6d28e46..f935d0b 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -228,14 +228,14 @@ DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
-DHAVE_PATHDEF -DFEAT_$(FEATURES)
ifeq ($(CROSS),yes)
-# cross-compiler:
-CC = i586-pc-mingw32msvc-gcc
+# cross-compiler prefix:
+CROSS_COMPILE = i586-pc-mingw32msvc-
DEL = rm
MKDIR = mkdir -p
-WINDRES = i586-pc-mingw32msvc-windres
+DIRSLASH = /
else
# normal (Windows) compilation:
-CC = gcc
+CROSS_COMPILE =
ifneq (sh.exe, $(SHELL))
DEL = rm
MKDIR = mkdir -p
@@ -245,8 +245,9 @@ DEL = del
MKDIR = mkdir
DIRSLASH = \\
endif
-WINDRES = windres
endif
+CC := $(CROSS_COMPILE)gcc
+WINDRES := $(CROSS_COMPILE)windres
#>>>>> end of choices
###########################################################################
@@ -529,10 +530,10 @@ upx: exes
upx vim.exe
xxd/xxd.exe: xxd/xxd.c
- $(MAKE) -C xxd -f Make_cyg.mak
+ $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC)
GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
- $(MAKE) -C GvimExt -f Make_ming.mak
+ $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE)
clean:
-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
diff --git a/src/xxd/Make_cyg.mak b/src/xxd/Make_cyg.mak
index f04b7bf..01a3ae5 100644
--- a/src/xxd/Make_cyg.mak
+++ b/src/xxd/Make_cyg.mak
@@ -21,7 +21,7 @@ DEL = del
endif
xxd.exe: xxd.c
- gcc $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS)
+ $(CC) $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS)
clean:
-$(DEL) xxd.exe
--
1.6.2.1.139.g54e5
> Before for xxd and GvimExt the normal compiler was invoked.
>
> Also introduce the CROSS_COMPILE variable for the cross-compiler prefix,
> now you don't have to set CC, CXX and WINDRES separately any more, if it
> differs from the default values.
Thanks. Shouldn't the src/INSTALLpc.txt file be updated with a few
remarks about this? There still is a "needs to be verified" note.
--
hundred-and-one symptoms of being an internet addict:
231. You sprinkle Carpet Fresh on the rugs and put your vacuum cleaner
in the front doorway permanently so it always looks like you are
actually attempting to do something about that mess that has amassed
since you discovered the Internet.
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Sure, I added a sentence for the CROSS_COMPILE variable.
> There still is a "needs to be verified" note.
This note refers to this:
1) Install the mingw32 cross-compiler. See
http://www.libsdl.org/extras/win32/cross/README.txt
I can't say anything about this, I created the mingw toolchain with
Gentoo's crossdev.
Markus
diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
index 755ea3b..0d27e61 100644
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -262,6 +262,8 @@ your Linux (or other unix) box. To do this, you need to follow a few steps:
http://www.libsdl.org/extras/win32/cross/README.txt
2) Get and unpack both the Unix sources and the extra archive
3) in 'Make_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
+ If your cross-compiler prefix differs from the predefined value,
+ set 'CROSS_COMPILE' corresponding.
Make further changes to 'Make_ming.mak' as you wish.
4) make -f Make_ming.mak gvim.exe
> > > Before for xxd and GvimExt the normal compiler was invoked.
> > >
> > > Also introduce the CROSS_COMPILE variable for the cross-compiler prefix,
> > > now you don't have to set CC, CXX and WINDRES separately any more, if it
> > > differs from the default values.
> >
> > Thanks. Shouldn't the src/INSTALLpc.txt file be updated with a few
> > remarks about this?
>
> Sure, I added a sentence for the CROSS_COMPILE variable.
Thanks.
> > There still is a "needs to be verified" note.
>
> This note refers to this:
>
> 1) Install the mingw32 cross-compiler. See
> http://www.libsdl.org/extras/win32/cross/README.txt
>
> I can't say anything about this, I created the mingw toolchain with
> Gentoo's crossdev.
Perhaps someone else can comment?
--
hundred-and-one symptoms of being an internet addict:
248. You sign your letters with your e-mail address instead of your name.
Maybe we can replace the link with this one from the official site:
http://www.mingw.org/wiki/LinuxCrossMinGW
Seems as if they build the toolchain the same way, both refer to
x86-mingw32-build.sh-0.0-20061107-1.tar.gz
Or put the link in there additionally, since there is no reference to a
precompiled toolchain on mingw.org. The prebuild from libsdl.org may be
a little bit outdated though, the timestamp of the file is from 2007.
Markus
I'll add the link, thanks.
--
Vi is clearly superior to emacs, since "vi" has only two characters
(and two keystrokes), while "emacs" has five. (Randy C. Ford)