Android 源码编译失败:
/bin/bash: m4: command not found
[ 0% 11/59985] Lex: checkpolicy <= external/selinux/checkpolicy/policy_scan.l
FAILED: out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_scan.c
/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_scan.c external/selinux/checkpolicy/policy_scan.l"
flex-2.5.39:??????,exec of /usr/bin/m4 failed
[ 0% 12/59985] Yacc: checkpolicy <= external/selinux/checkpolicy/policy_parse.y
FAILED: out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.c
/bin/bash -c "prebuilts/misc/linux-x86/bison/bison -d -v --defines=out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.h -o out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.c external/selinux/checkpolicy/policy_parse.y"
[ 0% 17/59985] Export includes file: -- out/target/product/generic/obj/SHARED_LIBRARIES/libz_intermediates/export_includes
ninja: build stopped: subcommand failed.
19:37:35 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
make: Leaving directory '/home/mi/Android/Source'
遇见这个最后的报错的时候,注意向上看看base输出。
这就是问题所在,比如我的:/bin/bash: m4: command not found
然后 下载这个指令就可以了:sudo apt-get install m4
然后重新make,继续执行就可以了。