Disabling JACK in android compilation

帅比萌擦擦* 提交于 2019-11-28 05:26:21

问题


Does anybody know how to completely disable jack while compiling AOSP (Master)?

I've always had problems with jack, so I've just always turned it off by adding ANDROID_COMPILE_WITH_JACK := false in BoardConfig.mk (when compiling CyanogenMod). I'm now compiling aosp and it just seems to ignore this command.

Note: I'm not really trying to solve any jack related issues I have, I'm trying to turn it off.


回答1:


I would recommend to use AOSP tag to build instead of master branch. For example, latest released Marshmallow is android-6.0.1_r43 tag.

So let's look at clear_vars.mk which is responsible for default values: https://android.googlesource.com/platform/build/+/android-6.0.1_r43/core/clear_vars.mk#110

LOCAL_JACK_ENABLED:=$(DEFAULT_JACK_ENABLED) # '' (ie disabled), disabled, full, incremental

So you either have to override LOCAL_JACK_ENABLED per module in Android.mk or define global default value with DEFAULT_JACK_ENABLED variable.

P.S. It's better to ask such questions on Google Groups: https://groups.google.com/forum/#!forum/android-building




回答2:


You can disable the JACK without to change any code.

make ANDROID_COMPILE_WITH_JACK:=false

Just do it when making the entire Android Project.

The magic is in build/make/combo/javac.mk:

ifndef ANDROID_COMPILE_WITH_JACK
# Defines if compilation with jack is enabled by default.
ANDROID_COMPILE_WITH_JACK := true
endif

And build/make/core/config.mk:

ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
DEFAULT_JACK_ENABLED:=full
else
DEFAULT_JACK_ENABLED:=
endif

And build/make/core/clear_vars.mk:

LOCAL_JACK_ENABLED:=DEFAULT_JACK_ENABLED

It also indicates why your modification in a local module is in vain.



来源:https://stackoverflow.com/questions/36680397/disabling-jack-in-android-compilation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!