andyzhaojianhui 2010-12-17
./configure--prefix=$PREFIX--build=i686-linux--host=mipsel-linux
第一次执行提示:
checkingforformattoprintfandscanfaguint64...configure:error:cannotruntestprogramwhilecrosscompiling
交叉编译时无法运行测试程序,编辑cachefile,把要检测的变量填进去:
echolibIDL_cv_long_long_format=ll>mips.cache
重新config:
./configure--prefix=$PREFIX--build=i686-linux--host=mipsel-linux--cache-file=mips.cache
生成makefile后,执行make,提示:
mips-linux-gnu-gcc:0.8.5":Nosuchfileordirectory
mips-linux-gnu-gcc:unrecognizedoption'-E"'
<command-line>:warning:missingterminating"character
<command-line>:warning:missingterminating"character
打开Makefile看到:
DEFS=-DPACKAGE_NAME=\"libIDL\"-DPACKAGE_TARNAME=\"libIDL\"-DPACKAGE_VERSION=\"0.8.5\"-DPACKAGE_STRING=\"libIDL\0.8.5\"-DPACKA
GE_BUGREPORT=\"http://bugzilla.gnome.org/enter_bug.cgi\?product=libIDL\"-DLIBIDL_VERSION=\"0.8.5\"-DHAVE_CPP_PIPE_STDIN=1-DCPP_NO
STDINC=\"-I-\"-DCPP_PROGRAM=\"mipsel-linux-gcc\-E\"-DSTDC_HEADERS=1-DHAVE_SYS_TYPES_H=1-DHAVE_SYS_STAT_H=1-DHAVE_STDLIB_H=1-D
HAVE_STRING_H=1-DHAVE_MEMORY_H=1-DHAVE_STRINGS_H=1-DHAVE_INTTYPES_H=1-DHAVE_STDINT_H=1-DHAVE_UNISTD_H=1-DHAVE_DLFCN_H=1-DSTDC
_HEADERS=1-DHAVE_STDDEF_H=1-DHAVE_UNISTD_H=1-DHAVE_WCHAR_H=1-DHAVE_POPEN=1-DHAVE_SYMLINK=1-DHAVE_ACCESS=1-DSIZEOF_LONG_LONG=8
这个里面的PACKAGE_STRING,以及CPP_PROGRAM=\"mipsel-linux-gcc\-E\"两个宏的定义里面包含空格,使用x86下的gcc,这两个宏可以正常定义,但是mipsel-linux-gcc处理不了空格转义,直接导致传给mipsel-linux-gcc的参数乱套。删除这两个宏在Makefile中的定义,单独放到config.h中,修改需要宏定义的c文件,#include<config.h>,编译通过。