From 95180e18e6fa6fab68af891373164cea8a27a505 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 10 Feb 2008 01:21:45 +0000 Subject: [PATCH] - Modified FLAC/share/alloc.h to define SIZE_T_MAX if it isn't defined already. For some reason, a stock install of MinGW doesn't define it, but if you compile your own GCC, it installs headers that do. - Changed the way that the makefiles detect MSYS to a method that should be more foolproof, thanks to changes in MSYS. SVN r737 (trunk) --- FLAC/Makefile.mgw | 2 +- FLAC/share/alloc.h | 16 +++++---- Makefile | 2 +- Makefile.mgw | 2 +- Makefile.mingw | 5 ++- docs/rh-log.txt | 15 +++++++-- jpeg-6b/Makefile.mgw | 2 +- tools/dehsupp/Makefile | 16 ++++----- tools/fixrtext/Makefile | 2 +- tools/lemon/Makefile | 16 ++++----- tools/makewad/Makefile | 16 ++++----- tools/makewad/makewad.c | 2 +- tools/re2c/Makefile | 2 +- tools/updaterevision/Makefile | 6 ++-- tools/updaterevision/trustinfo.rc | 6 ++++ tools/xlatcc/Makefile | 2 +- wadsrc/Makefile.mgw | 55 ++++++++++++++++--------------- zlib/Makefile.mgw | 2 +- 18 files changed, 97 insertions(+), 72 deletions(-) create mode 100644 tools/updaterevision/trustinfo.rc diff --git a/FLAC/Makefile.mgw b/FLAC/Makefile.mgw index fe70e1f74..d1a8bc3b4 100644 --- a/FLAC/Makefile.mgw +++ b/FLAC/Makefile.mgw @@ -11,7 +11,7 @@ ifeq (Windows_NT,$(OS)) WIN=1 WINCMD=1 endif -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) WIN=1 WINCMD=0 endif diff --git a/FLAC/share/alloc.h b/FLAC/share/alloc.h index 812aa69d0..73ac0d246 100644 --- a/FLAC/share/alloc.h +++ b/FLAC/share/alloc.h @@ -33,14 +33,16 @@ #endif #include /* for size_t, malloc(), etc */ -#ifndef SIZE_MAX -# ifndef SIZE_T_MAX -# ifdef _MSC_VER -# define SIZE_T_MAX UINT_MAX -# else -# error -# endif +#ifndef SIZE_T_MAX +# ifdef _WIN64 +# define SIZE_T_MAX ULLONG_MAX +# elif defined(_WIN32) +# define SIZE_T_MAX UINT_MAX /* Why doesn't the standard MinGW distribution define this? */ +# else +# error # endif +#endif +#ifndef SIZE_MAX # define SIZE_MAX SIZE_T_MAX #endif diff --git a/Makefile b/Makefile index c9d7daeec..7eb7e8855 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ ifeq (Windows_NT,$(OS)) WIN=1 endif -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) WIN=1 endif diff --git a/Makefile.mgw b/Makefile.mgw index 4edb0dab5..9e890aa8e 100644 --- a/Makefile.mgw +++ b/Makefile.mgw @@ -45,7 +45,7 @@ clean: @$(MAKE) -C zlib -f Makefile.mgw clean @$(MAKE) -C flac -f Makefile.mgw clean @$(MAKE) -C jpeg-6b -f Makefile.mgw clean -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) rm -f ccdv.exe else del /q /f ccdv.exe 2>nul diff --git a/Makefile.mingw b/Makefile.mingw index dd20aea9c..8ea1c471b 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -1,10 +1,13 @@ +# This makefile makes zdoom(d).exe only. +# Makefile.mgw builds this plus everything else. + # Sub-makefile autogenerated by premake # And then tweaked by hand # Where did you install the FMOD API to? Change this line so that the build process can find it. FMODDIR = "c:/program files/fmodapi375win" -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) WINCMD=0 else WINCMD=1 diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 08848d739..b12a3a8da 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,12 +1,23 @@ +February 9, 2008 +- Modified FLAC/share/alloc.h to define SIZE_T_MAX if it isn't defined + already. For some reason, a stock install of MinGW doesn't define it, but + if you compile your own GCC, it installs headers that do. +- After thoroughly messing up my MinGW/MSYS installation, I deleted the whole + thing and reinstalled everything using the latest zips. Much to my surprise, + the MSYS-detection in the makefiles no longer worked because OSTYPE wasn't + being exported to process launched by the MSYS shell. I've now switched to a + different method I found through the power of Google that asks the shell + what version it is to see if the version string contains "msys". + February 8, 2008 - Applied Blzut3's sbarinfo update #11: * SBarInfo will also accept a '|' between flags for those who are really bothered by the indefinite "arguments" in the middle of the statement. - * Added: completeBorder. When set to true SBarInfo will draw the border where + * Added: completeBorder. When set to true SBarInfo will draw the border where the status bar normally goes. * Fixed: I forgot to accept TK_None on "base" and "statusbar". * Fixed: "base" was apparently broken when the SBarInfo init code was moved to - d_main.cpp. Also, if "base Strife" was used then it would not use the + d_main.cpp. Also, if "base Strife" was used then it would not use the default log message of "find help". - Fixed: D_ReadUserInfoString() parsed the final element of a compact string as the empty string. Since that was the player class, this meant that any diff --git a/jpeg-6b/Makefile.mgw b/jpeg-6b/Makefile.mgw index 33efb274e..64b33c6f7 100644 --- a/jpeg-6b/Makefile.mgw +++ b/jpeg-6b/Makefile.mgw @@ -33,7 +33,7 @@ $(STATICLIB): $(OBJS) .PHONY: clean clean: -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) rm -f $(STATICLIB) rm -f *.o else diff --git a/tools/dehsupp/Makefile b/tools/dehsupp/Makefile index fceb14e25..2502093ce 100644 --- a/tools/dehsupp/Makefile +++ b/tools/dehsupp/Makefile @@ -1,11 +1,11 @@ -ifeq (Windows_NT,$(OS)) - WIN=1 - WINCMD=1 -endif -ifeq (msys,$(OSTYPE)) - WIN=1 - WINCMD=0 -endif +ifeq (Windows_NT,$(OS)) + WIN=1 + WINCMD=1 +endif +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) + WIN=1 + WINCMD=0 +endif ifeq (1,$(WIN)) EXE = dehsupp.exe diff --git a/tools/fixrtext/Makefile b/tools/fixrtext/Makefile index 83e166d92..420aad243 100644 --- a/tools/fixrtext/Makefile +++ b/tools/fixrtext/Makefile @@ -2,7 +2,7 @@ ifeq (Windows_NT,$(OS)) WIN=1 WINCMD=1 endif -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) WIN=1 WINCMD=0 endif diff --git a/tools/lemon/Makefile b/tools/lemon/Makefile index 887094329..c9d4774ac 100644 --- a/tools/lemon/Makefile +++ b/tools/lemon/Makefile @@ -1,11 +1,11 @@ -ifeq (Windows_NT,$(OS)) - WIN=1 - WINCMD=1 -endif -ifeq (msys,$(OSTYPE)) - WIN=1 - WINCMD=0 -endif +ifeq (Windows_NT,$(OS)) + WIN=1 + WINCMD=1 +endif +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) + WIN=1 + WINCMD=0 +endif ifeq (1,$(WIN)) EXE = lemon.exe diff --git a/tools/makewad/Makefile b/tools/makewad/Makefile index 380e992bc..b81fdeede 100644 --- a/tools/makewad/Makefile +++ b/tools/makewad/Makefile @@ -1,11 +1,11 @@ -ifeq (Windows_NT,$(OS)) - WIN=1 - WINCMD=1 -endif -ifeq (msys,$(OSTYPE)) - WIN=1 - WINCMD=0 -endif +ifeq (Windows_NT,$(OS)) + WIN=1 + WINCMD=1 +endif +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) + WIN=1 + WINCMD=0 +endif ifeq (1,$(WIN)) EXE = makewad.exe diff --git a/tools/makewad/makewad.c b/tools/makewad/makewad.c index 0cc1e1f8b..9c9b9edc5 100644 --- a/tools/makewad/makewad.c +++ b/tools/makewad/makewad.c @@ -323,7 +323,7 @@ int buildwad (FILE *listfile, char *listfilename, const char *makecmd, char *mak { fprintf (wadfile, " \\\n\t\"%s\"", filename); } - // ARGH! Stupid make. Too bad but then these files can't be checked. + // ARGH! Stupid make. Too bad, but then these files can't be checked. // Still better than something that doesn't work at all though! else if (!strpbrk(filename, "[]^")) { diff --git a/tools/re2c/Makefile b/tools/re2c/Makefile index f465951c5..05e7601cb 100644 --- a/tools/re2c/Makefile +++ b/tools/re2c/Makefile @@ -2,7 +2,7 @@ ifeq (Windows_NT,$(OS)) WIN=1 WINCMD=1 endif -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) WIN=1 WINCMD=0 endif diff --git a/tools/updaterevision/Makefile b/tools/updaterevision/Makefile index aa7a6086f..20f09049f 100644 --- a/tools/updaterevision/Makefile +++ b/tools/updaterevision/Makefile @@ -2,7 +2,7 @@ ifeq (Windows_NT,$(OS)) WIN=1 WINCMD=1 endif -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) WIN=1 WINCMD=0 endif @@ -27,8 +27,8 @@ all: $(EXE) $(EXE): $(OBJS) $(CCDV) $(CC) -o $(EXE) $(OBJS) $(CFLAGS) $(LDFLAGS) -%.o : %.rc - $(CCDV) windres -o $@ -i $< +%.o : %.rc + $(CCDV) windres -o $@ -i $< .PHONY: clean diff --git a/tools/updaterevision/trustinfo.rc b/tools/updaterevision/trustinfo.rc new file mode 100644 index 000000000..cda3092cb --- /dev/null +++ b/tools/updaterevision/trustinfo.rc @@ -0,0 +1,6 @@ +// This resource script is for compiling with MinGW only. Visual C++ +// compilations use the manifest tool to insert the manifest instead. + +#include + +1 RT_MANIFEST "trustinfo.txt" diff --git a/tools/xlatcc/Makefile b/tools/xlatcc/Makefile index 9f87a2807..4d1540018 100644 --- a/tools/xlatcc/Makefile +++ b/tools/xlatcc/Makefile @@ -2,7 +2,7 @@ ifeq (Windows_NT,$(OS)) WIN=1 WINCMD=1 endif -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) WIN=1 WINCMD=0 endif diff --git a/wadsrc/Makefile.mgw b/wadsrc/Makefile.mgw index 14406f9f0..5557ebb5b 100644 --- a/wadsrc/Makefile.mgw +++ b/wadsrc/Makefile.mgw @@ -1,26 +1,29 @@ -MAKEWAD=../tools/makewad/makewad -XLATCC=../tools/xlatcc/xlatcc -DEHSUPP=../tools/dehsupp/dehsupp - -ifneq ($(MAKECMDGOALS),clean) -include Makefile2 -endif - -wadmake: zdoom.lst $(MAKEWAD).exe $(XLATCC).exe $(DEHSUPP).exe - $(MAKEWAD) -make wadmake zdoom.lst - -clean: -ifeq (msys,$(OSTYPE)) - rm -f wadmake zdoom.pk3 xlat/*.x dehsupp.lmp -else - del /q /f wadmake zdoom.pk3 xlat\*.x dehsupp.lmp 2>nul -endif - -../tools/makewad/makewad.exe: - $(MAKE) -C ../tools/makewad -f Makefile - -../tools/xlatcc/xlatcc.exe: - $(MAKE) -C ../tools/xlatcc -f Makefile - -../tools/dehsupp/dehsupp.exe: - $(MAKE) -C ../tools/dehsupp -f Makefile +MAKEWAD=../tools/makewad/makewad +XLATCC=../tools/xlatcc/xlatcc +DEHSUPP=../tools/dehsupp/dehsupp + +ifneq ($(MAKECMDGOALS),clean) +include Makefile2 +endif +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) +export OSTYPE=msys +endif + +wadmake: zdoom.lst $(MAKEWAD).exe $(XLATCC).exe $(DEHSUPP).exe + $(MAKEWAD) -make wadmake zdoom.lst + +clean: +ifeq ($(OSTYPE),msys) + rm -f wadmake zdoom.pk3 xlat/*.x dehsupp.lmp +else + del /q /f wadmake zdoom.pk3 xlat\*.x dehsupp.lmp 2>nul +endif + +../tools/makewad/makewad.exe: + $(MAKE) -C ../tools/makewad -f Makefile + +../tools/xlatcc/xlatcc.exe: + $(MAKE) -C ../tools/xlatcc -f Makefile + +../tools/dehsupp/dehsupp.exe: + $(MAKE) -C ../tools/dehsupp -f Makefile diff --git a/zlib/Makefile.mgw b/zlib/Makefile.mgw index 8895d8e5c..d1e6d3669 100644 --- a/zlib/Makefile.mgw +++ b/zlib/Makefile.mgw @@ -63,7 +63,7 @@ minigzip: minigzip.o $(STATICLIB) .PHONY: clean clean: -ifeq (msys,$(OSTYPE)) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) rm -f $(STATICLIB) rm -f *.o rm -f *.exe