diff options
author | Christopher Faylor <me@cgf.cx> | 2003-04-19 01:02:51 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-04-19 01:02:51 +0000 |
commit | b128dd21af09a966adf260f2465edefa618fdcfd (patch) | |
tree | b99b3c927318439e7f7370b86130d5020752cc3a /winsup | |
parent | 8997bae831cc15231a71b173061f5a587675399e (diff) | |
download | newlib-b128dd21af09a966adf260f2465edefa618fdcfd.zip newlib-b128dd21af09a966adf260f2465edefa618fdcfd.tar.gz newlib-b128dd21af09a966adf260f2465edefa618fdcfd.tar.bz2 |
* Makefile.in: Reorganize to try to allow lack of mingw/w32api to work.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/Makefile.common | 32 |
2 files changed, 27 insertions, 9 deletions
diff --git a/winsup/ChangeLog b/winsup/ChangeLog index d755a26..6cd29fe 100644 --- a/winsup/ChangeLog +++ b/winsup/ChangeLog @@ -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. diff --git a/winsup/Makefile.common b/winsup/Makefile.common index dcac394..97812f9 100644 --- a/winsup/Makefile.common +++ b/winsup/Makefile.common @@ -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) |