Permalink
Browse files

Support sqlite on the dalvikvm host build.

Change-Id: I900daf7f205f8f666eac9c4070d2e5c99d85b3b3
  • Loading branch information...
1 parent 109038d commit 90f23688416d9f4e1e5d0128dca5f26404b6898e Jesse Wilson committed Sep 14, 2010
Showing with 35 additions and 9 deletions.
  1. +13 −4 android/Android.mk
  2. +22 −5 dist/Android.mk
View
@@ -1,22 +1,31 @@
LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= \
+libsqlite3_android_local_src_files := \
PhoneNumberUtils.cpp \
PhoneticStringUtils.cpp \
OldPhoneNumberUtils.cpp \
PhonebookIndex.cpp \
sqlite3_android.cpp
-LOCAL_C_INCLUDES := \
+libsqlite3_android_c_includes := \
external/sqlite/dist \
external/icu4c/i18n \
external/icu4c/common
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES:= $(libsqlite3_android_local_src_files)
+LOCAL_C_INCLUDES := $(libsqlite3_android_c_includes)
LOCAL_MODULE:= libsqlite3_android
-
include $(BUILD_STATIC_LIBRARY)
+ifeq ($(WITH_HOST_DALVIK),true)
+ include $(CLEAR_VARS)
+ LOCAL_SRC_FILES:= $(libsqlite3_android_local_src_files)
+ LOCAL_C_INCLUDES := $(libsqlite3_android_c_includes)
+ LOCAL_MODULE:= libsqlite3_android
+ include $(BUILD_HOST_STATIC_LIBRARY)
+endif
+
# Test for PhoneticStringUtils
include $(CLEAR_VARS)
View
@@ -8,6 +8,12 @@ LOCAL_PATH:= $(call my-dir)
common_src_files := sqlite3.c
+# NOTE the following flags,
+# SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want
+# SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2.
+# SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto-vacuum
+sqlite_cflags := -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 -DSQLITE_THREADSAFE=1 -DNDEBUG=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_DEFAULT_AUTOVACUUM=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_BACKWARDS
+
# the device library
include $(CLEAR_VARS)
@@ -17,11 +23,7 @@ ifneq ($(TARGET_ARCH),arm)
LOCAL_LDLIBS += -lpthread -ldl
endif
-# NOTE the following flags,
-# SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want
-# SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2.
-# SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto-vacuum
-LOCAL_CFLAGS += -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 -DSQLITE_THREADSAFE=1 -DNDEBUG=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_DEFAULT_AUTOVACUUM=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_BACKWARDS
+LOCAL_CFLAGS += $(sqlite_cflags)
ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SHARED_LIBRARIES := libdl
@@ -45,6 +47,21 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libsqlite3_android
include $(BUILD_SHARED_LIBRARY)
+
+ifeq ($(WITH_HOST_DALVIK),true)
+ include $(CLEAR_VARS)
+ LOCAL_SRC_FILES := $(common_src_files)
+ LOCAL_LDLIBS += -lpthread -ldl
+ LOCAL_CFLAGS += $(sqlite_cflags)
+ LOCAL_MODULE:= libsqlite
+ LOCAL_SHARED_LIBRARIES += libicuuc libicui18n
+ LOCAL_STATIC_LIBRARIES := liblog libutils libcutils
+
+ # include android specific methods
+ LOCAL_WHOLE_STATIC_LIBRARIES := libsqlite3_android
+ include $(BUILD_HOST_SHARED_LIBRARY)
+endif
+
##
##
## Build the device command line tool sqlite3

0 comments on commit 90f2368

Please sign in to comment.