zlib库交叉编译

zlib-1.2.11

开发板:arm9

交叉编译器arm-fsl-linux-gnueabihf-gcc

编译方式:

./configure -h可以发现zlib并没有提供CC配置,所以

(1)export CC=arm-fsl-linux-gnueabihf-gcc

(2)./configure --prefix=/opt/libz

出现错误:Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).

解决方案参考http://blog.csdn.net/hzh_beyond/article/details/40074081

在configure 删除以下字段,避免将warn处理为error :

echo "Checking for obsessive-compulsive compiler options..." >> configure.log

if try $CC -c $CFLAGS $test.c; then
  :
else
  echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
  leave 1
fi

另外,后来使用arm-linaro-linux-gnueabihf-gcc并没有以上错误

少壮不识cpp,老大方知cpp可怕
原文地址:https://www.cnblogs.com/Jacket-K/p/7374187.html