I'm trying to build svn client on Mac OS 10.7.5. My aim is to build svn client completely static so it would not depend on any dylib to be installed. The idea is that the svn client could be copied to a disk on key, or downloaded and will work without need to install or configure anything.
I downloaded the svn source code (subversion-1.7.8) and all the required dependencies (apr, par-util, neon, sqlite-amalgamation) and stated the configure - make - make install cycle.
Svn's configure option has --enable-all-static flag that creates the svn client that does not depend on external dylibs. However the build always fails with the following message:
Warning! dlname not found in /Volumes/mydisk/build/svn/libexec/mod_dav_svn.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /Volumes/mydisk/build/svn/libexec/mod_dav_svn.so
chmod: /Volumes/mydisk/wsvn/build/svn/libexec/mod_dav_svn.so: No such file or directory
apxs:Error: Command failed with rc=65536
.
make: *** [install-mods-shared] Error 1
It seems that the build is looking for mod_dav_svn.so even when it is not needed and everything compiles static.
Funny thing is that the svn client that was build actually runs! I would like however, to complete the build & install properly.
My questions are:
Thanks
In my experience it can be tricky to compile applications that make use of 3rd party libraries and/or system libraries such as glibc etc. The problem is that in addition to your application being built statically, all these libraries need to provide both a dynamic (.so) version as well as a static version (.a) and some libraries just don't provide this, at least not easily. So you're forced to compile everything down the stack of dependencies yourself and this can be tough.
That being said here, courtesy Rick Vanderzwet's Blog:
% 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
Confirm with the following commands:
% 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)
This last bit shows that this executable is still dependent on several dynamic libraries but it's much less than a typical dynamically built subversion!
If you do not require mod_dav_svn
support you can disable this through the use of the --without-serf
switch to configure
.
NOTE #1: Disabling this support will disable your svn
client's ability to access SVN repos via http
and https
!
NOTE #2: If you look at the output from svn --version
command you can see which repository access (RA) modules have been compiled into your svn
client.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With