The attached patch applied over current ebuild, and the attached pamd files makes screen work out of the box on G/FBSD systems. It depends on virtual/pam, which defaults to >=sys-libs/pam-0.78 on usual linux systems, so the package must be revbumped and marked ~arch. It also uses newpamd to install the pamd file, which checks on its own for pam useflag. I've also replaced uclibc useflat to elibc_uclibc as now is supported by base tree. Thanks, Diego
Created attachment 58748 [details, diff] Ebuild patch
Created attachment 58749 [details] screen.pam.include
wrote a better check that didnt involve USE=uclibc and imported the other fixes here
Uhm that won't work if you don't change the pamd file (in a *separate* file as -r1 doesn't depend on virtual/pam and will work on sys-libs/pam-0.77 where the new one won't.
Fixed in app-misc/screen-4.0.2-r3