blob: 7e369ca0b371c33ce259d4617a364bd81e74a56a [file] [log] [blame]
Dan Albert2ef012e2014-04-08 12:03:21 -07001#
2# Copyright (C) 2014 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Stephen Hines27ae7cb2014-04-25 19:13:02 -070017# Don't build for unbundled branches
18ifeq (,$(TARGET_BUILD_APPS))
19
Dan Albert2ef012e2014-04-08 12:03:21 -070020LOCAL_PATH := $(call my-dir)
21
22LIBCXX_SRC_FILES := \
23 src/algorithm.cpp \
24 src/bind.cpp \
25 src/chrono.cpp \
26 src/condition_variable.cpp \
27 src/debug.cpp \
28 src/exception.cpp \
29 src/future.cpp \
30 src/hash.cpp \
31 src/ios.cpp \
32 src/iostream.cpp \
33 src/locale.cpp \
34 src/memory.cpp \
35 src/mutex.cpp \
36 src/new.cpp \
37 src/optional.cpp \
38 src/random.cpp \
39 src/regex.cpp \
40 src/shared_mutex.cpp \
41 src/stdexcept.cpp \
42 src/string.cpp \
43 src/strstream.cpp \
44 src/system_error.cpp \
45 src/thread.cpp \
46 src/typeinfo.cpp \
47 src/utility.cpp \
48 src/valarray.cpp \
49 src/stubs.cpp \
50
51LIBCXX_CPPFLAGS := \
52 -I$(LOCAL_PATH)/include/ \
Dan Albert2ef012e2014-04-08 12:03:21 -070053 -std=c++11 \
Dan Albert8a6f7b12014-05-01 17:49:58 -070054 -nostdinc++ \
Dan Albert2ef012e2014-04-08 12:03:21 -070055 -fexceptions \
56
57include $(CLEAR_VARS)
58LOCAL_MODULE := libc++
59LOCAL_CLANG := true
60LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
Dan Albert9569f042014-05-01 18:12:37 -070061LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) -Iexternal/libcxxrt/src -DLIBCXXRT
Dan Albertf1550542014-05-06 14:16:05 -070062LOCAL_RTTI_FLAG := -frtti
Dan Albert9569f042014-05-01 18:12:37 -070063LOCAL_STATIC_LIBRARIES := libcxxrt
64LOCAL_SHARED_LIBRARIES := libdl
Dan Albert2ef012e2014-04-08 12:03:21 -070065LOCAL_SYSTEM_SHARED_LIBRARIES := libc
Dan Albert226cd952014-04-16 10:58:40 -070066
Stephen Hines3486f692014-04-30 01:16:20 -070067# Bug: 14296739
68# The MIPS target in LLVM is spuriously generating a text relocation for
69# __gxx_personality_v0 in the .eh_frame section. This triggers a linker
70# warning, since it is not considered PIC. Disable warnings as errors
71# for this link step until we can get the bug fixed.
72ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH), mips mips64))
73LOCAL_LDFLAGS := -Wl,--no-fatal-warnings
74endif
75
Dan Albertc10e7192014-04-16 16:38:42 -070076ifneq ($(TARGET_ARCH),arm)
Dan Albert226cd952014-04-16 10:58:40 -070077 LOCAL_SHARED_LIBRARIES += libdl
78endif
79
Brian Carlstrom12c28912014-05-09 20:47:13 -070080LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albert2ef012e2014-04-08 12:03:21 -070081include $(BUILD_SHARED_LIBRARY)
82
83include $(CLEAR_VARS)
84LOCAL_MODULE := libc++
85LOCAL_CLANG := true
86LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
87LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS)
Dan Albertf1550542014-05-06 14:16:05 -070088LOCAL_RTTI_FLAG := -frtti
Dan Albert8a6f7b12014-05-01 17:49:58 -070089LOCAL_LDFLAGS := -nodefaultlibs
90LOCAL_LDLIBS := -lc
Tim Murrayd513b7a2014-04-21 15:06:30 -070091
92ifeq ($(HOST_OS), darwin)
Dan Albert9569f042014-05-01 18:12:37 -070093LOCAL_CPPFLAGS += -Iexternal/libcxxabi/include
Dan Albert8a6f7b12014-05-01 17:49:58 -070094LOCAL_LDFLAGS += \
Tim Murrayd513b7a2014-04-21 15:06:30 -070095 -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \
Tim Murrayd513b7a2014-04-21 15:06:30 -070096 -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \
97 -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp
Dan Albert9569f042014-05-01 18:12:37 -070098LOCAL_STATIC_LIBRARIES := libc++abi
Tim Murrayd513b7a2014-04-21 15:06:30 -070099else
Dan Albert9569f042014-05-01 18:12:37 -0700100LOCAL_CPPFLAGS += -Iexternal/libcxxrt/src -DLIBCXXRT
Dan Albert7d57f1b2014-05-12 14:54:53 -0700101LOCAL_STATIC_LIBRARIES := libcxxrt libunwind
102LOCAL_WHOLE_STATIC_LIBRARIES := libcompiler_rt
103LOCAL_LDLIBS += -lrt -lpthread -ldl -lm
Tim Murrayd513b7a2014-04-21 15:06:30 -0700104endif
105
Brian Carlstrom12c28912014-05-09 20:47:13 -0700106LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albert2ef012e2014-04-08 12:03:21 -0700107include $(BUILD_HOST_SHARED_LIBRARY)
Stephen Hines27ae7cb2014-04-25 19:13:02 -0700108
109endif # TARGET_BUILD_APPS