blob: afad48e67f6bc31be67e8bcb5a209bf21504e155 [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 \
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 \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080058 Socket.cpp \
59 ZipEntry.cpp \
60 ZipFile.cpp
61
62# For the host
63# =====================================================
64
65include $(CLEAR_VARS)
66
67LOCAL_SRC_FILES:= $(commonSources) $(hostSources)
68
69ifeq ($(HOST_OS),linux)
70# Use the futex based mutex and condition variable
71# implementation from android-arm because it's shared mem safe
72 LOCAL_SRC_FILES += \
Andy McFadden69197b62009-05-27 16:01:39 -070073 futex_synchro.c
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080074endif
75
76LOCAL_MODULE:= libutils
77
78LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
79LOCAL_C_INCLUDES += external/zlib
80
81ifeq ($(HOST_OS),windows)
82ifeq ($(strip $(USE_CYGWIN),),)
83# Under MinGW, ctype.h doesn't need multi-byte support
84LOCAL_CFLAGS += -DMB_CUR_MAX=1
85endif
86endif
87
88include $(BUILD_HOST_STATIC_LIBRARY)
89
90
91
92# For the device
93# =====================================================
94include $(CLEAR_VARS)
95
96
97# we have the common sources, plus some device-specific stuff
98LOCAL_SRC_FILES:= \
99 $(commonSources) \
Joe Onoratoaaead202009-05-05 11:50:51 -0700100 Unicode.cpp \
Joe Onorato62a381b2009-05-15 09:07:06 -0400101 backup_data.cpp \
102 backup_helper_file.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800103
104ifeq ($(TARGET_SIMULATOR),true)
105LOCAL_SRC_FILES += $(hostSources)
106endif
107
108ifeq ($(TARGET_OS),linux)
109# Use the futex based mutex and condition variable
110# implementation from android-arm because it's shared mem safe
111LOCAL_SRC_FILES += futex_synchro.c
112LOCAL_LDLIBS += -lrt -ldl
113endif
114
115LOCAL_C_INCLUDES += \
116 external/zlib \
117 external/icu4c/common
118LOCAL_LDLIBS += -lpthread
119
120LOCAL_SHARED_LIBRARIES := \
121 libz \
122 liblog \
123 libcutils
124
125ifneq ($(TARGET_SIMULATOR),true)
126ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
127# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
128LOCAL_SHARED_LIBRARIES += \
129 libdl
130endif # linux-x86
131endif # sim
132
133LOCAL_MODULE:= libutils
134
135#LOCAL_CFLAGS+=
136#LOCAL_LDFLAGS:=
137
138include $(BUILD_SHARED_LIBRARY)
139