Skip to content

Instantly share code, notes, and snippets.

@alexshagov
Last active May 21, 2022 13:41
Show Gist options
  • Save alexshagov/7e5ed7841667c66ef5ca4f31664714a9 to your computer and use it in GitHub Desktop.
Save alexshagov/7e5ed7841667c66ef5ca4f31664714a9 to your computer and use it in GitHub Desktop.
How to install GNU Global with universall ctags support on mac OS

Unfortunately, homebrew does not support --with-universal-ctags option for global (on the state of April 2018) The reason is that universal-ctags is not officially released yet.

Install universal ctags

Run brew install --HEAD universal-ctags/universal-ctags/universal-ctags (See https://github.com/universal-ctags/homebrew-universal-ctags repo)

If you're on macOS, you might have an old ctags installed with command line tools for XCode. To fix this, simply run alias ctags="brew --prefix/bin/ctags"

To check that universal-ctags installed correctly, run the ctags --version command. You must see the following output:

Universal Ctags 0.0.0(8e09804), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Apr  8 2018, 10:06:38
  URL: https://ctags.io/

Install GNU Global from source

Download GNU Global from https://www.gnu.org/software/global/download.html Uncompress and configure it with universal ctags

./configure --with-universal-ctags=/usr/local/bin/ctags and then make & make install

To check that gtags was installed correctly, you could run which gtags. It must point out to /usr/local/bin/gtags

Now, running the gtags --gtagslabel=new-ctags should not produce any errors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment