用于MIPS的交叉编译GLib导致“无iconv()实现”配置错误

时间:2013-05-16 15:04:56

标签: mips cross-compiling configure glib

我正按照here的指示,尝试为MIPS系统交叉编译GLib 2.37.0。我有一个mips.cache文件,其中包含以下内容:

glib_cv_stack_grows=no
glib_cv_uscore=no
ac_cv_func_posix_getpwuid_r=no
ac_cv_func_posix_getgrgid_r=no

我正在使用以下命令行调用configure脚本:

./configure --cache-file=mips.cache --host=mips-linux CCFLAGS=-I/opt/toolchain/build_mips/staging_dir/usr/include LDFLAGS=-L/opt/toolchain/build_mips/staging_dir/usr/lib

不幸的是我收到了这个错误:

configure: error: *** No iconv() implementation found in C library or libiconv

如果有帮助,整个输出是:

checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for mips-linux-gcc... mips-linux-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... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mips-linux-gcc accepts -g... yes
checking for mips-linux-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of mips-linux-gcc... gcc3
checking how to run the C preprocessor... mips-linux-gcc -E
checking build system type... i686-pc-linux-gnu
checking host system type... mips-unknown-linux-gnu
checking for the BeOS... no
checking for Win32... no
checking for the Android... no
checking for Mac OS X Carbon support... no
checking for Mac OS X Cocoa support... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether we are using the GNU C Library 2.1 or newer... yes
checking whether to enable garbage collector friendliness... no
checking whether to disable memory pools... no
checking for mips-linux-c++... mips-linux-c++
checking whether we are using the GNU C++ compiler... yes
checking whether mips-linux-c++ accepts -g... yes
checking dependency style of mips-linux-c++... gcc3
checking whether mips-linux-gcc and cc understand -c and -o together... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for mips-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.16... yes
checking for gawk... (cached) gawk
checking for perl5... no
checking for perl... perl
checking for indent... no
checking for perl... /usr/bin/perl
checking for a Python interpreter with version >= 2.5... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
checking for iconv_open... no
configure: error: *** No iconv() implementation found in C library or libiconv

我尝试使用--with-libiconv=no选项调用configure脚本,但结果是一样的。我从其他来源得知mips.cache文件很好,但我不知道让configure脚本工作的神奇之处。我还使用此工具链来交叉编译其他应用程序。我在这里缺少什么?

谢谢!

1 个答案:

答案 0 :(得分:0)

这是因为libiconv不会使用正确的编译器(在这种情况下为mips编译器)构建,或者库(.so)在配置glib时指定的路径中不存在。