分类:
2006-07-20 17:17:36
$tar zxvf ite-2.8.15.tar.gz -C uClinux-dist/user/ |
uClinux-dist/user/Makefile uClinux-dist/config/Configure.help uClinux-dist/config/config.in |
ite/main.mk 修改 ite/Makefile 添加 ite/src/os.c 修改 ite/src/shell.c 修改 |
TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src |
TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src $(CFLAGS) |
ite$(EXE): $(TOP)/src/shell.c libite.a ite.h $(TCCX) $(READLINE_FLAGS) -o ite$(EXE) $(TOP)/src/shell.c \ libite.a $(LIBREADLINE) $(THREADLIB) |
shell.o: $(TOP)/src/shell.c ite.h $(TCCX) $(READLINE_FLAGS) -c $(TOP)/src/shell.c ite$(EXE): shell.o libite.a $(TCC) $(LDFLAGS) -o $@ shell.o \ libite.a $(LIBREADLINE) $(THREADLIB) $(LDLIBS) |
install: ite libite.a ite.h mv ite /usr/bin mv libite.a /usr/lib mv ite.h /usr/include |
romfs: ite $(ROMFSINST) /bin/ite |
clean: rm -f *.o ite libite.a ite.h opcodes.* rm -f lemon lempar.c parse.* ite*.tar.gz rm -f $(PUBLISH) rm -f *.da *.bb *.bbg gmon.out rm -rf tsrc |
clean: rm -f *.o ite libite.a ite.h opcodes.* ite.gdb rm -f $(PUBLISH) rm -f *.da *.bb *.bbg gmon.out rm -rf tsrc distclean: clean rm -f lemon lempar.c parse.* ite*.tar.gz rm -f config.h |
===========Makefile内容开始=========== #!/usr/make # # Makefile for SQLITE # # This is a template makefile for SQLite. Most people prefer to # use the autoconf generated "configure" script to generate the # makefile automatically. But that does not work for everybody # and in every situation. If you are having problems with the # "configure" script, you might want to try this makefile as an # alternative. Create a copy of this file, edit the parameters # below and type "make". # #### The toplevel directory of the source tree. This is the directory # that contains this "Makefile.in" and the "configure.in" script. # TOP = . #### C Compiler and options for use in building executables that # will run on the platform that is doing the build. # BCC = gcc -g -O2 #BCC = /opt/ancic/bin/c89 -0 #### If the target operating system supports the "usleep()" system # call, then define the HAVE_USLEEP macro for all C modules. # #USLEEP = USLEEP = -DHAVE_USLEEP=1 #### If you want the SQLite library to be safe for use within a # multi-threaded program, then define the following macro # appropriately: # #THREADSAFE = -DTHREADSAFE=1 THREADSAFE = -DTHREADSAFE=0 #### Specify any extra linker options needed to make the library # thread safe # #THREADLIB = -lpthread THREADLIB = #### Leave MEMORY_DEBUG undefined for maximum speed. Use MEMORY_DEBUG=1 # to check for memory leaks. Use MEMORY_DEBUG=2 to print a log of all # malloc()s and free()s in order to track down memory leaks. # # SQLite uses some expensive assert() statements in the inner loop. # You can make the library go almost twice as fast if you compile # with -DNDEBUG=1 # #OPTS = -DMEMORY_DEBUG=2 #OPTS = -DMEMORY_DEBUG=1 #OPTS = -DNDEBUG=1 OPTS = -DMEMORY_DEBUG=1 #### The suffix to add to executable files. ".exe" for windows. # Nothing for unix. # #EXE = .exe EXE = #### C Compile and options for use in building executables that # will run on the target platform. This is usually the same # as BCC, unless you are cross-compiling. # TCC = $(CROSS)gcc FLTFLAGS += -s 12000 #TCC = gcc -g -O0 -Wall #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage #TCC = /opt/mingw/bin/i386-mingw32-gcc -O6 #TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive #### Tools used to build a static library. # AR = $(CROSS)ar cr #AR = /opt/mingw/bin/i386-mingw32-ar cr RANLIB = $(CROSS)ranlib #RANLIB = /opt/mingw/bin/i386-mingw32-ranlib #### Extra compiler options needed for programs that use the TCL library. # #TCL_FLAGS = #TCL_FLAGS = -DSTATIC_BUILD=1 #TCL_FLAGS = -I/home/drh/tcltk/8.4linux #TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1 #TCL_FLAGS = -I/home/drh/tcltk/8.3hpux #### Linker options needed to link against the TCL library. # #LIBTCL = -ltcl -lm -ldl #LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl #LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt #LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc #### Compiler options needed for programs that use the readline() library. # READLINE_FLAGS = #READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline #### Linker options needed by programs using readline() must link against. # #LIBREADLINE = #LIBREADLINE = -static -lreadline -ltermcap #### Should the database engine assume text is coded as UTF-8 or iso8859? # # ENCODING = UTF8 ENCODING = ISO8859 # You should not have to change anything below this line ############################################################################### include $(TOP)/main.mk ===========Makefile内容结束=========== |
The configure script uses autoconf 2.50 and libtool. If the configure script does not work out for you, there is a generic makefile named "Makefile.linux-gcc" in the top directory of the source tree that you can copy and edit to suite your needs. Comments on the generic makefile show what changes are needed. |
if( s!=0 ) |
if( s!=0 && errno != ENOSYS ) |
int colWidth[100]; int actualWidth[100]; char outfile[FILENAME_MAX]; |
int colWidth[20]; int actualWidth[20]; char *outfilep; |
#ifndef FILENAME_MAX #define FILENAME_MAX 4095 #endif char outfilename[FILENAME_MAX]; /* Filename for *out */ |
struct callback_data { ... }; #ifndef FILENAME_MAX #define FILENAME_MAX 4095 #endif char outfilename[FILENAME_MAX]; /* Filename for *out */ |
ite_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg); |
memcpy(&data, p, sizeof(data)); |
data.cnt = 0; |
open_db(p); memcpy(&data, p, sizeof(data)); data.cnt = 0; |
strcmp(azArg[1],"stdout")==0 |
strcpy(p->outfile,azArg[1]); |
strcpy(outfilename,azArg[1]); p->outfilep = outfilename; |
fprintf(p->out,"%9.9s: %s\n","output", |
fprintf(p->out,"%9.9s: %s\n","output", strlen(p->outfile) ? p->outfile : "stdout"); |
fprintf(p->out,"%9.9s: %s\n","output", p->outfilep && strlen(p->outfilep) ? p->outfilep : "stdout"); |
Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| GDB/ARMulator support by For further information check: / Command: /bin/ifconfig eth0 up 10.0.0.2 Execution Finished, Exiting init: Booting to single user mode Sash command shell (version 1.1.1) /> cd bin /bin> ls -l ite -rwxr-xr-x 1 0 0 327072 Jan 01 00:00 ite /bin >cd /tmp /tmp>ite test.ite ite> create table my(name varchar(80), num smallint); ite> insert into my values('yutao', 100); ite> insert into my values('uclinux', 99); ite> select * from my; yutao|100 uclinux|99 ite> .tables my ite> .schema create table my(name varchar(80), num smallint); ite> .q /tmp>ls –l test.ite |