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.
http://bugs.winehq.org/show_bug.cgi?id=35940
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source
https://bugs.winehq.org/show_bug.cgi?id=35940
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de
--- Comment #1 from André H. nerv@dawncrow.de --- Hi, isn't building the server disabled on Cygwin by our configure script?
https://bugs.winehq.org/show_bug.cgi?id=35940
--- Comment #2 from Carlo Bramini carlo.bramix@libero.it --- (In reply to André H. from comment #1)
Hi, isn't building the server disabled on Cygwin by our configure script?
Yes, it is. But in my private source tree I did bug fixes and improvements for running WINE on Windows.
https://bugs.winehq.org/show_bug.cgi?id=35940
--- Comment #3 from Carlo Bramini carlo.bramix@libero.it --- According to several sources including:
https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html
https://msdn.microsoft.com/en-us/library/36k2cdd4.aspx
I'm also able to bypass the problem by simply deleting from the generated Makefile the '-I' option that points to the source directory. Actually, the #include statement with quotes points to the directory containing the current source file, so adding that '-I' option here is not only redundant but it's even a damage because the inclusions made with quotes and the ones made with angle brackets will have the same effect.
I did some experiments, by trying to compile with "hacked" Makefile in different conditions: the server is correctly compiled, both in my CYGWIN environment and into Ubuntu 12.04. I also tried to configure and to compile the WINE server outside the source tree, no problems found.
But I have some difficulties to understand where I must do a fix for removing that option from the generated Makefile for the server, if you could give me some tips I could try to provide a patch. Thank you.
https://bugs.winehq.org/show_bug.cgi?id=35940
--- Comment #4 from André H. nerv@dawncrow.de --- (In reply to Carlo Bramini from comment #3)
But I have some difficulties to understand where I must do a fix for removing that option from the generated Makefile for the server, if you could give me some tips I could try to provide a patch. Thank you.
AFAICT it comes from output_sources() in tools/makedep.c While I'm not sure if this is the right place to fix it, it's worth a try. The other option is to rename the header file...
https://bugs.winehq.org/show_bug.cgi?id=35940
Ahmad Hobdy ahmadhobdy6@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ahmadhobdy6@gmail.com