Android.mk revision 51c0f5bb47b896eda82ee50277bbb80a97006d87
1# Copyright (C) 2009 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16LOCAL_PATH := $(call my-dir)
17
18#
19# Common definitions for host and device.
20#
21
22src_files := \
23    JNIHelp.c \
24    Register.c
25
26c_includes := \
27    $(JNI_H_INCLUDE)
28
29# Any shared/static libs required by libjavacore
30# need to be mentioned here as well.
31# TODO: fix this requirement
32
33shared_libraries := \
34    libcrypto  \
35    libicui18n \
36    libicuuc   \
37    libsqlite \
38    libssl
39
40static_libraries := \
41    libjavacore \
42    libfdlibm
43
44
45
46#
47# Build for the target (device).
48#
49
50include $(CLEAR_VARS)
51
52LOCAL_SRC_FILES := $(src_files)
53LOCAL_C_INCLUDES := $(c_includes)
54LOCAL_STATIC_LIBRARIES := $(static_libraries)
55LOCAL_SHARED_LIBRARIES := $(shared_libraries) libcutils libexpat liblog libutils libz
56LOCAL_MODULE_TAGS := optional
57LOCAL_MODULE := libnativehelper
58
59include $(BUILD_SHARED_LIBRARY)
60
61
62#
63# Build for the host.
64#
65
66ifeq ($(WITH_HOST_DALVIK),true)
67
68    include $(CLEAR_VARS)
69
70    LOCAL_SRC_FILES := $(src_files)
71    LOCAL_C_INCLUDES := $(c_includes)
72    LOCAL_WHOLE_STATIC_LIBRARIES := $(static_libraries:%=%-host)
73
74    ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-x86)
75        # OSX has a lot of libraries built in, which we don't have to
76        # bother building; just include them on the ld line.
77        LOCAL_LDLIBS := -lexpat -lssl -lz -lcrypto -licucore -lsqlite3
78        LOCAL_WHOLE_STATIC_LIBRARIES += libutils
79    else
80        LOCAL_SHARED_LIBRARIES := $(shared_libraries)
81        LOCAL_STATIC_LIBRARIES := libcutils libexpat liblog libutils libz
82    endif
83
84    LOCAL_MODULE_TAGS := optional
85    LOCAL_MODULE := libnativehelper
86    include $(BUILD_HOST_STATIC_LIBRARY)
87
88endif
89