The heimdal port is not self contained and relies upon parts (libcom_err.*) of the heimdal base to function. The heimdal port pulls in /usr/lib/libcom_err which is installed via heimdal base. When heimdal port builds, configure performs a test for libcom_err, if it exists link to it, otherwise fail. To ensure that the heimdal port is not dependent on the heimdal base, the following 3 steps are required: 1) Have this in the /usr/ports/security/heimdal/Makefile: PLIST_SUB+= LIBCOM_ERR="" 2) and remove /usr/ports/security/heimdal/files/patch-lib-com_err-Makefile.in As I build ports on a development machine which has heimdal from base installed, the heimdal package expects /usr/lib/libcom_err.* to exist. However our production systems have /etc/src.conf containing: WITHOUT_GSSAPI=yes WITHOUT_KERBEROS=yes WITHOUT_KERBEROS_SUPPORT=yes So for our development machine we remove /usr/lib/libcom_err.* to enable the heimdal port's configure script to NOT detect /usr/lib/libcom_err.* 3) Either build a base system without /usr/lib/libcom_err.* or remove the files prior to building the heimdal port, to ensure that the heimdal port is entirely self-contained; particularly when heimdal is NOT part of the base system or the target system. If I was more technical, I would see about eliminating configure's test for the existence of /usr/lib/libcom_err.* files and to unconditionally build its own from its library; ideally build its own libcom_err files, similar to the way samba41 does this.
Take.
A commit references this bug: Author: hrs Date: Sat Nov 22 10:52:00 UTC 2014 New revision: 373047 URL: https://svnweb.freebsd.org/changeset/ports/373047 Log: - Move headers and libraries into PREFIX/{include,lib}/heimdal. This prevents build breakage when a port depends on heimdal in base and some other libraries in LOCALBASE/lib such as OpenSSL from ports at the same time. - Always build libcom_err[*]. PR: 194475 [*] Changes: head/Mk/Uses/gssapi.mk head/security/heimdal/Makefile head/security/heimdal/files/kpasswdd-Makefile head/security/heimdal/files/patch-configure head/security/heimdal/pkg-plist
Changes in r373047 should fix this problem. libcom_err is now built unconditionally and the port works regardless of WITHOUT_KERBEROS=yes. If there is still a problem, please let me know.