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