1#!/bin/sh 2 3# Makes a .pc file in the Android NDK for meson to find its libraries. 4 5set -ex 6 7ndk="$1" 8pc="$2" 9cflags="$3" 10libs="$4" 11version="$5" 12 13sysroot=$ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot 14 15for arch in \ 16 x86_64-linux-android \ 17 i686-linux-android \ 18 aarch64-linux-android \ 19 arm-linux-androideabi; do 20 pcdir=$sysroot/usr/lib/$arch/pkgconfig 21 mkdir -p $pcdir 22 23 cat >$pcdir/$pc <<EOF 24prefix=$sysroot 25exec_prefix=$sysroot 26libdir=$sysroot/usr/lib/$arch/29 27sharedlibdir=$sysroot/usr/lib/$arch 28includedir=$sysroot/usr/include 29 30Name: zlib 31Description: zlib compression library 32Version: $version 33 34Requires: 35Libs: -L$sysroot/usr/lib/$arch/29 $libs 36Cflags: -I$sysroot/usr/include $cflags 37EOF 38done 39