主题 : Python交叉编译失败怎么回事? 复制链接 | 浏览器收藏 | 打印
www.3g.com.cn
级别: 新手上路
UID: 60853
精华: 0
发帖: 21
金钱: 110 两
威望: 22 点
综合积分: 42 分
注册时间: 2011-12-18
最后登录: 2013-10-23
楼主  发表于: 2012-09-10 16:24

 Python交叉编译失败怎么回事?

./configure -host=arm-linux -prefix=/usr/local/arm-linux/Python成功
...

然后make失败
[root@localhost Python-3.2.3]# make
arm-linux-gcc -c -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
In file included from Include/Python.h:50:0,
  from ./Modules/python.c:3:
Include/pyport.h:260:13: error: #error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG"
make: *** [Modules/python.o] 错误 1

    
自由,自强,共享,共创。
级别: 论坛版主
UID: 12573
精华: 27
发帖: 8838
金钱: 46490 两
威望: 9298 点
综合积分: 18216 分
注册时间: 2010-01-09
最后登录: 2019-07-16
1楼  发表于: 2012-09-10 17:21
推荐使用Debian, 已经自带了Python
新手如何向我们反馈有效的信息,以便解决问题,见此贴:
http://www.arm9home.net/read.php?tid-14431.html

[注]: 此处签名链接仅为指引方向,而非解答问题本身.
www.3g.com.cn
级别: 新手上路
UID: 60853
精华: 0
发帖: 21
金钱: 110 两
威望: 22 点
综合积分: 42 分
注册时间: 2011-12-18
最后登录: 2013-10-23
2楼  发表于: 2012-09-13 11:09

 但libhid怎么编译不过呢,它说要install Python的包

