Reputation: 73
I'm trying to upgrade m4 from version 1.4.6 (the version that comes with OS X 10.6.8) to 1.4.16. I've installed with homebrew, and I've also built from source into /usr/local/ (and edited /etc/paths to put /usr/local above /usr), but the system version still seems to take precedence.
Specifically, if I type m4 --version', I get
GNU M4 1.4.6 , but if I type
/usr/local/bin/m4 --versoin, I get
m4 (GNU M4) 1.4.16 `. How do I set the new version as the default version?
...ultimately, I'd like to update autoconf and automake. Is there anything else I should know about installing them?
Upvotes: 2
Views: 2419
Reputation: 212404
When you type just m4
at the prompt, your shell looks through the PATH
variable to locate the command. You just need to prepend /usr/local/bin
to your path. For example, in ~/.bashrc
, you can simply do:
PATH=/usr/local/bin:$PATH
Note that this may lead to the directory appearing multiple times in the PATH. You can avoid that with something like:
echo $PATH | tr : \\n | grep -q '^/usr/local/bin$' || PATH=/usr/local/bin:$PATH
Upvotes: 1