blob: 3f5cb85ac8411ad2e82043539b5c0f24f2cad82d [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 \
Mathias Agopian14d978d2009-06-05 15:11:23 -070044 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080045
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080046
47# For the host
48# =====================================================
49
50include $(CLEAR_VARS)
51
Mathias Agopian09e2b142009-06-05 14:56:35 -070052LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080053
54ifeq ($(HOST_OS),linux)
55# Use the futex based mutex and condition variable
56# implementation from android-arm because it's shared mem safe
57 LOCAL_SRC_FILES += \
Andy McFadden69197b62009-05-27 16:01:39 -070058 futex_synchro.c
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080059endif
60
61LOCAL_MODULE:= libutils
62
63LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
64LOCAL_C_INCLUDES += external/zlib
65
66ifeq ($(HOST_OS),windows)
67ifeq ($(strip $(USE_CYGWIN),),)
68# Under MinGW, ctype.h doesn't need multi-byte support
69LOCAL_CFLAGS += -DMB_CUR_MAX=1
70endif
71endif
72
73include $(BUILD_HOST_STATIC_LIBRARY)
74
75
76
77# For the device
78# =====================================================
79include $(CLEAR_VARS)
80
81
82# we have the common sources, plus some device-specific stuff
83LOCAL_SRC_FILES:= \
84 $(commonSources) \
Joe Onoratoaaead202009-05-05 11:50:51 -070085 Unicode.cpp \
Mathias Agopian7c889142009-06-04 13:53:57 -070086 BackupData.cpp \
87 BackupHelpers.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080088
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080089ifeq ($(TARGET_OS),linux)
90# Use the futex based mutex and condition variable
91# implementation from android-arm because it's shared mem safe
92LOCAL_SRC_FILES += futex_synchro.c
93LOCAL_LDLIBS += -lrt -ldl
94endif
95
96LOCAL_C_INCLUDES += \
97 external/zlib \
98 external/icu4c/common
99LOCAL_LDLIBS += -lpthread
100
101LOCAL_SHARED_LIBRARIES := \
102 libz \
103 liblog \
104 libcutils
105
106ifneq ($(TARGET_SIMULATOR),true)
107ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
108# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
109LOCAL_SHARED_LIBRARIES += \
110 libdl
111endif # linux-x86
112endif # sim
113
114LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800115include $(BUILD_SHARED_LIBRARY)
116