2012-06-11 58 views
2

我正在试图在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. 

下面我就如何继续是很笨。有什么建议么?

回答

2

您是否尝试过使用 SKIP_RMDIR_CHECK =是 指令?

+0

谢谢。这确实启用了配置的完成。无论如何,我们采取了不同的路径,所以现在这不太重要。我只是想知道(从makefile文件中可以很容易地看出)那里包含了ARM的具体设置。无论如何,使用该ARM生成文件,我可以开始构建,但它会出现在头文件错误(与配置程序无关)上。 – ysap

3

嵌入式平台的环境是否适合使用命令行gzip程序?如果您想从您为嵌入式平台编写的软件执行gzip压缩和解压缩,则应考虑使用zlib

+0

答案是 - 有点。在使用GDB时,我们确实支持标准I/O。最终目标是对应用程序进行分区,例如I/O部分在主机上完成,但首先,我试图在嵌入式环境中构建一个简单的程序。感谢您指出zlib。从第一眼看来,它好像是一个与gzip无关的项目,对吧?但它确实支持gzip压缩算法,因此我可以编写一个实用程序,对gzip编码/待解码的任何文件进行解码/编码 - 是吗? – ysap

+1

zlib与gzip非常相关,由同一作者编写。是的,您可以使用它来压缩和解压缩与gzip实用程序兼容的gzip流。 –

0

好的,谢谢,非常有帮助,它给了我需要的线索。 我已经在走远一点我现在有一个更正确的--host字符串:

主机= EIII-parallella-顿悟

所以我打电话配置为: 的./configure CC =/cygdrive/[MYPATH]/Parallella/INSTALL/bin/e-gcc --host = eIII-parallella-epiphany

但是您需要做其他一些事情,包括将epiphany源代码中的config.sub脚本复制到你自己的配置空间。我还必须做一些其他编辑,以便MACHOS被定义。 查看:http://forums.parallella.org/viewtopic.php?f=13&t=337&p=2014#p2014了解更多详情。

欢呼声,博韦伯