cmd.sh will use GNU readlink or GNU realpath if available.

Homebrew: brew install coreutils
MacPorts: port install coreutils
Gentoo Prefix: emerge sys-apps/coreutils