Embedded 如何交叉构建GZIP?

Embedded 如何交叉构建GZIP?,embedded,gzip,cross-compiling,Embedded,Gzip,Cross Compiling,我正在尝试为Linux机器上的嵌入式平台构建gzip。我从下载了最新的gzip发行版。然后,make首先需要运行configure程序,以便为特定目标定制Makefile 因此,我运行configure并得到一些错误消息。问题似乎是几件事的结合。我们的编译器版本名为e-gcc,因此我使用了以下行,并得到了此错误: ~/Projects/gzip-1.4$ ./configure CC=e-gcc checking for a BSD-compatible install... /usr/bin/

我正在尝试为Linux机器上的嵌入式平台构建
gzip
。我从下载了最新的gzip发行版。然后,
make
首先需要运行
configure
程序,以便为特定目标定制
Makefile

因此,我运行
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编译的程序不能运行,b/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
              bug-coreutils@gnu.org 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.

我现在对如何继续下去一无所知。有什么建议吗?

嵌入式平台是否有一个可以使用命令行gzip程序的环境?如果您想从正在为嵌入式平台编写的软件中进行GZIP压缩和解压缩,那么您应该考虑。 跳过\u RMDIR\u检查=是
指令?

好的,谢谢,非常有用,它给了我需要的线索。 我更进一步,现在有了一个更正确的主机字符串:

--主机=eIII平行六面体

因此,我将配置称为: ./configure CC=/cygdrive/[MYPATH]/Parallella/INSTALL/bin/e-gcc--host=eIII Parallella六面体

但是,您还需要做一些其他事情,包括将config.sub脚本从epiphany源复制到您自己的配置空间中。我还必须做一些其他的编辑,这样才能定义男性。 有关更多详细信息,请参阅


干杯,博·韦伯

谢谢。这确实实现了配置的完成。不管怎样,我们走了一条不同的道路,所以这现在不那么重要了。我只是想知道(从大的makefile中很难分辨)其中包含了哪些特定于ARM的设置。不管怎样,使用这个ARM makefile,我可以启动构建,但它会出现头文件错误(尽管与配置程序无关)。在使用GDB时,我们确实支持标准I/O。最终目标是对应用程序进行分区,例如在主机上完成I/O部分,但首先,我尝试在嵌入式环境中简单构建程序。谢谢你指出zlib。乍一看,这似乎是一个与gzip无关的项目,对吗?但它确实支持gzip压缩算法,因此我可以编写一个实用程序,对任何由gzip编码/解码的文件进行解码-是吗?zlib与gzip非常相关,由同一作者编写。是的,您可以使用它来压缩和解压缩与gzip实用程序兼容的gzip流。