sys/capability.h will be removed before FreeBSD 13. The (now) correct header to use on all supported versions of FreeBSD is sys/capsicum.h; there's no need for autoconf checks etc. to check for both.
A commit references this bug:
Date: Tue Nov 6 00:05:18 UTC 2018
New revision: 340171
capability.h: add comment about planned removal timeline
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
r340171 referenced this PR by accident; the intent was to reference PR 228878.
The upstream change is not yet in a pkg release. Is a new release coming soon? pkg is now the only holdout preventing the removal of sys/capability.h.
pkg 1.11 does not use sys/capability.h anymore