简体   繁体   中英

Cross-compiling on windows with cygwin, distcc and cmake

I want my Jenkins installation (on Windows) to utilise slave machines with distcc to reduce compile time.

I am using Cygwin on the slaves to run distcc, but I am having problems during the configuration ie "./configure" . The configuration does compiler checks but as I am cross-compiling for an embedded device using CMake to generate the build files, I assume I do not need to specify all this information to distcc.

I tried to explicity set it anyway using:

export CC=path/to/compiler

however, this results in error:

$ ./configure --prefix=/usr/local
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking for gcc... path/to/compiler.exe
checking whether the C compiler works... yes
checking for C compiler default output file name... conftest.elf
checking for suffix of executables... .elf
checking whether we are cross compiling... configure: error: in `/distcc-3.2rc1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

I believe that --build is configured correctly as I will be running distcc through Cygwin, but the values for the other variables are unclear.

Anyone had success with this kind of setup? Any other settings I am missing or has any resources for hints/tips? There doesn't seem to be howto for configuring on Windows machines.

Usually from ./configure --help you can see the option to inform the build system that you want to compile a program that will run on a different system (HOST)

System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]

See also, for Automake:

https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html

For any others who might be unfamiliar with this type of install, the compiler in this case means the compiler used to build the distcc program itself (GCC and Make).

In my case, since I will be running distcc on Cygwin on all machines, I did not need to cross compile - therefore I could simple let automake guess build/host/target option (required moving config.guess and config.sub files from automake into distcc).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM