Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 1 | # |
| 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 Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 17 | # Don't build for unbundled branches |
| 18 | ifeq (,$(TARGET_BUILD_APPS)) |
| 19 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 20 | LOCAL_PATH := $(call my-dir) |
| 21 | |
| 22 | LIBCXX_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 | |
| 51 | LIBCXX_CPPFLAGS := \ |
| 52 | -I$(LOCAL_PATH)/include/ \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 53 | -std=c++11 \ |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 54 | -nostdinc++ \ |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 55 | -fexceptions \ |
| 56 | |
| 57 | include $(CLEAR_VARS) |
| 58 | LOCAL_MODULE := libc++ |
| 59 | LOCAL_CLANG := true |
| 60 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame^] | 61 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) -Iexternal/libcxxrt/src -DLIBCXXRT |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 62 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame^] | 63 | LOCAL_STATIC_LIBRARIES := libcxxrt |
| 64 | LOCAL_SHARED_LIBRARIES := libdl |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 65 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 66 | |
Stephen Hines | 3486f69 | 2014-04-30 01:16:20 -0700 | [diff] [blame] | 67 | # 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. |
| 72 | ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH), mips mips64)) |
| 73 | LOCAL_LDFLAGS := -Wl,--no-fatal-warnings |
| 74 | endif |
| 75 | |
Dan Albert | c10e719 | 2014-04-16 16:38:42 -0700 | [diff] [blame] | 76 | ifneq ($(TARGET_ARCH),arm) |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 77 | LOCAL_SHARED_LIBRARIES += libdl |
| 78 | endif |
| 79 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 80 | include $(BUILD_SHARED_LIBRARY) |
| 81 | |
| 82 | include $(CLEAR_VARS) |
| 83 | LOCAL_MODULE := libc++ |
| 84 | LOCAL_CLANG := true |
| 85 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
| 86 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Dan Albert | f155054 | 2014-05-06 14:16:05 -0700 | [diff] [blame] | 87 | LOCAL_RTTI_FLAG := -frtti |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 88 | LOCAL_LDFLAGS := -nodefaultlibs |
| 89 | LOCAL_LDLIBS := -lc |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 90 | |
| 91 | ifeq ($(HOST_OS), darwin) |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame^] | 92 | LOCAL_CPPFLAGS += -Iexternal/libcxxabi/include |
Dan Albert | 8a6f7b1 | 2014-05-01 17:49:58 -0700 | [diff] [blame] | 93 | LOCAL_LDFLAGS += \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 94 | -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \ |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 95 | -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \ |
| 96 | -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame^] | 97 | LOCAL_STATIC_LIBRARIES := libc++abi |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 98 | else |
Dan Albert | 9569f04 | 2014-05-01 18:12:37 -0700 | [diff] [blame^] | 99 | LOCAL_CPPFLAGS += -Iexternal/libcxxrt/src -DLIBCXXRT |
| 100 | LOCAL_STATIC_LIBRARIES := libcxxrt libcompiler_rt libunwind |
| 101 | LOCAL_LDLIBS += -lrt -lpthread -ldl |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 102 | endif |
| 103 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 104 | include $(BUILD_HOST_SHARED_LIBRARY) |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 105 | |
| 106 | endif # TARGET_BUILD_APPS |