術(shù)語(yǔ)匯編:剖析Subversion編譯相關(guān)問(wèn)題
大家都知道Subversion(svn)是很好的版本管理工具,它有三個(gè)最常用的模塊,但如果進(jìn)行手動(dòng)Subversion編譯安裝,實(shí)在是一件困難的事情。下面首先來(lái)看看最常用的模塊。
Subversion有三個(gè)最常用的模塊:
*ra_svn:使用svn網(wǎng)絡(luò)協(xié)議訪問(wèn)檔案庫(kù)的模塊。
-handles’svn’scheme
◆ra_local:訪問(wèn)本地磁盤的檔案庫(kù)模塊。
◆ra_dav:訪問(wèn)http://檔案庫(kù)模塊。
前面兩個(gè),是Subversion編譯的默認(rèn)模塊,ra_dav是大多數(shù)人遇到的問(wèn)題。如果ra_dav沒(méi)有編譯到系統(tǒng)中,當(dāng)你從http://這樣的路徑checkout時(shí),會(huì)出現(xiàn)這樣的錯(cuò)誤提示:svn:UnrecognizedURLscheme
那么,如何編譯ra_dav呢?你至少需要越過(guò)以下幾道關(guān)卡:
1、ra_dav是由一個(gè)叫neon的軟件完成的,你需要安裝neon。
neon的官方網(wǎng)站:http://www.webdav.org/neon/
2、重新configureSubversion
這一步非常重要,稍不小心,就可能會(huì)找不到neon,即使你已經(jīng)安裝neon,即使你已經(jīng)將neon的源代碼加壓到Subversion的目錄下,即使你已經(jīng)把neon-0.28.4改名為neon目錄。configureSubversion有一個(gè)很不爽的地方就是,當(dāng)你configure配置了neon,但configure失敗的時(shí)候,它不會(huì)把這個(gè)結(jié)果在執(zhí)行完單獨(dú)列出來(lái),而是在configure的輸出過(guò)程中顯示,讓人誤以為configureok,其實(shí),neon并沒(méi)有被configure進(jìn)去。
在我編譯Subversion1.6.1版本中,neon失敗的輸出為:
configure:checkingneonlibrary
Anappropriateversionofneoncouldnotbefound,solibsvn_ra_neon
willnotbebuilt.Ifyouwanttobuildlibsvn_ra_neon,pleaseeither
installneon0.28.4onthissystem or
getneon0.28.4from:
http://www.webdav.org/neon/neon-0.28.4.tar.gz
unpackthearchiveusingtar/gunzipandrenametheresulting
directoryfrom./neon-0.28.4/to./neon/
我之前嘗試了多種configure的方法,例如:./configure–prefix=/usr/–with-apr=/usr/bin/apr-1-config–with-apr-util=/usr/bin/apu-1-cfig–with-neon=/usr/bin/neon-config–with-zlib=/lib–with-apache-libexecdir–with-apxs=/usr/sbin/apxs或者把neon解壓到當(dāng)前目錄,并改名為neon,configure如下:./configure–prefix=/usr/–with-apr=/usr/bin/apr-1-config–with-apr-util=/usr/bin/apu-1-cfig–with-neon=./neon–with-zlib=/lib–with-apache-libexecdir–with-apxs=/usr/sbin/apxs
這兩種configure方式都會(huì)導(dǎo)致neon無(wú)法作為Subversion的編譯選項(xiàng),正確的configure方法是–with-neon后不加參數(shù),這個(gè)Subversion的configure也真是夠賤的!./configure–prefix=/usr/–with-apr=/usr/bin/apr-1-config–with-apr-util=/usr/bin/apu-1-cfig–with-neon=–with-zlib=/lib–with-apache-libexecdir–with-apxs=/usr/sbin/apxs
這一步完成后,make&&makeinstall就沒(méi)有問(wèn)題了。
Subversion編譯安裝完成后,使用svn–admin來(lái)驗(yàn)證:
#svn–version
svn,version1.6.1(r37116)
compiledApr292009,10:56:22
Copyright(C)2000-2009CollabNet.
Subversionisopensourcesoftware,seehttp://Subversion.tigris.org/
ThisproductincludessoftwaredevelopedbyCollabNet(http://www.Collab.Net/).
Thefollowingrepositoryaccess(RA)modulesareavailable:
◆ra_neon:ModuleforaccessingarepositoryviaWebDAVprotocolusingNeon.
-handles‘http’scheme
◆ra_svn:Moduleforaccessingarepositoryusingthesvnnetworkprotocol.
-handles’svn’scheme
◆ra_local:Moduleforaccessingarepositoryonlocaldisk.
-handles‘file’scheme
以上內(nèi)容引自http://www.9say.com/2009/04/Subversion-compile-with-ra-dav/
另外在按上面方法進(jìn)行解決的時(shí)候發(fā)現(xiàn)問(wèn)題:當(dāng)把neon解壓到當(dāng)前目錄,并改名為neon后,configure如下:
./configure–prefix=/usr/–with-apr=/usr/bin/apr-1-config–with-apr-util=/usr/bin/apu-1-cfig–with-zlib=/lib–with-apache-libexecdir–with-apxs=/usr/sbin/apxs就可以了,無(wú)需指定neon。大家在configure的時(shí)候看有沒(méi)有找到neon如果找到,就肯定沒(méi)有問(wèn)題了。
另外關(guān)于make時(shí)遇到fPCI的問(wèn)題,請(qǐng)把neon/src/下的Makefile里的CFLAGS=-g-02改為CFLAGS=-fPIC-g-02.,好了Subversion編譯問(wèn)題到這里已經(jīng)介紹完了,如果你想學(xué)習(xí)其他有關(guān)Subversion方面的知識(shí),請(qǐng)單擊www.szyisi.cn查找相關(guān)內(nèi)容。
.
【編輯推薦】