使用 Cygwin 作为 MinGW 的 shell
我安装了 Cygwin 和 MinGW (TDM)。要从源代码构建某些项目,您必须运行 ./configure 脚本,这需要 bash shell 和某些 UNIX 实用程序。为此,MinGW 项目分发了 MSYS,它基本上是旧的精简版本 Cygwin。我已经安装了 Cygwin,所以我宁愿只使用它。我需要为 Cygwin 安装哪些软件包以及如何调用 ./configure 以便它知道我正在尝试使用 MinGW 构建本机 Windows 二进制文件?
I have Cygwin and MinGW (TDM) installed. To build certain projects from source, you have to run a ./configure script, which requires a bash shell and certain unix utilities. For this, the MinGW project distributes MSYS, which is basically an old, stripped-down version Cygwin. I already have Cygwin installed, so I'd rather just use that. What packages would I need to install for Cygwin and how would I need to invoke ./configure so that it knows that I'm trying to use MinGW to build native Windows binaries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您知道 Cygwin 附带了 MinGW 编译器和内置库吗?通过使用 -mno-cygwin 开关,您可以将 Cygwin gcc 转换为 MinGW gcc。你如何调整 ./configure 来使用它超出了我的范围,但我想这将取决于 ./configure 脚本。
我所做的通常是通过将 -mno-cygwin 开关添加到编译器和链接器标志来调整生成的 Makefile。
You are aware that Cygwin comes with a MinGW-compiler and library built in? By using the -mno-cygwin switch you turn the Cygwin gcc into a MinGW gcc. How you'd tweek ./configure to use this is beyond me, but I suppose it would depend on the ./configure script.
What I do is usually to tweek the generated Makefiles by adding the -mno-cygwin switch to the compiler and linker flags.