Created attachment 336478 [details, diff] fix build with samba 4 A configure check fails, but after fixing that, an additional fix is required for the relevant Makefile.am. IIRC, samba3 installed pkg-config files too, so the fix should be valid even then.
1.2.4 in Portage and looking at m4/input.m4, this is fixed in it.