From fc556dfcc15304ace5275b92c95a7c9cd91a86aa Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 11 Mar 2005 17:33:12 +0000 Subject: [PATCH] Check BinUtils and GCC version. svn path=/trunk/; revision=13932 --- reactos/tools/Makefile | 7 +++++-- reactos/tools/tools-check.c | 32 ++++++++++++++++++++++++++++++++ reactos/tools/tools-check.mak | 18 ++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 reactos/tools/tools-check.c create mode 100644 reactos/tools/tools-check.mak diff --git a/reactos/tools/Makefile b/reactos/tools/Makefile index 92b921af52d..1ccc88dc8d2 100644 --- a/reactos/tools/Makefile +++ b/reactos/tools/Makefile @@ -18,12 +18,15 @@ TOOLS = \ LIBS = lib_unicode lib_wpp -CLEAN_FILES = $(TOOLS) +CLEAN_FILES = $(TOOLS) tools-check.tmp tools-check.h -all: $(TOOLS) $(LIBS) zlib_target wmc_target cabman_target cdmake_target mkhive_target rgenstat_target \ +all: $(TOOLS) tools_check $(LIBS) zlib_target wmc_target cabman_target cdmake_target mkhive_target rgenstat_target \ wine2ros_target pipetools_target winebuild_target bin2res_target wrc_target widl_target \ buildno_target +tools_check: + $(MAKE) -f tools-check.mak + regtests$(EXE_POSTFIX): regtests.c @$(HOST_CC) $(CFLAGS) -o regtests$(EXE_POSTFIX) regtests.c diff --git a/reactos/tools/tools-check.c b/reactos/tools/tools-check.c new file mode 100644 index 00000000000..8b6cf7d6a4f --- /dev/null +++ b/reactos/tools/tools-check.c @@ -0,0 +1,32 @@ +#include "tools-check.h" + +/* + * - Binutils older than 2003/10/01 have broken windres which can't handle + * icons with alpha channel. + * - Binutils between 2004/09/02 and 2004/10/08 have broken handling of + * forward exports in dlltool. + */ + +#if (BINUTILS_VERSION_DATE >= 20040902 && BINUTILS_VERSION_DATE <= 20041008) || \ + (BINUTILS_VERSION_DATE < 20031001) +#error Due to technical reasons your binutils version can't be used to \ + build ReactOS. Please consider upgrading to newer version. See \ + www.mingw.org for details.) +#endif + +/* + * GCC 3.3.1 is lowest allowed version. Older versions have various problems + * with C++ code. + */ + +#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) || \ + (__GNUC__ < 3) +#error Due to technical reasons your GCC version can't be used to \ + build ReactOS. Please consider upgrading to newer version. See \ + www.mingw.org for details.) +#endif + +/* + * FIXME: GCC 3.4.1 has broken headers which cause Explorer to not build. + * We should warn in this case...maybe add check for the broken headers? + */ diff --git a/reactos/tools/tools-check.mak b/reactos/tools/tools-check.mak new file mode 100644 index 00000000000..07e05434b72 --- /dev/null +++ b/reactos/tools/tools-check.mak @@ -0,0 +1,18 @@ +PATH_TO_TOP = .. +include $(PATH_TO_TOP)/rules.mak + +# +# Get the binutils version +# +# The "ld -v" output can be in either of these two formats: +# "GNU ld version 050113 20050113" (nightly build) +# "GNU ld version 2.15.94 20050118" (official release) +# + +BINUTILS_VERSION_DATE=$(word 5,$(shell $(PREFIX)ld -v)) + +all: + @echo #define BINUTILS_VERSION_DATE $(BINUTILS_VERSION_DATE) > tools-check.h + $(HOST_CC) -c tools-check.c -o tools-check.temp + $(RM) tools-check.temp + $(RM) tools-check.h