配置用于在Linux-64上为Linux-64构建MinGW-64的选项(最终针对Windows-64) [英] Configure options for building MinGW-64 on linux-64 for linux-64 (ultimately targetting windows-64)
问题描述
我要在以下位置构建MinGW-w64:
I want to build MinGW-w64 where:
A:我想在Linux(64位)上编译MinGW本身.
B:我希望MinGW工具(编译器等)在Linux(64位)上运行.
C:我希望MinGW工具(编译器等)产生可在Windows 64位(Win7和Win8)上运行的代码.
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: I want the MinGW tools (compiler, etc) to produce code that runs on Windows 64-bit (Win7 & Win8).
在配置阶段遇到麻烦.我已经在Google上搜索了一下,但无法找到配置时需要传递的选项.
I'm having trouble at the configure stage. I've googled around a bit but I can't find out what options I need to pass to configure.
我从( https ://svn.code.sf.net/p/mingw-w64/code/trunk/). (AFAICT,这是当前的正式回购.)
I have downloaded the source for MinGW-w64 SVN from (https://svn.code.sf.net/p/mingw-w64/code/trunk/). (AFAICT this is the current official repo).
源提供了文本帮助(mingw-w64-doc/howto-build/mingw-w64-howto-build.txt).但是,这主要适用于那些希望在Windows上运行MinGW工具的人.
(针对非multilib w64目标的)示例选项为:
The source has a text help (mingw-w64-doc/howto-build/mingw-w64-howto-build.txt). However, this is primarily intended for those wanting to run MinGW tools on Windows.
The example options (for a non-multilib w64 target) are:
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multilib
但是我想我希望host选项引用linux(对吗?).我尝试过
But I think I want the host option to refer to linux (right?). I've tried
--host=x86_64-linux-gnu
和
--host=x86_64-pc-linux-gnu
,但是没有运气.
我收到错误:
configure: error: Please check if the mingw-w64 header set and the build/host option are set properly.
configure: error: ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt/configure failed for mingw-w64-crt
完整日志为
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/build-aux/missing: Unknown `--is-lightweight' option
Try `/make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/build-aux/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for x86_64-linux-gnu-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether to build the headers... yes
checking whether to build the crt... yes
checking whether to build the optional libraries... no
checking whether to build the optional tools... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
=== configuring in mingw-w64-headers (/make/tool/MinGW/build/v6615-2014-05-07/mingw-w64-headers)
configure: running /bin/bash ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers/configure --disable-option-checking '--prefix=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32' '--target=x86_64-w64-mingw32' '--host=x86_64-linux-gnu' '--disable-multilib' '--with-sysroot=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32' 'host_alias=x86_64-linux-gnu' 'target_alias=x86_64-w64-mingw32' --cache-file=/dev/null --srcdir=../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers/build-aux/missing: Unknown `--is-lightweight' option
Try `/make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers/build-aux/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for x86_64-linux-gnu-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking whether to rebuild headers with widl... no
checking whether to build a w32api package for Cygwin... no
checking for c-runtime headers... yes
checking for optional sdk headers... ddk,directx
checking if installing idl files is enabled... no
checking whether to enable the secure API... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating crt/_mingw.h
config.status: creating config.h
config.status: config.h is unchanged
=== configuring in mingw-w64-crt (/make/tool/MinGW/build/v6615-2014-05-07/mingw-w64-crt)
configure: running /bin/bash ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt/configure --disable-option-checking '--prefix=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32' '--target=x86_64-w64-mingw32' '--host=x86_64-linux-gnu' '--disable-multilib' '--with-sysroot=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32' 'host_alias=x86_64-linux-gnu' 'target_alias=x86_64-w64-mingw32' --cache-file=/dev/null --srcdir=../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-linux-gnu-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for sysroot... /make/tool/MinGW/use/v6615/x86_64-w64-mingw32
checking for a sed that does not truncate output... /bin/sed
checking for gawk... (cached) gawk
checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-linux-gnu-gcc accepts -g... yes
checking for x86_64-linux-gnu-gcc option to accept ISO C89... none needed
checking whether x86_64-linux-gnu-gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of x86_64-linux-gnu-gcc... gcc3
checking for x86_64-linux-gnu-g++... x86_64-linux-gnu-g++
checking whether we are using the GNU C++ compiler... yes
checking whether x86_64-linux-gnu-g++ accepts -g... yes
checking dependency style of x86_64-linux-gnu-g++... gcc3
checking how to run the C preprocessor... x86_64-linux-gnu-gcc -E
checking for x86_64-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for x86_64-linux-gnu-dlltool... no
checking for dlltool... no
checking for x86_64-linux-gnu-ar... no
checking for x86_64-linux-gnu-lib... no
checking for x86_64-linux-gnu-link... no
checking for ar... ar
checking the archiver (ar) interface... ar
checking dependency style of x86_64-linux-gnu-gcc... gcc3
checking for x86_64-linux-gnu-as... no
checking for as... as
checking whether to build a w32api package for Cygwin... no
checking whether to build the Win32 libraries... no
checking whether to build the Win64 libraries... yes
checking whether to build the WinCE libraries... no
checking whether to enable globbing... no
checking whether to enable private exports... no
checking whether to enable delay import libs... no
checking whether to enable experimental features... no
checking whether the compiler supports -municode... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking _mingw_mac.h usability... no
checking _mingw_mac.h presence... no
checking for _mingw_mac.h... no
configure: error: Please check if the mingw-w64 header set and the build/host option are set properly.
configure: error: ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt/configure failed for mingw-w64-crt
注意:我可以成功编译本机GCC&来自源的叮当声.
NOTE: I can successfully compile native GCC & Clang from source.
目的:
我的最终目标是使用最新的Clang为Windows 7/8 64位(包括D3D11和OpenGL)生成C ++ 14代码.
我要构建中继MinGW,因为最新的Clang生成了默认MinGW无法组装的组装代码(主要是行末垃圾"错误).
从2014年5月7日(今天)开始,只有Clang提供完整的C ++ 14支持,而我正在使用仅在Clang中可用的功能(例如:变量模板).
但是,Clang依赖于GCC/MinGW进行组装和链接.
Purpose:
My ultimate goal is to use the latest Clang to produce C++14 code for Windows 7/8 64-bit (including D3D11 & OpenGL).
I want to build trunk MinGW because the latest Clang produces assembly code that the default MinGW cannot assemble (mainly "junk at end of line" errors).
As of 2014-05-07 (today), only Clang offers full C++14 support, and I am making use of features only available in Clang (eg: variable templates).
Yet, Clang relies on GCC / MinGW for assembling and linking.
信息: 操作系统:Linux Mint 16 64位(XFCE).
Info: OS: Linux Mint 16 64-bit (XFCE).
感谢所有帮助.
推荐答案
旧问题,但答案可能对来自Google的人有所帮助.
Old question, but an answer might be helpful to those coming from google.
主机和构建标志有点误导.帮助页面mingw-w64-crt/configure --help
上的信息显示:
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]
因此,我们希望保留--build
并指定要与--host
交叉编译的Windows系统.
So we want to leave --build
alone, and specify the windows system we wish to cross-compile for with --host
.
因此,为64位Windows构建并包括32位和64位库以及std :: experimental功能的方法是:
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
如果要针对32位Windows进行构建,这非常相似,但是您当然不能启用64位模式:
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
这篇关于配置用于在Linux-64上为Linux-64构建MinGW-64的选项(最终针对Windows-64)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!