0. 写文初衷
svn作为集中式版本管理软件,受到很多大项目的青睐,但是在现在git王道的时代,还用svn就显得不是那么极客。
奈何公司软件版本管理需要使用svn,于是就要考虑在Ubuntu系统中安装svn。
一般的,在Ubuntu系统命令行中,输入 svn ,即会跳出安装指令。如下:
root@ubuntu:~# svn 程序“svn”尚未安装。 您可以使用以下命令安装: apt-get install subversion # 然后就静精地等待安装完成 root@ubuntu:~# svn help # 显示安装内容
更奈何,公司网络限制 apt-get 的方式安装软件,于是有了这篇博文。
本文参考了一些网上的安装示例,走了一些弯路,才有了现在的一键安装脚本。感谢其他博主的辛苦努力,后面再附上参考地址。
言归正传,下面就介绍一下以源码的方式如何安装svn。
1. 一键安装
1.1 安装subversion
在研究了其他人的安装步骤后,总结:编译subversion,需要以下安装包:
- apr-1.6.5.tar.bz2
- apr-util-1.6.1.tar.bz2
- expat-2.2.7.tar.bz2
- openssl-1.0.2s.tar.gz
- scons-3.0.4.tar.gz
- serf-1.3.9.tar.bz2
- sqlite-amalgamation-3290000.zip
- zlib-1.2.11.tar.gz
- subversion-1.12.0.tar.bz2
下载并解压合集包(网盘地址:网盘 提取码:5xc9 ),运行 install.sh ,等待解压、配置并且编译源码包。大约20分钟安装完毕,脚本完成。输入 svn --version 检测是否安装成功。
root@ubuntu:桌面# svn --version svn,版本 1.12.0 (r1857323) 编译于 Jul 15 2019,11:54:36 在 x86_64-unknown-linux-gnu Copyright (C) 2019 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/ 可使用以下的版本库访问模块: * ra_svn : 使用 svn 网络协议访问版本库的模块。 - 处理“svn”方案 * ra_local : 访问本地磁盘的版本库模块。 - 处理“file”方案 * ra_serf : Module for accessing a repository via WebDAV protocol using serf. - using serf 1.3.9 (compiled with 1.3.9) - 处理“http”方案 - 处理“https”方案 The following authentication credential caches are available: * GPG-Agent root@ubuntu:桌面#
如果没有下载合集包,可以编写此脚本会自行 wget 下载所需要的包(注意:复制粘贴操作请在linux系统下完成,因为linux系统和windows系统的换行符号不同,linux无法识别win系统中 换行符,会报程序错误。)
1 # wget http://www.apache.org/dist/apr/apr-1.6.5.tar.bz2 2 tar xjf apr-1.6.5.tar.bz2 3 cd apr-1.6.5 4 ./configure --prefix=/usr/local/apache 5 make && sudo make install 6 7 cd .. 8 # wget http://distfiles.macports.org/expat/expat-2.2.7.tar.bz2 9 tar xjf expat-2.2.7.tar.bz2 10 cd expat-2.2.7 11 ./configure 12 make && sudo make install 13 14 cd .. 15 # wget http://www.apache.org/dist/apr/apr-util-1.6.1.tar.bz2 16 tar xjf apr-util-1.6.1.tar.bz2 17 cd apr-util-1.6.1 18 ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apache 19 make && sudo make install 20 21 cd .. 22 # wget https://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz 23 tar xzf zlib-1.2.11.tar.gz 24 cd zlib-1.2.11 25 ./configure 26 make && sudo make install 27 28 cd .. 29 # wget http://prdownloads.sourceforge.net/scons/scons-3.0.4.tar.gz 30 tar xzf scons-3.0.4.tar.gz 31 cd scons-3.0.4 32 sudo python setup.py install 33 34 cd .. 35 # wget http://distfiles.macports.org/openssl/openssl-1.0.2s.tar.gz 36 tar xzf openssl-1.0.2s.tar.gz 37 cd openssl-1.0.2s 38 ./config -fPIC --prefix=/usr/local/openssl enable-shared 39 make && sudo make install 40 41 cd .. 42 # wget https://archive.apache.org/dist/serf/serf-1.3.9.tar.bz2 43 tar xjf serf-1.3.9.tar.bz2 44 cd serf-1.3.9 45 scons PREFIX=/usr/local/serf APR=/usr/local/apache APU=/usr/local/apache OPENSSL=/usr/local/openssl 46 sudo scons install 47 sudo ln -sf /usr/local/serf/include/serf-1/serf_bucket_util.h /usr/local/include/serf_bucket_util.h 48 sudo ln -sf /usr/local/serf/include/serf-1/serf_bucket_types.h /usr/local/include/serf_bucket_types.h 49 sudo ln -sf /usr/local/serf/include/serf-1/serf.h /usr/local/include/serf.h 50 51 sudo ln -sf /usr/local/serf/lib/libserf-1.so.1.3.0 /usr/local/lib/libserf-1.so 52 sudo ln -sf /usr/local/serf/lib/libserf-1.so.1.3.0 /usr/local/lib/libserf-1.so.1 53 sudo ldconfig 54 55 56 cd .. 57 # wget https://www.sqlite.org/2019/sqlite-amalgamation-3290000.zip 58 unzip sqlite-amalgamation-3290000.zip 59 mv sqlite-amalgamation-3290000 sqlite-amalgamation 60 61 # wget http://distfiles.macports.org/subversion/subversion-1.12.0.tar.bz2 62 tar xjf subversion-1.12.0.tar.bz2 63 mv sqlite-amalgamation subversion-1.12.0 64 cd subversion-1.12.0 65 ./configure --prefix=/usr/local/svn --with-apr=/usr/local/apache --with-apr-util=/usr/local/apache --with-zlib=/usr/local/zlib --with-serf=/usr/local/serf --with-lz4=internal --with-utf8proc=internal 66 make && sudo make install 67 sudo ln -sf /usr/local/svn/bin/* /usr/bin 68 svn help 69 70 # wget http://ftp.yz.yamagata-u.ac.jp/pub/eclipse/technology/subversive/3.0/builds/Subversive-3.0.5.I20160701-1700.zip
1.2 设置快捷命令
# 为svn的bin文件创建软链接
sudo ln -sf /usr/local/svn/bin/* /usr/bin
# 由于subversion需要使用serf的共享库,需要把共享库放在 /usr/local/lib 中 sudo ln -sf /usr/local/serf/lib/libserf-1.so.1.3.0 /usr/local/lib/libserf-1.so
sudo ln -sf /usr/local/serf/lib/libserf-1.so.1.3.0 /usr/local/lib/libserf-1.so.1
# 生效共享库配置 (重要)
sudo ldconfig
1.3 安装subclipse
subclipse是eclipse下的第三方svn插件。首先下载subclipse插件包 site-1.10.13-1.9.x.zip ,地址 (集成包中也有)
# 或者直接 wget 下载
wget http://subclipse.tigris.org/files/documents/906/49486/site-1.10.13-1.9.x.zip
打开eclipse CDT,点击 Help -> Install New Software
选择 Add 添加压缩包
压缩包选择如下:
选择需要安装的项目:(Graph不选,其他都选择)
检测条件是否满足:
执行下一步,接受许可,
点击 Finish 完成安装,中途弹出弹框点击OK,全部安装完成后 Restart 就行。
重启后,选择视窗 ,中文名称为 SVN资源库研究,英文是 SVN Repositry Exploring,证明安装成功。
TODO: 使用方法后面博文
2. 蹚坑记录
2.1 编译apr-util报错:xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
1 op/subversion/apr-util-1.6.1/include -I/home/yq/Desktop/subversion/apr-util-1.6.1/include/private -I/usr/local/apache/include/apr-1 -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo 2 xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory 3 compilation terminated. 4 make[1]: *** [xml/apr_xml.lo] Error 1 5 make[1]: Leaving directory `/home/yq/Desktop/subversion/apr-util-1.6.1' 6 make: *** [all-recursive] Error 1 7 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$
需要在编译 apr-util 之前先安装 expat 包,用于xml文件的解析。
2.2 源码安装时候 默认安装路径
./configrue 是linux系统下常见的源码配置程序,配置后可以生成编译规则文件 makefile ,而linux系统较之于windows系统不同之处之一是软件的安装位置管理不够直观,
所以一般的,配置makefile时候,有个选项 --prefix=WILL_INSTALL_PATH ,
一般指定 WILL_INSTALL_PATH 为 usr/local ,在PATH系统环境中,方便快捷键调用。
1 root@ubuntu:apr-1.6.5# ./configure help 2 configure: WARNING: you should use --build, --host, --target 3 checking build system type... Invalid configuration `help': machine `help' not recognized 4 configure: error: /bin/bash build/config.sub help failed 5 root@ubuntu:apr-1.6.5# ./configure --help 6 `configure' configures this package to adapt to many kinds of systems. 7 8 Usage: ./configure [OPTION]... [VAR=VALUE]... 9 10 To assign environment variables (e.g., CC, CFLAGS...), specify them as 11 VAR=VALUE. See below for descriptions of some of the useful variables. 12 13 Defaults for the options are specified in brackets. 14 15 Configuration: 16 -h, --help display this help and exit 17 --help=short display options specific to this package 18 --help=recursive display the short help of all the included packages 19 -V, --version display version information and exit 20 -q, --quiet, --silent do not print `checking ...' messages 21 --cache-file=FILE cache test results in FILE [disabled] 22 -C, --config-cache alias for `--cache-file=config.cache' 23 -n, --no-create do not create output files 24 --srcdir=DIR find the sources in DIR [configure dir or `..'] 25 26 Installation directories: 27 --prefix=PREFIX install architecture-independent files in PREFIX 28 [/usr/local] 29 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX 30 [PREFIX] 31 32 By default, `make install' will install all the files in 33 `/usr/local/bin', `/usr/local/lib' etc. You can specify 34 an installation prefix other than `/usr/local' using `--prefix', 35 for instance `--prefix=$HOME'. 36 37 For better control, use the options below. 38 39 Fine tuning of the installation directories: 40 --bindir=DIR user executables [EPREFIX/bin] 41 --sbindir=DIR system admin executables [EPREFIX/sbin] 42 --libexecdir=DIR program executables [EPREFIX/libexec] 43 --sysconfdir=DIR read-only single-machine data [PREFIX/etc] 44 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] 45 --localstatedir=DIR modifiable single-machine data [PREFIX/var] 46 --libdir=DIR object code libraries [EPREFIX/lib] 47 --includedir=DIR C header files [PREFIX/include] 48 --oldincludedir=DIR C header files for non-gcc [/usr/include] 49 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] 50 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] 51 --infodir=DIR info documentation [DATAROOTDIR/info] 52 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] 53 --mandir=DIR man documentation [DATAROOTDIR/man] 54 --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] 55 --htmldir=DIR html documentation [DOCDIR] 56 --dvidir=DIR dvi documentation [DOCDIR] 57 --pdfdir=DIR pdf documentation [DOCDIR] 58 --psdir=DIR ps documentation [DOCDIR] 59 60 System types: 61 --build=BUILD configure for building on BUILD [guessed] 62 --host=HOST cross-compile to build programs to run on HOST [BUILD] 63 --target=TARGET configure for building compilers for TARGET [HOST] 64 65 Optional Features: 66 --disable-option-checking ignore unrecognized --enable/--with options 67 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 68 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 69 --enable-layout=LAYOUT 70 --enable-experimental-libtool Use experimental custom libtool 71 --enable-shared[=PKGS] build shared libraries [default=yes] 72 --enable-static[=PKGS] build static libraries [default=yes] 73 --enable-fast-install[=PKGS] 74 optimize for fast installation [default=yes] 75 --disable-libtool-lock avoid locking (might break parallel builds) 76 --enable-debug Turn on debugging and compile time warnings 77 --enable-maintainer-mode Turn on debugging and compile time warnings 78 --enable-profile Turn on profiling for the build (GCC) 79 --enable-pool-debug[=yes|no|verbose|verbose-alloc|lifetime|owner|all] Turn on pools debugging 80 --enable-malloc-debug Switch on malloc_debug for BeOS 81 --disable-lfs Disable large file support on 32-bit platforms 82 --enable-nonportable-atomics Use optimized atomic code which may produce nonportable binaries 83 --enable-threads Enable threading support in APR. 84 --enable-posix-shm Use POSIX shared memory (shm_open) if available 85 --enable-allocator-uses-mmap Use mmap in apr_allocator instead of malloc 86 --enable-allocator-guard-pages Use guard pages in apr_allocator 87 (implies --enable-allocator-uses-mmap) 88 --enable-pool-concurrency-check Check for concurrent usage of memory pools 89 --disable-dso Disable DSO support 90 --enable-other-child Enable reliable child processes 91 --disable-ipv6 Disable IPv6 support in APR. 92 93 Optional Packages: 94 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 95 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) 96 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use 97 both] 98 --with-aix-soname=aix|svr4|both 99 shared library versioning (aka "SONAME") variant to 100 provide on AIX, [default=aix]. 101 --with-gnu-ld assume the C compiler uses GNU ld [default=no] 102 --with-sysroot[=DIR] Search for dependent libraries within DIR (or the 103 compiler's sysroot if not specified). 104 --with-installbuilddir=DIR location to store APR build files 105 --without-libtool avoid using libtool to link the library 106 --with-efence[=DIR] path to Electric Fence installation 107 --with-valgrind[=DIR] Enable code to teach valgrind about apr pools 108 (optionally: set path to valgrind headers) 109 --with-sendfile Override decision to use sendfile 110 --with-egd[=DIR] use EGD-compatible socket 111 --with-devrandom[=DEV] use /dev/random or compatible [searches by default] 112 113 Some influential environment variables: 114 CC C compiler command 115 CFLAGS C compiler flags 116 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a 117 nonstandard directory <lib dir> 118 LIBS libraries to pass to the linker, e.g. -l<library> 119 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if 120 you have headers in a nonstandard directory <include dir> 121 CPP C preprocessor 122 LT_SYS_LIBRARY_PATH 123 User-defined run-time library search path. 124 125 Use these variables to override the choices made by `configure' or to help 126 it to find libraries and programs with nonstandard names/locations. 127 128 Report bugs to the package provider.
./configrue --prefix=/usr/local/apache # 安装apr-1.6.5到 /usr/local/apache
注意:也有例外的情况,比如此脚本中在安装expat包的时候不能指定路径,否则会报libexpat.h找不到,可能安装的库不在系统环境中导致异常,重新configure一下,取消默认路径,再次编译和安装后正常。
进一步分析,为何安装指定的路径下,就不能被其他软件调用到。分析如下:
1 xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory # 安装expat 到 /usr/local/expat 之后,再make apr-util 依然报错,找不到expat
2 compilation terminated.
3 make[1]: *** [xml/apr_xml.lo] Error 1
4 make[1]: Leaving directory `/home/yq/Desktop/subversion/apr-util-1.6.1'
5 make: *** [all-recursive] Error 1
6 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ find /usr -name expat.h # 进一步查找expat.h 发现已经安装成功
7 /usr/local/arm-4.8.4/include/expat.h
8 /usr/local/arm-4.8.4/arm-buildroot-linux-gnueabihf/sysroot/usr/include/expat.h
9 /usr/local/expat/include/expat.h # 安装成功 地址在 /usr/local/expat/include/expat.h
10 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ ls /usr/local/include/
11 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ ls /usr/local/expat/include/
12 expat_config.h expat_external.h expat.h # expat存在的头文件
13 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ sudo ln -s /usr/local/expat/include/expat*.h /usr/local/include/ # 注意:处理方式,将expat安装后的头文件,创建一组软连接到系统环境中的头文件路径 /usr/local/include
14 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ ls /usr/local/include/
15 expat_config.h expat_external.h expat.h
16 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ make # 再次编译 apr-util 成功
17 make[1]: Entering directory `/home/yq/Desktop/subversion/apr-util-1.6.1'
22 /bin/bash /usr/local/apache/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/home/yq/Desktop/subversion/apr-util-1.6.1/include -I/home/yq/Desktop/subversion/apr-util-1.6.1/include/private -I/usr/local/apache/include/apr-1 -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
23 /bin/bash /usr/local/apache/build-1/libtool --silent --mode=link gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/home/yq/Desktop/subversion/apr-util-1.6.1/include -I/home/yq/Desktop/subversion/apr-util-1.6.1/include/private -I/usr/local/apache/include/apr-1 -version-info 6:1:6 -o libaprutil-1.la -rpath /usr/local/apache/lib buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/apr_siphash.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo redis/apr_redis.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo -lrt -lcrypt -lpthread -ldl /usr/local/apache/lib/libapr-1.la -lrt -lcrypt -lpthread -ldl
24 gawk -f /usr/local/apache/build-1/make_exports.awk /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_anylock.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_base64.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_buckets.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_crypto.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_date.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_dbd.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_dbm.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_hooks.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_init.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_option.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_rebind.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_url.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_md4.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_md5.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_memcache.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_optional.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_optional_hooks.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_queue.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_redis.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_reslist.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_rmm.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_sdbm.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_sha1.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_siphash.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_strmatch.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_thread_pool.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_uri.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_uuid.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_xlate.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_xml.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apu_errno.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apu_version.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_crypto_internal.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_dbd_internal.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_dbd_odbc_v2.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_dbm_private.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apu_internal.h > exports.c
25 gawk -f /usr/local/apache/build-1/make_var_export.awk /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_anylock.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_base64.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_buckets.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_crypto.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_date.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_dbd.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_dbm.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_hooks.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_init.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_option.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_rebind.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_ldap_url.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_md4.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_md5.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_memcache.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_optional.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_optional_hooks.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_queue.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_redis.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_reslist.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_rmm.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_sdbm.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_sha1.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_siphash.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_strmatch.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_thread_pool.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_uri.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_uuid.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_xlate.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apr_xml.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apu_errno.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/apu_version.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_crypto_internal.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_dbd_internal.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_dbd_odbc_v2.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apr_dbm_private.h /home/yq/Desktop/subversion/apr-util-1.6.1/include/private/apu_internal.h > export_vars.c
26 gcc -E -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/home/yq/Desktop/subversion/apr-util-1.6.1/include -I/home/yq/Desktop/subversion/apr-util-1.6.1/include/private -I/usr/local/apache/include/apr-1 exports.c | grep "ap_hack_" | sed -e 's/^.*[)](.*);$/1/' >> aprutil.exp
27 gcc -E -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/home/yq/Desktop/subversion/apr-util-1.6.1/include -I/home/yq/Desktop/subversion/apr-util-1.6.1/include/private -I/usr/local/apache/include/apr-1 export_vars.c | sed -e 's/^#[^!]*//' | sed -e '/^$/d' >> aprutil.exp
28 sed 's,^(location=).*$,1installed,' < apu-1-config > apu-config.out
29 make[1]: Leaving directory `/home/yq/Desktop/subversion/apr-util-1.6.1'
30 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ make | grep Error
31 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$ make | grep make
32 make[1]: Entering directory `/home/yq/Desktop/subversion/apr-util-1.6.1'
33 make[1]: Nothing to be done for `local-all'.
34 make[1]: Leaving directory `/home/yq/Desktop/subversion/apr-util-1.6.1'
35 yq@ubuntu:~/Desktop/subversion/apr-util-1.6.1$
综上分析:对于不能被引入头文件的Error,尝试将头文件创建为软连接放置在系统环境路径中,以便编译全局调用。(同2.4)
2.3 配置subversion报错:configure: error: failed to recognize APR_INT64_T_FMT on this platform
参考了博文,有博友评论是 subversion 仅支持 apr-1.6.5 版本以下的安装,不支持最新的1.7.0。更换了apr-1.6.5版本后,配置正常。
2.4 编译subversion报错:serf.h 没有这个文件
subversion/libsvn_ra_serf/blame.c:25:18: 致命错误: serf.h:没有那个文件或目录 编译中断。 make: *** [subversion/libsvn_ra_serf/blame.lo] 错误 1 root@ubuntu:subversion-1.12.0#
考虑是因为安装serf后,文件并不在系统环境变量中,将 serf.h 相关的头文件,链接到系统环境中,编译正常。操作如下:
# 创建serf头文件的超链接到 /usr/local/include
ln -s /usr/local/serf/include/serf-1/serf*.h /usr/local/include/
参考文献:
[1]. configure: error: failed to recognize APR_INT64_T_FMT on this platform-爱开源
[2]. [OE-core] [PATCH 08/10] subversion: Add -P to CPPFLAGS
[3]. Ubuntu 源码方式安装Subversion - wwl1991 - 博客园
[4]. Subversion 1.8.1编译安装(self) - lj2007331 - 博客园
[5]. Eclipse安装svn插件的几种方式 - Alamps - 博客园