Merge pull request #153571 from angerman/angerman/android-export-staticlibs

bionic-prebuild: Export static libc, libm, libdl as well
This commit is contained in:
John Ericson 2022-01-04 23:41:34 -08:00 committed by GitHub
commit 91e1b9904d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,6 @@
{ stdenvNoCC, lib, fetchzip, pkgs
{ stdenv, stdenvNoCC, lib, fetchzip, pkgs
, enableStatic ? stdenv.hostPlatform.isStatic
, enableShared ? !stdenv.hostPlatform.isStatic
}:
let
@ -92,10 +94,17 @@ stdenvNoCC.mkDerivation rec {
cp -v ${prebuilt_crt.out}/*.o $out/lib/
cp -v ${prebuilt_crt.out}/libgcc.a $out/lib/
cp -v ${prebuilt_ndk_crt.out}/*.o $out/lib/
'' + lib.optionalString enableShared ''
for i in libc.so libm.so libdl.so liblog.so; do
cp -v ${prebuilt_libs.out}/$i $out/lib/
done
'' + lib.optionalString enableStatic ''
# no liblog.a; while it's also part of the base libraries,
# it's only available as shared object in the prebuilts.
for i in libc.a libm.a libdl.a; do
cp -v ${prebuilt_ndk_crt.out}/$i $out/lib/
done
'' + ''
mkdir -p $dev/include
cp -v $out/include/*.h $dev/include/
'';