Curl: C compiler cannot create executables


June 2015.

Problem


Curl won't build under my FreeBSD jail, stating it cannot find a decent compiler.


[...]
configure: using CFLAGS: -I/usr/include -O2 -pipe -march=opteron -fstack-protector -fno-strict-aliasing
configure: CFLAGS note: CFLAGS should only be used to specify C compiler flags, not include directories. Use CPPFLAGS for: -I/usr/include
configure: WARNING: Continuing even with errors mentioned immediately above this line.
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... cc
checking whether the C compiler works... no
configure: error: in `/var/ports/usr/ports/ftp/curl/work/curl-7.42.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
===> Script "configure" failed unexpectedly.
Please report the problem to sunpoet@FreeBSD.org [maintainer] and attach the
"/var/ports/usr/ports/ftp/curl/work/curl-7.42.1/config.log" including the
output of the failure of your make command. Also, it might be a good idea to
provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ftp/curl
*** Error code 1

Stop.
make: stopped in /usr/ports/ftp/curl

Solution


In my case, this has nothing to do with the machine's choice of compilers. It was linked to the fact that my system was built without the support of Kerberos. Setting GSSAPI to GSSAPI_NONE in the port configuration solved the problem.

GSSAPI_NONE configured in Curl in the FreeBSD port collection

So much for a bad error message.