当前位置:  技术问答>linux和unix

交叉编译libxml2出错

    来源: 互联网  发布时间:2017-05-22

    本文导语:  使用的libxml版本是 libxml2-2.7.8 交叉编译工具是mipsel-linux-gcc 3.4.2 配置如下:./configure --host=mipsel-linux  --prefix=/finrod/mips_lib/test_xml/libxml --enable-static=yes  --without-zlib 在make的时候,出现以下错误: Making all in . make[3...

使用的libxml版本是 libxml2-2.7.8
交叉编译工具是mipsel-linux-gcc 3.4.2

配置如下:./configure --host=mipsel-linux  --prefix=/finrod/mips_lib/test_xml/libxml --enable-static=yes  --without-zlib
在make的时候,出现以下错误:

Making all in .
make[3]: 正在进入目录 `/finrod/mips_lib/test_xml/libxml2-2.7.8/python'
/bin/sh ../libtool  --tag=CC   --mode=compile mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/python2.7 -I../include -I../include -I../python    -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -MT libxml.lo -MD -MP -MF .deps/libxml.Tpo -c -o libxml.lo `test -f './libxml.c' || echo './'`./libxml.c
libtool: compile:  mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/python2.7 -I../include -I../include -I../python -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -MT libxml.lo -MD -MP -MF .deps/libxml.Tpo -c ./libxml.c  -fPIC -DPIC -o .libs/libxml.o
In file included from /usr/include/python2.7/Python.h:8,
                 from ./libxml.c:14:
/usr/include/python2.7/pyconfig.h:24:52: mipsel-linux-gnu/python2.7/pyconfig.h: No such file or directory
In file included from /usr/include/python2.7/Python.h:77,
                 from ./libxml.c:14:
/usr/include/python2.7/pymath.h:18: warning: redundant redeclaration of 'copysign'
/usr/include/python2.7/pymath.h:26: warning: redundant redeclaration of 'hypot'
In file included from /usr/include/python2.7/Python.h:110,
                 from ./libxml.c:14:
/usr/include/python2.7/pycapsule.h:31: warning: declaration of 'destructor' shadows a global declaration
/usr/include/python2.7/object.h:306: warning: shadowed declaration is here
/usr/include/python2.7/pycapsule.h:45: warning: declaration of 'destructor' shadows a global declaration
/usr/include/python2.7/object.h:306: warning: shadowed declaration is here
In file included from /usr/include/python2.7/Python.h:133,
                 from ./libxml.c:14:
/usr/include/python2.7/abstract.h:1387: warning: declaration of 'index' shadows a global declaration
/finrod/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/string.h:321: warning: shadowed declaration is here
/usr/include/python2.7/abstract.h:1389: warning: declaration of 'index' shadows a global declaration
/finrod/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/string.h:321: warning: shadowed declaration is here
./libxml.c:2678: warning: no previous prototype for 'libxml_xmlNodeRemoveNsDef'
./libxml.c: In function `libxml_serializeNode':
./libxml.c:2765: warning: unused variable `len'
./libxml.c: At top level:
./libxml.c:1775: warning: unused parameter 'severity'
./libxml.c:1748: warning: unused parameter 'severity'
make[3]: *** [libxml.lo] 错误 1
make[3]:正在离开目录 `/finrod/mips_lib/test_xml/libxml2-2.7.8/python'
make[2]: *** [all-recursive] 错误 1
make[2]:正在离开目录 `/finrod/mips_lib/test_xml/libxml2-2.7.8/python'
make[1]: *** [all-recursive] 错误 1
make[1]:正在离开目录 `/finrod/mips_lib/test_xml/libxml2-2.7.8'
make: *** [all] 错误 2



说是没有mipsel-linux-gnu/python2.7/pyconfig.h这个文件

/usr/include/python2.7/pyconfig.h中这里的代码是
#  if _MIPS_SIM == _ABIO32
#   include 
#  elif _MIPS_SIM == _ABIN32
#   include 
#  elif _MIPS_SIM == _ABI64
#   include 
#  else
#   error unknown multiarch location for pyconfig.h
#  endif


有哪位高手知道,这个文件夹和文件应该怎么弄出来?需要交叉编译python吗?
谢谢~

|
自己解决了,由于不能还分给自己,只能另外用个号把解决方法贴出来。
在Makefile中有看到需要 -lpython2.7 所以肯定了需要交叉编译python

步骤如下
1. python的编译 使用文件 python.2.7
参考网址 http://www.linuxidc.com/Linux/2014-03/98457.htm
         http://blog.csdn.net/shuxiao9058/article/details/7026205

(1) 由于在编译python的时候,需要先编译一个叫pgen的程序出来,用于生成语法解析器,所以我们要先生成一个pc版本的pgen
    mkdir build.pc  
    cd build.pc  
    ../configure  
    make Parser/pgen


(2) cd ../
    echo ac_cv_file__dev_ptmx=no > config.site
    echo ac_cv_file__dev_ptc=no >> config.site
    export CONFIG_SITE=config.site
    ./configure CC=mipsel-linux-gcc CXX=mipsel-linux-g++ --host=mipsel-linux --build=i386-linux-gnu --disable-ipv6

(3) 修改makefile

OPT=            -DNDEBUG -g -O3 -Wall -Wstrict-prototypes 
一行中,去掉-g,我们不要debug python,-O3改为-O2,空间紧张O2就可以了。

PGEN=           Parser/pgen$(EXE)
一行的下面加上  PGEN_HOST=      ../build.pc/Parser/pgen$(EXE) 
表明我们在HOST上运行的pgen,在要使用PGEN的地方改为PGEN_HOST:
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)  
                -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 
