Android.mk revision eaedcae89bc45d6bf6426edad6e39507722a8701
1## 2## 3## Build the library 4## 5## 6 7LOCAL_PATH:= $(call my-dir) 8 9common_sqlite_flags := -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 -DSQLITE_DEFAULT_FILE_FORMAT=4 10 11common_src_files := sqlite3.c 12 13# the device library 14include $(CLEAR_VARS) 15 16LOCAL_SRC_FILES := $(common_src_files) 17 18ifneq ($(TARGET_ARCH),arm) 19LOCAL_LDLIBS += -lpthread -ldl 20endif 21 22# NOTE the following flags, 23# SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want 24# SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2. 25# SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto-vacuum 26LOCAL_CFLAGS += $(common_sqlite_flags) 27 28ifneq ($(TARGET_SIMULATOR),true) 29LOCAL_SHARED_LIBRARIES := libdl 30endif 31 32LOCAL_MODULE:= libsqlite 33LOCAL_C_INCLUDES += $(call include-path-for, system-core)/cutils 34LOCAL_SHARED_LIBRARIES += liblog \ 35 libicuuc \ 36 libicui18n \ 37 libutils 38 39# include android specific methods 40LOCAL_WHOLE_STATIC_LIBRARIES := libsqlite3_android 41 42## Choose only one of the allocator systems below 43# new sqlite 3.5.6 no longer support external allocator 44#LOCAL_SRC_FILES += mem_malloc.c 45#LOCAL_SRC_FILES += mem_mspace.c 46 47 48include $(BUILD_SHARED_LIBRARY) 49 50## 51## 52## Build the device command line tool sqlite3 53## 54## 55ifneq ($(SDK_ONLY),true) # SDK doesn't need device version of sqlite3 56 57include $(CLEAR_VARS) 58 59LOCAL_SRC_FILES := shell.c 60 61LOCAL_C_INCLUDES := $(LOCAL_PATH)/../android $(call include-path-for, system-core)/cutils 62 63LOCAL_SHARED_LIBRARIES := libsqlite \ 64 libicuuc \ 65 libicui18n \ 66 libutils 67 68ifneq ($(TARGET_ARCH),arm) 69LOCAL_LDLIBS += -lpthread -ldl 70endif 71 72LOCAL_CFLAGS += $(common_sqlite_flags) 73 74LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) 75 76LOCAL_MODULE_TAGS := debug 77 78LOCAL_MODULE := sqlite3 79 80include $(BUILD_EXECUTABLE) 81 82endif # !SDK_ONLY 83 84 85## 86## 87## Build the host command line tool sqlite3 88## 89## 90 91include $(CLEAR_VARS) 92 93LOCAL_SRC_FILES := $(common_src_files) shell.c 94 95LOCAL_CFLAGS += $(common_sqlite_flags) -DNO_ANDROID_FUNCS=1 96 97# sqlite3MemsysAlarm uses LOG() 98LOCAL_STATIC_LIBRARIES += liblog 99 100 101have_readline := $(wildcard /usr/include/readline/readline.h) 102have_history := $(wildcard /usr/lib/libhistory*) 103ifneq ($(strip $(have_readline)),) 104LOCAL_CFLAGS += -DHAVE_READLINE=1 105endif 106 107ifeq ($(strip $(USE_MINGW)),) 108LOCAL_LDLIBS += -lpthread 109ifneq ($(HOST_OS),freebsd) 110LOCAL_LDLIBS += -ldl 111endif 112endif 113 114ifneq ($(strip $(have_readline)),) 115LOCAL_LDLIBS += -lreadline -lncurses 116endif 117ifneq ($(strip $(have_history)),) 118LOCAL_LDLIBS += -lhistory 119endif 120 121LOCAL_MODULE := sqlite3 122 123include $(BUILD_HOST_EXECUTABLE) 124 125