summaryrefslogtreecommitdiffstats
path: root/libs/utils
diff options
context:
space:
mode:
authorDan Egnor <egnor@google.com>2010-05-06 17:35:06 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-06 17:35:06 -0700
commit7dd2bb84128d9026f045999b94644fcda772de52 (patch)
treea338e707a1837b40f2a00b82b44be4d9b446e457 /libs/utils
parenta1abd2133d13f05cdfd3f6c9fb5be92b9bd2063d (diff)
parente3c233d1a994459969efc7b6fd0309a82ec220db (diff)
downloadframeworks_native-7dd2bb84128d9026f045999b94644fcda772de52.zip
frameworks_native-7dd2bb84128d9026f045999b94644fcda772de52.tar.gz
frameworks_native-7dd2bb84128d9026f045999b94644fcda772de52.tar.bz2
am ca48c88c: am 8a8658a5: Merge "Make static versions of libutils and libbinder." into froyo
Merge commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f' into kraken * commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f': Make static versions of libutils and libbinder.
Diffstat (limited to 'libs/utils')
-rw-r--r--libs/utils/Android.mk10
-rw-r--r--libs/utils/String8.cpp9
2 files changed, 15 insertions, 4 deletions
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
index d0eedb4..afecdcb 100644
--- a/libs/utils/Android.mk
+++ b/libs/utils/Android.mk
@@ -104,3 +104,13 @@ endif # sim
LOCAL_MODULE:= libutils
include $(BUILD_SHARED_LIBRARY)
+ifneq ($(TARGET_SIMULATOR),true)
+ifeq ($(TARGET_OS),linux)
+include $(CLEAR_VARS)
+LOCAL_C_INCLUDES += external/zlib external/icu4c/common
+LOCAL_LDLIBS := -lrt -ldl -lpthread
+LOCAL_MODULE := libutils
+LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
+include $(BUILD_STATIC_LIBRARY)
+endif
+endif
diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp
index 3a34838..636cd83 100644
--- a/libs/utils/String8.cpp
+++ b/libs/utils/String8.cpp
@@ -136,10 +136,11 @@ static inline char* getEmptyString()
void initialize_string8()
{
-#ifdef LIBUTILS_NATIVE
- // Bite me, Darwin!
- gDarwinIsReallyAnnoying = gDarwinCantLoadAllObjects;
-#endif
+ // HACK: This dummy dependency forces linking libutils Static.cpp,
+ // which is needed to initialize String8/String16 classes.
+ // These variables are named for Darwin, but are needed elsewhere too,
+ // including static linking on any platform.
+ gDarwinIsReallyAnnoying = gDarwinCantLoadAllObjects;
SharedBuffer* buf = SharedBuffer::alloc(1);
char* str = (char*)buf->data();