m4 is broken on 10.5–10.6 by unconditional usage of the patch, added in 256704c
MacPorts applies that patch on 10.4. Can pkgsrc use patches conditionally on macOS version? If not, then the patch should be changed in a way to accommodate all three systems.
FYI @hauke