1.去如下网址下载pixman-0.34
pixman - Pixman: The pixel-manipulation library for X and cairo. (mirrored from https://gitlab.freedesktop.org/pixman/pixman)https://cgit.freedesktop.org/pixman/Files · 0.34 · Pixman / pixman · GitLabImage processing and manipulation libraryhttps://gitlab.freedesktop.org/pixman/pixman/-/tree/0.34注意:第一个网址是官网可以查看相关的版本介绍,第二个网址是github代码网址,要去第二个网址下载代码,我下载的是pixman-0.34,虽然有更高的版本但是好像他们都是预发布版本,不是稳定版本
2.去如下网址下载automake-1.16.5版本
Index of /gnu/automakehttps://ftp.gnu.org/gnu/automake/?C=M;O=D注意:为什么不用sudo apt install automake?因为这个命令最高可以安装automake-1.16.1版本,并且pixman-0.34需要的是automake-1.16.5版本,如果你安装的是automake-1.16.1版本,就会./autogen.sh的时候报错,所以需要手动去官网下载编译安装automake。
然后:
tar -xvf automake-1.16.5.tar.gz
cd automake-1.16.5
./configure && make && make install
3.在pixman-0.34目录下执行./autogen.sh脚本生成configure文件。
若是想要了解autoconf和automake,可以去如下网址:
https://www.jianshu.com/p/c44d1dc9e837https://www.jianshu.com/p/c44d1dc9e8374.交叉编译安装libpng,去如下网址
因为pixman依赖libpng包。
用NDK-r25编译libpng_短发也可以在被青春吹起的博客-CSDN博客
5.交叉编译安装
tar -xvf pixman-0.34.tar.gz
cd pixman-0.34 && mkdir build && cd build
CC="aarch64-linux-android21-clang" ../configure --prefix=/home/dubu/installtest --host=aarch64-linux-android21 --with-sysroot=$SYSROOT CPPFLAGS="-I${SYSROOT}/usr/include" LDFLAGS="-L${SYSROOT}/usr/lib -lz" PNG_CFLAGS="-I${SYSROOT}/usr/include" PNG_LIBS="-L${SYSROOT}/usr/lib -lpng16"
make 报错了
报如下错误:
make[2]: 进入目录“/home/dubu/pixman-0.34/build/demos”
make[2]: 对“all”无需做任何事。
make[2]: 离开目录“/home/dubu/pixman-0.34/build/demos”
Making all in test
make[2]: 进入目录“/home/dubu/pixman-0.34/build/test”
CC oob-test.o
CC utils.lo
CC utils-prng.lo
../../test/utils-prng.c:207:27: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
^
../../test/utils-prng.c:207:25: error: assigning to 'uint8x16' (vector of 16 'uint8_t' values) from incompatible type 'int'
randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make[2]: *** [Makefile:1157:utils-prng.lo] 错误 1
make[2]: 离开目录“/home/dubu/pixman-0.34/build/test”
make[1]: *** [Makefile:506:all-recursive] 错误 1
make[1]: 离开目录“/home/dubu/pixman-0.34/build”
make: *** [Makefile:413:all] 错误 2
报的这个问题我不知道怎么解决,不知下面这两位兄弟是怎么编译通过的:
12、交叉编译pixman_Skyline的博客-CSDN博客_pixman 编译
pixman-0.34.0交叉编译_goThinks的博客-CSDN博客_pixman
这里就不多说了。
后来我下载了又去pixman官网,下载了预发布版本pixman-0.40.tar.gz,最后make && make install的时候通过了。然后又去看源码文件utils-prng.c,内容如下:
# if __has_builtin(__builtin_shufflevector)
randdata.vb =
__builtin_shufflevector (randdata.vb, randdata.vb,
3, 2, 1, 0, 7, 6 , 5, 4,
11, 10, 9, 8, 15, 14, 13, 12);
# else
static const uint8x16 bswap_shufflemask =
{
3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
};
randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
# endif
pixman-0.34的源码文件utils-prng.c,内容如下:
const uint8x16 bswap_shufflemask =
{
3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
};
randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
store_rand_128_data (buf, &randdata, aligned);
buf += 16;
看来此问题在pixman-0.40中已经解决了。那就用pixman-0.40把。