This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
-nostdinc on Cygwin
- To: gcc-patches at gcc dot gnu dot org
- Subject: -nostdinc on Cygwin
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Mon, 25 Jun 2001 20:02:26 +1000
In gcc 2.95 on Cygwin, the `-nostdinc' option doesn't work properly.
Even with `-nostdinc', the search path still contains /usr/include and
other system include directories. Looking at the source code, it appears
that this bug is still present in gcc 3.0 and in the cvs mainline.
Here is a patch which I hope will fix the problem,
by wrapping all the specs entries which add directories
to the search path inside "%{!nostdinc:" ... "}".
Unfortunately this patch is *completely untested*.
--- cygwin.h.old Mon Jun 25 19:49:00 2001
+++ cygwin.h.new Mon Jun 25 19:53:25 2001
@@ -103,12 +103,12 @@
-D__declspec(x)=__attribute__((x)) \
-D__i386__ -D__i386 \
%{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
- %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\
- MINGW_INCLUDES "} \
- %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix "\
- CYGWIN_INCLUDES "}\
+ %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} \
+ ${!nostdinc:" MINGW_INCLUDES "}} \
+ %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix \
+ %{!nostdinc:" CYGWIN_INCLUDES "}} \
%{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT}\
- %{!mno-win32:" W32API_INC "}\
+ %{!mno-win32:%{!nostdinc:" W32API_INC "}} \
"
#undef STARTFILE_SPEC
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.