When I was compiling and installing the headers and crt, I found out that there is major problems with how the current setup is handled. Currently the makefiles do not allow for easy installation where the program is compiled as a user, but installed as a system library. For example, When i compile the headers using sudo, the expected sequence is:
../path/to/configure --build=`gcc -dumpmachine` --host=x86_64-w64-mingw32 --prefix=/mypath
make
sudo make install
However, as it stands now, the make install will always fail because it tries to use the compiler at a point when it is not required ( due to the library already being installed)... And the current work around that is somewhat buggy is to run the following sequence of commands:
../path/to/configure --build=`gcc -dumpmachine` --host=x86_64-w64-mingw32 --prefix=/mypath
make
sudo env PATH=$PATH:/mypath/bin make install
Please show the failed command
I ran into this problem while building the cross compiler using v2.0.3 of the headers. For some reason during the install step ( where no compiling, or toolchain work should really be happening), toolchain commands are issued. Anyways, the work around should have been enough to signal that the problem is with how the makefiles are made. I would expect at the install stage that there would be no requirement to have any toolchain calls made ( like ranlib, gcc, etc)... Anyways, Here's an example of one of the errors I found:
( cd '/mypath/x86_64-w64-mingw32/lib32' && x86_64-w64-mingw32-ranlib libm.a )
/bin/sh: line 5: x86_64-w64-mingw32-ranlib: command not found
make[3]: *** [install-lib32LIBRARIES] Error 127
make[3]: Leaving directory `/home/kphillisjr/tmp/win64/mingw-w64-v2.0.3/mingw-w64-crt'
Another example:
make[2]: Entering directory `/home/kphillisjr/tmp/win64/mingw-w64-v2.0.3/mingw-w64-crt'
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -m32 -pipe -std=gnu99 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes -g -O2 -MT profile/lib32_libgmon_a-mcount.o -MD -MP -MF profile/.deps/lib32_libgmon_a-mcount.Tpo -c -o profile/lib32_libgmon_a-mcount.o `test -f 'profile/mcount.c' || echo './'`profile/mcount.c
/bin/sh: x86_64-w64-mingw32-gcc: command not found
make[2]: *** [profile/lib32_libgmon_a-mcount.o] Error 127
I am not sure why the it is calling the compiler again, it shouldn't. For the ranlib command, I think it's due to automake.
I Think the issue is how automake is handled. I did not run into this issue with gcc, and gcc prebuilds everything before hand. My guess is the current makefiles are not correctly configured.properly.