2016-07-28 129 views
0

我繼承了基於Open Embedded/Yocto的項目,我需要修改操作系統映像。我想添加一個新的python模塊 - pycrypto。在我做出更改之前,項目建立得很好。我應該如何配置BitBake來交叉編譯我的python模塊?

我已經添加了以下BitBake的食譜pycrypto:

DESCRIPTION = "Python crypto" 
SECTION = "devel/python"   
LICENSE = "PD" 
SRC_URI = "https://pypi.python.org/packages/source/p/pycrypto/pycrypto-${PV}.tar.gz" 
SRC_URI[md5sum] = "55a61a054aa66812daf5161a0d5d7eda" 
SRC_URI[sha256sum] = "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c" 
LIC_FILES_CHKSUM = "file://README;md5=453a552a607fd82384e25db312340e9a" 
S = "${WORKDIR}/pycrypto-${PV}" 
inherit setuptools 

爲python-crypto_2.6.1.bb。

然後我在我的主要操作系統映像配方使用:

PYTHON_INSTALL = " \ 
    python-ctypes python-subprocess python-threading python-json \ 
    python-pyopenssl python-audio python-bsddb python-codecs python-compile python-compiler python-compression python-core python-crypt python-curses python-datetime python-db python-debugger python-dev python-difflib python-distutils python-doctest python-elementtree python-email python-fcntl python-gdbm python-hotshot python-html python-idle python-image python-io python-lang python-logging python-mailbox python-math python-mime python-mmap python-multiprocessing python-netclient python-netserver python-numbers python-pickle python-pkgutil python-pprint python-profile python-pydoc python-re python-readline python-resource python-robotparser python-shell python-smtpd python-sqlite3 python-sqlite3-tests python-stringold python-syslog python-terminal python-tests python-textutils python-tkinter python-unittest python-unixadmin python-xml python-xmlrpc python-zlib python-modules python-pyserial python-misc python-mysql python-crypto\ 
" 

當構建執行(bitbake my-image),一切似乎去罰款檢索用於pycrypto來源。但編譯之後,配置嘗試運行交叉編譯的程序 - 哪些不起作用(它是爲不同的體系結構構建的)並停止bitbake創建我的映像。

這裏的日誌文件:

DEBUG: Executing shell function do_compile 
running build 
running build_py 
running build_ext 
running build_configure 
checking for gcc... arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/media/parallels/build/tmp/sysroots/overo 
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 `/media/parallels/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/python-crypto/2.6.1-r0/pycrypto-2.6.1': 
configure: error: cannot run C compiled programs. 
If you meant to cross compile, use `--host'. 
See `config.log' for more details 
Traceback (most recent call last): 
    File "setup.py", line 456, in <module> 
    core.setup(**kw) 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/core.py", line 151, in setup 
    dist.run_commands() 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands 
    self.run_command(cmd) 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/command/build.py", line 127, in run 
    self.run_command(cmd_name) 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command 
    self.distribution.run_command(command) 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "setup.py", line 251, in run 
    self.run_command(cmd_name) 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command 
    self.distribution.run_command(command) 
    File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "setup.py", line 278, in run 
    raise RuntimeError("autoconf error") 
RuntimeError: autoconf error 
ERROR: python setup.py build_ext execution failed. 
WARNING: exit code 1 from a shell command. 
ERROR: Function failed: do_compile (log file is located at /media/parallels/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/python-crypto/2.6.1-r0/temp/log.do_compile.6553) 

我從64位主機的建設和定位的ARM處理器。

日誌文件中的建議似乎是合理的 - 「如果你想交叉編譯,使用'--host'。」 - 唯一的問題是我在哪裏使用 --host?

此外,對現有項目資源的搜索沒有發現其他使用--host的實例,並且它爲ARM構建的所有內容都很好,所以這個消息可能導致我誤入歧途,這有些令人不安。

任何人都可以幫助配置BitBake/automake /任何部分的開放嵌入式工具鏈,以便一旦我的模塊已被交叉編譯,它不會嘗試在我的主機上執行它(錯誤建築)?

謝謝!

回答