[Ctags-devel] [PATCH] Add support for installing readtags command with --with-readcmd
Brought to you by:
dhiebert
From: Maxime C. <fr...@gm...> - 2014-01-21 14:16:03
|
Hello, Here is a patch that enable installing the readtags command along with ctags. readtags is already useful as is, and provides a nice shell based way of retrieving information from the tags file, so it makes sense to provide a way to install it. More specifically, Kakoune (my code editor) ctags support relies on the readtags binary being available, so I'd like to make its installation as easy as possible. Cheers, Maxime Coste. --- Makefile.in | 14 ++++++++++++-- configure.ac | 10 ++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 68ef039..339021c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -87,6 +87,7 @@ CTAGS_EXEC = $(CTAGS_PROG)$(EXEEXT) ETAGS_EXEC = $(ETAGS_PROG)$(EXEEXT) DEST_CTAGS = $(bindir)/$(CTAGS_EXEC) DEST_ETAGS = $(bindir)/$(ETAGS_EXEC) +DEST_READ_CMD = $(bindir)/readtags$(EXEEXT) DEST_READ_LIB = $(libdir)/$(READ_LIB) DEST_READ_INC = $(incdir)/$(READ_INC) DEST_CMAN = $(man1dir)/$(CMAN) @@ -95,7 +96,7 @@ DEST_EMAN = $(man1dir)/$(EMAN) # # primary rules # -all: $(CTAGS_EXEC) $(READ_LIB) +all: $(CTAGS_EXEC) $(READ_LIB) readtags$(EXEEXT) $(CTAGS_EXEC): $(OBJECTS) $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) @@ -137,6 +138,7 @@ install-bin: install-cbin install-ebin install-lib install-cbin: $(DEST_CTAGS) install-ebin: $(DEST_ETAGS) install-lib: $(DEST_READ_LIB) $(DEST_READ_INC) +install-cmd: $(DEST_READ_CMD) $(DEST_CTAGS): $(CTAGS_EXEC) $(bindir) FORCE $(INSTALL_PROG) $(CTAGS_EXEC) $@ && chmod 755 $@ @@ -170,11 +172,16 @@ $(DEST_READ_LIB): $(READ_LIB) $(libdir) FORCE $(DEST_READ_INC): $(READ_INC) $(incdir) FORCE $(INSTALL_PROG) $(READ_INC) $@ && chmod 644 $@ +# +# install the readtags command +# +$(DEST_READ_CMD): readtags$(EXEEXT) $(bindir) FORCE + $(INSTALL_PROG) readtags$(EXEEXT) $@ && chmod 755 $@ # # rules for uninstalling # -uninstall: uninstall-bin uninstall-lib uninstall-man +uninstall: uninstall-bin uninstall-lib uninstall-cmd uninstall-man uninstall-bin: - rm -f $(DEST_CTAGS) $(DEST_ETAGS) @@ -182,6 +189,9 @@ uninstall-bin: uninstall-lib: - rm -f $(DEST_READ_LIB) $(DEST_READ_INC) +uninstall-cmd: + - rm -f readtags$(EXEEXT) + uninstall-man: - rm -f $(DEST_CMAN) $(DEST_EMAN) diff --git a/configure.ac b/configure.ac index 719634b..e989d13 100644 --- a/configure.ac +++ b/configure.ac @@ -146,6 +146,9 @@ AC_ARG_WITH(posix-regex, AC_ARG_WITH(readlib, [ --with-readlib include readtags library object during install]) +AC_ARG_WITH(readcmd, +[ --with-readcmd include readtags command during install]) + # AC_ARG_WITH(perl-regex, # [ --with-perl-regex use Perl pcre interface, if available]) @@ -204,6 +207,13 @@ if test yes = "$with_readlib"; then else AC_MSG_RESULT(no) fi +AC_MSG_CHECKING(whether to install readtags command) +if test yes = "$with_readcmd"; then + AC_MSG_RESULT(yes) + install_targets="$install_targets install-cmd" +else + AC_MSG_RESULT(no) +fi AC_SUBST(install_targets) if test "$enable_custom_config" = no -o "$enable_custom_config" = yes ; then -- 1.8.5.2 |