Path: blob/21.2-virgl/bin/update-android-headers.sh
4545 views
#!/bin/sh12set -eu34if [ ! -e .git ]; then5echo must run from top-level directory;6exit 17fi89if [ ! -d platform-hardware-libhardware ]; then10git clone --depth 1 https://android.googlesource.com/platform/hardware/libhardware platform-hardware-libhardware11git clone --depth 1 https://android.googlesource.com/platform/system/core platform-system-core12git clone --depth 1 https://android.googlesource.com/platform/frameworks/native platform-frameworks-native13fi1415dest=include/android_stub1617# Persist the frozen Android N system/window.h for backward compatibility1819cp -av ${dest}/system/window.h platform-system-core/libsystem/include/system2021rm -rf ${dest}22mkdir ${dest}232425# These directories contains mostly only the files we need, so copy wholesale2627cp -av platform-frameworks-native/libs/nativewindow/include/vndk \28platform-system-core/libsync/include/sync \29platform-system-core/libsync/include/ndk \30platform-system-core/libbacktrace/include/backtrace \31platform-system-core/libsystem/include/system \32platform-system-core/liblog/include/log \33platform-frameworks-native/libs/nativewindow/include/apex \34platform-frameworks-native/libs/nativebase/include/nativebase \35${dest}363738# We only need a few files from these big directories so just copy those3940mkdir ${dest}/hardware41cp -av platform-hardware-libhardware/include/hardware/{hardware,gralloc,gralloc1,fb}.h ${dest}/hardware42cp -av platform-frameworks-native/vulkan/include/hardware/hwvulkan.h ${dest}/hardware4344mkdir ${dest}/cutils45cp -av platform-system-core/libcutils/include/cutils/{log,native_handle,properties}.h ${dest}/cutils464748# include/android has files from a few different projects4950mkdir ${dest}/android51cp -av platform-frameworks-native/libs/nativewindow/include/android/* \52platform-frameworks-native/libs/arect/include/android/* \53platform-system-core/liblog/include/android/* \54platform-system-core/libsync/include/android/* \55${dest}/android56575859