I want to revert sed's behaviour to original/BSD one. But I haven't found a place where I can define "LEGACY_BSDSED_COMPAT" variable. The check happens here:
Where can I define LEGACY_BSDSED_COMPAT ?
file path is /usr/src/usr.bin/sed/compile.c
You would need to add it to CFLAGS in your /etc/make.conf or /etc/src.conf, e.g.
Then rebuild at least sed(1).
Closing as "Not a bug" since this is technically not a bug, but feel free to re-open as needed. :)