add CROSS_CC CROSS_PKGCONFIG CROSS_SDLCONFIG for Mingw32 Cross compilation
This commit is contained in:
parent
6a6f9372ba
commit
b70d49349a
@ -96,8 +96,10 @@ This will only work on an UNIXsystem (Linux or FreeBSD).
|
|||||||
== Windows ==
|
== Windows ==
|
||||||
|
|
||||||
It is also possible to compile from linux, with this command :
|
It is also possible to compile from linux, with this command :
|
||||||
make WIN32CROSS=1
|
$ make WIN32CROSS=1
|
||||||
You will need the mingw cross-compiler, and all the librairies listed above.
|
You will need the mingw cross-compiler, and all the librairies listed above.
|
||||||
|
Variables CROSS_CC, CROSS_PKGCONFIG and CROSS_SDLCONFIG can be set :
|
||||||
|
$ CROSS_CC=mingw32-gcc CROSS_PKGCONFIG=mingw32-pkg-config CROSS_SDLCONFIG=/path/to/ming32/sdl-config WIN32CROSS=1 NOTTF=1 make
|
||||||
|
|
||||||
Here is a list of the resources used to build the Windows version:
|
Here is a list of the resources used to build the Windows version:
|
||||||
|
|
||||||
|
|||||||
17
src/Makefile
17
src/Makefile
@ -362,12 +362,19 @@ endif
|
|||||||
# These can only be used under linux and maybe freebsd. They allow to compile for the gp2x or to create a windows binary
|
# These can only be used under linux and maybe freebsd. They allow to compile for the gp2x or to create a windows binary
|
||||||
ifdef WIN32CROSS
|
ifdef WIN32CROSS
|
||||||
#cross compile a Win32 executable
|
#cross compile a Win32 executable
|
||||||
CC = i686-w64-mingw32-gcc
|
CROSS_CC ?= $(shell which i686-w64-mingw32-gcc || which mingw32-gcc)
|
||||||
|
CROSS_PKGCONFIG ?= $(shell i686-w64-mingw32-pkg-config || mingw32-pkg-config)
|
||||||
|
CROSS_SDLCONFIG ?= /usr/local/cross-tools/i386-mingw32/bin/sdl-config
|
||||||
|
CC = $(CROSS_CC)
|
||||||
BIN = ../bin/grafx2.exe
|
BIN = ../bin/grafx2.exe
|
||||||
COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags) $(TTFCOPT)
|
COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main $(shell $(CROSS_SDLCONFIG) --cflags) $(TTFCOPT)
|
||||||
LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs) -lSDL_image $(TTFLOPT)
|
LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi $(shell $(CROSS_SDLCONFIG) --libs) -lSDL_image $(TTFLOPT)
|
||||||
COPT += $(shell PKG_CONFIG_PATH=/usr/local/cross-tools/i386-mingw32/lib/pkgconfig i686-w64-mingw32-pkg-config --cflags libpng)
|
ifeq (,$(CROSS_PKGCONFIG))
|
||||||
LOPT += $(shell PKG_CONFIG_PATH=/usr/local/cross-tools/i386-mingw32/lib/pkgconfig i686-w64-mingw32-pkg-config --libs libpng)
|
COPT += -D__no_pnglib__
|
||||||
|
else
|
||||||
|
COPT += $(shell PKG_CONFIG_PATH=/usr/local/cross-tools/i386-mingw32/lib/pkgconfig $(CROSS_PKGCONFIG) --cflags libpng)
|
||||||
|
LOPT += $(shell PKG_CONFIG_PATH=/usr/local/cross-tools/i386-mingw32/lib/pkgconfig $(CROSS_PKGCONGIF) --libs libpng)
|
||||||
|
endif
|
||||||
OBJDIR = ../obj/win32
|
OBJDIR = ../obj/win32
|
||||||
PLATFORM = win32
|
PLATFORM = win32
|
||||||
PLATFORMFILES = bin/SDL.dll bin/SDL_image.dll bin/libpng14-14.dll bin/zlib1.dll $(TTFLIBS)
|
PLATFORMFILES = bin/SDL.dll bin/SDL_image.dll bin/libpng14-14.dll bin/zlib1.dll $(TTFLIBS)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user