sibojia / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

build google-glog with MinGW-w64 on Linux x86_64 #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download and install the MinGW-w64 cross-compiler on a Linux x86_64 
installation (http://mingw-w64.sourceforge.net/).
2. Setup a script to set the PATH variable according to 
https://sourceforge.net/apps/trac/mingw-w64/wiki/UsingLinuxBinaries (i.e. point 
to the cross-compiler instead of the system's native build tools).
3. Within the script from step 2, run configure --host=x86_64-w64-mingw32 and 
then run make.

What is the expected output? What do you see instead?
Build fails, because it can't find certain header files (e.g. port.h).

What version of the product are you using? On what operating system?
Using google-glog 0.3.1-1 on Linux x86_64, cross-compiling with MinGW-w64.

Please provide any additional information below.
In short, I would like to build the glog library, which I can further link to 
my project. When compiling for a Linux host, things work OK. But when 
cross-compiling for Windows-64 using MinGW-w64, glog fails to compile. Tracking 
down the issue, I've found that the code detects a WIN32 build environment and 
sets at various places certain defines (essentially produces the code to be 
consumed by MSVC++). This is contrary to what MinGW-w64 is set to do, which is 
to consume code written to be compiled on Linux (i.e. with no Windows-specific 
includes, etc), and produce a binary to be run in Windows-64.

This is related, but in one sense inverse on the issue #27 (in this case the 
user is running MinGW-w64 on a Windows machine).

Any tips would be appreciated.

Original issue reported on code.google.com by a...@maginatics.com on 24 Jun 2011 at 10:37