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