Windows - 自动制作在 MSYS64 中不可用

Posted

技术标签:

【中文标题】Windows - 自动制作在 MSYS64 中不可用【英文标题】:Windows - automake not available in MSYS64 【发布时间】:2016-07-17 12:23:06 【问题描述】:

我正在尝试遵循this 教程,了解如何使用 MSYS 64 位在 Windows 上构建 64 位库。我坚持构建libiconv。我密切关注本教程 - 问题在于“./configure”步骤。

步骤失败:

configure: error: cannot guess build type; you must specify one

更具体地说,这里是完整的输出:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make sets $(MAKE)... (cached) no
checking for gcc... D:\Development\SFMLearn\x86_64-4.9.2-release-posix-seh-rt_v4-rev2\mingw64\bin\gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
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 D:\Development\SFMLearn\x86_64-4.9.2-release-posix-seh-rt_v4-rev2\mingw64\bin\gcc accepts -g... yes
checking for D:\Development\SFMLearn\x86_64-4.9.2-release-posix-seh-rt_v4-rev2\mingw64\bin\gcc option to accept ISO C89... none needed
checking for style of include used by make... none
checking dependency style of D:\Development\SFMLearn\x86_64-4.9.2-release-posix-seh-rt_v4-rev2\mingw64\bin\gcc... none
checking how to run the C preprocessor... D:\Development\SFMLearn\x86_64-4.9.2-release-posix-seh-rt_v4-rev2\mingw64\bin\gcc -E
checking for strip... /mingw/bin/strip
checking build system type... build-aux/config.guess: unable to guess system type

This script, last modified 2009-02-03, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (build-aux/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2009-02-03

uname -m = x86_64
uname -r = 2.4.1(0.294/5/3)
uname -s = MSYS_NT-10.0
uname -v = 2016-02-03 10:57

/usr/bin/uname -p = unknown
/bin/uname -X     =

hostinfo               =
/bin/universe          =
/usr/bin/arch -k       =
/bin/arch              = x86_64
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = x86_64
UNAME_RELEASE = 2.4.1(0.294/5/3)
UNAME_SYSTEM  = MSYS_NT-10.0
UNAME_VERSION = 2016-02-03 10:57
configure: error: cannot guess build type; you must specify one

它告诉我从提供的 URL 下载 config.guess 和 config.sub(因为我的脚本版本显然是 2009 年的),但是,我不知道该脚本放在哪里。

This 回答建议交换 %MSYS_ROOT%/usr/share/automake.1.11.1/config.guess,但是 automake 甚至没有安装! /usr/share 中没有文件夹“automake”。

Felix@felix MSYS /usr/share
$ ls
aclocal          doc    info      magic             misc     pki       zoneinfo
awk              emacs  libalpm   makepkg           Msys     readline  zsh
bash-completion  file   licenses  makepkg-template  p11-kit  tabset
cygwin           gnupg  locale    man               pacman   terminfo

我不知道如何在 MSYS 64 位上安装 automake,谷歌也没有帮助。我已经下载了“automake-1.11.1-1-msys-1.0.13-bin”和config.guess和config.sub,但是不知道放在哪里。

感谢任何帮助。

【问题讨论】:

【参考方案1】:

尝试将这些参数传递给configure 脚本:

--build=$MSYSTEM_CHOST --host=$MSYSTEM_CHOST

实际上,您为什么还要构建 libiconv?您可以通过 MSYS2 的包管理器安装它。运行:

pacman -S mingw-w64-x86_64-libiconv mingw-w64-x86_64-iconv

(我不知道 libiconv 和 iconv 包之间的区别,所以我只是将它们都包含在上面。)

如果您好奇,可以在这里查看这些包是如何构建的:

https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-libiconv

【讨论】:

【参考方案2】:

一般情况下,您可以在https://packages.msys2.org/base找到可用的软件包

pacman -S automake1.16 将安装最新版本(在此发布时)。

此外,可执行文件将具有文件名automake-1.16 而不仅仅是automake,...

【讨论】:

以上是关于Windows - 自动制作在 MSYS64 中不可用的主要内容,如果未能解决你的问题,请参考以下文章

windows安装msys2 mingw64

Windows 中的 MSYS 和 MinGW 需要啥

使用 MSYS2/MINGW-64 缺少 POSIX 和 std 符号

MSYS2 使用

windows中使用mingw64编译dlib的c++

使用 MinGW/MSYS 制作“xz-5.2.1”时出错