On Thu, Sep 24, 2020 at 12:34:28PM +0200, Paolo Bonzini wrote: > On 24/09/20 12:30, Roman Bolshakov wrote: > > Yes, keg-only packages do not shadow system utilities (which either come > > from FreeBSD or GNU but have the most recent GPL2 version, i.e. quite > > old), so adding `brew --prefix`/bin to PATH doesn't help much. > > > > brew link doesn't help either :) > > > > $ brew link gnu-getopt > > > > Warning: Refusing to link macOS provided/shadowed software: gnu-getopt > > If you need to have gnu-getopt first in your PATH run: > > echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.zshrc > > Oh, that's not what https://docs.brew.sh/FAQ says: > > ----- > What does “keg-only” mean? > > It means the formula is installed only into the Cellar and is not linked > into /usr/local. This means most tools will not find it. You can see why > a formula was installed as keg-only, and instructions to include it in > your PATH, by running brew info <formula>. > > You can still link in the formula if you need to with brew link > <formula>, though this can cause unexpected behaviour if you are > shadowing macOS software. > ----- > > Apparently you need --force. > Unfortunately it has no effect (and I wouldn't want to do that to avoid issues with other scripts/software that implicitly depend on native utilities): $ brew link --force gnu-getopt Warning: Refusing to link macOS provided/shadowed software: gnu-getopt If you need to have gnu-getopt first in your PATH run: echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.zshrc So if it's possible I'd still prefer to add an option to specify --getopt in configure. I can resend a patch for that. Thanks, Roman