[SQL9.com] iihero实验室首页 .PostgreSQL .综合技术 .随笔 .MySQL|Others .Oracle .Sybase .图书|工具

A shell script for download and compile and ship SQLite automatically on Windows OS

发布栏目:MySQL|Others|发布时间:2012-03-25
Compared with manually create a VS project, combind the code and compile, adjust the project properties. It's wasting time to some extent.

So I write this script to speed up the compile and shipping.

You just need a VS2008 with VC. Populate the vcvars.bat in advance.  Of course, you need 3rd party tool:  wget and 7z which will be used for the download of sqlite source code.

以前手动下载,并且建工程,编译,挺浪费时间的。干脆用wget, 7z, 结合批处理,整理成一个可以下载并编译成dll和exe的脚本。 


运行脚本之前,请先将vs2008的vcvar运行一下,得到vc的编译环境。 

内容如下: 

  1. @echo off  
  2. set version=%1  
  3. set os_cpu=win32-x86  
  4.   
  5. rem  
  6. rem from sqlite3.7.4,  
  7. rem sqlite3-product-version.zip  
  8. rem sqlite3-product-version.tar.gz  
  9. rem sqlite3-product-os-cpu-version.zip  
  10. rem sqlite3-product-date.zip  
  11. @rem sqlite-build  3070500 3070400 3070800  
  12.   
  13. if not exist "sqlite-amalgamation-%version%.zip" (  
  14.     echo fetching sqlite-amalgamation-%version%.zip ...   
  15.     wget http://www.sqlite.org/sqlite-amalgamation-%version%.zip  
  16.     if not exist "sqlite-amalgamation-%version%.zip" (  
  17.         echo download sqlite-amalgamation-%version%.zip error!  
  18.         goto EOF  
  19.     )  
  20. )  
  21.   
  22. 7z x -y -o.sqlite-amalgamation-%version% "sqlite-amalgamation-%version%.zip"  
  23. if exist ".sqlite-amalgamation-%version%sqlite-amalgamation-%version%" (  
  24.     move .sqlite-amalgamation-%version%sqlite-amalgamation-%version%* .sqlite-amalgamation-%version%  
  25. )  
  26.   
  27. if not exist ".sqlite-amalgamation-%version%shell.c" (  
  28.     echo copy shell.c from another location ...  
  29.     if not exist ".sqlite-source-%version%.zip" (  
  30.         echo fetching sqlite-source-%version%.zip ...  
  31.         wget http://www.sqlite.org/sqlite-source-%version%.zip  
  32.     )  
  33.     7z x -y -o.sqlite-source-%version% "sqlite-source-%version%.zip"  
  34.     copy /y .sqlite-source-%version%shell.c .sqlite-amalgamation-%version%  
  35.     rd /s /q sqlite-source-%version%  
  36.       
  37.     echo copy shell.c from another location ...  
  38.     if not exist ".sqlite-src-%version%.zip" (  
  39.         echo fetching sqlite-src-%version%.zip ...  
  40.         wget http://www.sqlite.org/sqlite-src-%version%.zip  
  41.     )  
  42.     7z x -y -o. "sqlite-src-%version%.zip"  
  43.     copy /y .sqlite-src-%version%shell.c .sqlite-amalgamation-%version%  
  44.     rd /s /q sqlite-src-%version%      
  45. )  
  46.   
  47. if not exist ".sqlite-amalgamation-%version%sqlite3.def" (  
  48.     if not exist "sqlitedll-%version%.zip" (  
  49.         echo fetching sqlitedll-%version%.zip ...  
  50.         wget http://www.sqlite.org/sqlitedll-%version%.zip  
  51.     )  
  52.     7z x -y -o.sqlitedll-%version% "sqlitedll-%version%.zip"  
  53.     copy /y .sqlitedll-%version%sqlite3.def .sqlite-amalgamation-%version%  
  54.     rd /s /q sqlitedll-%version%    
  55.   
  56.     echo try another dll zip  
  57.     if not exist "sqlite-dll-%os_cpu%-%version%.zip" (  
  58.         echo fetching sqlite-dll-%os_cpu%-%version%.zip ...  
  59.         wget http://www.sqlite.org/sqlite-dll-%os_cpu%-%version%.zip  
  60.     )  
  61.     7z x -y -o.sqlite-dll-%os_cpu%-%version% "sqlite-dll-%os_cpu%-%version%.zip"  
  62.     copy /y .sqlite-dll-%os_cpu%-%version%sqlite3.def .sqlite-amalgamation-%version%  
  63.     rd /s /q sqlite-dll-%os_cpu%-%version%       
  64. )  
  65.   
  66. cd /d sqlite-amalgamation-%version%  
  67. echo begin building sqlite-amalgamation-%version%  
  68.   
  69. cl -Gs -GX -D_WIN32 -nologo -Zi -DOS_WIN=1 -DSQLITE_DEBUG=1 -DWIN32=1 -DTHREADSAFE=1 -DSQLITE_OS_WIN=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SOUNDEX=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -I. shell.c sqlite3.c -o sqlite3.exe  
  70.   
  71. echo sqlite3.exe build finished ......  
  72.   
  73. cl /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SQLITE3_EXPORTS" /D THREADSAFE=1 /D SQLITE_OS_WIN=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_SOUNDEX=1 /D QLITE_OMIT_LOAD_EXTENSION=1 /D SQLITE_ENABLE_RTREE=1 /YX /Fp"sqlite3.pch" /FD /GZ /c /debug sqlite3.c  
  74.   
  75. rem lib -out:"sqlite3.lib" sqlite3.obj  
  76.   
  77. link.exe kernel32.lib user32.lib /nologo /dll /incremental:yes /debug /machine:I386 /pdb:"sqlite3.pdb" /def:"sqlite3.def" /out:"sqlite3.dll" /implib:"sqlite3.lib" /pdbtype:sept sqlite3.obj  
  78.   
  79. echo sqlite3.dll build finished ......  
  80.   
  81. echo end building sqlite-amalgamation-%version%  
  82. echo -----------------------------------------------  
  83. cd /d ..  
  84.   
  85.   
  86. :EOF  
  87. @echo on  


