wget ftp://xmlsoft.org/libxml2/libxml2-2.7.2.tar.gz
./configure CC=aarch64-linux-gnu-gcc --host=arm-linux --prefix=/home/book/tool/libxml2-2.7.2/build_out --with-python=no --without-zlib
make
make install
问题:
–without-zlib选项很重要,如果不加此选项,make的时候会提示如下错误:
./.libs/libxml2.so: undefined reference to `gzopen'
./.libs/libxml2.so: undefined reference to `gzclose'
./.libs/libxml2.so: undefined reference to `deflate'
./.libs/libxml2.so: undefined reference to `gzrewind'
./.libs/libxml2.so: undefined reference to `gzwrite'
./.libs/libxml2.so: undefined reference to `crc32'
./.libs/libxml2.so: undefined reference to `deflateEnd'
./.libs/libxml2.so: undefined reference to `gzdopen'
./.libs/libxml2.so: undefined reference to `deflateInit2_'
./.libs/libxml2.so: undefined reference to `gzread'
collect2: ld returned 1 exit status