您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 企业文化 > 实验17-嵌入式数据库sqlite移植实验
1SQLitenSQLitenSQLitenCnLinuxvinMakefilenLinuxnUP-NETARM2410-SnPCPentium50040G128MnPCRedHatLinux9.0nARM-LINUXnsqlite-2.8.17-2410.tar.bz2nsqlite-3.3.8.tar.gzsqlite-2.8.17-2410.tar.bz2configureMakefileMakefilesqlitex86armsqlite-2.8.17-2410.tar.bz2sqlite1SQLiteGeneratedbyFoxitPDFCreator©FoxitSoftware©FoxitSoftware[root@localhostarm2410s]#tarxjfsqlite-2.8.17-2410.tar.bz2b.sqlite-2.8.17[root@localhostarm2410s]#cdsqlite-2.8.172.configureMakefilea.src/sqliteInt.h#ifSQLITE_PTR_SZ==4#defineINTPTR_TYPEint#else#defineINTPTR_TYPElonglong#endif115#defineSQLITE_PTR_SZ4btreeBintlonglongb.configure1915319157199911999520420204242039420398#iftest$cross_compiling=yes;then#{{echo$as_me:12710:error:unabletofindacompilerforbuildingbuildtools&5#echo$as_me:error:unabletofindacompilerforbuildingbuildtools&2;}#{(exit1);exit1;};}#fi#else#test$cross_compiling=yes&{{echo$as_me:$LINENO:error:cannotcheckforfileexistenceGeneratedbyFoxitPDFCreator©FoxitSoftware:error:cannotcheckforfileexistencewhencrosscompiling&2;}#{(exit1);exit1;};}configurec.build[root@localhostsqlite-2.8.17]#mkdirbuild[root@localhostsqlite-2.8.17]#cdbuild[root@localhostbuild]#ls[root@localhostbuild]#../configure--disable-tcl--host=armv4l-unknown-linuxMakefile[root@localhostbuild]#lsconfig.logconfig.statuslibtoolMakefilesqlite.pc3.MakefileMakefilea.BCC=armv4l-unknown-linux-gcc-g-O2BCC=gcc-g-O2TCCb.alllibsqlite.lalibsqlite.aall:sqlite.hlibsqlite.asqliteMakefile:$(TOP)/Makefile.in./config.status#Generatethefilelast_changewhichcontainsthedateofchange#ofthemostrecentlymodifiedsourcecodefile#last_change:$(SRC)cat$(SRC)|grep'$$Id:'|sort+4|tail-1\|awk'{print$$5,$$6}'last_changelibsqlite.a:$(LIBOBJ)$(LTLINK)-olibsqlite.a$(LIBOBJ)${RELEASE}-rpath${prefix}/lib\-version-info8:6:8libtclsqlite.la:tclsqlite.lolibsqlite.a$(LTLINK)-olibtclsqlite.latclsqlite.lo\libsqlite.a$(LIBTCL)-rpath${prefix}/lib/sqlite\GeneratedbyFoxitPDFCreator©FoxitSoftware:8sqlite:$(TOP)/src/shell.clibsqlite.asqlite.h$(LTLINK)$(READLINE_FLAGS)-osqlite$(TOP)/src/shell.c\libsqlite.a$(LIBREADLINE)sqlitearm-linux.aMakefile4makecleanmake17.3sqlitesqlitestrip[root@localhostbuild]#filesqlitesqlite:ELF32-bitLSBexecutable,ARM,version1(ARM),forGNU/Linux2.0.0,dynamicallylinked(usessharedlibs),notstripped[root@localhostbuild]#armv4l-unknown-linux-stripsqlite[root@localhostbuild]#filesqlitesqlite:ELF32-bitLSBexecutable,ARM,version1(ARM),forGNU/Linux2.0.0,dynamicallylinked(usessharedlibs),stripped5.minicommounthostmount–tnfs–o192.168.0.121:/arm2410s/host17.4sqlitesqlite[/host/sqlite-2.8.17/build]sqliteex1SQLiteversion2.8.17Enter.helpforinstructionssqlitecreatetabletbl1(onevarchar(10),twosmallint);SQLerror:databaseislockedsqlite[1]+Stoppedsqliteex1sqlite[/host/sqlite-2.8.17/build]cpsqlite/mnt/yaffs/[/host/sqlite-2.8.17/build]cd/mnt/yaffs/[/mnt/yaffs]lsbluetoothgps_gprskbd_gpmpcmcia-modtouchscreenwireless485caniccardlibsdcarducos4[4daidelibwebs.aserial_8250videoQtopiaexpinit.shlost+foundsoundwebadfpgairdamotorsqliteweb1GeneratedbyFoxitPDFCreator©FoxitSoftware[/mnt/yaffs]./sqliteex1SQLiteversion2.8.17Enter.helpforinstructionssqlitecreatetabletbl1(onevarchar(10),twosmallint);sqliteinsertintotbl1values('hello!',10);sqliteinsertintotbl1values('goodbye',20);sqliteselect*fromtbl1;hello!|10goodbye|20sqliteexit...[2]+Stopped./sqliteex1[/mnt/yaffs]SQLite17.317.4GeneratedbyFoxitPDFCreator©FoxitSoftware(void*NotUsed,intargc,char**argv,char**azColName){inti;for(i=0;iargc;i++){printf(%s=%s\n,azColName[i],argv[i]?argv[i]:NULL);}printf(\n);return0;}intmain(intargc,char**argv){sqlite*db;char*zErrMsg=0;intrc;if(argc!=3){fprintf(stderr,Usage:%sDATABASESQL-STATEMENT\n,argv[0]);exit(1);}db=sqlite_open(argv[1],0666,&zErrMsg);if(db==NULL){fprintf(stderr,Can'topendatabase:%s\n,&zErrMsg);sqlite_close(db);GeneratedbyFoxitPDFCreator©FoxitSoftware(1);}rc=sqlite_exec(db,argv[2],callback,0,&zErrMsg);if(rc!=SQLITE_OK){fprintf(stderr,SQLerror:%s\n,zErrMsg);}sqlite_close(db);return0;}2.[root@localhostbuild]#armv4l-unknown-linux-gcc-I/arm2410s/sqlite-2.8.17/build-L/arm2410s/sqlite-2.8.17/build-otestopendbsqlite.c–lsqlitetestarmv4l-unknown-linux-gcc-Isqlite.h-Llibsqlite.a-lsqlitelibsqlite.a3.armtest/mnt/yaffssqliteex1[/host/sqlite-2.8.17/build]cptest/mnt/yaffs/[/host/sqlite-2.8.17/build]cd/mnt/yaffs/[/mnt/yaffs]./testUsage:./testDATABASESQL-STATEMENT[/mnt/yaffs]./te
本文标题:实验17-嵌入式数据库sqlite移植实验
链接地址:https://www.777doc.com/doc-4248777 .html