How to compile AOSP on Mac 10.13

Follow : https://source.android.com/setup/initializing

Then you may meet one compile error:

FAILED: out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.cpp out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.h 

BISON_PKGDATADIR=external/bison/data prebuilts/misc/darwin-x86/bison/bison -d  --defines=out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.h -o out/soong/.intermediates/system/tools/aidl/libaidl-common/darwin_x8664static/gen/yacc/system/tools/aidl/aidl_language_y.cpp system/tools/aidl/aidl_language_y.yy

Then do this:

1.Patch bison fix for High Sierra and build bison:

    cd /Volumes/AOSP/external/bison

    git cherry-pick c0c852bd6fe462b148475476d9124fd740eba160

    mm

2.Replace prebuilt bison binary with patched binary

    cp /Volumes/AOSP/out/host/darwin-x86/bin/bison /Volumes/AOSP/prebuilts/misc/darwin-x86/bison/

3.Build