Ubuntu 12.04 LTS下编译安装 SVN 1.7


由于最新Ubuntu的官方源上的svn版本是1.6,和eclispe上面的subclipse插件版本对svn版本要求为1.7有不合适的地方,尤其是javahl的库导致现在eclipse使用起来很bug,现在可以使用其他人自己打包的svn1.7来进行尝试,相关参考见下:http://steveliles.github.com/subversion_1_7_eclipse_integration_in_Ubuntu.html

  1. Adddominik's repository: sudo apt-add-repositoryppa:dominik-stadler/subversion-1.7

  2. Updateapt: sudo apt-get update

  3. Installlibsvn-java: sudo apt-get install libsvn-java

  4. Installsubversion 1.7: sudo apt-get install subversion


注意自己编译svn的代码最后一定要运行sudoldconfig

编译代码的过程(请参照INSTALL文档,然后再以我这个为参考):

  1. make distclean 清除之前全部的生成的文件包括makefile

  2. ls -l /usr/local/lib/libsvn* 查看lib目录下关于svn相关的库的编译时间最好是统一时间编译安装的否则不要轻易运行下一步删除

  3. sudo rm /usr/local/lib/libsvn* 删除之前自己编译安装的svn相关的库文件

  4. ./autogen.sh 重新检查配置,并生成新的configure

  5. ./configure --enable-maintainer-mode –enable-javahl 进行make之前的环境检查,检查需要的库依赖是否齐全,不齐全的话,请先apt-cachesearch 然后apt-getinstall 对应的库文件,–enable-javahl这个是为了编译javahl相关的库依赖做准备

  6. make -j2 external-all 这个不清楚干吗的(测试没有输出,应该进行一些简单测试吧)

官方的文档描述如下:

Notethat if you commonly build with the -jN option to make and

haveused the get-deps.sh script to fetch dependencies, the make

stepabove may fail, because we don't ensure that third party

librariesin our source tree will finish building before

subversionitself. If you want to use -jN, use the following

instead:

$./configure


$make -jN external-all

$make -jN local-all

$make check

#make install

  1. make -j2 local-all 进行代码编译

  2. make check 进行编译后的测试检查,我觉得很慢就没有做

  3. make check-clean 删除代码检查的中间文件(我之前检查了一般,我Ctrl-C取消掉了,所以就运行这个删掉)

  4. make javahl 编译javahl的库文件(这个很重要,因为subclipse对它依赖)见下


  1. sudo make install install-docs install-javahl install-man install-static将编译好的文件和帮助文档安装到系统中

  2. sudo ldconfig-v进行编译后的库文件的连接,很重要,否则启动eclispe提示javahl库缺失,而实际上对应的路径上却存在这个文件,搞不清楚啊,我最后只有重新编译安装一遍了,蛋疼!!!我的输出如下(列出部分)

更多Ubuntu相关信息见Ubuntu 专题页面 http://www.bkjia.com/topicnews.aspx?tid=2

相关内容