* Makefile.in: Reorganize to try to allow lack of mingw/w32api to work.

This commit is contained in:
Christopher Faylor 2003-04-19 01:02:51 +00:00
parent 8997bae831
commit b128dd21af
2 changed files with 27 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2003-04-18 Christopher Faylor <cgf@redhat.com>
* Makefile.in: Reorganize to try to allow lack of mingw/w32api to work.
2003-04-11 Christopher Faylor <cgf@redhat.com>
* Makefile.common (w32api_lib): Fix w32api detection.

View File

@ -58,9 +58,6 @@ bz2lib_source:=$(updir)/bz2lib
bz2lib_build:=$(bupdir)/bz2lib
w32api_source:=$(updir)/w32api
w32api_build:=$(bupdir)/w32api
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
@ -83,12 +80,34 @@ ifeq (,${findstring $(cygwin_source)/include,$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)}
cygwin_include:=-I$(cygwin_source)/include
endif
# Try to determine what directories are available in winsup.
# Attempt to properly detect missing mingw or w32api and adjust command
# line parameters appropriately
nostdinc:=${shell [ -d "$(updir)/w32api" ] && echo "-nostdinc -nostdinc++"}
ifneq (,$(nostdinc))
ifeq (,${findstring $(w32api_source),$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)})
w32api_include:=-I$(w32api_source)/include
endif
endif
mingw_include:=${shell [ -d "$(mingw_source)/include" ] && echo "-I$(mingw_source)/include"}
ifneq (,$(mingw_include))
nostdlib:=-nostdlib
else
nostdlib:=
endif
ifeq (,${nostdlib})
nostdinc:=
endif
INCLUDES:=-I. $(cygwin_include) -I$(cygwin_source) $(newlib_sys_include) $(newlib_include) $(newlib_sys_include_include) $(w32api_include)
ifdef CONFIG_DIR
INCLUDES+=-I$(CONFIG_DIR)
endif
MINGW_INCLUDES:=-I$(updir)/mingw/include $(w32api_include)
MINGW_INCLUDES:=${mingw_include} $(w32api_include)
MINGW_CFLAGS:=-mno-cygwin $(MINGW_INCLUDES)
MINGW_CXXFLAGS:=${filter-out $(newlib_source)/%,$(CXXFLAGS)} -mno-cygwin $(MINGW_INCLUDES)
MINGW_LDFLAGS:=-B${mingw_build} -B${mingw_build}/mingwex
@ -118,11 +137,6 @@ ifeq (,${findstring $(gcc_libdir),$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)})
GCC_INCLUDE:=${subst //,/,-I$(gcc_libdir)/include}
endif
nostdinc:=${shell [ -d "$(updir)/w32api" ] && echo "-nostdinc -nostdinc++"}
ifeq (,$(nostdinc))
override w32api_lib:=${subst //,/,${shell $(CC) -print-search-dirs | awk -F: '/^librar/{for (i = 1; i <= NF; i++) if ($$i ~ /\/lib\/*$$/) foo=$$i} END{print foo}'}/w32api}
endif
COMPILE_CXX=$(CXX) $c $(nostdinc) $(ALL_CXXFLAGS) $(GCC_INCLUDE) \
-fno-rtti -fno-exceptions
COMPILE_CC=$(CC) $c $(nostdinc) $(ALL_CFLAGS) $(GCC_INCLUDE)