Compiling Pound 2.6e on CentOS 5.x

Quick fix: edit configure, at row 3235 delete -Wno-unused-result from the CPPFLAGS (found on pound mailing list).

Explanation

Today I had to compile Pound reverse proxy on a CentOS 5.6 host. Initially, the configure process failed to find ssl libs, or any other lib:

$ ./configure 
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: *** Checking for threads library and/or flags ***
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for pthread-config... no
configure: *** Parsing options ***
configure: *** Checking for libraries ***
checking for dlopen in -ldl... no
checking for socket in -lsocket... no
checking for hstrerror in -lresolv... no
checking for BIO_new in -lcrypto... no
Missing OpenSSL (-lcrypto) - aborted

After some fiddling and much googling, I found out that there was no problem with the compile environment, instead the configure script was using a particular flag, -Wno-unused-result, that is not supported by the old GCC version installed in CentOS 5.x.

You can verify by compiling any C file:

$ gcc -Wno-unused-result -o my-gcc-is-old http.c 
cc1: error: unrecognized command line option "-Wno-unused-result"

So, GCC is failing to compile the sample programs that configure uses to determine if a lib (or some function in a lib) is available, hence configure aborts lamenting the absence of the library.

Advertisements

One thought on “Compiling Pound 2.6e on CentOS 5.x

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s