checking if malloc() and friends prototypes are gmem.h compatible

来源:互联网 发布:软件需求调查问卷 编辑:程序博客网 时间:2024/04/29 20:25
在交叉编译的时候总是使用configure --host=arm-linux 嘿嘿但是在CONFIGURE中有很多的测试程序是不可以在HOST上运行的就会出现: error: cannot run test program while cross compiling
类似的错误,可以使用CACHEFILE解决这个问题,还要谢谢ABSURD兄的文章给我的指导。
我是这样解决的第一步:记录下错误的地方如:checking abstract socket namespace... configure: error: cannot run test program while cross compiling
注意到abstract socket namespace在configure中查找abstract socket可以看到类似这样的结构
echo "$as_me:$LINENO: checking abstract socket namespace" >&5
echo $ECHO_N "checking abstract socket namespace... $ECHO_C" >&6
if test "${ac_cv_have_abstract_sockets+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
其中ac_cv_have_abstract_sockets是我们要查找的变量
使用echo ac_cv_have_abstract_sockets=yes>arm-linux.cache
然后
./configure --host=arm-linux --cache-file=arm-linux.cache

OK这样就搞定了

checking for growing stack pointer... configure: error: cannot run test program while cross compiling

 

原来configure不能为交叉编译检查glib_cv_stack_grows,glib_cv_stack_grows表示堆栈的增长方向。configure无法在目标机上运行测试程序,自然无法检查,只好手工指定。顺便看一下还哪些相关的变量不能检查的,一起写到cache文件中,并重新配置:

[root@linux glib-2.8.0]# echo ac_cv_type_long_long=yes>$ARCH-linux.cache

[root@linux glib-2.8.0]# echo glib_cv_stack_grows=no>>$ARCH-linux.cache

[root@linux glib-2.8.0]# echo glib_cv_uscore=no>>$ARCH-linux.cache

[root@linux glib-2.8.0]# echo ac_cv_func_posix_getpwuid_r=yes>>$ARCH-linux.cache

[root@linux glib-2.8.0]# ./configure --host=$ARCH-linux --prefix=$ROOTFS_DIR/usr --cache-file=$ARCH-linux.cache

glib_cv_stack_grows=no
glib_cv_uscore=no
ac_cv_func_posix_getpwuid_r=no
ac_cv_func_posix_getgrgid_r=no

这回配置成功了,编译:

[
0 0