1 ## 2 ## 3 ## Build the library 4 ## 5 ## 6 7 LOCAL_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 13 common_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 32 common_src_files := sqlite3.c 33 34 # the device library 35 include $(CLEAR_VARS) 36 37 LOCAL_SRC_FILES := $(common_src_files) 38 39 ifneq ($(TARGET_ARCH),arm) 40 LOCAL_LDLIBS += -lpthread -ldl 41 endif 42 43 LOCAL_CFLAGS += $(common_sqlite_flags) -DUSE_PREAD64 -Dfdatasync=fdatasync 44 45 LOCAL_SHARED_LIBRARIES := libdl 46 47 LOCAL_MODULE:= libsqlite 48 LOCAL_C_INCLUDES += $(call include-path-for, system-core)/cutils 49 LOCAL_SHARED_LIBRARIES += liblog \ 50 libicuuc \ 51 libicui18n \ 52 libutils \ 53 liblog 54 55 # include android specific methods 56 LOCAL_WHOLE_STATIC_LIBRARIES := libsqlite3_android 57 58 59 include $(BUILD_SHARED_LIBRARY) 60 61 62 ifeq ($(WITH_HOST_DALVIK),true) 63 include $(CLEAR_VARS) 64 LOCAL_SRC_FILES := $(common_src_files) 65 LOCAL_LDLIBS += -lpthread -ldl 66 LOCAL_CFLAGS += $(common_sqlite_flags) 67 LOCAL_MODULE:= libsqlite 68 LOCAL_SHARED_LIBRARIES += libicuuc libicui18n 69 LOCAL_STATIC_LIBRARIES := liblog libutils libcutils 70 71 # include android specific methods 72 LOCAL_WHOLE_STATIC_LIBRARIES := libsqlite3_android 73 include $(BUILD_HOST_SHARED_LIBRARY) 74 endif 75 76 ## 77 ## 78 ## Build the device command line tool sqlite3 79 ## 80 ## 81 ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of sqlite3 82 83 include $(CLEAR_VARS) 84 85 LOCAL_SRC_FILES := shell.c 86 87 LOCAL_C_INCLUDES := $(LOCAL_PATH)/../android $(call include-path-for, system-core)/cutils 88 89 LOCAL_SHARED_LIBRARIES := libsqlite \ 90 libicuuc \ 91 libicui18n \ 92 libutils 93 94 ifneq ($(TARGET_ARCH),arm) 95 LOCAL_LDLIBS += -lpthread -ldl 96 endif 97 98 LOCAL_CFLAGS += $(common_sqlite_flags) -DUSE_PREAD64 99 100 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) 101 102 LOCAL_MODULE_TAGS := debug 103 104 LOCAL_MODULE := sqlite3 105 106 include $(BUILD_EXECUTABLE) 107 108 endif # !SDK_ONLY 109 110 111 ## 112 ## 113 ## Build the host command line tool sqlite3 114 ## 115 ## 116 117 include $(CLEAR_VARS) 118 119 LOCAL_SRC_FILES := $(common_src_files) shell.c 120 121 LOCAL_CFLAGS += $(common_sqlite_flags) -DNO_ANDROID_FUNCS=1 122 123 # sqlite3MemsysAlarm uses LOG() 124 LOCAL_STATIC_LIBRARIES += liblog 125 126 ifeq ($(strip $(USE_MINGW)),) 127 LOCAL_LDLIBS += -lpthread 128 ifneq ($(HOST_OS),freebsd) 129 LOCAL_LDLIBS += -ldl 130 endif 131 endif 132 133 LOCAL_MODULE := sqlite3 134 135 include $(BUILD_HOST_EXECUTABLE) 136