I was setting up a new server for someone, and encountered this error while I was trying to build svn

/usr/bin/ld: cannot find -lexpat

Now, while I can do some things on that a sys admin can, I am by no means a sys admin. I have only installed svn a handful of times, and I didn’t know what this was.

First I installed expat from source. It didn’t help.

I then installed apr and apr-util. Didn’t help. I probably needed to follow these instructions.. but I didn’t.

Libraries have been installed in: /usr/local/apr/lib

If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the -LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to theLD_LIBRARY_PATH’ environment variable during execution - add LIBDIR to the LD_RUN_PATH' environment variable during linking - use the-Wl,–rpath -Wl,LIBDIR’ linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf’

Decided I don’t care anymore about trying to figure out why it wasn’t working and just got the subversion dependencies from their site, untarred them into the svn folder as recommended. Everything compiled without issue.

On the make install, I got this:

/usr/local/src/subversion-1.4.6/subversion/svnversion/.libs/lt-svnversion: error while loading shared libraries: /usr/local/src/subversion-1.4.6/subversion/libsvn_delta/.libs/libsvn_delta-1.so.0: cannot restore segment prot after reloc: Permission denied make: *** [revision-install] Error 127

Googling that error got me to this site, where it suggested SELinux might be breaking it. I disabled it and rebooted the machine. The install proceeded without issue at this point.