[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: How to build subversion to run on most Linux systems?

From: Bob Proulx <bob_at_proulx.com>
Date: 2005-05-28 19:12:35 CEST

Zsolt Koppany wrote:
> We would like to ship subversion with our application to customers that use
> different Linux systems (Suse 8.x,9.x,RedHat-7.x,9.x,RHE-3,RHE-4.
> How should I build subversion?

What I do is to include all of the libraries my application is using
in a lib directory next to my application bin directory. I copy all
of the shared libraries used by the programs to that directory. Then
I wrap the program with a shell script that sets LD_LIBRARY_PATH to
that directory. I override the native GNU libc library by calling the
ld.so directly on the binary. This allows you to use a specific
version of glibc other than the natively installed one.

Assume your wrappers are in bin and your real binaries are in libexec.
The structure would look like this. The names of the libraries will
vary by version and architecture. Using subversion as an example it
would look similar to this.

  ./bin/svn # wrapper script
  ./libexec/svn # real binary
  ... long list of libraries and symlinks to libraries deleted ...

Here is some shell code to illustrate use.

  MYAPPDIR=$(dirname $(dirname $0))
  exec $MYAPPDIR/lib/ld-linux.so.2 $MYAPPDIR/libexec/$(basename $0) "$@"

Calling an application explicitly through the use of ld-linux.so.2 has
an additional advantage in that it also allows a 32-bit application to
run on a 64-bit amd64 or ia64 system mode if the kernel also allows it.

If you are supporting multiple architectures then it would be best to
put all of the architecture specific files in an architecture specific
subdirectory. I would mirror the proposed multiarch hiearchy. Then
adjust the script above to call the appropriate architecture. That is
straight-forward and so is left as an exercise for the reader. :-)

Here are some ideas as to how to get a list of libs to copy to your
distribution area. You will want both the shared library and the
symlink to it copied to your application area. (Hint: Use 'cp -a' to
copy syminks as symlinks.)

  ldd /usr/bin/svn | awk '{print$3}'
  ldd /usr/bin/svn | awk '{print$3}' | xargs ls -l | awk '{print$NF}'

Enjoy improved platform independence!


Useful References:


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat May 28 19:14:53 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.