以下是我的执行结果: 
引用
fetching sqlite-amalgamation-3070800.zip ... 
--2011-09-20 08:48:30--  http://www.sqlite.org/sqlite-amalgamation-3070800.zip 
Resolving www.sqlite.org... 67.18.92.124 
Connecting to www.sqlite.org|67.18.92.124|:80... connected. 
HTTP request sent, awaiting response... 200 OK 
Length: 1329197 (1.3M) [application/zip] 
Saving to: `sqlite-amalgamation-3070800.zip' 

100%[==========================================================>] 1,329,197    119K/s   in 11s 

2011-09-20 08:48:41 (120 KB/s) - `sqlite-amalgamation-3070800.zip' saved [1329197/1329197] 


7-Zip 9.15 beta  Copyright (c) 1999-2010 Igor Pavlov  2010-06-20 

Processing archive: sqlite-amalgamation-3070800.zip 

Extracting  sqlite-amalgamation-3070800 
Extracting  sqlite-amalgamation-3070800shell.c 
Extracting  sqlite-amalgamation-3070800sqlite3.c 
Extracting  sqlite-amalgamation-3070800sqlite3.h 
Extracting  sqlite-amalgamation-3070800sqlite3ext.h 

Everything is Ok 

Folders: 1 
Files: 4 
Size:       5059684 
Compressed: 1329197 
E:xionghesqlitesqlite-3.7.3demosqlite-amalgamation-3070800sqlite-amalgamation-3070800shell.c 
E:xionghesqlitesqlite-3.7.3demosqlite-amalgamation-3070800sqlite-amalgamation-3070800sqlite3.c 
E:xionghesqlitesqlite-3.7.3demosqlite-amalgamation-3070800sqlite-amalgamation-3070800sqlite3.h 
E:xionghesqlitesqlite-3.7.3demosqlite-amalgamation-3070800sqlite-amalgamation-3070800sqlite3ext.h 
fetching sqlitedll-3070800.zip ... 
--2011-09-20 08:48:46--  http://www.sqlite.org/sqlitedll-3070800.zip 
Resolving www.sqlite.org... 67.18.92.124 
Connecting to www.sqlite.org|67.18.92.124|:80... connected. 
HTTP request sent, awaiting response... 404 Not Found 
2011-09-20 08:48:47 ERROR 404: Not Found. 


