1## 2## 3## Build the library 4## 5## 6 7LOCAL_PATH:= $(call my-dir) 8 9# NOTE the following flags, 10# SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want 11# SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2. 12# SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto-vacuum 13common_sqlite_flags := \ 14 -DNDEBUG=1 \ 15 -DHAVE_USLEEP=1 \ 16 -DSQLITE_HAVE_ISNAN \ 17 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \ 18 -DSQLITE_THREADSAFE=2 \ 19 -DSQLITE_TEMP_STORE=3 \ 20 -DSQLITE_POWERSAFE_OVERWRITE=1 \ 21 -DSQLITE_DEFAULT_FILE_FORMAT=4 \ 22 -DSQLITE_DEFAULT_AUTOVACUUM=1 \ 23 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 \ 24 -DSQLITE_ENABLE_FTS3 \ 25 -DSQLITE_ENABLE_FTS3_BACKWARDS \ 26 -DSQLITE_ENABLE_FTS4 \ 27 -DSQLITE_OMIT_BUILTIN_TEST \ 28 -DSQLITE_OMIT_COMPILEOPTION_DIAGS \ 29 -DSQLITE_OMIT_LOAD_EXTENSION \ 30 -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 31 32common_src_files := sqlite3.c 33 34# the device library 35include $(CLEAR_VARS) 36 37LOCAL_SRC_FILES := $(common_src_files) 38 39ifneq ($(TARGET_ARCH),arm) 40LOCAL_LDLIBS += -lpthread -ldl 41endif 42 43LOCAL_CFLAGS += $(common_sqlite_flags) -DUSE_PREAD64 -Dfdatasync=fdatasync 44 45LOCAL_SHARED_LIBRARIES := libdl 46 47LOCAL_MODULE:= libsqlite 48LOCAL_C_INCLUDES += $(call include-path-for, system-core)/cutils 49LOCAL_SHARED_LIBRARIES += liblog \ 50 libicuuc \ 51 libicui18n \ 52 libutils 53 54# include android specific methods 55LOCAL_WHOLE_STATIC_LIBRARIES := libsqlite3_android 56 57 58include $(BUILD_SHARED_LIBRARY) 59 60 61ifeq ($(WITH_HOST_DALVIK),true) 62 include $(CLEAR_VARS) 63 LOCAL_SRC_FILES := $(common_src_files) 64 LOCAL_LDLIBS += -lpthread -ldl 65 LOCAL_CFLAGS += $(common_sqlite_flags) 66 LOCAL_MODULE:= libsqlite 67 LOCAL_SHARED_LIBRARIES += libicuuc libicui18n 68 LOCAL_STATIC_LIBRARIES := liblog libutils libcutils 69 70 # include android specific methods 71 LOCAL_WHOLE_STATIC_LIBRARIES := libsqlite3_android 72 include $(BUILD_HOST_SHARED_LIBRARY) 73endif 74 75## 76## 77## Build the device command line tool sqlite3 78## 79## 80ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of sqlite3 81 82include $(CLEAR_VARS) 83 84LOCAL_SRC_FILES := shell.c 85 86LOCAL_C_INCLUDES := $(LOCAL_PATH)/../android $(call include-path-for, system-core)/cutils 87 88LOCAL_SHARED_LIBRARIES := libsqlite \ 89 libicuuc \ 90 libicui18n \ 91 libutils 92 93ifneq ($(TARGET_ARCH),arm) 94LOCAL_LDLIBS += -lpthread -ldl 95endif 96 97LOCAL_CFLAGS += $(common_sqlite_flags) -DUSE_PREAD64 98 99LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) 100 101LOCAL_MODULE_TAGS := debug 102 103LOCAL_MODULE := sqlite3 104 105include $(BUILD_EXECUTABLE) 106 107endif # !SDK_ONLY 108 109 110## 111## 112## Build the host command line tool sqlite3 113## 114## 115 116include $(CLEAR_VARS) 117 118LOCAL_SRC_FILES := $(common_src_files) shell.c 119 120LOCAL_CFLAGS += $(common_sqlite_flags) -DNO_ANDROID_FUNCS=1 121 122# sqlite3MemsysAlarm uses LOG() 123LOCAL_STATIC_LIBRARIES += liblog 124 125ifeq ($(strip $(USE_MINGW)),) 126LOCAL_LDLIBS += -lpthread 127ifneq ($(HOST_OS),freebsd) 128LOCAL_LDLIBS += -ldl 129endif 130endif 131 132LOCAL_MODULE := sqlite3 133 134include $(BUILD_HOST_EXECUTABLE) 135