我正在试图在Linux机器上为嵌入式平台构建gzip
。我从here下载了最新的gzip发行版。然后,make
需要首先运行configure
程序,以便为特定目标定制Makefile
。如何交叉构建GZIP?
所以我运行configure
并得到一些错误消息。这个问题似乎是几件事情的结合。我们的编译器的版本叫做e-gcc
,所以我用下面的线,并得到了这个错误:
~/Projects/gzip-1.4$ ./configure CC=e-gcc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... e-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... configure: error: in `/home/xyz/Projects/gzip-1.4':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
显然,C编译的程序不能运行,二/三是交叉编译。消息说我必须使用--host
选项,但问题是我们在gcc中并没有真正的名称。不过,我想:
./configure CC=e-gcc --host=epiphany
和收到的错误是:
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
blah blah blah
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `epiphany': machine `epiphany' not recognized
configure: error: /bin/bash build-aux/config.sub epiphany failed
最后一件事,我试图欺骗和设置主机arm
,因为它是最接近的精神,我们的架构。配置更进了一步,但最终也失败了以下消息:
checking for GNU libc compatible realloc... no
checking for rmdir... no
configure: error: in `/home/xyz/Projects/gzip-1.4':
configure: error: Your system lacks the rmdir function.
Please report this, along with the output of "uname -a", to the
[email protected] mailing list. To continue past this point,
rerun configure with SKIP_RMDIR_CHECK=yes.
E.g., ./configure SKIP_RMDIR_CHECK=yes
See `config.log' for more details.
下面我就如何继续是很笨。有什么建议么?
谢谢。这确实启用了配置的完成。无论如何,我们采取了不同的路径,所以现在这不太重要。我只是想知道(从makefile文件中可以很容易地看出)那里包含了ARM的具体设置。无论如何,使用该ARM生成文件,我可以开始构建,但它会出现在头文件错误(与配置程序无关)上。 – ysap