This commit allows users to specify a path to their "etags"
executable for use when doing "make tags".
I based this patch off of this one from upstream automake:
https://git.savannah.gnu.org/cgit/automake.git/commit/m4?id=
d2ccbd7eb38d6a4277d6f42b994eb5a29b1edf29
This means that I just supplied variables that the user can override
for the tags programs, rather than having the configure scripts
actually check for them. I handle etags and ctags separately because
the intl subdirectory has separate targets for them. This commit
only affects the subdirectories that use handwritten Makefiles; the
ones that use automake will have to wait until we update the version
of automake used to be 1.16.4 or newer before they'll be fixed.
Addresses #103021
gcc/ChangeLog:
PR other/103021
* Makefile.in: Substitute CTAGS, ETAGS, and CSCOPE
variables. Use ETAGS variable in TAGS target.
* configure: Regenerate.
* configure.ac: Allow CTAGS, ETAGS, and CSCOPE
variables to be overridden.
gcc/ada/ChangeLog:
PR other/103021
* gcc-interface/Make-lang.in: Use ETAGS variable in
TAGS target.
gcc/c/ChangeLog:
PR other/103021
* Make-lang.in: Use ETAGS variable in TAGS target.
gcc/cp/ChangeLog:
PR other/103021
* Make-lang.in: Use ETAGS variable in TAGS target.
gcc/d/ChangeLog:
PR other/103021
* Make-lang.in: Use ETAGS variable in TAGS target.
gcc/fortran/ChangeLog:
PR other/103021
* Make-lang.in: Use ETAGS variable in TAGS target.
gcc/go/ChangeLog:
PR other/103021
* Make-lang.in: Use ETAGS variable in TAGS target.
gcc/objc/ChangeLog:
PR other/103021
* Make-lang.in: Use ETAGS variable in TAGS target.
gcc/objcp/ChangeLog:
PR other/103021
* Make-lang.in: Use ETAGS variable in TAGS target.
intl/ChangeLog:
PR other/103021
* Makefile.in: Use ETAGS variable in TAGS target,
CTAGS variable in CTAGS target, and MKID variable
in ID target.
* configure: Regenerate.
* configure.ac: Allow CTAGS, ETAGS, and MKID
variables to be overridden.
libcpp/ChangeLog:
PR other/103021
* Makefile.in: Use ETAGS variable in TAGS target.
* configure: Regenerate.
* configure.ac: Allow ETAGS variable to be overridden.
libiberty/ChangeLog:
PR other/103021
* Makefile.in: Use ETAGS variable in TAGS target.
* configure: Regenerate.
* configure.ac: Allow ETAGS variable to be overridden.
# These exist for maintenance purposes.
+CTAGS=@CTAGS@
+ETAGS=@ETAGS@
+CSCOPE=@CSCOPE@
+
# Update the tags table.
TAGS: lang.tags
(cd $(srcdir); \
incs="$$incs --include $$dir/TAGS.sub"; \
fi; \
done; \
- etags -o TAGS.sub c-family/*.h c-family/*.c c-family/*.cc \
+ $(ETAGS) -o TAGS.sub c-family/*.h c-family/*.c c-family/*.cc \
*.h *.c *.cc \
../include/*.h ../libiberty/*.c \
../libcpp/*.c ../libcpp/include/*.h \
--language=none --regex="/\(char\|unsigned int\|int\|bool\|void\|HOST_WIDE_INT\|enum [A-Za-z_0-9]+\) [*]?\([A-Za-z_0-9]+\)/\2/" common.opt \
--language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\|DEFTIMEVAR\|DEFPARAM\|DEFPARAMENUM5\)[ ]?(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def timevar.def \
; \
- etags --include TAGS.sub $$incs)
+ $(ETAGS) --include TAGS.sub $$incs)
# -----------------------------------------------------
# Rules for generating translated message descriptions.
ada.srcman:
ada.tags: force
- cd $(srcdir)/ada && etags -o TAGS.sub *.c *.h *.ads *.adb && \
- etags --include TAGS.sub --include ../TAGS.sub
+ cd $(srcdir)/ada && $(ETAGS) -o TAGS.sub *.c *.h *.ads *.adb && \
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
# Generate documentation.
c.srcextra: gengtype-lex.c
-cp -p $^ $(srcdir)
c.tags: force
- cd $(srcdir)/c; etags -o TAGS.sub *.c *.h; \
- etags --include TAGS.sub --include ../TAGS.sub
+ cd $(srcdir)/c; $(ETAGS) -o TAGS.sub *.c *.h; \
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
c.man:
c.srcman:
enable_lto
DO_LINK_SERIALIZATION
DO_LINK_MUTEX
+CSCOPE
+ETAGS
+CTAGS
MAINT
zlibinc
zlibdir
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19458 "configure"
+#line 19461 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19564 "configure"
+#line 19567 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
MAINT='#'
fi
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to avoid linking multiple front-ends at once" >&5
$as_echo_n "checking whether to avoid linking multiple front-ends at once... " >&6; }
fi
+_AC_FINALIZE
fi
AC_SUBST(MAINT)dnl
+dnl Variables for tags utilities; copied from automake 1.16.4+'s init.m4
+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])
+
dnl Whether to prevent multiple front-ends from linking at the same time
AC_MSG_CHECKING([whether to avoid linking multiple front-ends at once])
c++.srcextra:
c++.tags: force
- cd $(srcdir)/cp; etags -o TAGS.sub *.c *.cc *.h --language=none \
+ cd $(srcdir)/cp; $(ETAGS) -o TAGS.sub *.c *.cc *.h --language=none \
--regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' cp-tree.def; \
- etags --include TAGS.sub --include ../TAGS.sub
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
c++.man: doc/g++.1
d.tags: force
cd $(srcdir)/d; \
- etags -o TAGS.sub *.c *.cc *.h dmd/*.c dmd/*.h dmd/root/*.h dmd/root/*.c; \
- etags --include TAGS.sub --include ../TAGS.sub
+ $(ETAGS) -o TAGS.sub *.c *.cc *.h dmd/*.c dmd/*.h dmd/root/*.h dmd/root/*.c; \
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
d.man: doc/gdc.1
d.srcman: doc/gdc.1
-cp -p $^ $(srcdir)/fortran
fortran.tags: force
- cd $(srcdir)/fortran; etags -o TAGS.sub *.c *.h; \
- etags --include TAGS.sub --include ../TAGS.sub
+ cd $(srcdir)/fortran; $(ETAGS) -o TAGS.sub *.c *.h; \
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
fortran.info: doc/gfortran.info doc/gfc-internals.info
go.srcextra:
go.tags: force
cd $(srcdir)/go; \
- etags -o TAGS.sub *.c *.h gofrontend/*.h gofrontend/*.cc; \
- etags --include TAGS.sub --include ../TAGS.sub
+ $(ETAGS) -o TAGS.sub *.c *.h gofrontend/*.h gofrontend/*.cc; \
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
go.man: doc/gccgo.1
go.srcman: doc/gccgo.1
-cp -p $^ $(srcdir)/doc
objc.install-plugin:
objc.tags: force
- cd $(srcdir)/objc; etags -o TAGS.sub *.c *.h; \
- etags --include TAGS.sub --include ../TAGS.sub
+ cd $(srcdir)/objc; $(ETAGS) -o TAGS.sub *.c *.h; \
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
lang_checks += check-objc
obj-c++.install-plugin:
obj-c++.tags: force
- cd $(srcdir)/objcp; etags -o TAGS.sub *.c *.h; \
- etags --include TAGS.sub --include ../TAGS.sub
+ cd $(srcdir)/objcp; $(ETAGS) -o TAGS.sub *.c *.h; \
+ $(ETAGS) --include TAGS.sub --include ../TAGS.sub
lang_checks += check-obj-c++
LIBS = @LIBS@
DEFS = -DHAVE_CONFIG_H
+CTAGS = @CTAGS@
+ETAGS = @ETAGS@
+MKID = @MKID@
+
COMPILE = $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(DEFS-$@) $(INCLUDES)
HEADERS = \
tags: TAGS
TAGS: $(HEADERS) $(SOURCES)
here=`pwd`; cd $(srcdir) && \
- etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+ $(ETAGS) -o $$here/TAGS $(HEADERS) $(SOURCES)
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES)
here=`pwd`; cd $(srcdir) && \
- ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
+ $(CTAGS) -o $$here/CTAGS $(HEADERS) $(SOURCES)
id: ID
ID: $(HEADERS) $(SOURCES)
here=`pwd`; cd $(srcdir) && \
- mkid -f$$here/ID $(HEADERS) $(SOURCES)
+ $(MKID) -f$$here/ID $(HEADERS) $(SOURCES)
mostlyclean:
rm -f *.a *.la *.o *.obj *.lo core core.* libintl.h
BISON3_YES
INCINTL
LIBINTL_DEP
+MKID
+ETAGS
+CTAGS
MAINT
AUTOHEADER
AUTOCONF
fi
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+if test -z "$MKID"; then
+ MKID=mkid
+fi
+
+
# Additional info for config.intl.
fi
AC_SUBST(MAINT)
+dnl Variables for tags utilities; based on automake 1.16.4+'s init.m4
+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 "$MKID"; then
+ MKID=mkid
+fi
+AC_SUBST([MKID])
+
# Additional info for config.intl.
AC_SUBST(LIBINTL_DEP)
AC_SUBST(INCINTL)
sed 's:$(srcdir)/::g' <po/$(PACKAGE).pot.tmp >po/$(PACKAGE).pot
rm po/$(PACKAGE).pot.tmp
+ETAGS = @ETAGS@
+
TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h system.h ucnid.h \
include/cpplib.h include/line-map.h include/mkdeps.h include/symtab.h
TAGS: $(TAGS_SOURCES)
- cd $(srcdir) && etags $(TAGS_SOURCES)
+ cd $(srcdir) && $(ETAGS) $(TAGS_SOURCES)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
WARN_PEDANTIC
c_warn
warn
+ETAGS
AUTOHEADER
AUTOCONF
ACLOCAL
test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader"
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+
# Figure out what compiler warnings we can enable.
# See config/warnings.m4 for details.
AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+
# Figure out what compiler warnings we can enable.
# See config/warnings.m4 for details.
.PHONY: all etags tags TAGS ls clean stage1 stage2
+ETAGS = @ETAGS@
+
etags tags TAGS: etags-subdir
- cd $(srcdir) && etags $(CFILES)
+ cd $(srcdir) && $(ETAGS) $(CFILES)
# The standalone demangler (c++filt) has been moved to binutils.
# But make this target work anyway for demangler hacking.
PERL
BUILD_INFO
MAKEINFO
+ETAGS
NOTMAINT
MAINT
libiberty_topdir
NOTMAINT=''
fi
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+
# Do we have a single-tree copy of texinfo? Even if we do, we can't
# rely on it - libiberty is built before texinfo.
# Extract the first word of "makeinfo", so it can be a program name with args.
AC_SUBST(MAINT)dnl
AC_SUBST(NOTMAINT)dnl
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+
# Do we have a single-tree copy of texinfo? Even if we do, we can't
# rely on it - libiberty is built before texinfo.
AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )