Ticket #7934: mingw.patch

File mingw.patch, 2.2 KB (added by Kirben, 23 years ago)

mingw support

  • Makefile.mingw

    diff -burN scummvm/Makefile.mingw nscummvm/Makefile.mingw
    old new  
     1# Where is scummvm will be installed
     2SCUMMVMPATH=C:/scummvm
     3SRC=.
     4
     5### Modify these paths
     6SDL_CFLAGS=-I$(SRC)/sdl/include
     7SDL_LIBS=-L$(SRC)/sdl/lib -lSDLmain -lSDL
     8
     9CC      = gcc
     10CFLAGS  = -g -Wno-multichar
     11DEFINES = -DUSE_ADLIB
     12LDFLAGS :=
     13INCLUDES:= $(SDL_CFLAGS) -I./ -I./sound
     14CPPFLAGS= $(DEFINES) $(INCLUDES)
     15LIBS    = -lmingw32 $(SDL_LIBS) -mwindows -mconsole
     16
     17EXEC=scummvm.exe
     18
     19INCS    = scumm.h scummsys.h stdafx.h
     20
     21OBJS    = actor.o boxes.o costume.o gfx.o object.o resource.o \
     22        saveload.o script.o scummvm.o sound.o string.o \
     23        sys.o verbs.o sdl.o script_v1.o script_v2.o debug.o gui.o \
     24        sound/imuse.o sound/fmopl.o sound/adlib.o sound/gmidi.o debugrl.o \
     25        akos.o
     26
     27.cpp.o:
     28        $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
     29
     30all: $(EXEC)
     31
     32$(EXEC): $(OBJS)
     33        $(CC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS)
     34
     35clean:
     36        rm -f $(OBJS) $(EXEC)
     37
     38install:   $(EXEC)
     39        mkdir -p $(SCUMMVMPATH)
     40        strip scummvm.exe -o $(SCUMMVMPATH)/scummvm.exe
     41        cp copying.txt $(SCUMMVMPATH)/copying.txt
     42        cp readme.txt $(SCUMMVMPATH)/readme.txt
     43        cp whatsnew.txt $(SCUMMVMPATH)/whatsnew.txt
     44        cp SDL/README-SDL.txt $(SCUMMVMPATH)/README-SDL.txt
     45        cp SDL/lib/SDL.dll $(SCUMMVMPATH)/SDL.dll
  • scummsys.h

    diff -burN scummvm/scummsys.h nscummvm/scummsys.h
    old new  
    7474#define START_PACK_STRUCTS pack (push,1)
    7575#define END_PACK_STRUCTS   pack(pop)
    7676
     77#elif defined(__MINGW32__)
     78
     79#define scumm_stricmp stricmp
     80#define CHECK_HEAP
     81#define SCUMM_LITTLE_ENDIAN
     82
     83#define FORCEINLINE inline
     84#define NORETURN __attribute__((__noreturn__))
     85#define GCC_PACK __attribute__((packed))
     86#define _HEAPOK 0
     87
     88typedef unsigned char byte;
     89typedef unsigned char uint8;
     90typedef unsigned short uint16;
     91typedef unsigned long uint32;
     92typedef unsigned int uint;
     93typedef signed char int8;
     94typedef signed short int16;
     95typedef signed long int32;
     96
     97#define START_PACK_STRUCTS pack (push,1)
     98#define END_PACK_STRUCTS   pack(pop)
     99
    77100#elif (defined(UNIX) || defined(__APPLE__))
    78101
    79102#define scumm_stricmp strcasecmp