From bc6aa7e1b4893cfe80f0ceaceb3b10d8e4e3ab53 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 10 Oct 2001 01:57:43 +0000 Subject: [PATCH] * Makefile.common: Avoid adding -I options to compile if they already exist in CC or C*FLAGS. This prevents warnings from newer versions of gcc. --- winsup/ChangeLog | 6 ++++++ winsup/Makefile.common | 23 ++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/winsup/ChangeLog b/winsup/ChangeLog index caba4ed79..d950361d9 100644 --- a/winsup/ChangeLog +++ b/winsup/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 7 23:08:46 2001 Christopher Faylor + + * Makefile.common: Avoid adding -I options to compile if they already + exist in CC or C*FLAGS. This prevents warnings from newer versions of + gcc. + Tue May 15 01:09:56 2001 Christopher Faylor * Makefile.common: Change method for finding current directory. diff --git a/winsup/Makefile.common b/winsup/Makefile.common index e9774ef98..700b6f00f 100644 --- a/winsup/Makefile.common +++ b/winsup/Makefile.common @@ -54,7 +54,9 @@ endif w32api_source:=$(updir)/w32api w32api_build:=$(bupdir)/w32api -w32api_include:=$(w32api_source)/include +ifeq (,${findstring $(w32api_source),$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)}) +w32api_include:=-I$(w32api_source)/include +endif w32api_lib:=$(w32api_build)/lib newlib_source:=$(updir1)/newlib newlib_build:=$(bupdir1)/newlib @@ -64,8 +66,16 @@ mingw_build:=$(bupdir)/mingw mingw_source:=$(updir)/mingw utils_build:=$(bupdir)/utils utils_source:=$(updir)/utils +ifeq (,${findstring $(newlib_source),$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)}) +newlib_include:=-I$(newlib_source)/libc/include +newlib_sys_include:=-I$(newlib_source)/libc/sys +endif +ifeq (,${findstring $(cygwin_source)/include,$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)}) +cygwin_include:=-I$(cygwin_source)/include +endif +cygwin_include:=-I$(cygwin_source)/include -INCLUDES:=-I. -I$(cygwin_source)/include -I$(cygwin_source) -I$(newlib_source)/libc/sys/cygwin -I$(newlib_source)/libc/include -I$(w32api_include) +INCLUDES:=-I. $(cygwin_include) -I$(cygwin_source) $(newlib_sys_include) $(newlib_include) $(w32api_include) ifdef CONFIG_DIR INCLUDES+=-I$(CONFIG_DIR) endif @@ -92,11 +102,14 @@ o=.E endif libgcc:=${subst \,/,${shell $(CC_FOR_TARGET) -print-libgcc-file-name}} -GCC_INCLUDE:=${word 1,${dir $(libgcc)}}/include +gcc_libdir:=${word 1,${dir $(libgcc)}} +ifeq (,${findstring $(gcc_libdir),$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)}) +GCC_INCLUDE:=-I$(gcc_libdir)/include +endif -COMPILE_CXX:=$(CXX) $c -nostdinc++ $(ALL_CXXFLAGS) -I$(GCC_INCLUDE) \ +COMPILE_CXX:=$(CXX) $c -nostdinc++ $(ALL_CXXFLAGS) $(GCC_INCLUDE) \ -fno-rtti -fno-exceptions -COMPILE_CC:=$(CC) $c -nostdinc $(ALL_CFLAGS) -I$(GCC_INCLUDE) +COMPILE_CC:=$(CC) $c -nostdinc $(ALL_CFLAGS) $(GCC_INCLUDE) vpath %.a $(cygwin_build):$(w32api_lib):$(newlib_build)/libc:$(newlib_build)/libm