The attached ebuild (which uses pam eclass) with the attached patch allows sys-libs/pam_ssh_agent to build (and seems also work) fine on G/FBSD systems. I sent also the patch to upstream maintainer but the project doesn't seem to react too much. Low priority but it's stuff which needs to be fixed (added here just to avoid forget about it).
Created attachment 59247 [details] pam_ssh_agent-0.2-r1.ebuild
Created attachment 59248 [details, diff] pam_ssh_agent-0.2-openpam.patch
Committed it.