本文描述的软件包在以下链接可以下载,感谢ourdev站长 阿莫 提供硬盘空间!
http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=4906372&bbs_id=9999
首先是libusb-0.1.12库的编译,出现很多问题
[fanguisheng@WX-ASIC-S01 libusb-0.1.12]$ ./configure --build=i686-linux --host=unicore32-linux --
prefix=/home/fanguisheng/tiger-testbsp/3g/libusb-0.1.12/install
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 unicore32-linux-strip... unicore32-linux-strip
checking build system type... i686-pc-linux-gnu
checking host system type... Invalid configuration `unicore32-linux': machine `unicore32' not recognized
configure: error: /bin/sh ./config.sub unicore32-linux failed
[fanguisheng@WX-ASIC-S01 libusb-0.1.12]$
解决:
在config.sub文件的
1069 pmac | pmac-mpw)
1070 basic_machine=powerpc-apple
1071 ;;
1072 unicore32)
1073 basic_machine=unicore32
1074 ;;
1075 *-unknown)
1076 # Make sure to match an already-canonicalized machine name.
1077 ;;
1078 *)
1079 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized
1>&2
1080 exit 1
添加unicore32 的CPU类型信息,去除
checking host system type... Invalid configuration `unicore32-linux': machine `unicore32' not recognized
的出错信息。
再次编译,出现如下信息
checking for unicore32-linux-gcc... unicore32-linux-gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
查看config.log中的详细信息
84 configure:2558: checking for C compiler default output file name
85 configure:2561: unicore32-linux-gcc conftest.c >&5
86 /opt/cross-compliation-tools/unicore/uc4-1.0-beta-hard-RHELAS5/bin/../lib/gcc/unicore
32-linux/4.4.2/../../../../unicore32-linux/bin/ld: cannot find /usr/unicore/gnu-toolc
hain-unicore/uc4-1.0-beta-hard-RHELAS5/unicore32-linux/lib/libc.so.6
87 collect2: ld returned 1 exit status
88 configure:2564: $? = 1
89 configure: failed program was:
90 | /* confdefs.h. */
91 |
92 | #define PACKAGE_NAME "libusb"
93 | #define PACKAGE_TARNAME "libusb"
94 | #define PACKAGE_VERSION "0.1.12"
95 | #define PACKAGE_STRING "libusb 0.1.12"
96 | #define PACKAGE_BUGREPORT ""
97 | #define PACKAGE "libusb"
98 | #define VERSION "0.1.12"
99 | #define LIBUSB_MAJOR_VERSION 0
100 | #define LIBUSB_MINOR_VERSION 1
101 | #define LIBUSB_MICRO_VERSION 12
102 | #define LIBUSB_INTERFACE_AGE 4
103 | #define LIBUSB_BINARY_AGE 8
104 | /* end confdefs.h. */
105 |
106 | int
107 | main ()
108 | {
109 |
110 | ;
111 | return 0;
112 | }
113 configure:2603: error: C compiler cannot create executables
114 See `config.log' for more details.
问题出在红色部分
84 configure:2558: checking for C compiler default output file name
85 configure:2561: unicore32-linux-gcc conftest.c >&5
86 /opt/cross-compliation-tools/unicore/uc4-1.0-beta-hard-RHELAS5/bin/../lib/gcc/unicore
32-linux/4.4.2/../../../../unicore32-linux/bin/ld: cannot find /usr/unicore/gnu-toolc
hain-unicore/uc4-1.0-beta-hard-RHELAS5/unicore32-linux/lib/libc.so.6
87 collect2: ld returned 1 exit status
配置脚本无法在 /usr/unicore/gnu-toolc
hain-unicore/uc4-1.0-beta-hard-RHELAS5/unicore32-linux/lib/目录下找到libc.so.6库文件,显然,肯定找不到,编译器安装在
[fanguisheng@WX-ASIC-S01 /]$ which unicore32-linux-gcc
/opt/cross-compliation-tools/unicore/uc4-1.0-beta-hard-RHELAS5/bin/unicore32-linux-gcc
[fanguisheng@WX-ASIC-S01 /]$
这个路径下。
试着不去执行测试编译
2565 #(exit $ac_status); }; then
2566 }; then
将出错退出屏蔽,让程序继续下去,出现如下信息
87 collect2: ld returned 1 exit status
88 configure:2564: $? = 1
89 configure:2611: result: b.out
90 configure:2616: checking whether the C compiler works
91 configure:2642: result: yes
92 configure:2649: checking whether we are cross compiling
93 configure:2651: result: yes
94 configure:2654: checking for suffix of executables
95 configure:2656: unicore32-linux-gcc -o conftest conftest.c >&5
96 /opt/cross-compliation-tools/unicore/uc4-1.0-beta-hard-RHELAS5/bin/../lib/gcc/unicore
32-linux/4.4.2/../../../../unicore32-linux/bin/ld: cannot find /usr/unicore/gnu-toolc
hain-unicore/uc4-1.0-beta-hard-RHELAS5/unicore32-linux/lib/libc.so.6
97 collect2: ld returned 1 exit status
98 configure:2659: $? = 1
99 configure:2677: error: cannot compute suffix of executables: cannot compile and link
100 See `config.log' for more details.
有屏蔽出错信息
2680 #{ (exit 1); exit 1; }; }
2681 {}; }
可以顺利执行了
然后尝试make
结果报错
/opt/cross-compliation-tools/unicore/uc4-1.0-beta-hard-RHELAS5/bin/../lib/gcc/unicore32-linux/4.4.2/../../../../unicore32-linux/bin/ld: cannot find /usr/unicore/gnu-toolchain-unicore/uc4-1.0-beta-hard-RHELAS5/unicore32-linux/lib/libc.so.6
collect2: ld returned 1 exit status
make[2]: *** [libusb.la] Error 1
make[2]: Leaving directory `/home/fanguisheng/tiger-testbsp/3g/libusb-0.1.12'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/fanguisheng/tiger-testbsp/3g/libusb-0.1.12'
make: *** [all] Error 2
看来之前屏蔽的还是逃不过啊。
待续.....
转发至微博
转发至微博
评论