使用arm-linux-gcc编译sqlite3报错

内核编译和嵌入式产品的设计与开发
回复
hh_L
帖子: 15
注册时间: 2015-08-12 9:12
系统: ubuntu

使用arm-linux-gcc编译sqlite3报错

#1

帖子 hh_L » 2016-08-02 10:31

编译sqlite3首先编译ncurses、readline这两个库,在编译的时候遇到以下问题,求解答
(arm-linux-gcc已加入到path路径中,编译普通.c文件没有问题)
编译普通源文件:

代码: 全选

lixingliang@lixingliang:~/code/c$ cat 30.c
#include <stdio.h>
int main(void)
{
	int a[8] = {1, 3, 5, 7, 9, 11, 13, 15};
	int i, j, k;
	for(i = 0; i<8; i++)
		for(j = 0; j < 8; j++)
			for(k = 0; k < 8; k++)
			{
				if(a[i]+a[j]+a[k] == 30)
					printf("%d %d %d\n",a[i], a[j], a[k]);
			}
	return 0;
}
lixingliang@lixingliang:~/code/c$ arm-fsl-linux-gnueabi-gcc 30.c -o 30
lixingliang@lixingliang:~/code/c$ 
编译ncurses-6.0:

代码: 全选

lixingliang@lixingliang:~/下载/ncurses-6.0$ sudo ./configure --host=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc --prefix=/opt/arm/arm-sqlite3/
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 egrep... grep -E
Configuring NCURSES 6.0 ABI 6 (Tue Aug  2 09:56:04 CST 2016)
checking for package version... 6.0
checking for package patch date... 20150808
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc': machine `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi' not recognized
configure: error: /bin/sh ./config.sub /opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc failed
编译sqlite-autoconf-3130000:

代码: 全选

lixingliang@lixingliang:~/下载/sqlite-autoconf-3130000$ sudo ./configure --host=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc --prefix=/opt/arm/arm-sqlite3/
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc-gcc... no
checking for gcc... 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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc-gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc': machine `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi' not recognized
configure: error: /bin/bash ./config.sub /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc failed
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 使用arm-linux-gcc编译sqlite3报错

#2

帖子 vickycq » 2016-08-02 11:09

hh_L 写了:(arm-linux-gcc已加入到path路径中,编译普通.c文件没有问题)
checking host system type... Invalid configuration `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc': machine `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi' not recognized
configure: error: /bin/bash ./config.sub /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc failed
--host=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc 改为 --host=arm-fsl-linux-gnueabi
另根据情况设置环境变量
export CROSS_COMPILE=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi
export CC=${CROSS_COMPILE}-gcc
export LD=${CROSS_COMPILE}-ld
export AS=${CROSS_COMPILE}-as
......
......

另参考 https://how-to-build-for-arm.wikispaces.com/ncurses
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
回复