1# Copyright (C) 2008 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 15LOCAL_PATH:= $(call my-dir) 16 17# libutils is a little unique: It's built twice, once for the host 18# and once for the device. 19 20commonSources:= \ 21 Asset.cpp \ 22 AssetDir.cpp \ 23 AssetManager.cpp \ 24 BufferedTextOutput.cpp \ 25 CallStack.cpp \ 26 Debug.cpp \ 27 FileMap.cpp \ 28 RefBase.cpp \ 29 ResourceTypes.cpp \ 30 SharedBuffer.cpp \ 31 Static.cpp \ 32 StopWatch.cpp \ 33 String8.cpp \ 34 String16.cpp \ 35 SystemClock.cpp \ 36 TextOutput.cpp \ 37 Threads.cpp \ 38 TimerProbe.cpp \ 39 Timers.cpp \ 40 VectorImpl.cpp \ 41 ZipFileCRO.cpp \ 42 ZipFileRO.cpp \ 43 ZipUtils.cpp \ 44 misc.cpp \ 45 ported.cpp \ 46 LogSocket.cpp 47 48# 49# The cpp files listed here do not belong in the device 50# build. Consult with the swetland before even thinking about 51# putting them in commonSources. 52# 53# They're used by the simulator runtime and by host-side tools like 54# aapt and the simulator front-end. 55# 56hostSources:= \ 57 InetAddress.cpp \ 58 Pipe.cpp \ 59 Socket.cpp \ 60 ZipEntry.cpp \ 61 ZipFile.cpp 62 63# For the host 64# ===================================================== 65 66include $(CLEAR_VARS) 67 68LOCAL_SRC_FILES:= $(commonSources) $(hostSources) 69 70ifeq ($(HOST_OS),linux) 71# Use the futex based mutex and condition variable 72# implementation from android-arm because it's shared mem safe 73 LOCAL_SRC_FILES += \ 74 futex_synchro.c \ 75 executablepath_linux.cpp 76endif 77ifeq ($(HOST_OS),darwin) 78 LOCAL_SRC_FILES += \ 79 executablepath_darwin.cpp 80endif 81 82LOCAL_MODULE:= libutils 83 84LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) 85LOCAL_C_INCLUDES += external/zlib 86 87ifeq ($(HOST_OS),windows) 88ifeq ($(strip $(USE_CYGWIN),),) 89# Under MinGW, ctype.h doesn't need multi-byte support 90LOCAL_CFLAGS += -DMB_CUR_MAX=1 91endif 92endif 93 94include $(BUILD_HOST_STATIC_LIBRARY) 95 96 97 98# For the device 99# ===================================================== 100include $(CLEAR_VARS) 101 102 103# we have the common sources, plus some device-specific stuff 104LOCAL_SRC_FILES:= \ 105 $(commonSources) \ 106 Binder.cpp \ 107 BpBinder.cpp \ 108 IInterface.cpp \ 109 IMemory.cpp \ 110 IPCThreadState.cpp \ 111 MemoryDealer.cpp \ 112 MemoryBase.cpp \ 113 MemoryHeapBase.cpp \ 114 MemoryHeapPmem.cpp \ 115 Parcel.cpp \ 116 ProcessState.cpp \ 117 IPermissionController.cpp \ 118 IServiceManager.cpp \ 119 Unicode.cpp \ 120 BackupData.cpp \ 121 BackupHelpers.cpp 122 123ifeq ($(TARGET_SIMULATOR),true) 124LOCAL_SRC_FILES += $(hostSources) 125endif 126 127ifeq ($(TARGET_OS),linux) 128# Use the futex based mutex and condition variable 129# implementation from android-arm because it's shared mem safe 130LOCAL_SRC_FILES += futex_synchro.c 131LOCAL_LDLIBS += -lrt -ldl 132endif 133 134LOCAL_C_INCLUDES += \ 135 external/zlib \ 136 external/icu4c/common 137LOCAL_LDLIBS += -lpthread 138 139LOCAL_SHARED_LIBRARIES := \ 140 libz \ 141 liblog \ 142 libcutils 143 144ifneq ($(TARGET_SIMULATOR),true) 145ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86) 146# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp 147LOCAL_SHARED_LIBRARIES += \ 148 libdl 149endif # linux-x86 150endif # sim 151 152LOCAL_MODULE:= libutils 153 154#LOCAL_CFLAGS+= 155#LOCAL_LDFLAGS:= 156 157include $(BUILD_SHARED_LIBRARY) 158 159