Build LFTP on OS X Snow Leopard

One can build LFTP on OS X Snow Leopard with the help of Homebrew, or MacPorts. However, if one directly builds LFTP, it would probably end like this:

 

 

This is due to the incompatibility of OS X built-in readline library, or rather inconsistency between lftp's expectation and OS X built-in readline's provision. As both Homebrew[1] and MacPorts[2] explicitly specify readline to be dependent on, the problem above could be solved by building our own readline library. 

 

wget http://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz tar xzf readline-6.1.tar.gz 
cd readline-6.1 
wget http://ftp.gnu.org/gnu/readline/readline-6.1-patches/readline61-001
wget http://ftp.gnu.org/gnu/readline/readline-6.1-patches/readline61-002 
patch -p0 < ./readline61-001 
patch -p0 < ./readline61-002 
./configure --enable-multibyte 
make -j2  
sudo make install 

 

Now let's make LFTP with our own readline library:

 

wget http://ftp.yars.free.net/pub/source/lftp/lftp-4.1.3.tar.bz2 
tar xjf lftp-4.1.3.tar.bz2 
cd lftp-4.1.3 
CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure --disable-dependency-tracking --without-gnutls --with-openssl --enable-nls 
make -j2 
sudo make install  

 

If everything goes well, it would succeed eventually. Check which libraries LFTP uses:

 

 


[1] https://github.com/mxcl/homebrew/blob/master/Library/Formula/readline.rb
[2] http://trac.macports.org/browser/trunk/dports/net/lftp/Portfile