Configure options for building MinGW-64 on linux-64 for linux-64 (ultimately targetting windows-64)

后端 未结 1 974
甜味超标
甜味超标 2021-01-12 23:48

I want to build MinGW-w64 where:

A: I want to compile MinGW itself on Linux (64-bit).
B: I want the MinGW tools (compiler, etc) to run on Linux (64-bit).
C:

相关标签:
1条回答
  • 2021-01-13 00:00

    Old question, but an answer might be helpful to those coming from google.

    The host and build flags are a bit misleading. The info from the help page at mingw-w64-crt/configure --help shows:

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

    So we want to leave --build alone, and specify the windows system we wish to cross-compile for with --host.

    So, the way to build for 64bit windows, and include both 32bit and 64bit libraries and std::experimental features is with:

    ./configure --enable-lib32 --enable-lib64 --enable-experimental --host=x86_64-w64-mingw32
    

    It's very similar if you want to build for 32bit windows, but of course you can't enable 64bit mode:

    ./configure --enable-lib32 --enable-experimental --host=i686-w64-mingw32
    
    0 讨论(0)
提交回复
热议问题