http://bugs.winehq.org/show_bug.cgi?id=35940
Bug ID: 35940 Summary: Server (and perhaps others) may fail to build on some platforms Product: Wine Version: unspecified Hardware: x86 OS: Windows Status: UNCONFIRMED Severity: normal Priority: P2 Component: build-env Assignee: wine-bugs@winehq.org Reporter: carlo.bramix@libero.it
In my opinion there is a severe mistake in the build system for the server.
From the man page of GCC, the documentation for '-I' option says:
`-I DIR' Add the directory DIR to the list of directories to be searched for header files. Directories named by `-I' are searched before the standard system include directories. If the directory DIR is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated .
When building the server, a '-I' option is placed on the command line, pointing to the source directory of the server.
The file wine/port.h provides this piece of code:
[...cut...] #ifdef HAVE_PROCESS_H # include <process.h> #endif [...cut...]
The problem comes out because, inside the directory with the sources of the server, there is a file named process.h and since the -I option allows to take the files before the standard system include directories, the wine/port.h won't include the system file, but the one in the server directory: infact, it happens that the local process.h file is included two times.
This is the cause for the server not compiled correctly on my platform (cygwin) but probably it can be also applied to others.
I did an experiment and I have bypassed the problem by changing the generated Makefile: I replaced the '-I' option that pointed to the source directory of the server with '-idirafter'. The final result is a server that installs and runs correctly on Windows.
Actually, this defect caused a failure on the server, but probably it may apply to all components of WINE with some local include files: the option that allows to point to the source directory of the component being compiled (and only this one) should be changed with '-idirafter' or something similar, depending on the compiler used, while all other paths could be left to '-I' without troubles.