我正在尝试构建具有通用 ctags 支持的 GNU Global,但没有成功。有什么我遗漏的东西,或者我正在使用不兼容的 GNU Global 和 univeral-ctags 版本吗?我在 Ubuntu 18.04.2 LTS 上执行此操作(也在 Ubuntu 16.04 上测试过)
官方安装说明
其他相关信息
- https://stackoverflow.com/a/15169556/5518304
- https://gist.github.com/carakan/60496e0f05033417be2352419639fcc5
简而言之,我执行以下命令。
git clone https://github.com/universal-ctags/ctags.git
cd ctags
cat docs/autotools.rst # installation instructions
./autogen
./configure
make
make install
which ctags
# /usr/local/bin/ctags
ctags --version
# Universal Ctags 0.0.0(6365358b), Copyright (C) 2015 Universal Ctags Team
# Universal Ctags is derived from Exuberant Ctags.
# Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
# Compiled: Mar 8 2019, 12:48:27
# URL: https://ctags.io/
# Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +packcc
这似乎工作正常,并且ctags
可执行文件按预期构建标签文件。接下来,我尝试使用 GNU Global 手册(上面的链接)第 4.2 节中的说明安装 GNU Global。
wget http://tamacom.com/global/global-6.6.3.tar.gz
tar -xzvf global-6.6.3.tar.gz
cd global-6.6.3
./configure --with-universal-ctags=/usr/local/bin/ctags
make
sudo make install
export GTAGSCONF=/usr/local/share/gtags/gtags.conf
export GTAGSLABEL=new-ctags
gtags
# ctags: Warning: Unknown language "Ada:.adb.ads.Ada,Ant:(build.xml)(*.build.xml).ant.xml,Asm:.A51(*.29[kK])(*.[68][68][kKsSxX])(*.[xX][68][68]).asm.ASM.s.S,Asp:.asp.asa,Autoconf:(configure.in).ac,Automake:(Makefile.am).am,Awk:.awk.gawk.mawk,Basic:.bas.bi.bb.pb,BETA:.bet,Clojure:.clj.cljs.cljc,C:.c,C++:.c++.cc.cp.cpp.cxx.h.h++.hh.hp.hpp.hxx.inl,CSS:.css,C#:.cs,ctags:.ctags,Cobol:.cbl.cob.CBL.COB,CUDA:.cu.cuh,D:.d.di,Diff:.diff.patch,DTD:.dtd.mod,DTS:.dts.dtsi,DosBatch:.bat.cmd,Eiffel:.e,elm:.elm,Erlang:.erl.ERL.hrl.HRL,Falcon:.fal.ftd,Flex:.as.mxml,Fortran:.f.for.ftn.f77.f90.f95.f03.f08.f15,gdbinit:(.gdbinit).gdb,Go:.go,HTML:.htm.html,Iniconf:.ini.conf,ITcl:.itcl,Java:.java,JavaProperties:.properties,JavaScript:.js.jsx,JSON:.json,LdScript:(*.lds.S)(ld.*).lds.scr.ld,Lisp:.cl.clisp.el.l.lisp.lsp,Lua:.lua,M4:.m4.spt,man:.1.2.3.4.5.6.7.8.9,Make:([Mm]akefile)(GNUmakefile).mak.mk,MatLab:.m,Myrddin:.myr,ObjectiveC:.mm,OCaml:.ml.mli.aug,passwd:(passwd),Pascal:.p.pas,Perl:.pl.pm.ph.plx.perl,Perl6:.p6.pm6.pl6,PHP:.php.php3.php4.php5.php7.phtml,pod:.pod,Protobuf:.proto,puppetManifest:.pp,Python:.py.pyx.pxd.pxi.scons,QemuHX:.hx,R:.r.R.q,REXX:.rexx.rx,Robot:.robot,RpmSpec:.spec,reStructuredText:.rest.reST.rst,Ruby:.rb.ruby,Rust:.rs,Scheme:.SCM.SM.sch.scheme.scm.sm,Sh:.sh.SH.bsh.bash.ksh.zsh.ash,SLang:.sl,SML:.sml.sig,SQL:.sql,SystemdUnit:.unit.service.socket.device.mount.automount.swap.target.path.timer.snapshot.scope.slice.time,Tcl:.tcl.tk.wish.exp,Tex:.tex,TTCN:.ttcn.ttcn3,Vera:.vr.vri.vrh,Verilog:.v,SystemVerilog:.sv.svh.svi,VHDL:.vhdl.vhd,Vim:(vimrc)([._]vimrc)(gvimrc)([._]gvimrc).vim.vba,WindRes:.rc,YACC:.y,YumRepo:.repo,Zephir:.zep,Glade:.glade,Maven2:(pom.xml).pom,PlistXML:.plist,RelaxNG:.rng,SVG:.svg,XSLT:.xsl.xslt" in "langmap" option