Dulguun Otgon
Dulguun Otgon

Reputation: 1949

Compile for windows using mingw-w64 and autotools

I've this project called librsync. Installed ubuntu package called mingw-w64. Looked at automake manpage.

What I want to do is to build executable that runs on windows or dll, whichever I could get working.

./configure --host "what do i put here?"

By looking at ubuntu packages I can't figure it out. From automake manpage - If I had mingw32 it should be i586-mingw32msvc. But how do I figure that out on my own in the first place? At least, what should I put in hosts param if I have mingw-w64?

Upvotes: 2

Views: 4325

Answers (1)

user539810
user539810

Reputation:

For building something with a cross compiler, you will use configuration-gcc as the C compiler with configuration being what you would pass to --host to build a library or executable.

ls /usr/bin/*mingw*gcc should give you the C compiler to use, allowing you to know what the configuration is.

  • MinGW (aka mingw32): iX86-pc-mingw32 or iX86-mingw32msvc (X is a 4, 5, or 6 depending on how it was configured)
  • mingw-w64: ARCH-w64-mingw32 (ARCH is one of i686 or x86_64)

I've honestly not seen anything else for mingw-w64, except in its earlier days when it used ARCH-pc-mingw64, but that shouldn't be used anymore.

Upvotes: 5

Related Questions