forked from ubports/audioflingerglue
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Android.mk
109 lines (92 loc) · 3.31 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
LOCAL_PATH:= $(call my-dir)
ifneq (,$(wildcard frameworks/av/media/libmediaplayerservice/Android.mk))
MINIAF_32 := $(shell cat frameworks/av/media/mediaserver/Android.mk |grep "LOCAL_32_BIT_ONLY[[:space:]]*:=[[:space:]]*" |grep -o "true\|1\|false\|0")
else
ifneq (,$(wildcard frameworks/av/media/mediaserver/Android.bp))
ifneq (,$(shell cat frameworks/av/media/mediaserver/Android.bp |grep "compile_multilib:[[:space:]]*\".*32\""))
MINIAF_32 := true
else
MINIAF_32 := false
endif
endif
endif
ANDROID_MAJOR :=
ANDROID_MINOR :=
ANDROID_MICRO :=
ifndef ANDROID_MAJOR
# First check if version_defaults.mk was already loaded.
ifndef PLATFORM_VERSION
include build/core/version_defaults.mk
endif
ifeq ($(strip $(PLATFORM_VERSION)),)
$error(*** Cannot get Android platform version)
endif
ANDROID_MAJOR = $(shell echo $(PLATFORM_VERSION) | cut -d . -f 1)
ANDROID_MINOR = $(shell echo $(PLATFORM_VERSION) | cut -d . -f 2)
ANDROID_MICRO = $(shell echo $(PLATFORM_VERSION) | cut -d . -f 3)
endif
ifeq ($(strip $(ANDROID_MAJOR)),)
$(error *** ANDROID_MAJOR undefined)
endif
ifeq ($(strip $(ANDROID_MINOR)),)
$(error *** ANDROID_MINOR undefined)
endif
ifeq ($(strip $(ANDROID_MICRO)),)
$(warning *** ANDROID_MICRO undefined. Assuming 0)
ANDROID_MICRO = 0
endif
include $(CLEAR_VARS)
LOCAL_SRC_FILES := audioflingerglue.cpp IPrivateAfGlue.cpp IPrivateAfGlueHandler.cpp
ifeq ($(strip $(ANDROID_MAJOR)), 4)
LOCAL_SHARED_LIBRARIES := libc \
libdl \
libutils \
libcutils \
libbinder \
libmedia
else
LOCAL_SHARED_LIBRARIES := libc \
libdl \
libutils \
libcutils \
libbinder \
libmedia \
endif
ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -le 9 && echo true),true)
LOCAL_SHARED_LIBRARIES += libserviceutility
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),8 9 10))
LOCAL_SHARED_LIBRARIES += liblog
endif
LOCAL_CPPFLAGS :=-DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) -Wno-unused-parameter
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libaudioflingerglue
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := IPrivateAfGlue.cpp PrivateAfGlue.cpp IPrivateAfGlueHandler.cpp miniaf.cpp
LOCAL_SHARED_LIBRARIES := libutils \
libbinder \
libcutils \
libaudioutils \
libmedia \
libhardware
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),8 9 10))
LOCAL_SHARED_LIBRARIES += libaudioclient \
liblog
endif
LOCAL_MODULE_TAGS := optional
LOCAL_CPPFLAGS := -DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) -Wno-unused-parameter
ifneq ($(CM_BUILD),)
LOCAL_CPPFLAGS += -DCM_BUILD
endif
ifneq ($(shell cat frameworks/av/include/media/AudioSystem.h |grep SetACFPreviewParameter),)
LOCAL_CPPFLAGS += -DUSE_SERVICES_VENDOR_EXTENSION
endif
LOCAL_MODULE := miniafservice
ifeq ($(strip $(MINIAF_32)), true)
LOCAL_32_BIT_ONLY := true
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),7 8 9 10))
LOCAL_INIT_RC := miniaf.rc
endif
include $(BUILD_EXECUTABLE)