This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] corrects search order of directories for include files for gcc 3.2


I observed that with Cygwin's gcc 3.2, /usr/include/w32api is searched before /usr/include, even when gcc is called without -mwin32 nor -mno-cygwin. If somes files exist with the same name in both /usr/include/w32api and /usr/include, such as mapi.h or the files in the GL subdirectory, the later are never used. IMO, this is wrong.

With Cygwin's gcc-2, /usr/include is searched before /usr/include/w32api when gcc-2 is called without -mwin32 nor -mno-cygwin.

I need this issue to be settled before I can prepare an updated version of the OpenGL package.

Here's a patch that sets the search order to:

gcc -mno-cygwin :
 /usr/i686-pc-mingw32/lib/../../include/w32api
 /usr/lib/gcc-lib/i686-pc-cygwin/3.2/include
 /usr/include/mingw

gcc -mwin32 :
 /usr/i686-pc-mingw32/lib/../../include/w32api
 /usr/lib/gcc-lib/i686-pc-cygwin/3.2/include
 /usr/include

"plain" gcc or gcc -mcygwin
 /usr/lib/gcc-lib/i686-pc-cygwin/3.2/include
 /usr/include
 /usr/i686-pc-cygwin/lib/../../include/w32api

I tested the patch by modifying the specs file by hand.

The patch is for /usr/src/gcc-3.2-3/gcc/config/i386/cygwin.h
----------------------------------------------------------------
diff -pu cygwin.h.orig cygwin.h
--- cygwin.h.orig 2003-03-04 15:08:38.000000000 -0500
+++ cygwin.h 2003-03-04 15:34:54.000000000 -0500
@@ -44,7 +44,8 @@ Boston, MA 02111-1307, USA. */
%{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{!ansi:%{mthreads:-D_MT}}}\
%{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix}\
%{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}}\


- %{!nostdinc:%{!mno-win32|mno-cygwin:-isystem ../include/w32api%s -isystem ../../include/w32api%s}}\
+ %{!nostdinc:%{mwin32|mno-cygwin:-isystem ../../include/w32api%s}}\
+ %{!nostdinc:%{!mwin32:%{!mno-cygwin:-idirafter ../../include/w32api%s}}}\
"
----------------------------------------------------------------




André Bleau, Cygwin's OpenGL package maintainer.

email: bleau at igb dot umontreal dot ca
(Fight SPAM: encode your email-address)

Please address all questions and problem reports about Cygwin's OpenGL package to cygwin at cygwin dot com .


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]