Browse Source

aapt: Fix building with unified headers

android-5
Fredrik Fornwall 8 years ago
parent
commit
d4132dd039
  1. 16
      packages/aapt/build.sh
  2. 23
      packages/aapt/libcutils-patch.txt

16
packages/aapt/build.sh

@ -51,6 +51,7 @@ termux_step_make_install () {
"https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libcutils.tar.gz" \
$LIBCUTILS_TARFILE
tar xf $LIBCUTILS_TARFILE
patch -p0 < $TERMUX_PKG_BUILDER_DIR/libcutils-patch.txt
$CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets.o sockets.cpp
$CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets_unix.o sockets_unix.cpp
sed -i 's%include <sys/_system_properties.h>%include <sys/system_properties.h>%' properties.c
@ -231,13 +232,12 @@ termux_step_make_install () {
ZipFileRO.cpp \
ZipUtils.cpp"
sed -i 's%#include <binder/TextOutput.h>%%' ResourceTypes.cpp
$CXX $CXXFLAGS $LDFLAGS -isystem $AOSP_INCLUDE_DIR \
if [ -z "${TERMUX_UNIFIED_HEADERS:=""}" ]; then
CPPFLAGS+=" -DACONFIGURATION_SCREENROUND_ANY=0x00 -DACONFIGURATION_SCREENROUND_NO=0x1 -DACONFIGURATION_SCREENROUND_YES=0x2 -DACONFIGURATION_SCREEN_ROUND=0x8000"
fi
$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -isystem $AOSP_INCLUDE_DIR \
-std=c++11 \
$commonSources \
-DACONFIGURATION_SCREENROUND_ANY=0x00 \
-DACONFIGURATION_SCREENROUND_NO=0x1 \
-DACONFIGURATION_SCREENROUND_YES=0x2 \
-DACONFIGURATION_SCREEN_ROUND=0x8000 \
-landroid-cutils \
-landroid-utils \
-landroid-ziparchive \
@ -246,8 +246,6 @@ termux_step_make_install () {
-shared \
-o $TERMUX_PREFIX/lib/libandroid-fw.so
# Build aapt:
AAPT_TARFILE=$TERMUX_PKG_CACHEDIR/aapt_${_TAGNAME}.tar.gz
test ! -f $AAPT_TARFILE && termux_download \
@ -262,10 +260,6 @@ termux_step_make_install () {
-DANDROID_SMP=1 \
-DNDEBUG=1 \
-DHAVE_ENDIAN_H=1 -DHAVE_POSIX_FILEMAP=1 -DHAVE_OFF64_T=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_PTHREADS=1 \
-DACONFIGURATION_SCREENROUND_ANY=0x00 \
-DACONFIGURATION_SCREENROUND_NO=0x1 \
-DACONFIGURATION_SCREENROUND_YES=0x2 \
-DACONFIGURATION_SCREEN_ROUND=0x8000 \
-isystem $AOSP_INCLUDE_DIR \
*.cpp \
-landroid-cutils -landroid-utils -landroid-fw -landroid-ziparchive \

23
packages/aapt/libcutils-patch.txt

@ -0,0 +1,23 @@
https://android.googlesource.com/platform/system/core/+/84421d8475ca8262a914b3875ed110fc6187ee74
Add ioprio values directly.
The ioprio.h header is not a uapi header, so remove it's use and
add the two values that this code needs to use.
Bug: 30072483
Change-Id: I5c8b6f40bd60a43f50ac26792f96d2fa3f6db020
diff -u -r ../libcutils-orig/iosched_policy.c ./iosched_policy.c
--- ../libcutils-orig/iosched_policy.c 2017-06-28 13:45:36.296011839 +0200
+++ ./iosched_policy.c 2017-06-28 13:45:47.307888245 +0200
@@ -24,7 +24,8 @@
#include <cutils/iosched_policy.h>
#if defined(__ANDROID__)
-#include <linux/ioprio.h>
+#define IOPRIO_WHO_PROCESS (1)
+#define IOPRIO_CLASS_SHIFT (13)
#include <sys/syscall.h>
#define __android_unused
#else
Loading…
Cancel
Save