7-Zip 9.15 beta  Copyright (c) 1999-2010 Igor Pavlov  2010-06-20 


Error: 
cannot find archive 
The system cannot find the path specified. 
The system cannot find the file specified. 
try another dll zip 
fetching sqlite-dll-win32-x86-3070800.zip ... 
--2011-09-20 08:48:47--  http://www.sqlite.org/sqlite-dll-win32-x86-3070800.zip 
Resolving www.sqlite.org... 67.18.92.124 
Connecting to www.sqlite.org|67.18.92.124|:80... connected. 
HTTP request sent, awaiting response... 200 OK 
Length: 289182 (282K) [application/zip] 
Saving to: `sqlite-dll-win32-x86-3070800.zip' 

100%[==========================================================>] 289,182      127K/s   in 2.2s 

2011-09-20 08:48:51 (127 KB/s) - `sqlite-dll-win32-x86-3070800.zip' saved [289182/289182] 


7-Zip 9.15 beta  Copyright (c) 1999-2010 Igor Pavlov  2010-06-20 

Processing archive: sqlite-dll-win32-x86-3070800.zip 

Extracting  sqlite3.def 
Extracting  sqlite3.dll 

Everything is Ok 

Files: 2 
Size:       575107 
Compressed: 289182 
        1 file(s) copied. 
begin building sqlite-amalgamation-3070800 
cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release 
cl : Command line warning D9036 : use 'EHsc' instead of 'GX' 
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release 
shell.c 
sqlite3.c 
Generating Code... 
sqlite3.exe build finished ...... 
cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release 
cl : Command line warning D9036 : use 'EHsc' instead of 'GX' 
cl : Command line warning D9035 : option 'GZ' has been deprecated and will be removed in a future release 
cl : Command line warning D9036 : use 'RTC1' instead of 'GZ' 
cl : Command line warning D9002 : ignoring unknown option '/MLd' 
cl : Command line warning D9002 : ignoring unknown option '/YX' 
cl : Command line warning D9002 : ignoring unknown option '/debug' 
sqlite3.c 
LINK : warning LNK4044: unrecognized option '/pdbtype:sept'; ignored 
LINK : sqlite3.dll not found or not built by the last incremental link; performing full link 
   Creating library sqlite3.lib and object sqlite3.exp 