[root@localhost libhid-0.2.16]# ./configure  -host=arm-linux -prefix=/usr/local/arm-linux/libhid LDFLAGS=-L/usr/local/arm-linux/libusb/lib
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
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-strip... arm-linux-strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to enable pedantic compiler checks... (cached) no
checking whether to enable proper compiler warnings... (cached) yes
checking whether to enable compiler warnings as errors... (cached) yes
checking whether to enable debugging... (cached) no
checking whether to enable gdb-enhanced debugging symbols... (cached) no
checking whether to use documentation generated by doxygen... (cached) yes
checking whether to enable swig python wrapper... (cached) yes
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking for target OS... Linux
checking for style of include used by make... GNU
checking for arm-linux-gcc... arm-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gcc accepts -g... yes
checking for arm-linux-gcc option to accept ISO C89... none needed
checking dependency style of arm-linux-gcc... gcc3
checking how to run the C preprocessor... arm-linux-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking usb.h usability... yes
checking usb.h presence... yes
checking for usb.h... yes
checking for arm-linux-gcc... (cached) arm-linux-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-linux-gcc accepts -g... (cached) yes
checking for arm-linux-gcc option to accept ISO C89... (cached) none needed
checking dependency style of arm-linux-gcc... (cached) gcc3
checking for a sed that does not truncate output... /bin/sed
checking for ld used by arm-linux-gcc... /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld
checking if the linker (/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking for /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for arm-linux-g++... arm-linux-g++
checking whether we are using the GNU C++ compiler... yes
checking whether arm-linux-g++ accepts -g... yes
checking dependency style of arm-linux-g++... gcc3
checking how to run the C++ preprocessor... arm-linux-g++ -E
checking for arm-linux-g77... no
checking for arm-linux-f77... no
checking for arm-linux-xlf... no
checking for arm-linux-frt... no
checking for arm-linux-pgf77... no
checking for arm-linux-cf77... no
checking for arm-linux-fort77... no
checking for arm-linux-fl32... no
checking for arm-linux-af77... no
checking for arm-linux-f90... no
checking for arm-linux-xlf90... no
checking for arm-linux-pgf90... no
checking for arm-linux-pghpf... no
checking for arm-linux-epcf90... no
checking for arm-linux-gfortran... no
checking for arm-linux-g95... no
checking for arm-linux-f95... no
checking for arm-linux-fort... no
checking for arm-linux-xlf95... no
checking for arm-linux-ifort... no
checking for arm-linux-ifc... no
checking for arm-linux-efc... no
checking for arm-linux-pgf95... no
checking for arm-linux-lf95... no
checking for arm-linux-ftn... no
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... gfortran
configure: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org.
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking the maximum length of command line arguments... 32768
checking command to parse /opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-nm -B output from arm-linux-gcc object... ok
checking for objdir... .libs
checking for arm-linux-ar... arm-linux-ar
checking for arm-linux-ranlib... arm-linux-ranlib
checking for arm-linux-strip... (cached) arm-linux-strip
checking if arm-linux-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-linux-gcc option to produce PIC... -fPIC
checking if arm-linux-gcc PIC flag -fPIC works... yes
checking if arm-linux-gcc static flag -static works... yes
checking if arm-linux-gcc supports -c -o file.o... yes
checking whether the arm-linux-gcc linker (/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by arm-linux-g++... /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld
checking if the linker (/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking whether the arm-linux-g++ linker (/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking for arm-linux-g++ option to produce PIC... -fPIC
checking if arm-linux-g++ PIC flag -fPIC works... yes
checking if arm-linux-g++ static flag -static works... yes
checking if arm-linux-g++ supports -c -o file.o... yes
checking whether the arm-linux-g++ linker (/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gfortran option to produce PIC... -fPIC
checking if gfortran PIC flag -fPIC works... yes
checking if gfortran static flag -static works... yes
checking if gfortran supports -c -o file.o... yes
checking whether the gfortran linker (/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking for ANSI C header files... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
checking for an ANSI C-conforming const... yes
checking whether byte ordering is bigendian... no
checking for preprocessor stringizing operator... yes
configure: enabled compiler warnings.
configure: turned compiler warnings into errors.
checking for swig... /usr/bin/swig
checking for SWIG version... 1.3.33
configure: SWIG executable is '/usr/bin/swig'
configure: SWIG library directory is '/usr/share/swig/1.3.33'

SWIG Version 1.3.33

Compiled with g++ [i386-redhat-linux-gnu]
Please see http://www.swig.org for reporting bugs and further information
checking for python... /usr/local/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for python2.7... (cached) /usr/local/bin/python
checking for a version of Python >= '2.1.0'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/usr/local/include/python2.7
checking for Python library path... /usr/local/lib/python2.7/config/libpython2.7.a
checking for Python site-packages path... /usr/local/lib/python2.7/site-packages
checking python extra libraries...  -lpthread -ldl  -lutil
checking python extra linking flags... -Xlinker -export-dynamic
checking consistency of all components of python development environment... no
configure: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================
自由,自强,共享,共创。
级别: 论坛版主
UID: 12573
精华: 27
发帖: 8838
金钱: 46490 两
威望: 9298 点
综合积分: 18216 分
注册时间: 2010-01-09
最后登录: 2019-07-16
3楼  发表于: 2012-09-13 11:24
我们不对用户自己的程序,或非光盘中的软件提供开发移植或调试,几乎每天都有各种各样的用户程序问题,各种平台,各种应用;开发板利润本来就很低,这种支持已经超出了我们的服务范围,请谅解
新手如何向我们反馈有效的信息,以便解决问题,见此贴:
http://www.arm9home.net/read.php?tid-14431.html

[注]: 此处签名链接仅为指引方向,而非解答问题本身.
级别: 新手上路
UID: 3374
精华: 0
发帖: 44
金钱: 220 两
威望: 44 点
综合积分: 88 分
注册时间: 2009-01-07
最后登录: 2020-09-08
4楼  发表于: 2013-02-25 13:53
pyport.h中添加#define PY_FORMAT_LONG_LONG "ll"