根据我的经验,编译使用 3rd 方库和/或系统库(如 glibc 等)的应用程序可能会很棘手。问题是,除了您的应用程序是静态构建的之外,所有这些库都需要同时提供动态( .so) 版本以及静态版本 (.a) 和一些库只是不提供这个,至少不容易。因此,您被迫自己将所有内容编译到依赖堆栈中,这可能很困难。
话虽如此,由Rick Vanderzwet 的博客提供:
% curl -O wget http://archive.apache.org/dist/subversion/subversion-1.7.8.tar.gz
% tar zxvf subversion-1.7.8.tar.gz
% cd subversion-1.7.8/
% ./get-deps.sh
% ./configure --with-ssl --without-gssapi --without-swig --enable-all-static
% make
使用以下命令确认:
可执行文件的大小?
% ls -lh subversion/svn/svn
-rwxrwxr-x 1 saml saml 11M Jan 19 22:09 subversion/svn/svn
可执行文件运行?
% subversion/svn/svn --version
svn, version 1.7.8 (r1419691)
compiled Jan 19 2013, 22:03:50
Copyright (C) 2012 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/
The following repository access (RA) modules are available:
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- handles 'http' scheme
- handles 'https' scheme
可执行文件依赖于什么?
% ldd subversion/svn/svn
linux-vdso.so.1 => (0x00007fffd7463000)
libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00000034fc600000)
libm.so.6 => /lib64/libm.so.6 (0x00000034e7600000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x0000003210800000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x000000399a000000)
libz.so.1 => /lib64/libz.so.1 (0x00000034e8600000)
libmagic.so.1 => /usr/lib64/libmagic.so.1 (0x00000034ef600000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00000034eb200000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00000034eda00000)
librt.so.1 => /lib64/librt.so.1 (0x00000034e8a00000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00000034f5e00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00000034e7e00000)
libdl.so.2 => /lib64/libdl.so.2 (0x00000034e7a00000)
libc.so.6 => /lib64/libc.so.6 (0x00000034e7200000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00000034ea200000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x000000320f800000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x0000003210000000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003d3ce00000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003210400000)
/lib64/ld-linux-x86-64.so.2 (0x00000034e6e00000)
libfreebl3.so => /lib64/libfreebl3.so (0x00000034f6200000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x000000320fc00000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00000034f3a00000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00000034e8e00000)
最后一点表明这个可执行文件仍然依赖于几个动态库,但它比典型的动态构建的颠覆要少得多!
编辑#1
如果您不需要mod_dav_svn
支持,您可以通过使用--without-serf
switch 来禁用它configure
。
注意 #1:禁用此支持将禁用您的客户端通过和svn
访问 SVN 存储库的能力!http
https
注意 #2:如果您查看svn --version
命令的输出,您可以看到哪些存储库访问(RA)模块已编译到您的svn
客户端中。