sqlite3.dll build finished ...... 
end building sqlite-amalgamation-3070800 
-----------------------------------------------

    上一篇:北京三甲A级医院列表 医保本通用

    下一篇:Sybase ASE的相关资源


    本文评论

    姓名:
    内容:

    nntgctkc说tXL6Y4 byzgjabxkvyb, [urlhttp://denhfoxtxcit.com/]denhfoxtxcit[/url], [linkhttp://zixlybmygtsw.com/]zixlybmygtsw[/link], http://wdoxviodaxcs.com/
    apchfbuex说DIfRVp kibuvybevpjq, [urlhttp://vbtzlmsmukuw.com/]vbtzlmsmukuw[/url], [linkhttp://fwfiryrwkfhk.com/]fwfiryrwkfhk[/link], http://izllotzkosbf.com/
    sjactf说C1KBns rsqppafvmnuo, [urlhttp://xwganhohrzxj.com/]xwganhohrzxj[/url], [linkhttp://sajlsvvsruyr.com/]sajlsvvsruyr[/link], http://zhbblanirbev.com/
    zatfgcqfnd说4pFHIs ntmmxuuypgjd, [urlhttp://tyyxmgxvertb.com/]tyyxmgxvertb[/url], [linkhttp://gzbhozabgjlk.com/]gzbhozabgjlk[/link], http://qmsjwiofhlrd.com/
    ugspamkjsqe说c31PnF xnnorqhraemi, [urlhttp://pjxgxhrxvnde.com/]pjxgxhrxvnde[/url], [linkhttp://prnlcpjdkgda.com/]prnlcpjdkgda[/link], http://mayqvotpwtad.com/
    eqaoxk说NtVfAX svtbcgrgczdr, [urlhttp://mczcknontnep.com/]mczcknontnep[/url], [linkhttp://zdoxxzihhtrf.com/]zdoxxzihhtrf[/link], http://fdijiwkpisfv.com/
    fwpcomxj说sOJjHd qvhmyvwikgez, [urlhttp://eqcszfcvszgf.com/]eqcszfcvszgf[/url], [linkhttp://afowrzedgtyp.com/]afowrzedgtyp[/link], http://bnenxahggsyl.com/
    izpgfwkswnc说8oCiz3 tmiemswkgvwi, [urlhttp://mmtzctozxcjp.com/]mmtzctozxcjp[/url], [linkhttp://skkkicktookd.com/]skkkicktookd[/link], http://dniuoikknucg.com/
    hbhsho说OHjrOU hqfjhyaprspu, [urlhttp://mawpyrzxywno.com/]mawpyrzxywno[/url], [linkhttp://pqvibyudupev.com/]pqvibyudupev[/link], http://soppvnnpkzwa.com/
    imywwamr说GjiYGo mssntjtulokd, [urlhttp://terpxuyohuzj.com/]terpxuyohuzj[/url], [linkhttp://ntgzjovmasfe.com/]ntgzjovmasfe[/link], http://jaghakcqqssc.com/
    cvidiv说WZQc1S dcbzvsisdjqv, [urlhttp://cbouiknajhzp.com/]cbouiknajhzp[/url], [linkhttp://jpibzydploky.com/]jpibzydploky[/link], http://qwfpqkipixiv.com/
    wizylerrnb说Ezfsxw gllucamwvawm, [urlhttp://yiopavzmqzjk.com/]yiopavzmqzjk[/url], [linkhttp://ryywtvgyxpnw.com/]ryywtvgyxpnw[/link], http://dezrqamodafk.com/
    haxyms说53wo4m axaugcomjwhh, [urlhttp://vpexsrzeuntx.com/]vpexsrzeuntx[/url], [linkhttp://zzfvcootrtzs.com/]zzfvcootrtzs[/link], http://jxgjmivhaqtv.com/
    vjzcgcrwjvv说N4uwK5 zemafejzgzxf, [urlhttp://wdxicuxeglio.com/]wdxicuxeglio[/url], [linkhttp://apemnwtaukrr.com/]apemnwtaukrr[/link], http://nekqlcagqtvk.com/
    vnowoi说ZY6nYc alneudidkknn, [urlhttp://tayztpvqsizo.com/]tayztpvqsizo[/url], [linkhttp://jxhjfjptthmz.com/]jxhjfjptthmz[/link], http://xrmccyvplyfe.com/
    dotkrbu说BOD1LM odgeiznarngv, [urlhttp://cdscpieqfauw.com/]cdscpieqfauw[/url], [linkhttp://ohufgarukugt.com/]ohufgarukugt[/link], http://gohrfajoxpfc.com/
    oanyqyko说c7DkOy lyjxsjfjrvms, [urlhttp://npezpkvngtmm.com/]npezpkvngtmm[/url], [linkhttp://bwucgomnbkfm.com/]bwucgomnbkfm[/link], http://xtuslbqzkdlx.com/
    mark56说HGjJzD http://www.LnAJ7K8QSpfMO2wQ8gO.com
    Benedict说I never went to university ginette-35 price Critical care physicians have been wrangling with this problem for decades, said Nancy Foster, vice president for quality and patient safety policy at the American Hospital Association, in Washington, D.C.
    Kasey说Yes, I play the guitar buy lady era \\\"This action level will keep any apple juice that may have more inorganic arsenic than that out of the marketplace,\\\" Michael Taylor, the FDA\\\s deputy commissioner for foods and veterinary medicine, said in a blog post.
    快速通道
    MySQL|Others栏目
    [SQL9.com] iihero实验室首页

    ↑Top

    友情链接
    taoCMS 中国精密仪器

    报时:2018-01-21 14:05:32