提交 6433eeae 编写于 作者: xpxyr's avatar xpxyr 提交者: geniusgogo

build env component removal

上级 dd2a4cd4
......@@ -26,7 +26,14 @@ BCC = gcc -g
# will run on the target platform. (BCC and TCC are usually the
# same unless your are cross-compiling.)
#
TCC = arm-none-eabi-gcc -g -O2 -DSQLITE_OS_UNIX=1 -I. -I${TOP}/src -I${TOP}/ext/rtree
TCC = arm-none-eabi-gcc -g -O2 \
-DSQLITE_OS_OTHER=1 -DSQLITE_OS_RTT=1 \
-I. -I${TOP}/src -I${TOP}/ext/rtree \
-I../../../../include \
-I../../../../components/dfs/include \
-I../../../../components/libc/newlib \
-I../../../../components/libc/newlib/sys \
-I../../../../bsp/mini2440
# Define this for the autoconf-based build, so that the code knows it can
# include the generated config.h
......@@ -75,7 +82,9 @@ TEMP_STORE = -DSQLITE_TEMP_STORE=1
# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
# The same set of OMIT and ENABLE flags should be passed to the
# LEMON parser generator and the mkkeywordhash tool as well.
OPT_FEATURE_FLAGS = -DSQLITE_OMIT_LOAD_EXTENSION=1
OPT_FEATURE_FLAGS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_RTT_NO_WIDE=1 \
-DSQLITE_OMIT_WAL -DSQLITE_ENABLE_LOCKING_STYLE=0 \
-DSQLITE_DISABLE_LOCKING_STYLE=1
TCC += $(OPT_FEATURE_FLAGS)
......@@ -173,8 +182,8 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
icu.lo insert.lo journal.lo legacy.lo loadext.lo \
main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
memjournal.lo \
mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
mutex.lo mutex_noop.lo mutex_rtt.lo \
notify.lo opcodes.lo os.lo os_rtt.lo \
pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
random.lo resolve.lo rowset.lo rtree.lo select.lo status.lo \
table.lo tokenize.lo trigger.lo \
......@@ -233,14 +242,12 @@ SRC = \
$(TOP)/src/mutex.c \
$(TOP)/src/mutex.h \
$(TOP)/src/mutex_noop.c \
$(TOP)/src/mutex_unix.c \
$(TOP)/src/mutex_w32.c \
$(TOP)/src/mutex_rtt.c \
$(TOP)/src/notify.c \
$(TOP)/src/os.c \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
$(TOP)/src/os_rtt.c \
$(TOP)/src/pager.c \
$(TOP)/src/pager.h \
$(TOP)/src/parse.y \
......@@ -676,11 +683,8 @@ mutex.lo: $(TOP)/src/mutex.c $(HDR)
mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
mutex_unix.lo: $(TOP)/src/mutex_unix.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
mutex_rtt.lo: $(TOP)/src/mutex_rtt.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_rtt.c
notify.lo: $(TOP)/src/notify.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
......@@ -697,11 +701,8 @@ pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
os.lo: $(TOP)/src/os.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
os_win.lo: $(TOP)/src/os_win.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
os_rtt.lo:$(TOP)/src/os_rtt.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_rtt.c
pragma.lo: $(TOP)/src/pragma.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
......@@ -976,21 +977,3 @@ clean:
distclean: clean
rm -f config.log config.status libtool Makefile sqlite3.pc
#
# Windows section
#
dll: sqlite3.dll
REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
$(REAL_LIBOBJ): $(LIBOBJ)
sqlite3.def: $(REAL_LIBOBJ)
echo 'EXPORTS' >sqlite3.def
nm $(REAL_LIBOBJ) | grep ' T ' | grep ' _sqlite3_' \
| sed 's/^.* _//' >>sqlite3.def
sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
$(TCC) -shared -o $@ sqlite3.def \
-Wl,"--strip-all" $(REAL_LIBOBJ)
......@@ -35,10 +35,10 @@
/* #undef HAVE_LOCALTIME_S */
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* #define HAVE_MALLOC_H 0 */
/* Define to 1 if you have the `malloc_usable_size' function. */
#define HAVE_MALLOC_USABLE_SIZE 1
/* #define HAVE_MALLOC_USABLE_SIZE 0 */
/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
......
......@@ -245,8 +245,6 @@ foreach file {
mem5.c
mutex.c
mutex_noop.c
mutex_unix.c
mutex_w32.c
mutex_rtt.c
malloc.c
printf.c
......@@ -256,8 +254,6 @@ foreach file {
hash.c
opcodes.c
os_unix.c
os_win.c
os_rtt.c
bitvec.c
......
......@@ -10,16 +10,16 @@
* SQLite compile macro
*/
#define RT_USING_SQLITE
#define SQLITE_MINIMUM_FILE_DESCRIPTOR 0
#define SQLITE_OMIT_LOAD_EXTENSION 1
#define SQLITE_RTT_NO_WIDE 1
#define SQLITE_OMIT_WAL
#define SQLITE_RTT_NO_WIDE 1
#define SQLITE_ENABLE_LOCKING_STYLE 0
#define SQLITE_DISABLE_LOCKING_STYLE 1
#define SQLITE_TEMP_STORE 1
#define SQLITE_THREADSAFE 1
#define HAVE_READLINE 0
#define NDEBUG
#define SQLITE_TEST
#define _HAVE_SQLITE_CONFIG_H
#define BUILD_sqlite
#define SQLITE_OS_OTHER 1
......
......@@ -11,18 +11,23 @@ static int callback(void *NotUsed, int argc, char **argv, char **azColName){
return 0;
}
int test10_main(int argc, char **argv){
int test10_main(void){
static int step = 0;
int argc = 4;
char *argv[4] = {"test10_main", "test.db",
"create table mytable(entry1 int)",
"drop table mytable"};
sqlite3 *db;
char *zErrMsg = 0;
int rc;
if( argc!=3 ){
if( argc<3 ){
rt_kprintf("Usage: %s DATABASE SQL-STATEMENT\n", argv[0]);
return(1);
}
rt_kprintf("ready open %s\n", argv[1]);
rc = sqlite3_open(argv[1], &db);
if( rc ){
rt_kprintf("Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
......@@ -31,12 +36,32 @@ int test10_main(int argc, char **argv){
else{
rt_kprintf("open %s success\n", argv[1]);
}
rt_kprintf("SQL exec: %s\n", argv[2]);
rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);
if( rc!=SQLITE_OK ){
rt_kprintf("SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
if (step == 0) {
rt_kprintf("SQL exec: %s\n", argv[2]);
rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);
if( rc!=SQLITE_OK ){
rt_kprintf("SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}
else{
rt_kprintf("SQL exec: %s success\n", argv[2]);
}
}
else {
rt_kprintf("SQL exec: %s\n", argv[3]);
rc = sqlite3_exec(db, argv[3], callback, 0, &zErrMsg);
if( rc!=SQLITE_OK ){
rt_kprintf("SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}
else{
rt_kprintf("SQL exec: %s success\n", argv[3]);
}
}
step = !step;
sqlite3_close(db);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册