BSD: Set *BSD variables when targeting a *BSD system

Fixes: #23853
11 files changed