David Reynolds

Welcome to boredom

How to Compile Lftp on OS X Leopard

| Comments

I’ve recently been missing a few pieces of software from my linux days most recently, lftp. It wasn’t as simple as I had hoped it would be so I thought I’d record how I did it here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Download and install readline
$ wget ftp://ftp.cwru.edu/pub/bash/readline-6.0.tar.gz # (or latest stable version)
...
$ tar zxvf readline-6.0.tar.gz
$ cd readline-6.0
$ ./configure --prefix=/usr/local
...
$ make
...
$ sudo make install

# Download lftp
$ wget http://ftp.yars.free.net/pub/source/lftp/lftp-3.7.15.tar.gz # (or latest stable version)
...
$ tar zxvf lftp-3.7.15.tar.gz
# Here comes the magic
$ CXXFLAGS="-O0 -Wall -fno-exceptions -fno-rtti -fno-implement-inlines" \
   LDFLAGS="-Xlinker -search_paths_first -L/usr/local/lib" \
   CPPFLAGS="-I/usr/local/include" \
  ./configure --with-openssl --disable-shared --disable-nls --prefix=/usr/local
...
$ make
...
$ make install

.. and that should be it. As I understand it, the ‘magic’ part tells the compiler to look in the right place for the readline library.

UPDATE: I suggest you now ignore this and use Homebrew where I have contributed an lftp recipe.

Comments