blob: 70d440797305fdeb1e334b58d34ee790a345f96e [file] [log] [blame]
The Android Open Source Projectcbb10112009-03-03 19:31:44 -08001# 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 \
Mathias Agopian254406e2009-06-05 01:26:23 -070035 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080036 SystemClock.cpp \
37 TextOutput.cpp \
38 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080039 Timers.cpp \
40 VectorImpl.cpp \
41 ZipFileCRO.cpp \
42 ZipFileRO.cpp \
43 ZipUtils.cpp \
44 misc.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080045 LogSocket.cpp
46
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080047
48# For the host
49# =====================================================
50
51include $(CLEAR_VARS)
52
Mathias Agopian09e2b142009-06-05 14:56:35 -070053LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080054
55ifeq ($(HOST_OS),linux)
56# Use the futex based mutex and condition variable
57# implementation from android-arm because it's shared mem safe
58 LOCAL_SRC_FILES += \
Andy McFadden69197b62009-05-27 16:01:39 -070059 futex_synchro.c
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080060endif
61
62LOCAL_MODULE:= libutils
63
64LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
65LOCAL_C_INCLUDES += external/zlib
66
67ifeq ($(HOST_OS),windows)
68ifeq ($(strip $(USE_CYGWIN),),)
69# Under MinGW, ctype.h doesn't need multi-byte support
70LOCAL_CFLAGS += -DMB_CUR_MAX=1
71endif
72endif
73
74include $(BUILD_HOST_STATIC_LIBRARY)
75
76
77
78# For the device
79# =====================================================
80include $(CLEAR_VARS)
81
82
83# we have the common sources, plus some device-specific stuff
84LOCAL_SRC_FILES:= \
85 $(commonSources) \
Joe Onoratoaaead202009-05-05 11:50:51 -070086 Unicode.cpp \
Mathias Agopian7c889142009-06-04 13:53:57 -070087 BackupData.cpp \
88 BackupHelpers.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080089
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080090ifeq ($(TARGET_OS),linux)
91# Use the futex based mutex and condition variable
92# implementation from android-arm because it's shared mem safe
93LOCAL_SRC_FILES += futex_synchro.c
94LOCAL_LDLIBS += -lrt -ldl
95endif
96
97LOCAL_C_INCLUDES += \
98 external/zlib \
99 external/icu4c/common
100LOCAL_LDLIBS += -lpthread
101
102LOCAL_SHARED_LIBRARIES := \
103 libz \
104 liblog \
105 libcutils
106
107ifneq ($(TARGET_SIMULATOR),true)
108ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
109# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
110LOCAL_SHARED_LIBRARIES += \
111 libdl
112endif # linux-x86
113endif # sim
114
115LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800116include $(BUILD_SHARED_LIBRARY)
117