]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tags: support setting CTAGS, ETAGS, CSCOPE vars via ./configure.
authorReuben Thomas <rrt@sc3d.org>
Sun, 6 Dec 2020 02:11:55 +0000 (18:11 -0800)
committerKarl Berry <karl@freefriends.org>
Sun, 6 Dec 2020 02:12:36 +0000 (18:12 -0800)
This change fixes https://bugs.gnu.org/45013.

* m4/init.m4: add default settings and AC_SUBST calls for the variables
  `CTAGS', `ETAGS' and `CSCOPE'.
* lib/am/tags.am: remove default settings of the above variables.
* doc/automake.texi (Tags): mention and index.
* NEWS: mention.

NEWS
doc/automake.texi
lib/am/tags.am
m4/init.m4

diff --git a/NEWS b/NEWS
index df978a54d95babac3bd472dfb07198e59acb14bb..8821376f63463fa5f48d4f8bd964c070ee2a91af 100644 (file)
--- a/NEWS
+++ b/NEWS
 
 New in ?.?.?:
 
+* New features added
+
+  - CTAGS, ETAGS, SCOPE variables can be set via configure.
+
 * Bugs fixed
 
   - test-driver less likely to clash with tests writing to the same file.
index 7e0ad1b05b25759e805dca4b3a74ec0dec8bac64..040172e667d76492ab1f985d0c61ae752d19a2bd 100644 (file)
@@ -10604,10 +10604,10 @@ GNU Emacs under some circumstances.
 If any C, C++ or Fortran 77 source code or headers are present, then
 @code{tags} and @code{TAGS} rules will be generated for the directory.
 All files listed using the @code{_SOURCES}, @code{_HEADERS}, and
-@code{_LISP} primaries will be used to generate tags.  Note that
-generated source files that are not distributed must be declared in
-variables like @code{nodist_noinst_HEADERS} or
-@code{nodist_@var{prog}_SOURCES} or they will be ignored.
+@code{_LISP} primaries will be used to generate tags.  Generated
+source files that are not distributed must be declared in variables
+like @code{nodist_noinst_HEADERS} or @code{nodist_@var{prog}_SOURCES}
+or they will be ignored.
 
 A @code{tags} rule will be output at the topmost directory of a
 multi-directory package.  When run from this topmost directory,
@@ -10619,10 +10619,12 @@ The @code{tags} rule will also be generated if the variable
 directories that contain taggable source that @command{etags} does
 not understand.  The user can use the @code{ETAGSFLAGS} to pass
 additional flags to @command{etags}; @code{AM_ETAGSFLAGS} is also
-available for use in @file{Makefile.am}.
+available for use in @file{Makefile.am}.  The variable @code{ETAGS}
+is the name of the program to invoke (by default @command{etags}).
 @vindex ETAGS_ARGS
 @vindex ETAGSFLAGS
 @vindex AM_ETAGSFLAGS
+@vindex ETAGS
 
 Here is how Automake generates tags for its source, and for nodes in its
 Texinfo file:
@@ -10642,6 +10644,9 @@ build @command{vi}-style @file{tags} files.  The variable @code{CTAGS}
 is the name of the program to invoke (by default @command{ctags});
 @code{CTAGSFLAGS} can be used by the user to pass additional flags,
 and @code{AM_CTAGSFLAGS} can be used by the @file{Makefile.am}.
+@vindex CTAGS_ARGS
+@vindex CTAGSFLAGS
+@vindex CTAGS
 
 @trindex id
 Automake will also generate an @code{ID} rule that will run
@@ -10659,6 +10664,9 @@ file names respectively, while @code{AM_CSCOPEFLAGS} can be used by the
 with non-GNU make implementations (especially with make implementations
 performing @ref{Automatic Rule Rewriting, , VPATH rewrites, autoconf,
 The Autoconf Manual}).
+@vindex CSCOPE_ARGS
+@vindex CSCOPEFLAGS
+@vindex CSCOPE
 
 Finally, Automake also emits rules to support the
 @uref{https://www.gnu.org/software/global/, GNU Global Tags program}.
index a485ff840544bf1181c8b3a41c4969df8b8fb240..c1ec37772326d24add0bea41c21f68b82595fd4b 100644 (file)
@@ -45,7 +45,6 @@ ID: $(am__tagged_files)
 ## TAGS.  ##
 ## ------ ##
 
-ETAGS = etags
 .PHONY: TAGS tags
 if %?SUBDIRS%
 AM_RECURSIVE_TARGETS += TAGS
@@ -101,7 +100,6 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 ## vi-style tags.  ##
 ## --------------- ##
 
-CTAGS = ctags
 .PHONY: CTAGS ctags
 if %?SUBDIRS%
 AM_RECURSIVE_TARGETS += CTAGS
@@ -136,7 +134,6 @@ GTAGS:
 ## ------- ##
 
 if %?TOPDIR_P%
-CSCOPE = cscope
 .PHONY: cscope clean-cscope
 AM_RECURSIVE_TARGETS += cscope
 cscope: cscope.files
index ba73676c1b1ddc1605f2bdfa1aab4cb517e4d214..f82d756c2d6748195813ba28d9ac43faec32393d 100644 (file)
@@ -116,6 +116,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
                  [m4_define([AC_PROG_OBJCXX],
                             m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+  CTAGS=ctags
+fi
+AC_SUBST([CTAGS])
+if test -z "$ETAGS"; then
+  ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+if test -z "$CSCOPE"; then
+  CSCOPE=cscope
+fi
+AC_SUBST([CSCOPE])
+
 AC_REQUIRE([AM_SILENT_RULES])dnl
 dnl The testsuite driver may need to know about EXEEXT, so add the
 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This