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 16 LOCAL_PATH := $(call my-dir) 17 18 # 19 # Common definitions for host and device. 20 # 21 22 src_files := \ 23 JNIHelp.cpp \ 24 Register.cpp 25 26 c_includes := \ 27 $(JNI_H_INCLUDE) 28 29 # Any shared/static libs required by libcore 30 # need to be mentioned here as well. 31 # TODO: fix this requirement 32 33 shared_libraries := \ 34 libcrypto \ 35 libicui18n \ 36 libicuuc \ 37 libssl 38 39 static_libraries := \ 40 libjavacore \ 41 libfdlibm 42 43 44 45 # 46 # Build for the target (device). 47 # 48 49 include $(CLEAR_VARS) 50 51 LOCAL_SRC_FILES := $(src_files) 52 LOCAL_C_INCLUDES := $(c_includes) 53 LOCAL_STATIC_LIBRARIES := $(static_libraries) 54 LOCAL_SHARED_LIBRARIES := $(shared_libraries) libcutils libexpat liblog libstlport libz 55 LOCAL_MODULE_TAGS := optional 56 LOCAL_MODULE := libnativehelper 57 58 include $(BUILD_SHARED_LIBRARY) 59 60 61 # 62 # Build for the host. 63 # 64 65 ifeq ($(WITH_HOST_DALVIK),true) 66 67 include $(CLEAR_VARS) 68 69 LOCAL_SRC_FILES := $(src_files) 70 LOCAL_C_INCLUDES := $(c_includes) 71 LOCAL_WHOLE_STATIC_LIBRARIES := $(static_libraries:%=%-host) 72 73 ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-x86) 74 # OSX has a lot of libraries built in, which we don't have to 75 # bother building; just include them on the ld line. 76 LOCAL_LDLIBS := -lexpat -lssl -lz -lcrypto -licucore 77 else 78 LOCAL_SHARED_LIBRARIES := $(shared_libraries) 79 LOCAL_STATIC_LIBRARIES := libcutils libexpat liblog libz 80 endif 81 82 LOCAL_MODULE_TAGS := optional 83 LOCAL_MODULE := libnativehelper 84 include $(BUILD_HOST_STATIC_LIBRARY) 85 86 endif 87