改为:
    $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)  
                -$(PGEN_HOST) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 

修改所有使用新生成的python的地方。
    所有如 ./$(BUILDPYTHON) 的地方,都改为python


2. libxml的编译  使用文件 libxml2-2.7.8
    首先要将第1步编译出来的python加入交叉编译器中,步骤如下
(1) 修改/usr/include/python2.7/pyconfig.h 第24行 改为 #  include 
(2) 将/usr/include/i386-linux-gnu目录下的python2.7文件夹拷贝到交叉编译器mipsel-linux-gcc默认的include文件夹中 
  /finrod/buildroot-gcc342/lib/gcc/mipsel-linux-uclibc/3.4.2/include/i386-linux-gnu
        (3) 将编译好的libpython2.7.a拷贝到交叉编译器的lib文件中 /finrod/buildroot-gcc342/lib

    libxml的编译
    ./autogen.sh 
./configure --host=mipsel-linux  --prefix=/finrod/mips_lib/test_xml/libxml --enable-static=yes CC=mipsel-linux-gcc CXX=mipsel-linux-g++ --without-zlib  

    make
    make install

    
 
 

您可能感兴趣的文章:

  • 在cygwin编译驱动程序要不要交叉编译?
  • 关于arm交叉编译器4.3.3编译程序报错,但是3.4.5却能编译通过的问题
  • 交叉编译问题
  • arm-linux-gcc交叉编译出错,但gcc编译没错,什么原因呢???
  • linux下交叉编译的问题
  • ARM Cortex A15终结交叉编译?!
  • 请教:嵌入式Linux交叉编译工具----版本选择的问题
  • 谁知道如何在i386平台使用交叉编译工具为mips平台编译libtiff啊?
  • openssl怎么交叉编译?
  • LINUX下使用Eclipse,如何使用交叉编译器?
  • 交叉编译器可以通用吗?
  • 怎么查看arm平台上的程序是用那个版本的交叉编译器编译的????
  • 怎么建立arm交叉编译环境和ramdisk镜像?
  • 如何将LINUX下的命令nohup交叉编译?
  • 小弟遇到个交叉编译的问题,谁能帮忙解决下啊
  • 怎样交叉编译2.6内核下的驱动?
  • Linux下交叉编译静态库得问题
  • c/c++开源软件 iis7站长之家
  • 别人编译好的交叉编译的工具链,我在自己系统中怎么使用 急
  • 用MINIGUI写的程序,怎么进行交叉编译呀?
  • 我在交叉编译SDL时.老是出错
  • 交叉编译,动态链接库运行出错!请高人指点
  • 交叉编译QTE的多线程程序时出错:cannot find -lqte-mt
  • 交叉编译armlinux模块出错!???
  • arm-linux-gcc交叉编译出错
  • linux环境下交叉编译执行出错问题
  • 使用autotools生成makefile,最后一步交叉编译时make出错
  • 交叉编译出错
  • 交叉编译出错:impossible constraint in ‘asm’
  • qt embedded 2.37 自己写的hello 交叉编译出错,大家帮帮忙,谢谢
  • hostapd交叉编译出错,请高手指点
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 交叉编译时,ld ,搜索路径的设置
  • ubuntu 10.10环境下的交叉编译求助
  • 交叉编译系统调用模块错误
  • 有关scratchbox 交叉编译器的问题。。。
  • linux下交叉编译windows VC 程序的问题
  • linux 安装交叉编译器时出现错误
  • arm交叉编译求救
  • 求助arm-linux-gcc-3.4.1 如何交叉编译具有两个依赖库的文件?
  • arm-linux的交叉编译环境
  • 请教“交叉编译”的问题
  • 关于交叉编译apache
  • 为什么要增加交叉编译器的路径?
  • 怎样查看交叉编译器的版本???
  • 交叉编译中关于libxml2的问题
  • arm-linux-gcc交叉编译工具链安装
  • 请教交叉编译
  • 求助!!怎么在linux交叉环境下移植SOAP协议?
  • 请教关于交叉编译平台搭建的问题
  • 请教牛人,问一个Linux下交叉编译的问题
  • 交叉编译的文件在目标板无法执行


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3